<?xml version="1.0" encoding="UTF-8"?>
<chapter id="configuration">
   <title>Configuration</title>

   <para>The configuration for the IronJacamar container is mainly located under the <code>config/</code> directory.</para>

   <section id="configuration_ironjacamar">
      <title>IronJacamar server</title>

      <para>
        The IronJacamar server can be configured by including an <code>ironjacamar.properties</code> file
        next to the <code>ironjacamar-sjc.jar</code> in the <code>bin/</code> directory.
      </para>

      <para>
        This file will allow to override the core options given to the kernel environment, if multiple instances
        of the IronJacamar container are going to run on the same machine, and network interface.
      </para>

      <para>
        The options available

        <table frame="all">
          <title>IronJacamar options</title>
          <tgroup cols="3" align="left" colsep="1" rowsep="1">
            <colspec colname="c1" colwidth="3*"/>
            <colspec colname="c2" colwidth="2*"/>
            <colspec colname="c3" colwidth="3*"/>
            <thead>
              <row>
                <entry align="left">Property</entry>
                <entry align="left">Type</entry>
                <entry align="left">Description</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry><code>name</code></entry>
                <entry><code>String</code></entry>
                <entry>
                  The name of the IronJacamar configuration
                </entry>
              </row>
              <row>
                <entry><code>management</code></entry>
                <entry><code>boolean</code></entry>
                <entry>
                  Should management be enabled
                </entry>
              </row>
              <row>
                <entry><code>parallel.deploy</code></entry>
                <entry><code>boolean</code></entry>
                <entry>
                  Should parallel deployment be enabled
                </entry>
              </row>
              <row>
                <entry><code>remote.access</code></entry>
                <entry><code>boolean</code></entry>
                <entry>
                  Should remote access be enabled
                </entry>
              </row>
              <row>
                <entry><code>remote.port</code></entry>
                <entry><code>int</code></entry>
                <entry>
                  The port for remote access
                </entry>
              </row>
              <row>
                <entry><code>remote.jmx.access</code></entry>
                <entry><code>boolean</code></entry>
                <entry>
                  Should remote access via JMX be enabled
                </entry>
              </row>
              <row>
                <entry><code>use.platform.mbeanserver</code></entry>
                <entry><code>boolean</code></entry>
                <entry>
                  Should the platform MBeanServer be used for management
                </entry>
              </row>
              <row>
                <entry><code>bean.management</code></entry>
                <entry><code>boolean</code></entry>
                <entry>
                  Should management for all beans be enabled
                </entry>
              </row>
            </tbody>
          </tgroup>
        </table>
      </para>

      <para>
        An example of an <code>ironjacamar.properties</code> file:

        <programlisting>
remote.access=true
remote.port=1302
        </programlisting>
      </para>

      <section id="configuration_ironjacamar_leakpool">
        <title>Using the leak detector pool</title>

        <para>
          IronJacamar features a connection pool implementation, which keeps track of
          connection allocations, and their release in order to provide feedback if
          a connection is obtained, but never released by the application. This will cause
          leaks, and lead to applications not being able to obtain any connections.
        </para>

        <para>
          The leak detector pool provides a stack trace of the leaked connection allocation
          either during shutdown of the pool, or once the pool is flush using a flush strategy
          which kills all active connections.
        </para>

        <para>
          The leak detector pool is configured using the <code>ironjacamar.mcp</code> system
          property with a value of
        </para>

        <programlisting>
org.jboss.jca.core.connectionmanager.pool.mcp.LeakDumperManagedConnectionPool
        </programlisting>

        <para>
          This configuration applies to all connection pools used by IronJacamar.
        </para>

        <para>
          The system property <code>ironjacamar.leaklog</code> can be used
          to have the leaks dumped out into a special file separate from the logging
          setup.
        </para>

        <para>
          An example
        </para>

        <programlisting>
