final ModelMBeanInfo minfo = (ModelMBeanInfo) info;
Descriptor mbeanDescriptor = minfo.getMBeanDescriptor();
getMBeanInfoCtx = new InvocationContext();
getMBeanInfoCtx.setInvoker(this);
getMBeanInfoCtx.setDescriptor(mbeanDescriptor);
getMBeanInfoCtx.setDispatcher(new AbstractInterceptor("MBeanInfo Dispatcher")
{
public Object invoke(Invocation invocation) throws Throwable
{
return minfo;
}
});
// JBAS-33 - No need to register the "getMBeanInfo" context to the operationsContextMap,
// this is only accessible through AbstractMBeanInvoker.getMBeanInfo().
// Registering it will result in duplicate interceptor construction.
// Need to install the setManagedResource op
// TODO, this is probably uneccessary now so revisit this
String[] signature = new String[]{"java.lang.Object", "java.lang.String"};
OperationKey opKey = new OperationKey("setManagedResource", signature);
InvocationContext ctx = new InvocationContext();
ctx.setInvoker(this);
ctx.setDispatcher(new AbstractInterceptor("SetMangedResource Dispatcher")
{
public Object invoke(Invocation invocation) throws Throwable
{
Object[] args = invocation.getArgs();
setManagedResource(args[0], (String) args[1]);