1 7 package org.jboss.jms.server.container; 8 9 import org.jboss.aop.advice.Interceptor; 10 import org.jboss.aop.joinpoint.Invocation; 11 import org.jboss.aop.joinpoint.MethodInvocation; 12 13 19 public class ServerSessionInterceptor 20 implements Interceptor 21 { 22 24 26 28 public static ServerSessionInterceptor singleton = new ServerSessionInterceptor(); 29 30 32 34 36 public String getName() 37 { 38 return "ServerProducerInterceptor"; 39 } 40 41 public Object invoke(Invocation invocation) throws Throwable 42 { 43 MethodInvocation mi = (MethodInvocation) invocation; 44 String methodName = ((MethodInvocation) invocation).getMethod().getName(); 45 if (methodName.equals("createBrowser")) 46 return null; 47 else if (methodName.equals("createConsumer")) 48 return null; 49 else if (methodName.equals("createProducer")) 50 return null; 51 else if (methodName.equals("closing") || methodName.equals("close")) 52 return null; 53 throw new UnsupportedOperationException (mi.getMethod().toString()); 54 } 55 56 58 60 62 64 } 65 | Popular Tags |