-Dironjacamar.mcp=org.jboss.jca.core.connectionmanager.pool.mcp.LeakDumperManagedConnectionPool
-Dironjacamar.leaklog=leaks.txt
        </programlisting>

      </section>

      <section id="configuration_ironjacamar_rollback">
        <title>Allow obtaining connections during MARKED_FOR_ROLLBACK</title>

        <para>
          IronJacamar doesn't allow to obtain a new connection once a transaction is in
          <code>MARKED_FOR_ROLLBACK</code> mode. This allows the container to fail
          eagerly, since any work after that point is wasted anyway.
        </para>

        <para>
          However, certain applications depends on getting a connection to perform
          work.
        </para>

        <para>
          IronJacamar has a system property called <code>ironjacamar.allow_marked_for_rollback</code>
          which can be set to <code>true</code> to enable this scenario.
        </para>

        <para>
          Note, that an existing enlisted connection is allowed to be obtained. This can be disallowed
          by setting the system property <code>ironjacamar.allow_marked_for_rollback_fast_fail</code>
          to <code>true</code>.
        </para>

        <warning>
          This should not be considered best practice, and the application in question
          should be fixed by checking the transaction status.
        </warning>
      </section>

      <section id="configuration_ironjacamar_enlistment">
        <title>Disable enlistment trace</title>

        <para>
          IronJacamar records transaction enlistment traces in order to help to locate error situations
          that happens during enlistment of <code>XAResource</code> instances.
        </para>

        <para>
          This has a performance overhead of course, so in certain situations you may want to disable
          these traces.
        </para>

        <para>
          IronJacamar has a system property called <code>ironjacamar.disable_enlistment_trace</code>
          which can be set to <code>true</code> which does this.
        </para>

        <warning>
          By disabling the enlistment trace tracking down errors during transaction enlistment will 
          become much more difficult. So, only add this system property if you know what you are doing.
        </warning>
      </section>

      <section id="configuration_ironjacamar_delistresource">
        <title>Disable <code>delistResource</code> calls</title>

        <para>
          IronJacamar calls <code>transaction.enlistResource(xaResource)</code> for the <code>ManagedConnection</code>
          when it is enlisting in the transaction.
        </para>

        <para>
          IronJacamar will also call <code>transaction.delistResource(xaResource, flag)</code> once the
          <code>ManagedConnection</code> should be disassociated with the transaction. This typically happens
          on the transaction boundary (<code>beforeCompletion</code>) before the connection is returned to
          the pool (<code>afterCompletion</code>). This is done as part of the transaction specification contract.
        </para>

        <para>
          However, in certain scenarios you may want to disable this call, as other <code>Synchronization</code>
          objects may still want the connection enlisted in the transaction, and hence it depends on the
          ordering of these objects.
        </para>

        <para>
          IronJacamar has a system property called <code>ironjacamar.no_delist_resource</code>
          which is a <code>','</code> separated list of pool names where <code>delistResource</code>
          shouldn't be called. Disabling the <code>delistResource</code> call for all pools can be done
          by defining <code>ironjacamar.no_delist_resource_all</code>.
        </para>

        <warning>
          By disabling the <code>delistResource</code> call it is up to the resource manager and transaction
          manager to make sure that the connection is delisted from the transaction in all cases.
        </warning>
      </section>

      <section id="configuration_ironjacamar_rollback_on_fatal_error">
        <title>Disable <code>setRollbackOnly</code> calls</title>

        <para>
          IronJacamar calls <code>transaction.setRollbackOnly()</code> when the <code>ManagedConnection</code>
          has a fatal error occur on it after calling the <code>transaction.delistResource(xaResource, XAResource.TMFAIL)</code>
          method.
        </para>

        <para>
          IronJacamar has a system property called <code>ironjacamar.rollback_on_fatal_error</code>
          which is either a value of <code>true</code>, <code>false</code> or a <code>','</code> separated list of
          pool names where <code>setRollbackOnly</code>
          shouldn't be called.
        </para>

        <warning>
          By disabling the <code>setRollbackOnly</code> call it is up to the transaction
          manager to make sure that the outcome of transaction is correctly handled, since the associated
          <code>XAResource</code> instance no longer can access the Enterprise Information System, and hence
          implementation specific behavior.
        </warning>
      </section>

   </section>

   <section id="logging">
      <title>Logging service</title>

      <para>The IronJacamar container uses JBoss Logging framework as the implementation.</para>

      <para>The configuration is done in the</para>

      <programlisting>
