User: vharcq  
  Date: 01/07/08 15:17:12

  Modified:    src/docs advconfig.xml
  Log:
  2.2 compliance
  remove t3 (grrr.... jboss IS the reference)
  make home lookup "classic" (portablenarrow)
  cosmetics
  
  Revision  Changes    Path
  1.14      +104 -44   manual/src/docs/advconfig.xml
  
  Index: advconfig.xml
  ===================================================================
  RCS file: /cvsroot/jboss/manual/src/docs/advconfig.xml,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- advconfig.xml     2001/07/07 19:25:16     1.13
  +++ advconfig.xml     2001/07/08 22:17:11     1.14
  @@ -7,6 +7,12 @@
                </author>
                <email>[EMAIL PROTECTED]</email>
        </para>
  +     <para>JBoss 2.2 compliance checked by:<author>
  +                     <firstname>Vincent</firstname>
  +                     <surname>Harcq</surname>
  +             </author>
  +             <email>[EMAIL PROTECTED]</email>  
  +     </para>
        <section>
                <title>What is jboss.xml?</title>
                <para>To deploy your beans, you have to specify (nearly) everything 
about them in a 
  @@ -67,19 +73,23 @@
       </session>
   
     </enterprise-beans>
  -  ...
   </ejb-jar>
   ]]></programlisting>
                        <para>And your bean will be available under the "MyBeanName" 
in JNDI.
   In your client code, your call will look like this:</para>
  -                     <programlisting>public class Client {                          
                       
  -  ...
  -  public static void main(String arg[]) {
  -    ...
  -    //No need to use the "narrow" operation, a cast will work in jboss
  -    MyBeanHome home = (MyBeanHome) new InitialContext().lookup("MyBeanName");
  -    ...
  -  }
  +                     <programlisting>import javax.naming.InitialContext;
  +import javax.rmi.PortableRemoteObject;
  +   
  +public class Client {                                                 
  +  
  +   public static void main(String args[]) {
  +      ...  
  +      InitialContext namingContext = new InitialContext();
  +      Object ref = namingContext.lookup("MyBeanName");
  +      MyBeanHome home = (MyBeanHome)PortableRemoteObject.narrow(ref, 
MyBeanHome.class);
  +      ...
  +   }
  +  
   }</programlisting>
                        <para>Here the "MyBeanName" refers to the name of your bean in 
the JNDI namespace. 
   JBoss does not currently allow 
  @@ -114,15 +124,19 @@
   new metadata, this is what we call "differential" jboss.xml).</para>
                        <para>Your bean is then available in JNDI under 
somePath/otherName</para>
                        <para>In your client code, your call will look like 
