domain.xml work
starksm64 Apr 1, 2010 3:59 AMHere is an initial example of the domain.xml effort. The notion is that the domain.xml is a static metadata model of an API for configuring the server. This can be use for a rest client, command line client, junit client, etc.
The relatively easy part is deciding what features we want to support via the model. The issues to resolve are how to:
1. Map this metadata onto the admin API of the profileservice. In general the domain.xml is a subset of the full metadata the service supports. The ManagedComponent view of the deployment metadata is the full featured configuration.
2. Provide a plug in to handle the mapping of the domain.xml metadata onto the ManagedComponent associated with the domain.xml element namespace. Currently the ManagedComponent is a view that is generated after deployment.
3. Deal with the different mechanisms for producing the runtime components from metadata. Some layers are using BeanMetaDataFactorys, jboss-managed plugins, custom deployers to manipulate metadata. Pulling in the domain.xml element override at the correct phase in the deployment chain is an issue.
4. Dealing with rollbacks of the domain.xml if we allow direct editing of the a domain.xml file. If the domain.xml is essentially a subset of admin edits of the available ManagedComponents, a rollback needs to write out a revised domain.xml that corresponds to the previous subset view.
<?xml version="1.0" encoding="UTF-8"?>
<!--
The JBoss ApplicationServer domain configuration file.
-->
<domain xmlns="urn:jboss:profileservice:domain:1.0"
xmlns:xi="http://www.w3.org/2001/XInclude">
<server name="server1" xmlns="urn:jboss:profileservice:server:1.0">
<properties>
<property name="timeout">3000</property>
<!-- Enable EAR classloader isolation. -->
<property name="classloaderIsolation">true</property>
</properties>
<shutdown-timeout>3600000</shutdown-timeout>
</server>
<jdbc-resources xmlns="urn:jboss:profileservice:jdbc-resources:1.0">
<jdbc-resource jndi-name="jdbc/TimerPool" pool-name="TimerPool" enabled="true">
<min-pool-size>1</min-pool-size>
<max-pool-size>10</max-pool-size>
<username>userx</username>
<password>passy</password>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<properties>
<entry key="query-timeout" value="30" />
<entry key="new-connection-sql" value="select * from x" />
</properties>
</jdbc-resource>
<jdbc-resource jndi-name="java:DefaultDS" pool-name="DefaultDS" enabled="true">
<min-pool-size>1</min-pool-size>
<max-pool-size>10</max-pool-size>
<username>sa</username>
<password></password>
<connection-url>jdbc:hsqldb:hsql://${jboss.bind.address}:1701</connection-url>
<driver-class>org.hsqldb.jdbcDriver</driver-class>
<type-mapping>Hypersonic SQL</type-mapping>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<properties>
<entry key="query-timeout" value="30" />
<entry key="new-connection-sql" value="select * from x" />
<entry key="idle-timeout-minutes" value="0" />
<entry key="track-statements" value="true" />
<entry key="security-domain" value="HsqlDbRealm" />
<entry key="prepared-statement-cache-size" value="32" />
</properties>
</jdbc-resource>
</jdbc-resources>
<jms-resources xmls="urn:jboss:profileservice:jms-resources:1.0">
<topic name="topic/MyTopic" />
<queue name="queue/MyQueue">
<depends name="someDependencyRealNameNotJMXObjectName" />
</queue>
</jms-resources>
<threads xmlns="urn:jboss:profileservice:threads:1.0">
<!-- The system thread group for all JBoss threads. -->
<thread-group name="SystemThreadGroup" group-name="System Threads" daemon="true"/>
<!--
~ This thread pool is for SHORT-RUNNING tasks that block very little or not at all. Long-running
~ tasks submitted to this pool may cause starvation and extended blocking.
-->
<thread-group name="ShortTasksThreadGroup" group-name="Short Tasks Threads">
<parent-thread-group name="SystemThreadGroup"/>
</thread-group>
<!--
~ This thread pool is for LONG-RUNNING tasks that may block for extended periods, such as
~ blocking I/O network connection threads. Short-running tasks submitted to this pool may
~ cause excessive lock contention and performance degradation.
-->
<thread-group name="LongTasksThreadGroup" group-name="Long Tasks Threads">
<parent-thread-group name="SystemThreadGroup"/>
</thread-group>
<!-- A simple direct executor which is always available for use. -->
<executor name="DirectExecutor" type="direct">
</executor>
<executor name="BoundedThreadPool" type="bounded-queue-thread-pool">
<entry key="blocking" value="true" />
<entry key="thread-factory" value="ShortTasksThreadFactory"/>
<entry key="queue-length.count" value="500"/>
<entry key="queue-length.per-cpu" value="200"/>
<entry key="core-threads.count" value="5"/>
<entry key="core-threads.per-cpu" value="2"/>
<entry key="max-threads.count" value="10"/>
<entry key="max-threads.per-cpu" value="3"/>
<entry key="keepalive.time" value="30"/>
<entry key="keepalive.time-unit" value="seconds"/>
<!--
<task-filter>
<clear-context-classloader/>
<clear-tls/>
</task-filter>
-->
</executor>
<executor name="LongRunningTasksThreadPool" type="queueless-thread-pool">
<entry key="blocking" value="true" />
<entry key="thread-factory" value="LongTasksThreadFactory"/>
<!--
<task-filter>
<clear-context-classloader/>
<clear-tls/>
</task-filter>
-->
</executor>
<thread-factory name="ShortTasksThreadFactory">
<thread-group name="ShortTasksThreadGroup"/>
</thread-factory>
<thread-factory name="LongTasksThreadFactory">
<thread-group name="LongTasksThreadGroup"/>
</thread-factory>
</threads>
<system-properties>
<entry key="tmp.dir" value="/usr/tmp"/>
</system-properties>
<!-- TODO, metadata for the various cotainers, transport, apps, etc -->
</domain>