config/logging.properties
      </programlisting>

      <para>file.</para>

      <para>Consult the <ulink url="http://www.jboss.org/community/wiki/JBossBootLogging">
          JBoss Logging documentation</ulink> on how the service can be configured.</para>

   </section>

   <section id="transaction">
      <title>Transaction service</title>

      <para>The IronJacamar container uses Narayana its transaction implementation.</para>

      <para>The configuration is done in the</para>

      <programlisting>
config/transaction.xml
      </programlisting>

      <para>file.</para>

      <para>Consult the Narayana documentation on how the service can be configured.</para>

   </section>

   <section id="jca">
      <title>JCA</title>

      <section id="jca_deployer">
        <title>Deployer</title>

        <para>The IronJacamar deployer is configured in the</para>

        <programlisting>
config/bootstrap/jca.xml
        </programlisting>

        <para>file.</para>

        <section id="jca_deployer_configuration">
          <title>Configuration</title>

          <para>The configuration of the resource adapter deployer chain is handled
            by a <code>org.jboss.jca.deployers.fungal.RAConfiguration</code> bean.</para>

          <programlisting language="xml">
<![CDATA[
<bean name="RAConfiguration"
      class="org.jboss.jca.deployers.fungal.RAConfiguration">
  <property name="ArchiveValidation">true</property>
  <property name="ArchiveValidationFailOnWarn">false</property>
  <property name="ArchiveValidationFailOnError">true</property>
  <property name="BeanValidation">true</property>
  <property name="PrintStream">
    <inject bean="JBossStdioContext" property="Out"/>
  </property>
  <property name="DefaultBootstrapContext">
    <inject bean="DefaultBootstrapContext"/>
  </property>
  <property name="JndiStrategy"><inject bean="JndiStrategy"/></property>
  <property name="TransactionManager">
    <inject bean="RealTransactionManager"/>
  </property>
  <property name="MetadataRepository"><inject bean="MDR"/></property>
</bean>
 ]]>
          </programlisting>
          

          <table frame="all">
            <title>Resource adapter deployer configuration</title>
            <tgroup cols="3" align="left" colsep="1" rowsep="1">
              <colspec colname="c1" colwidth="2*"/>
              <colspec colname="c2" colwidth="2*"/>
              <colspec colname="c3" colwidth="3*"/>
              <thead>
                <row>
                  <entry align="left">Property</entry>
                  <entry align="left">Type</entry>
                  <entry align="left">Description</entry>
                </row>
              </thead>
              <tbody>
                <row>
                  <entry><code>ArchiveValidation</code></entry>
                  <entry><code>boolean</code></entry>
                  <entry>
                    Toggle archive validation for the deployment units.
                    <para>Default: <code>true</code></para>
                  </entry>
                </row>
                <row>
                  <entry><code>ArchiveValidation&#x200B;FailOnWarn</code></entry>
                  <entry><code>boolean</code></entry>
                  <entry>
                    Should an archive validation warning report fail the deployment.
                    <para>Default: <code>false</code></para>
                  </entry>
                </row>
                <row>
                  <entry><code>ArchiveValidation&#x200B;FailOnError</code></entry>
                  <entry><code>boolean</code></entry>
                  <entry>
                    Should an archive validation error report fail the deployment.
                    <para>Default: <code>true</code></para>
                  </entry>
                </row>
                <row>
                  <entry><code>BeanValidation</code></entry>
                  <entry><code>boolean</code></entry>
                  <entry>
                    Toggle bean validation (JSR-303) for the deployment units.
                    <para>Default: <code>true</code></para>
                  </entry>
                </row>
                <row>
                  <entry><code>DefaultBootstrap&#x200B;Context</code></entry>
                  <entry><code>org.jboss.jca.&#x200B;core.api.bootstrap.&#x200B;CloneableBootstrap&#x200B;Context</code></entry>
                  <entry>
                    Specifies the default bootstrap context for resource adapters
                  </entry>
                </row>
                <row>
                  <entry><code>BootstrapContexts</code></entry>
                  <entry><code>Map&lt;String, &#x200B;org.jboss.jca.&#x200B;core.api.bootstrap.&#x200B;CloneableBootstrap&#x200B;Context&gt;</code></entry>
                  <entry>
                    Bootstrap context map (unique name to a cloneable bootstrap context) which allows
                    developers to bind (through <code>ironjacamar.xml</code>) their resource adapter to
                    a specific bootstrap context instance.
                  </entry>
                </row>
                <row>
                  <entry><code>PrintStream</code></entry>
                  <entry><code>java.io.PrintStream</code></entry>
                  <entry>
                    Specifies which print stream that should be used to handle the <code>LogWriter</code>s
                  </entry>
                </row>
                <row>
                  <entry><code>MetadataRepository</code></entry>
                  <entry><code>org.jboss.jca.&#x200B;core.spi.mdr.&#x200B;MetadataRepository</code></entry>
                  <entry>
                    The metadata repository
                  </entry>
                </row>
                <row>
                  <entry><code>ResourceAdapterRepository</code></entry>
                  <entry><code>org.jboss.jca.&#x200B;core.spi.rar.&#x200B;ResourceAdapterRepository</code></entry>
                  <entry>
                    The resource adapter repository
                  </entry>
                </row>
                <row>
                  <entry><code>ScopeDeployment</code></entry>
                  <entry><code>boolean</code></entry>
                  <entry>
                    Should each deployment be scoped (isolated) from the container. This feature allows
                    deployment of libraries of a different version than used in the container environment.
                    <para>Default: <code>false</code></para>
                  </entry>
                </row>
                <row>
                  <entry><code>JndiStrategy</code></entry>
                  <entry><code>org.jboss.jca.&#x200B;core.spi.naming.&#x200B;JndiStrategy</code></entry>
                  <entry>
                    Specifies the JNDI strategy policy for binding the connection factories into
                    the naming environment
                    
                    <para>The JNDI strategies are located in the <code>org.jboss.jca.core.naming</code>
                      package</para>
                    <itemizedlist spacing="compact">
                      <listitem>
                        <code>NoopJndiStrategy</code>: A no operation JNDI strategy 
                        which doesn't bind/unbind any objects
                      </listitem>
                      <listitem>
                        <code>SimpleJndiStrategy</code>: A simple JNDI strategy 
                        which can bind/unbind a single connection factory
                      </listitem>
                      <listitem>
                        <code>ExplicitJndiStrategy</code>: A JNDI strategy 
                        which can requires explicit JNDI names to bind/unbind a connection factory
                      </listitem>
                    </itemizedlist>
                  </entry>
                </row>
              </tbody>
            </tgroup>
          </table>

        </section>

        <section id="jca_deployer_radeployer">
          <title>Resource adapter deployer</title>

          <para>The initial deployer for resource adapter archives is handled
            by a <code>org.jboss.jca.deployers.fungal.RADeployer</code> bean.</para>

          <programlisting language="xml">
