[wildfly-dev] Batch Subsystem Model

James R. Perkins jperkins at redhat.com
Thu Sep 12 23:39:19 EDT 2013


I'm struggling a bit come up with the right model for the batch 
subsystem. The XML currently looks like the following, but doesn't have 
to remain like this if someone has a better idea.

<subsystem xmlns="urn:jboss:domain:batch:1.0">
     <job-repository value="default"/>

     <job-repository-type name="default">
         <in-memory thread-pool-name="default"/>
     </job-repository>

     <job-repository-type name="jdbc">
         <jdbc thread-pool-name="default">
             <datasource jndi-name="java:jboss/datasources/ExampleDS"/>
         </jdbc>
     </job-repository>

     <unbounded-queue-thread-pool name="default">
         <max-threads count="10"/>
         <keepalive-time time="100" unit="milliseconds"/>
     </unbounded-queue-thread-pool>
</subsystem>

This would make the model for the in-memory type something like;
"subsystem" => {
     "batch" => {
         "job-repository" => "default",
         "job-repository-type" => {"default" => {
             "type" => "in-memory",
             "thread-pool-name" => "default"
         }}
     }
}

The problem is I'm not sure what to do with JDBC which would also need a 
datasource/jndi-name attribute, but I don't want that attribute on the 
in-memory type.

Another thought I had was to have it look more like;
"subsystem" => {
     "batch" => {
         "job-repository" => "default",
         "in-memory" => {"default" => {
             "thread-pool-name" => "default"
         }},
         "jdbc" => {"jdbc" => {
             "thread-pool-name" => "default",
             "jndi-name" => "java:jboss/datasources/ExampleDS"
         }}
     }
}

The problem here is really the jdbc resource could also be called 
default. I'm not sure if there is a way to query a parent resource to 
check each name, but if there is then maybe that's the way to go.

Anyway, if anyone has suggestions let me know.

-- 
James R. Perkins
Red Hat JBoss Middleware



More information about the wildfly-dev mailing list