this:</para>
  -                     <programlisting>public class Client {                          
                       
  -  ...
  -  public static void main(String arg[]) {
  -    ...
  -    //No need to use the "narrow" operation, a cast will work in jboss
  -    MyBeanHome home = (MyBeanHome) new 
  -InitialContext().lookup("somePath/otherName");
  -    ...
  -  }
  +                     <programlisting>import javax.naming.InitialContext;
  +import javax.rmi.PortableRemoteObject;
  +   
  +public class Client {                                                 
  +   
  +   public static void main(String args[]) {
  +      ...
  +      InitialContext namingContext = new InitialContext();
  +      Object ref = namingContext.lookup("somePath/otherName");
  +      MyBeanHome home = (MyBeanHome)PortableRemoteObject.narrow(ref, 
MyBeanHome.class);
  +      ...
  +   }
  +   
   }</programlisting>
                </section>
        </section>
  @@ -135,18 +149,34 @@
   the beginner trails) this is for bean calls all on the server. Most of these 
   calls are done inside the 
   server VM.</para>
  -             <para>This call will look like this: (beans running on the server must 
use the 
  -java:comp/env namespace).</para>
  -             <programlisting>public class ABean implements SessionBean {            
                
  -    ...
  -    public void BusinessMethod(...) {
  -        ...
  -     
  -        BHome home = (BHome)ctx.lookup("java:comp/env/ejb/myBean");
  -        B bean = home.create(pk);
  -        ...
  -    }
  +             <para>This call will look like this:</para>
  +             <programlisting>public class ABean implements SessionBean {
  +
  +   public void businessMethod(...) {
  +      ...
  +      InitialContext namingContext = new InitialContext();
  +      Object ref = namingContext.lookup("java:comp/env/ejb/myBean");
  +      BHome home = (BHome)PortableRemoteObject(ref);
  +      B bean = home.create(pk);
  +      ...
  +   }
  +
   }</programlisting>
  +             <para>You can also have a lookup relative to "java:comp/env" like this 
:</para>
  +             <programlisting>public class ABean implements SessionBean {
  +
  +   public void businessMethod(...) {
  +      ...
  +      InitialContext namingContext = new InitialContext();
  +      Object ref = namingContext.lookup("ejb/myBean");
  +      BHome home = (BHome)PortableRemoteObject(ref);
  +      B bean = home.create(pk);
  +      ...
  +   }
  +
  +}</programlisting>
  +             <para>This notation let better understand the redirection done by 
JBoss for the JNDI lookup.  As we will see, 
  +where the bean lives is not specified in the source code but in the deployment 
descriptor.</para>
                <para>To be allowed this call, the bean A must declare it in the its 
deployment 
   descriptor. This is done by an <![CDATA[<ejb-ref> 
   tag in the bean section of the ejb-jar.xml file. 2 cases may occur: 
  @@ -191,7 +221,6 @@
       </entity>
   
     </enterprise-beans>
  -  ...
   </ejb-jar>
   
   ]]></programlisting>
  @@ -233,7 +262,6 @@
       </session>
   
     </enterprise-beans>
  -  ...
   </ejb-jar>
   ]]></programlisting>
                        <para>jboss.xml: </para>
  @@ -244,7 +272,7 @@
         <ejb-name>Bean A</ejb-name>
         <ejb-ref>
           <ejb-ref-name>ejb/myBean</ejb-ref-name>
  -        <jndi-name>t3://otherserver/application/beanB</jndi-name>
  +        <jndi-name>jnp://otherserver/application/beanB</jndi-name>
         </ejb-ref>
       </session>
     <enterprise-beans>
  @@ -290,6 +318,9 @@
                                                <para>Standard Stateful SessionBean 
</para>
                                        </listitem>
                                        <listitem>
  +                                             <para>Standard Message Driven 
Bean</para>
  +                                     </listitem>
  +                                     <listitem>
                                                <para>jdk1.2.2 CMP EntityBean </para>
                                        </listitem>
                                        <listitem>
  @@ -303,12 +334,13 @@
                                        </listitem>
                                </itemizedlist>
                        </para>
  -                     <para>The first four ones are used if you run JBoss with a 
jdk1.3 JVM. The four last 
  -ones are used if you run JBoss with 
  -a jdk1.2.2 JVM.</para>
  +                     <para>The first five ones are to be used in all cases. The 
four last 
  +ones are deprecated and will disappear in the future.</para>
  +                     <para>They were used if you run JBoss with a jdk1.2.2 JVM as 
explain below.  From now the VM version
  +is detected and using the five first configurations is the rule.</para>
                </section>
                <section>
  -                     <title>How do I configure my bean for jdk1.2.2 clients 
?</title>
  +                     <title>[Deprecated]How do I configure my bean for jdk1.2.2 
clients ?</title>
                        <para>If you run JBoss on a jdk1.3 JVM, but your clients use 
jdk1.2.2, the standard 
   configuration won't work (the protocols 
   are not backward compatible). In this case, you have to force JBoss to use the 
  @@ -335,7 +367,6 @@
       </session>
   
     </enterprise-beans>
  -  ...
   </ejb-jar>
   ]]></programlisting>
                        <para>jboss.xml: </para>
  @@ -374,13 +405,39 @@
       <container-configuration>
         <container-name>Logging Configuration</container-name>
         <call-logging>true</call-logging>
  -      
<container-invoker>org.jboss.ejb.plugins.jrmp13.server.JRMPContainerInvoker</container-invoker>
  +      
