Index Changes

JMSJCA interceptors

  • This is a new feature which has been recently added, more info is available here

How does this work?

  • This is similar to EJB interceptors, however this interceptors can be applied globally
  • For composite applications involving jms endpoints the behaviour is as shown in the diagram

Sample code


public class Interceptor {
    // Inbound and outbound are using different interceptor instances, so
        
    @AroundInvoke
    public Object intercept(InvocationContext ctx) throws Exception {
        if (ctx.getMethod().getName().equals("onMessage")) {
            //TODO 
        } else {
            //on the outbound
        }
        return ctx.proceed();
        
    }
}


Configuration

  • The configuration is done is using jmsjca option

Packaging

  • Interceptors should be packaged as service providers as described in JDK 6. See the javadoc of the java.util.ServiceLoader class. In short, JMSJCA will try to load all files named META-INF/services/${JMSJCA.interceptorsvcname} through the current class loader and thread context class loader. Each of these files should be a text file containing the class names of the interceptors. There should be one class name per line. The text file is typically packaged in the jar file that contains the interceptors. There can be multiple of these jars

JSPWiki v2.4.100
[RSS]
« Home Index Changes Prefs
This page (revision-6) was last changed on 21-Jul-09 13:47 PM, -0700 by sujit