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 ServerConnectionInterceptor 20 implements Interceptor 21 { 22 24 26 28 public static ServerConnectionInterceptor singleton = new ServerConnectionInterceptor(); 29 30 32 34 36 public String getName() 37 { 38 return "ServerConnectionInterceptor"; 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("createSession")) 46 return null; 47 else if (methodName.equals("closing") || methodName.equals("close")) 48 return null; 49 throw new UnsupportedOperationException (mi.getMethod().toString()); 50 } 51 52 54 56 58 60 } 61 | Popular Tags |