<![CDATA[
<bean name="RADeployer"
      interface="com.github.fungal.spi.deployers.Deployer" 
      class="org.jboss.jca.deployers.fungal.RADeployer">
  <property name="Configuration"><inject bean="RAConfiguration"/></property>
  <depends>BeanValidation</depends>
  <depends>JBossStdioContextSelector</depends>
</bean>
 ]]>
          </programlisting>

          <para>This deployer will register the resource adapters with the metadata repository in
            the system.</para>
          

          <table frame="all">
            <title>Resource adapter deployer</title>
            <tgroup cols="3" align="left" colsep="1" rowsep="1">
              <colspec colname="c1" colwidth="2*"/>
              <colspec colname="c2" colwidth="2*"/>
              <colspec colname="c3" colwidth="3*"/>
              <thead>
                <row>
                  <entry align="left">Property</entry>
                  <entry align="left">Type</entry>
                  <entry align="left">Description</entry>
                </row>
              </thead>
              <tbody>
                <row>
                  <entry><code>Configuration</code></entry>
                  <entry><code>org.jboss.jca.&#x200B;deployers.fungal.&#x200B;RAConfiguration</code></entry>
                  <entry>
                    The configuration for the deployer
                  </entry>
                </row>
              </tbody>
            </tgroup>
          </table>

        </section>

        <section id="jca_deployer_raxmldeployer">
          <title>Resource adapter metadata deployer</title>

          <para>The deployer for deploying our <code>-ra.xml</code> deployment descriptor is handled
            by a <code>org.jboss.jca.deployers.fungal.RaXmlDeployer</code> bean.</para>
          
          <para>The deployment descriptor is defined by the <code>resource-adapters-1_0.xsd</code> and
          <code>resource-adapters-1_1.xsd</code> schemas.</para>

          <programlisting language="xml">
