1 22 package org.jboss.mq.server.jmx; 23 import javax.jms.IllegalStateException ; 24 import javax.management.ObjectName ; 25 26 import org.jboss.mq.server.JMSServerInterceptor; 27 import org.jboss.system.ServiceMBeanSupport; 28 34 35 abstract public class InterceptorMBeanSupport 36 extends ServiceMBeanSupport 37 implements InterceptorMBean 38 { 39 42 private JMSServerInterceptor nextInterceptor; 43 private ObjectName nextInterceptorObjName; 44 45 46 public ObjectName getNextInterceptor() 47 { 48 return this.nextInterceptorObjName; 49 } 50 51 public void setNextInterceptor(ObjectName jbossMQService) 52 { 53 this.nextInterceptorObjName = jbossMQService; 54 } 55 56 protected void startService() throws Exception 57 { 58 if( nextInterceptorObjName != null ) { 59 nextInterceptor = (JMSServerInterceptor)getServer().getAttribute(nextInterceptorObjName, "Interceptor"); 60 if (nextInterceptor == null) 61 throw new IllegalStateException ("The next interceptor was invalid."); 62 } 63 getInterceptor().setNext(nextInterceptor); 64 } 65 66 } 67 | Popular Tags |