<?xml version="1.0" encoding="utf-8"?>
<jboss> <secure>false</secure>
<container-configurations>
<container-configuration extends="Standard Stateless SessionBean"> <container-name>Retry</container-name> <container-interceptors>
<interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor> <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
<interceptor>org.jboss.test.retry.bean.DummyInterceptor</interceptor>
<interceptor>org.jboss.ejb.plugins.SecurityInterceptor</interceptor>
<!-- CMT -->
<interceptor transaction="Container">org.jboss.ejb.plugins.TxInterceptorCMT
<retry-handlers>
<handler>org.jboss.test.retry.interfaces.RetryHandler</handler>
</retry-handlers>
</interceptor>
<interceptor transaction="Container" metricsEnabled="true">org.jboss.ejb.plugins.MetricsInterceptor</interceptor>
<interceptor transaction="Container">org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor</interceptor>
<!-- BMT -->
<interceptor transaction="Bean">org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor</interceptor>
<interceptor transaction="Bean">org.jboss.ejb.plugins.TxInterceptorBMT</interceptor>
<interceptor transaction="Bean" metricsEnabled="true">org.jboss.ejb.plugins.MetricsInterceptor</interceptor>
<interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor> </container-interceptors> </container-configuration>
</container-configurations>
<enterprise-beans> <session> <ejb-name>RetrySession</ejb-name> <jndi-name>RetrySession</jndi-name> <configuration-name>Retry</configuration-name> </session> </enterprise-beans>
</jboss>
//Title: jbg //Version: //Author: Bill Burke //Company: JBG //Description: Your description
package org.jboss.test.retry.bean;
import java.rmi.*; import javax.ejb.*; import javax.naming.InitialContext; import javax.naming.Context; import org.jboss.ejb.plugins.AbstractInterceptor; import org.jboss.invocation.Invocation;
public class DummyInterceptor extends AbstractInterceptor { public Object invokeHome(final Invocation mi) throws Exception { // assert mi != null; System.out.println("INVOKE HOME INTERCEPTOR"); return getNext().invokeHome(mi); }
public Object invoke(final Invocation mi) throws Exception { System.out.println("INVOKE INTERCEPTOR"); // assert mi != null; return getNext().invoke(mi); } }
Giovanni Formenti wrote:
I readed this doc but I can't understand clearly how to do! I made the following steps: 1) Write a class that extends AbstractInterceptor and implements the invoke method: public Object invoke(Invocation invocation) throws Exception { Object lRet; System.out.println("LOG!!"); lRet=getNext().invoke(invocation); return lRet; } 2) Modify jboss.xml with a configuration: <container-configurations> <container-configuration extends="Standard Stateful SessionBean"> <container-name>Try</container-name> <container-interceptors> <interceptor>com.xxx.TryInterceptor</interceptor> </container-interceptors> </container-configuration> </container-configurations>
and a stateful session bean with that configuration: <session> <ejb-name>Application</ejb-name> <jndi-name>ApplicationBean</jndi-name> <local-jndi-name>ApplicationLocal</local-jndi-name> <configuration-name>Try</configuration-name> </session>
It don't works! What i miss? I really appreciate any suggestion... Thanx
-----Messaggio originale----- Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] conto di Sacha Labourey Inviato: mercoledi 7 gennaio 2004 17.39 A: [EMAIL PROTECTED] Oggetto: RE: [JBoss-user] Where to put an Interceptor class?
Sorry... but JBoss 3.2 can use interceptor? How?! I'm very interesting about this!
It is possible since JBoss 2.0.
Take a look at conf/standardjboss.xml and the documentation, it shows how to write your own JBoss.xml file which includes such a stack definition.
Cheers
sacha
------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
-- ================ Bill Burke Chief Architect JBoss Group LLC. ================
------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user