Listing 1: Configuration of Stateless Session EJBs
<!-- Stateless Session EJB description in weblogic-ejb-jar.xml -->
<!-- Other Tags As Appropriate Here... -->
<stateless-session-descriptor>
<!-- Other Tags As Appropriate Here... -->
<stateless-clustering>
<!-- Set this to be true to enable the home and remote stubs to be clusterable. -->
<stateless-bean-is-clusterable> true
</stateless-bean-is-clusterable>
<!-- Select one of the load-balancing algorithms WebLogic supports. -->
<stateless-bean-load-algorithm> round-robin
</stateless-bean-load-algorithm>
<!-- The name of a class that implements weblogic.rmi.extensions.CallRouter.
This class performs routing of remote method invocations. -->
<stateless-bean-call-router-class-name> common.QARouter
</stateless-bean-call-router-class-name>
<!-- Set this value to true if the methods of the remote interface are
idempotent and should be automatically failed over in a failure situation. -->
<stateless-bean-methods-are-idempotent> false
</stateless-bean-methods-are-idempotent>
</stateless-clustering>
Listing 2: Configuration of Stateful Session EJBs
<!-- Stateful Session EJB description in weblogic-ejb-jar.xml -->
<!-- Other Tags As Appropriate Here... -->
<stateful-session-descriptor>
<!-- Other Tags As Appropriate Here... -->
<stateful-session-clustering>
<!-- Setting this to true enables load balanced home.create(...) methods. -->
<home-is-clusterable> true
</home-is-clusterable>
<!-- This is the load balancing algorithm the home stub will use. -->
<home-load-algorithm> random
</home-load-algorithm>
<!-- The name of a class that implements weblogic.rmi.extensions.CallRouter.
This class performs routing of home method invocations. -->
<home-call-router-class-name> common.QARouter
</home-call-router-class-name>
<!-- Set this value to be InMemory to enable replication of beans. -->
<replication-type> InMemory
</replication-type>
</stateful-session-clustering>
Listing 3: Configuration of an Entity Bean Deployed with the Read-Mostly Strategy
<!-- Read-Mostly Entity EJB description in weblogic-ejb-jar.xml -->
<!-- Other Tags As Appropriate Here... -->
<!-- First, the Read-Write component -->
<weblogic-enterprise-bean>
<ejb-name>exampleReadWriteBean</ejb-name>
<!-- This example uses the automatic invalidation capability -->
<!-- so the read-write bean must use CMP -->
<entity-descriptor>
<persistence>
<persistence-type>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-type>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
</persistence-use>
</persistence>
<!-- This tag links the read-write and read-only beans so that an update -->
<!-- to the former triggers invalidation and refresh of the latter -->
<invalidation-target>
<ejb-name>
exampleReadOnlyBean
</ejb-name>
</invalidation-target>
</entity-descriptor>
<jndi-name>exampleReadWriteBeanHome</jndi-name>
</weblogic-enterprise-bean>
<!-- Now, the read-only component-->
<weblogic-enterprise-bean>
<ejb-name>exampleReadOnlyBean</ejb-name>
<entity-descriptor>
<entity-cache>
<!-- Value of 0 means that the bean is never periodically updated -->
<read-timeout-seconds>0</read-timeout-seconds>
<!-- Tells the container that the bean cannot manipulate its own data-->
<concurrency-strategy>ReadOnly</concurrency-strategy>
</entity-cache>
<persistence>
<!-- Tags identical to those for the read-write bean above-->
</persistence>
</entity-descriptor>
<jndi-name>exampleReadOnlyBeanHome</jndi-name>
</weblogic-enterprise-bean>