<?xml version="1.0" encoding="UTF-8"?>
<chapter version="5.0" xml:lang="en" xmlns="http://docbook.org/ns/docbook"
         xmlns:xlink="http://www.w3.org/1999/xlink"
         xmlns:xi="http://www.w3.org/2001/XInclude"
         xmlns:svg="http://www.w3.org/2000/svg"
         xmlns:mml="http://www.w3.org/1998/Math/MathML"
         xmlns:html="http://www.w3.org/1999/xhtml"
         xmlns:db="http://docbook.org/ns/docbook">
  <title>Essai 1</title>

  <toc></toc>

  <section>
    <title>Essai 1 avec <xi:include href="variables.xml"
    xpointer="appserver" /></title>

    <para>voici un lien sur le <ulink
    url="configuration_guide.html">configuration_guide</ulink>.</para>

    <para><screen>carol.protocols=jrmp <co xml:id="protocolchoice" />
carol.jrmp.url=rmi://localhost:1099 <co xml:id="registryurl" />
carol.jvm.rmi.local.call=false <co xml:id="localcall" />
carol.jvm.rmi.local.registry=false <co xml:id="localregistry" />
carol.jrmp.server.port=0 <co xml:id="serverport" />
carol.jrmp.interfaces.bind.single=false <co xml:id="bindsingle" /></screen>
    <calloutlist>
        <callout arearefs="protocolchoice">
          <para>choice of the protocol or list of protocols</para>
        </callout>

        <callout arearefs="registryurl">
          <para>connexion url to the RMI registry the hostname (localhost) and
          port number must be changed if needed. In a distributed
          configuration changing the hostname is mandatory.</para>
        </callout>

        <callout arearefs="localcall">
          <para>if true local calls are optimized: calls to methods of the
          remote interface are treated as call to local methods (it is not
          always possible depending on the packaging of the
          application).</para>
        </callout>

        <callout arearefs="localregistry">
          <para>if true a local Naming context is used. This must be used only
          with a collocated registry and it is mandatory when the
          jonas.security.manager property of jonas.properties is set to
          true.</para>
        </callout>

        <callout arearefs="serverport">
          <para>exported objects will listen on this port for remote method
          invocations. 0 means random port. Specify a port may be useful when
          the server run behind a firewall.</para>
        </callout>

        <callout arearefs="bindsingle">
          <para>if true use only a single interface when creating the
          registry. False means use all interfaces available.</para>
        </callout>
      </calloutlist></para>
  </section>

  <section>
    <title>Essai2 avec <xi:include href="variables.xml"
    xpointer="appserver" /></title>

    <para><mediaobject>
        <imageobject>
          <imagedata fileref="../../resources/images/myTomcatCluster.gif"
                     width="85%"></imagedata>
        </imageobject>
      </mediaobject></para>
  </section>

  <section>
    <title>Essai3 avec JOnAS</title>

    <para>The jonas-ra.xml contains JOnAS specific information describing
    deployment information, logging, pooling, jdbc connections, and RAR config
    property values:</para>

    <para><informaltable>
        <tgroup cols="3">
          <thead>
            <row>
              <entry>property name</entry>

              <entry>description</entry>

              <entry>possible values</entry>
            </row>
          </thead>

          <tbody>
            <row>
              <entry>jndiname</entry>

              <entry>name the RAR will be registered as. This property is
              required<para>This value will be used in the
              <property>resource-ref</property>section of an <phrase
              xml:id="j2ee">J2EE</phrase><note>
                  <para>AZEAEZAEAEAEAEZ</para>
                </note> composant.</para></entry>

              <entry><itemizedlist>
                  <listitem>
                    <para>Anyname (for example jdbc_1)</para>
                  </listitem>
                </itemizedlist></entry>
            </row>

            <row>
              <entry>rarlink</entry>

              <entry>jndiname of a base RAR file. Useful for deploying
              multiple connection factories without having to deploy the
              complete RAR file again. When this is used, the only entry in
              RAR is a <filename>META-INF/jonas-ra.xml</filename></entry>

              <entry><itemizedlist>
                  <listitem>
                    <para>JONASJDBC_DM</para>
                  </listitem>

                  <listitem>
                    <para>JONASJDBC_DS</para>
                  </listitem>

                  <listitem>
                    <para>JONASJDBC_CP</para>
                  </listitem>

                  <listitem>
                    <para>JONASJDBC_XA</para>
                  </listitem>
                </itemizedlist></entry>
            </row>

            <row>
              <entry>native-lib</entry>

              <entry>defines the path where native libraries can be
              found.</entry>

              <entry><itemizedlist>
                  <listitem>
                    <para>Any string for a path</para>
                  </listitem>
                </itemizedlist></entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable></para>

    <para></para>

    <para><informaltable>
        <tgroup cols="3">
          <thead>
            <row>
              <entry>property name</entry>

              <entry>description</entry>

              <entry>possible values</entry>
            </row>
          </thead>

          <tbody>
            <row>
              <entry>pool-init</entry>

              <entry>Initial size of the managed connection pool</entry>

              <entry><itemizedlist>
                  <listitem>
                    <para>0 (default value)</para>
                  </listitem>

                  <listitem>
                    <para>n</para>
                  </listitem>
                </itemizedlist></entry>
            </row>

            <row>
              <entry>pool-min</entry>

              <entry>Minimum size of the managed connection pool.</entry>

              <entry><itemizedlist>
                  <listitem>
                    <para>0 (default value)</para>
                  </listitem>

                  <listitem>
                    <para>n</para>
                  </listitem>
                </itemizedlist></entry>
            </row>

            <row>
              <entry>pool-max</entry>

              <entry>Maximum size of the managed connection pool.</entry>

              <entry><itemizedlist>
                  <listitem>
                    <para>n</para>
                  </listitem>

                  <listitem>
                    <para>-1 = unlimited (default value)</para>
                  </listitem>
                </itemizedlist></entry>
            </row>

            <row>
              <entry>pool-max-age-minutes</entry>

              <entry>Maximum number of minutes to keep the managed connection
              in the pool.</entry>

              <entry><itemizedlist>
                  <listitem>
                    <para>0 = an unlimited amount of time.</para>
                  </listitem>

                  <listitem>
                    <para>n in minutes</para>
                  </listitem>
                </itemizedlist></entry>
            </row>

            <row>
              <entry>pstmt-max</entry>

              <entry>Maximum number of PreparedStatements per managed
              connection in the pool. Only needed with the JDBC RA of JOnAS or
              another database vendor's RAR. Value of 0 is unlimited and -1
              disables the cache.</entry>

              <entry><itemizedlist>
                  <listitem>
                    <para>0 = unlimited</para>
                  </listitem>

                  <listitem>
                    <para>n (default value = 10)</para>
                  </listitem>

                  <listitem>
                    <para>-1 = cache disabled</para>
                  </listitem>
                </itemizedlist></entry>
            </row>

            <row>
              <entry>pool-max-opentime</entry>

              <entry>Identifies the maximum number of minutes that a managed
              connection can be left busy.</entry>

              <entry><itemizedlist>
                  <listitem>
                    <para>0 = an unlimited amount of time (default
                    value).</para>
                  </listitem>

                  <listitem>
                    <para>n in minutes</para>
                  </listitem>
                </itemizedlist></entry>
            </row>

            <row>
              <entry>pool-max-waiters:</entry>

              <entry>identifies the maximum number of waiters for a managed
              connection. Default value is 0.</entry>

              <entry><itemizedlist>
                  <listitem>
                    <para>0 (default value)</para>
                  </listitem>

                  <listitem>
                    <para>n</para>
                  </listitem>
                </itemizedlist></entry>
            </row>

            <row>
              <entry>pool-max-waittime</entry>

              <entry>identifies the maximum number of seconds that a waiter
              will wait for a managed connection. Default value is 0.</entry>

              <entry><itemizedlist>
                  <listitem>
                    <para>0 (default value)</para>
                  </listitem>

                  <listitem>
                    <para>n in seconds</para>
                  </listitem>
                </itemizedlist></entry>
            </row>

            <row>
              <entry>pool-sampling-period:</entry>

              <entry>identifies the number of seconds that will occur between
              statistics samplings of the pool. Default is 30 seconds.</entry>

              <entry><itemizedlist>
                  <listitem>
                    <para>n in seconds (default value = 30s)</para>
                  </listitem>
                </itemizedlist></entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable></para>
  </section>

  <section>
    <title>Essai de screen avec scrollbar</title>

    <para><programlisting>log.config.classname org.objectweb.util.monolog.wrapper.javaLog.LoggerFactory 