<![CDATA[
<bean name="RaXmlDeployer"
      interface="com.github.fungal.spi.deployers.Deployer" 
      class="org.jboss.jca.deployers.fungal.RaXmlDeployer">
  <property name="Configuration"><inject bean="DeployerConfiguration"/></property>
  <property name="Kernel"><inject bean="Kernel"/></property>
  <depends>BeanValidation</depends>
  <depends>JBossStdioContextSelector</depends>
</bean>
 ]]>
          </programlisting>

          <para>This deployer will activate resource adapters based on the deployment information.</para>
          

          <table frame="all">
            <title>Resource adapter metadata deployer</title>
            <tgroup cols="3" align="left" colsep="1" rowsep="1">
              <colspec colname="c1" colwidth="2*"/>
              <colspec colname="c2" colwidth="2*"/>
              <colspec colname="c3" colwidth="3*"/>
              <thead>
                <row>
                  <entry align="left">Property</entry>
                  <entry align="left">Type</entry>
                  <entry align="left">Description</entry>
                </row>
              </thead>
              <tbody>
                <row>
                  <entry><code>Configuration</code></entry>
                  <entry><code>org.jboss.jca.&#x200B;deployers.fungal.&#x200B;RAConfiguration</code></entry>
                  <entry>
                    The configuration for the deployer
                  </entry>
                </row>
              </tbody>
            </tgroup>
          </table>

        </section>

        <section id="jca_deployer_raactivator">
          <title>Resource adapter activator</title>

          <para>The deployer chain features an activator for resource adapter archives is handled
            by the <code>org.jboss.jca.deployers.fungal.RAActivator</code> bean.</para>

          <programlisting language="xml">