<container-invoker>org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker</container-invoker>
  +      <container-interceptors>
  +         <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
  +         <!-- CMT -->
  +         <interceptor 
transaction="Container">org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
  +         <interceptor transaction="Container" 
metricsEnabled="true">org.jboss.ejb.plugins.MetricsInterceptor</interceptor>
  +         <interceptor 
transaction="Container">org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor</interceptor>
  +         <!-- BMT -->
  +         <interceptor 
transaction="Bean">org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor</interceptor>
  +         <interceptor 
transaction="Bean">org.jboss.ejb.plugins.TxInterceptorBMT</interceptor>
  +         <interceptor transaction="Bean" 
metricsEnabled="true">org.jboss.ejb.plugins.MetricsInterceptor</interceptor>
  +         <interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
  +      </container-interceptors>
         
<instance-cache>org.jboss.ejb.plugins.StatefulSessionInstanceCache</instance-cache>
         
<persistence-manager>org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager</persistence-manager>
         <transaction-manager>org.jboss.tm.TxManager</transaction-manager>
         <container-invoker-conf>
  -        <Optimized>False</Optimized>
  +         <RMIObjectPort>4444</RMIObjectPort>
  +         <Optimized>False</Optimized>
         </container-invoker-conf>
  +         <container-cache-conf>
  +            
<cache-policy>org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy</cache-policy>     
 
  +            <cache-policy-conf>
  +               <min-capacity>1</min-capacity>
  +               <max-capacity>1</max-capacity>
  +               <overager-period>300</overager-period>
  +               <max-bean-age>600</max-bean-age>
  +               <resizer-period>400</resizer-period>
  +               <max-cache-miss-period>60</max-cache-miss-period>
  +               <min-cache-miss-period>1</min-cache-miss-period>
  +               <cache-load-factor>0.75</cache-load-factor>
  +            </cache-policy-conf>
  +         </container-cache-conf>
       </container-configuration>
     </container-configurations>
     ...
  @@ -456,22 +513,26 @@
   the returned object in any way she will modify the copy of the object.
   If Optimized is "true" then the caller will modify the original object
   per se, rather than a copy.</para>
  +<para>Another element is <![CDATA[<RMIObjectPort>]]>, it defines the port on which 
JBoss runs its RMI Server.  It has to 
  +be changed when running multiple instances of JBoss on the same server.</para>
  +<para>The other elements are specific to Message Driven Beans and are explained in 
<xref linkend="howto.mbeans"/></para>
                                </listitem>
                                <listitem>
                                        <para><![CDATA[<container-cache-conf> 
configuration of the cache. See below for more details.
   ]]></para>
                                </listitem>
                                <listitem>
  -                                     <para><![CDATA[<role-mapping-manager>, 
<security-domain>, <authentication-module> : security options. See the section about 
JAAS based security in JBoss.]]></para>
  +                                     <para><![CDATA[<role-mapping-manager>, 
<security-domain>, <authentication-module>]]> : security options. 
  +See <xref linkend="howtojaas"/>.</para>
                                </listitem>
                                <listitem>
                                        <para><![CDATA[<container-pool-conf> 
configuration of the pool. Mainly, 
  -the size of the pool. 
  +the minimum and maximum size of the pool. 
   ]]></para>
                                </listitem>
                                <listitem>
   <para>
  -<![CDATA[<commit-option> must be A, B, C, D (in CVS version). ]]></para>
  +<![CDATA[<commit-option> must be A, B, C, D (from JBoss 2.4). ]]></para>
   <para>
   Option A: The container caches the beans state between transactions.
   This options assumes that the bean/container is the only one accessing
  @@ -501,8 +562,7 @@
   invalid and might already have changed in the persistent storage when
   the business method executes.</para>
   <para>
  -Option D: This is a JBoss specific feature available in the actual 
  -version from CVS only. It enables a lazy read schema, where
  +Option D: This is a JBoss specific feature available from version 2.4. It enables a 
lazy read schema, where
   the beans state is cached between transactions as with option A,
   but resynchronized from the persistent storage from time to time
   (via ejbLoad). The default time between resynchronizations is 30
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to