package org.jboss.mq.server.jmx;
import javax.jms.IllegalStateException;
import org.jboss.mq.server.JMSServerInterceptor;
public class InterceptorLoader extends InterceptorMBeanSupport implements InterceptorLoaderMBean
{
private JMSServerInterceptor interceptor;
public JMSServerInterceptor getInterceptor()
{
return interceptor;
}
public void setInterceptorClass(String c) throws Exception
{
interceptor = (JMSServerInterceptor) Thread.currentThread().getContextClassLoader().loadClass(c).newInstance();
}
public String getInterceptorClass() throws Exception
{
return interceptor.getClass().getName();
}
protected void startService() throws Exception
{
if (interceptor == null)
throw new IllegalStateException("The interceptor class was not set (null)");
super.startService();
}
}