<![CDATA[
<bean name="RAActivator" 
      class="org.jboss.jca.deployers.fungal.RAActivator">
  <property name="Configuration"><inject bean="RAConfiguration"/></property>
  <property name="Kernel"><inject bean="Kernel"/></property>
  <property name="ExcludeArchives">
    <set elementClass="java.lang.String">
      <value>jdbc-local.rar</value>
      <value>jdbc-xa.rar</value>
    </set>
  </property>
  <depends>BeanValidation</depends>
  <depends>JBossStdioContextSelector</depends>
</bean>
 ]]>
          </programlisting>

          <para>This activator will activate any resource adapters which hasn't been activated yet
            unless they are in the excluded list.</para>
          

          <table frame="all">
            <title>Resource adapter activator</title>
            <tgroup cols="3" align="left" colsep="1" rowsep="1">
              <colspec colname="c1" colwidth="2*"/>
              <colspec colname="c2" colwidth="2*"/>
              <colspec colname="c3" colwidth="3*"/>
              <thead>
                <row>
                  <entry align="left">Property</entry>
                  <entry align="left">Type</entry>
                  <entry align="left">Description</entry>
                </row>
              </thead>
              <tbody>
                <row>
                  <entry><code>Configuration</code></entry>
                  <entry><code>org.jboss.jca.&#x200B;deployers.fungal.&#x200B;RAConfiguration</code></entry>
                  <entry>
                    The configuration for the deployer
                  </entry>
                </row>
                <row>
                  <entry><code>Enabled</code></entry>
                  <entry><code>boolean</code></entry>
                  <entry>
                    Should the activator be enabled. Default is <code>true</code>
                  </entry>
                </row>
                <row>
                  <entry><code>Kernel</code></entry>
                  <entry><code>com.github.fungal.&#x200B;api.Kernel</code></entry>
                  <entry>
                    The kernel instance
                  </entry>
                </row>
                <row>
                  <entry><code>ExcludeArchives</code></entry>
                  <entry><code>java.util.Set</code></entry>
                  <entry>
                    A set of resource adapter archives which should be excluded 
                    from activation
                  </entry>
                </row>
              </tbody>
            </tgroup>
          </table>

        </section>

      </section>

      <section id="jca_workmanager">
        <title>Work manager</title>

        <para>
          IronJacamar features a standard work manager on its default setup using one thread pool for
          short running jobs, and one thread pool for long running jobs identified by the 
          <code>HintsContext.LONGRUNNING_HINT</code> with a value of <code>true</code>.
        </para>

        <para>
          The configuration of the work manager and the necessary components can be viewed in the <code>jca.xml</code>
          file.
        </para>

        <section id="jca_distributed_workmanager">
          <title>Distributed work manager</title>

          <para>
            A distributed work manager is a work manager instance, which is able to reschedule work execution on
            another work manager instance on the network.
          </para>
          
          <para>
            The distributed work manager has three additional components

            <itemizedlist>
              <listitem>
                Policy -- When to distribute the work instance
              </listitem>
              <listitem>
                Selector -- To which work manager instance
              </listitem>
              <listitem>
                Transport -- How the work instance is transferred
              </listitem>
            </itemizedlist>

            to control the distribution process.
          </para>

          <para>
            Supported policies

            <itemizedlist>
              <listitem>
                Never -- <code>org.jboss.jca.core.workmanager.policy.Never</code>
                <para>
                  Never the distribute the <code>Work</code> instance to another node.
                </para>
              </listitem>
              <listitem>
                Always -- <code>org.jboss.jca.core.workmanager.policy.Always</code>
                <para>
                  Always the distribute the <code>Work</code> instance to another node.
                </para>
              </listitem>
              <listitem>
                WaterMark -- <code>org.jboss.jca.core.workmanager.policy.WaterMark</code>
                <para>
                  Distribute the <code>Work</code> instance to another node based on how many
                  free worker threads the current node has available.
                </para>
              </listitem>
            </itemizedlist>
          </para>

          <para>
            Supported selectors

            <itemizedlist>
              <listitem>
                FirstAvailable -- <code>org.jboss.jca.core.workmanager.selector.FirstAvailable</code>
                <para>
                  Select the first available node in the list
                </para>
              </listitem>
              <listitem>
                PingTime -- <code>org.jboss.jca.core.workmanager.selector.PingTime</code>
                <para>
                  Select the node with the lowest ping time
                </para>
              </listitem>
              <listitem>
                MaxFreeThreads -- <code>org.jboss.jca.core.workmanager.selector.MaxFreeThreads</code>
                <para>
                  Select the node with highest number of free worker threads
                </para>
              </listitem>
            </itemizedlist>
          </para>

          <para>
            Supported transports

            <itemizedlist>
              <listitem>
                Socket -- <code>org.jboss.jca.core.workmanager.transport.remote.socket.SocketTransport</code>
                <para>
                  Communication based on <code>java.net.Socket</code>, and hence TCP/IP 
                </para>
              </listitem>
              <listitem>
                JGroups -- <code>org.jboss.jca.core.workmanager.transport.remote.jgroups.JGroupsTransport</code>
                <para>
                  Communication based on the JGroups framework, and hence UDP (by default) 
                </para>
              </listitem>
            </itemizedlist>
          </para>

          <para>
            Below is an example of a socket based configuration where two instances <code>localhost:1299</code> and
            <code>localhost:1300</code> communicates, taken from the IronJacamar test suite.
          </para>

          <programlisting language="xml">
