-
1. Re: Load balance policy for multiple EJBs in single place
jaikiran Sep 1, 2010 1:47 AM (in response to nsemchenkov)@org.jboss.annotation.ejb.Clustered
In AS-5, the JBoss EJB3 specific annotations have moved to org.jboss.ejb3.annotation package. For this specific annotation, it would now be @org.jboss.ejb3.annotation.Clustered. So you should change those references in your *-aop.xml (and any code) to use these new annotations.
-
2. Re: Load balance policy for multiple EJBs in single place
nsemchenkov Sep 2, 2010 10:10 AM (in response to jaikiran)Yes, we've tried to make corresponding changes to ejb3-interceptors-aop.xml:
<annotation expr="class(@javax.ejb.Remote) AND !class(@org.jboss.ejb3.annotation.Clustered)"> @org.jboss.ejb3.annotation.Clustered(loadBalancePolicy="net.uk.topdog.td2.ha.StatelessAvailabilityLoadBalancePolicy") </annotation>
But this configuration also doesn't work - the system uses default RoundRobin load balance policy instead.
-
3. Re: Load balance policy for multiple EJBs in single place
jaikiran Sep 2, 2010 8:17 AM (in response to nsemchenkov)Post the relevant bean code and the entire ejb3-interceptors-aop.xml that you are using (including the modifications).
P.S: While posting, please use the forum editor's syntax highlighting options to format the code and the xml.
-
4. Re: Load balance policy for multiple EJBs in single place
nsemchenkov Sep 2, 2010 10:09 AM (in response to jaikiran)Example of EJB:
@Stateless(name = "LoginModuleSessionBean") @Remote(ILoginModule.class) @RemoteBinding(jndiBinding = "LoginModuleSessionBean/remote") @TransactionManagement(TransactionManagementType.BEAN) public class LoginModuleSessionBean implements ILoginModule { public LoginResponse login(LoginRequest request) { // Some code here } }
Stateless bean domain in ejb-interceptors-aop.xml file:
<domain name="Stateless Bean" extends="Intercepted Bean" inheritBindings="true"> <bind pointcut="execution(public * *->*(..))"> <interceptor-ref name="org.jboss.ejb3.ENCPropagationInterceptor" /> <interceptor-ref name="org.jboss.ejb3.security.AuthenticationInterceptorFactory" /> </bind> <bind pointcut="execution(public * @org.jboss.ejb3.annotation.SecurityDomain->*(..))"> <interceptor-ref name="Basic Authorization" /> </bind> <bind pointcut="execution(public * *->*(..))"> <interceptor-ref name="org.jboss.ejb3.security.RunAsSecurityInterceptorFactory" /> </bind> <bind pointcut="execution(public * @org.jboss.ejb3.annotation.Clustered->*(..))"> <interceptor-ref name="org.jboss.ejb3.remoting.ReplicantsManagerInterceptorFactory" /> </bind> <bind pointcut="execution(public * *->*(..))"> <interceptor-ref name="org.jboss.aspects.tx.TxPropagationInterceptor" /> <interceptor-ref name="org.jboss.ejb3.tx.CMTTxInterceptorFactory" /> <interceptor-ref name="org.jboss.ejb3.stateless.StatelessInstanceInterceptor" /> <interceptor-ref name="InvocationStatisticsInterceptor" /> <interceptor-ref name="org.jboss.ejb3.tx.BMTTxInterceptorFactory" /> <interceptor-ref name="org.jboss.ejb3.AllowedOperationsInterceptor" /> <interceptor-ref name="org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor" /> <!-- interceptor-ref name="org.jboss.ejb3.interceptor.EJB3InterceptorsFactory"/ --> <stack-ref name="EJBInterceptors" /> </bind> <annotation expr="class(*) AND !class(@org.jboss.ejb3.annotation.Pool)"> @org.jboss.ejb3.annotation.Pool (value="ThreadlocalPool", maxSize=30, timeout=10000) </annotation> <annotation expr="class(@javax.ejb.Remote) AND !class(@org.jboss.ejb3.annotation.Clustered)"> @org.jboss.ejb3.annotation.Clustered(loadBalancePolicy="net.uk.topdog.td2.ha.StatelessAvailabilityLoadBalancePolicy") </annotation> </domain>