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.mq.server.JMSServerInvoker; 28 import org.jboss.system.ServiceMBeanSupport; 29 37 38 public class Invoker 39 extends ServiceMBeanSupport 40 implements InvokerMBean 41 { 42 45 private JMSServerInterceptor nextInterceptor; 46 private ObjectName nextInterceptorObjName; 47 private JMSServerInvoker invoker; 48 49 50 53 public ObjectName getNextInterceptor() 54 { 55 return this.nextInterceptorObjName; 56 } 57 58 61 public void setNextInterceptor(ObjectName jbossMQService) 62 { 63 this.nextInterceptorObjName = jbossMQService; 64 } 65 66 protected void startService() throws Exception 67 { 68 if( nextInterceptorObjName != null ) { 69 nextInterceptor = (JMSServerInterceptor)getServer().getAttribute(nextInterceptorObjName, "Interceptor"); 70 if (nextInterceptor == null) 71 throw new IllegalStateException ("The next interceptor was invalid."); 72 } 73 invoker.setNext(nextInterceptor); 74 } 75 76 77 80 protected void createService() throws Exception 81 { 82 super.createService(); 83 invoker = new JMSServerInvoker(); 84 } 85 86 90 public JMSServerInvoker getInvoker() 91 { 92 return invoker; 93 } 94 95 } 96 | Popular Tags |