<xi:include parse="text" href="../../../../core/src/test/resources/dwm-socket.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
          </programlisting>

        </section>

      </section>

      <section id="jca_security">
        <title>Security</title>

        <para>The Java EE Connector Architecture 1.6 specification allows units of 
          <code>javax.resource.spi.Work</code> to be executed in a specific security context.</para>

        <para>This is done through the use of Java Authentication Service Provider Interface for Containers (JSR-196)
          call backs using the <code>javax.security.auth.callback.Callback</code> interface.</para>
        
        <para>The support is activated by letting the work instance implement the</para>

        <programlisting>
javax.resource.spi.work.WorkContextProvider
        </programlisting>

        <para>interface and returning an instance of <code>javax.resource.spi.work.SecurityContext</code>.</para>

        <para>
          The security callback is configured through the <code>&gt;workmanager&lt;</code> element for the
          deployment, either in <code>ironjacamar.xml</code> or in the <code>-ra.xml</code> file. See the schema
          definitions for further details.
        </para>

        <para>There is support for creating a basic security domain which can provide
          a <code>javax.security.auth.Subject</code> instance to deployments that
          are using <code>&lt;security-domain&gt;</code> or
          <code>&lt;security-domain-and-application&gt;</code> in their setup.</para>

        <para>A security domain can be configured through</para>

        <programlisting language="xml">
          <![CDATA[
<!-- SubjectFactory -->
<bean name="DefaultSecurityDomain"
      interface="org.jboss.jca.core.spi.security.SubjectFactory"
      class="org.jboss.jca.core.security.DefaultSubjectFactory">
  <property name="SecurityDomain">DefaultSecurityDomain</property>
  <property name="UserName">user</property>
  <property name="Password">password</property>
</bean>
           ]]>
        </programlisting>

        <para>beans.</para>

      </section>

   </section>

   <section id="datasources">
      <title>Datasources</title>

      <para>The IronJacamar project can deploy datasources using the <code>datasources-1_0.xsd</code>,
        <code>datasources-1_1.xsd</code> or <code>datasources-1_2.xsd</code> schemas.</para>

      <para>The configuration is done in the</para>

      <programlisting>
