<?xml version="1.0" encoding="UTF-8"?>

<!-- $Id: ssl-uil2-service.xml 33429 2005-07-11 19:59:46Z adrian $ -->

<server>

  <!-- An example invocation layer using ssl
       JBossMQ using the Unified Invocation Layer
       All communication uses one socket connection -->

  <mbean code="org.jboss.mq.il.uil2.UILServerILService"
	 name="jboss.mq:service=InvocationLayer,type=SSLUIL2">

    <!-- The server chain -->
    <depends optional-attribute-name="Invoker">jboss.mq:service=Invoker</depends>

    <!-- JNDI binding -->
    <attribute name="ConnectionFactoryJNDIRef">SSLUIL2ConnectionFactory</attribute>

    <!-- JNDI binding for XA -->
    <attribute name="XAConnectionFactoryJNDIRef">SSLUIL2XAConnectionFactory</attribute>

    <!-- The bind address -->
    <attribute name="BindAddress">${jboss.bind.address}</attribute>

    <!-- The bind port -->
    <attribute name="ServerBindPort">8091</attribute>

    <!-- The ping period in millis -->
    <attribute name="PingPeriod">60000</attribute>

    <!-- Whether tcp/ip does not wait for buffer fills -->

    <attribute name="EnableTcpNoDelay">true</attribute>
    <!-- Used to disconnect the client on the serverside if there is no activity -->
    <!-- Ensure this is greater than the ping period -->
    <attribute name="ReadTimeout">120000</attribute>

    <!-- Used to disconnect the client on the clientside if there is no activity -->
    <!-- Ensure this is greater than the ping period -->
    <attribute name="ClientReadTimeout">300000</attribute>

    <!-- The size of the buffer (in bytes) wrapping the socket -->
    <!-- The buffer is flushed after each request -->
    <attribute name="BufferSize">2048</attribute>

    <!-- Large messages may block the ping/pong -->
    <!-- A pong is simulated after each chunk (in bytes) for both reading and writing -->
    <!-- It must be larger than the buffer size -->
    <attribute name="ChunkSize">1000000</attribute>
    
    <!-- Minimum number of threads in the internal thread pool -->
    <attribute name="MinimumThreads">1</attribute>
    
    <!-- Maximum number of threads in the internal thread pool -->
    <!-- This is not strict, it represents how many threads go back into the pool -->
    <!-- rather than are reaped immediately -->
    <attribute name="MaximumThreads">50</attribute>
    
    <!-- The timeout for unused threads in the internal pool in millis -->
    <attribute name="TimeoutThreads">60000</attribute>

    <!-- SSL Socket Factories -->
    <attribute name="ClientSocketFactory">org.jboss.security.ssl.ClientSocketFactory</attribute>
    <attribute name="ServerSocketFactory">org.jboss.security.ssl.DomainServerSocketFactory</attribute>

    <!-- Security domain - see below -->
    <attribute name="SecurityDomain">java:/jaas/SSL</attribute>
  </mbean>

  <!-- Configures the keystore on the security domain
       This mbean is better placed in conf/jboss-service.xml where it
       can be used by other services. But it will still work from anywhere.
       Use keytool from the sdk to create the keystore.
  -->
  <mbean code="org.jboss.security.plugins.JaasSecurityDomain"
         name="jboss.security:service=JaasSecurityDomain,domain=SSL">
     <!-- This must correlate with the java:/jaas/SSL above -->
     <constructor>
        <arg type="java.lang.String" value="SSL"/>
     </constructor>
     <!-- The location of the keystore
          resource: loads from the classloaders conf/ is the first classloader -->
     <attribute name="KeyStoreURL">resource:test.keystore</attribute>
     <attribute name="KeyStorePass">changeme</attribute>
  </mbean>

</server>