handler.tty.type Console 
handler.tty.output Switch 
handler.tty.pattern  %d : %O{1}.%M : %m%n 

handler.logf.type File 
handler.logf.output automatic 
handler.logf.pattern  %d : %l : %h : %O{1}.%M :    %m%n

logger.root.handler.0 tty 
logger.root.handler.1 logf 

logger.root.level INFO 
logger.org.objectweb.level INFO

#logger.org.objectweb.jonas_ejb.level DEBUG 

handler.mesonly.type Console 
handler.mesonly.output Switch
handler.mesonly.pattern  %m%n

logger.org.objectweb.jonas.genic.handler.0 mesonly 
logger.org.objectweb.jonas.genic.additivity false 

[...]</programlisting></para>
  </section>

  <section>
    <title>Essai de screen sans scrollbar</title>

    <para><screen> se reporter au
          Chapitre 4, Conventions et règles diverses                                                                  dfdgdgdfdgdgfgdgdgdg
 yyyy ...                  
 ant -f build-jb.xml create_jonas_base

</screen></para>
  </section>

  <section>
    <title>Essai de literallayout</title>

    <para><literallayout> se reporter au &lt;xref linkend="conventions" /&gt; ...
          &lt;chapter xml:id="conventions"/&gt; &lt;title&gt;Conventions
          et règles diverses&lt;/title&gt;
        </literallayout></para>
  </section>

  <section>
    <title>Essai de rendus pour Strings</title>

    <para></para>

    <informaltable>
      <tgroup cols="3">
        <thead>
          <row>
            <entry>string</entry>

            <entry>elements/attributs</entry>

            <entry>rendu</entry>
          </row>
        </thead>

        <tbody>
          <row>
            <entry>logger.root.level</entry>

            <entry>aucun</entry>

            <entry>logger.root.level</entry>
          </row>

          <row>
            <entry>logger.root.level</entry>

            <entry>emphasis</entry>

            <entry><emphasis>logger.root.level</emphasis></entry>
          </row>

          <row>
            <entry>logger.root.level</entry>

            <entry>emphasis[bold]</entry>

            <entry><emphasis role="bold">logger.root.level</emphasis></entry>
          </row>

          <row>
            <entry>logger.root.level</entry>

            <entry>filename</entry>

            <entry><filename>logger.root.level</filename></entry>
          </row>

          <row>
            <entry>logger.root.level</entry>

            <entry>filename + class=directory</entry>

            <entry><filename
            class="directory">logger.root.level</filename></entry>
          </row>

          <row>
            <entry>logger.root.level</entry>

            <entry>filename + class=extension</entry>

            <entry><filename
            class="extension">logger.root.level</filename></entry>
          </row>

          <row>
            <entry>logger.root.level</entry>

            <entry>literal</entry>

            <entry><literal>logger.root.level</literal></entry>
          </row>

          <row>
            <entry>logger.root.level</entry>

            <entry>classname</entry>

            <entry><classname>logger.root.level</classname></entry>
          </row>

          <row>
            <entry>logger.root.level</entry>

            <entry>command</entry>

            <entry><command>logger.root.level</command></entry>
          </row>

          <row>
            <entry>logger.root.level</entry>

            <entry>envar</entry>

            <entry><envar>logger.root.level</envar></entry>
          </row>

          <row>
            <entry>logger.root.level</entry>

            <entry>interfacename</entry>

            <entry><interfacename>logger.root.level</interfacename></entry>
          </row>

          <row>
            <entry>logger.root.level</entry>

            <entry>package</entry>

            <entry><package>logger.root.level</package></entry>
          </row>

          <row>
            <entry>logger.root.level</entry>

            <entry>property</entry>

            <entry><property>logger.root.level</property></entry>
          </row>

          <row>
            <entry>logger.root.level</entry>

            <entry>function</entry>

            <entry><function>logger.root.level</function></entry>
          </row>

          <row>
            <entry>logger.root.level</entry>

            <entry>ulink</entry>

            <entry><ulink
            url="http://wiki.jonas.objectweb.org">logger.root.level</ulink></entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>
  </section>

  <section>
    <title>Essai Q and A</title>

    <para></para>

    <qandaset defaultlabel="qanda">
      <qandadiv>
        <qandaentry>
          <question>
            <para>How can I use a java client inside the client
            container?</para>
          </question>

          <answer>
            <para>see <emphasis role="bold">earsample</emphasis> and <emphasis
            role="bold">jaasclient</emphasis> for the use of client container.
            All examples under <filename class="directory">src</filename> show
            heavy clients without client container.</para>
          </answer>
        </qandaentry>

        <qandaentry>
          <question>
            <para>I would like to use cluster of <phrase
            xml:id="appserver">JOnAS</phrase></para>
          </question>

          <answer>
            <para>see sampleCluster2 and the <ulink
            url="http://wiki.jonas.objectweb.org/xwiki/bin/view/Main/Demos">associated
            demo</ulink>.</para>
          </answer>
        </qandaentry>

        <qandaentry>
          <question>
            <para>Is it possible to use EJB3?</para>
          </question>

          <answer>
            <para>it is possible to deploy and use EJB3 with <phrase
            xml:id="j48ee">JOnAS 4.8 EE</phrase> + EJB3 <ulink
            url="http://www.easybeans.net/xwiki/bin/view/Main/">EasyBeans</ulink>
            container. EasyBeans is available for JOnAS 4.x with a resource
            adapter, you only have to use a JDK 5.0.The guide <ulink
            url="http://www.easybeans.org/GettingStarted/GettingStarted.html">Getting
            started with the embedded EasyBeans for JOnAS J2EE server</ulink>
            explains how to do this.</para>
          </answer>
        </qandaentry>

        <qandaentry>
          <question>
            <para>Where can I find transaction management examples?</para>
          </question>

          <answer>
            <para>nearly all examples use container managed transactions but
            some use explicit transaction demarcation in the client (light or
            heavy) like earsample, src/eb, src/sb</para>
          </answer>
        </qandaentry>

        <qandaentry>
          <question>
            <para>Where can I find servlets and JSP examples?</para>
          </question>

          <answer>
            <para>see <emphasis role="bold">earsample</emphasis>, <emphasis
            role="bold">alarm</emphasis>, <emphasis
            role="bold">cmp2</emphasis>, <emphasis
            role="bold">olstore,</emphasis> <emphasis
            role="bold">petstore1.3</emphasis>, <emphasis
            role="bold">j2eemanagement</emphasis>, etc...</para>
          </answer>
        </qandaentry>

        <qandaentry>
          <question>
            <para>My application needs to access database</para>
          </question>

          <answer>
            <para>see <emphasis role="bold">src/eb</emphasis>, <emphasis
            role="bold">cmp2</emphasis>, <emphasis
            role="bold">alarm</emphasis>, <emphasis
            role="bold">olstore</emphasis>, <emphasis
            role="bold">petstore1.3</emphasis>,<emphasis
            role="bold">hibernate</emphasis>, <emphasis
            role="bold">jdo</emphasis> examples.</para>
          </answer>
        </qandaentry>

        <qandaentry>
          <question>
            <para>How to use JMS or message driven beans?</para>
          </question>

          <answer>
            <para>see <emphasis role="bold">src/jms</emphasis>, <emphasis
            role="bold">src/mdb/sampleappli,</emphasis> <emphasis
            role="bold">src/mdb/*</emphasis>, <emphasis
            role="bold">alarm</emphasis> examples.</para>
          </answer>
        </qandaentry>

        <qandaentry>
          <question>
            <para>Are there webservices examples?</para>
          </question>

          <answer>
            <para>Yes, of course see <emphasis
            role="bold">webservices/beans/ws</emphasis>, <emphasis
            role="bold">webservices/beans/wsclient</emphasis>, <emphasis
            role="bold">webservices/webs/webclient</emphasis>, <emphasis
            role="bold">webservices/webs/webendpoint</emphasis>, <emphasis
            role="bold">olstore</emphasis></para>
          </answer>
        </qandaentry>

        <qandaentry>
          <question>
            <para>how to use security?</para>
          </question>

          <answer>
            <para><emphasis role="bold">earsample</emphasis> uses EJB
            security, <emphasis role="bold">jaasclient</emphasis> uses JAAS
            login module, JACC authentication is used by all servlet examples
            that use authentication like <emphasis
            role="bold">olstore</emphasis>, <emphasis
            role="bold">petsore1.3</emphasis>,<emphasis role="bold">alarm.
            </emphasis><emphasis role="bold">webservices/beans/ws</emphasis>
            shows how to add security to a stateless session bean using
            WsGen</para>
          </answer>
        </qandaentry>

        <qandaentry>
          <question>
            <para>I would like to use mail API</para>
          </question>

          <answer>
            <para>see <emphasis role="bold">src/mailsb</emphasis>.</para>
          </answer>
        </qandaentry>

        <qandaentry>
          <question>
            <para>Is it possible to access to Management beans (MBeans) of
            <phrase xml:id="appserver">JOnAS</phrase>?</para>
          </question>

          <answer>
            <para>yes !j2eemanagement example shows how to use the Management
            EJB (MEJB) that allows to perform some management operations
            accordingly to the J2EE Management Specification (JSR77).</para>
          </answer>
        </qandaentry>

        <qandaentry>
          <question>
            <para>How to build and package Java EE application?</para>
          </question>

          <answer>
            <para>All examples are built and packaged via Ant. you can be
            inspired by the build.xml files.</para>

            <para>For example
            <filename>$JONAS_ROOT/examples/earsample/build.xml </filename>file
            is a very good example that can be followed. It shows ant targets
            for:</para>

            <itemizedlist>
              <listitem>
                <para>compiling all the java sources</para>
              </listitem>

              <listitem>
                <para>building ejbjar file for JOnAS via the standard
                <literal>ejb</literal> ant target</para>
              </listitem>

              <listitem>
                <para>building war file</para>
              </listitem>

              <listitem>
                <para>building client jar file</para>
              </listitem>

              <listitem>
                <para>building rar file</para>
              </listitem>

              <listitem>
                <para>building ear file</para>
              </listitem>
            </itemizedlist>
          </answer>
        </qandaentry>
      </qandadiv>
    </qandaset>
  </section>
</chapter>