config/bootstrap/ds.xml
      </programlisting>

      <para>file.</para>

      <table frame="all">
        <title>DsXmlDeployer</title>
        <tgroup cols="3" align="left" colsep="1" rowsep="1">
          <colspec colname="c1" colwidth="2*"/>
          <colspec colname="c2" colwidth="2*"/>
          <colspec colname="c3" colwidth="3*"/>
          <thead>
            <row>
              <entry align="left">Property</entry>
              <entry align="left">Type</entry>
              <entry align="left">Description</entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry><code>JDBCLocal</code></entry>
              <entry><code>String</code></entry>
              <entry>
                The name of the <code>jdbc-local.rar</code> deployment
              </entry>
            </row>
            <row>
              <entry><code>JDBCXA</code></entry>
              <entry><code>String</code></entry>
              <entry>
                The name of the <code>jdbc-xa.rar</code> deployment
              </entry>
            </row>
            <row>
              <entry><code>TransactionManager</code></entry>
              <entry><code>javax.transaction.&#x200B;TransactionManager</code></entry>
              <entry>
                The transaction manager
              </entry>
            </row>
            <row>
              <entry><code>MetadataRepository</code></entry>
              <entry><code>org.jboss.jca.&#x200B;core.spi.mdr.&#x200B;MetadataRepository</code></entry>
              <entry>
                The metadata repository
              </entry>
            </row>
            <row>
              <entry><code>Kernel</code></entry>
              <entry><code>com.github.fungal.&#x200B;api.Kernel</code></entry>
              <entry>
                The kernel
              </entry>
            </row>
          </tbody>
        </tgroup>
      </table>

      <para>The datasource deployer can be removed from the environment by removing the <code>ds.xml</code>
        file in</para>

      <programlisting>
config/bootstrap/
      </programlisting>

      <para>as well as the reference in <code>config/bootstrap/bootstrap.xml</code> to the file.</para>

      <para>Furthermore all <code>jdbc-*.rar</code> files in the <code>system/</code> directory should be removed too.</para>

   </section>

   <section id="webserver">
      <title>Web server</title>

      <para>The IronJacamar project features a web server which is used to serve web archive deployments.
        More information about Jetty can be found at the <ulink url="http://www.eclipse.org/jetty/">
        homepage</ulink>.
      </para>

      <para>The configuration is done in the</para>

      <programlisting>
system/web.xml
      </programlisting>

      <para>file.</para>

      <programlisting language="xml">
<![CDATA[
<bean name="WebServer" class="org.jboss.jca.web.WebServer">
  <property name="Host">${iron.jacamar.bindaddress:localhost}</property>
  <property name="Port">8080</property>
  <property name="ExecutorService"><inject bean="Kernel" property="ExecutorService"/></property>
</bean>
]]>
      </programlisting>

      <table frame="all">
        <title>Web server</title>
        <tgroup cols="3" align="left" colsep="1" rowsep="1">
          <colspec colname="c1" colwidth="2*"/>
          <colspec colname="c2" colwidth="2*"/>
          <colspec colname="c3" colwidth="3*"/>
          <thead>
            <row>
              <entry align="left">Property</entry>
              <entry align="left">Type</entry>
              <entry align="left">Description</entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry><code>Host</code></entry>
              <entry><code>String</code></entry>
              <entry>
                Set the bind address for the web server
                <para>Default: <code>localhost</code></para>
              </entry>
            </row>
            <row>
              <entry><code>Port</code></entry>
              <entry><code>int</code></entry>
              <entry>
                Set the port for the web server
                <para>Default: <code>8080</code></para>
              </entry>
            </row>
            <row>
              <entry><code>AcceptQueueSize</code></entry>
              <entry><code>int</code></entry>
              <entry>
                Set the accept queue size for the Jetty connector
                <para>Default: <code>64</code></para>
              </entry>
            </row>
            <row>
              <entry><code>ExecutorService</code></entry>
              <entry><code>java.util.concurrent.&#x200B;ExecutorService</code></entry>
              <entry>
                The thread pool for the web server
                <para>Default: The kernel thread pool</para>
              </entry>
            </row>
          </tbody>
        </tgroup>
      </table>

      <para>The web server can be removed from the environment by removing the <code>web.xml</code>
        file in</para>

      <programlisting>
system/
      </programlisting>

      <para>Furthermore all <code>.war</code> files in the same directory should be removed too.</para>

      <para>All the Jetty libraries can be removed by deleting the</para>

      <programlisting>
lib/jetty
      </programlisting>

      <para>directory.</para>

   </section>

</chapter>
