public Object invoke(Object proxy,
Method method,
Object[] args) throws Throwable {
String name = method.getName();
if (hasJBossInternalLifecycle)
{
try
{
server.invoke(objectName, ServiceController.JBOSS_INTERNAL_LIFECYCLE, new Object[] { name }, ServiceController.JBOSS_INTERNAL_LIFECYCLE_SIG);
return null;
}
catch (Exception e)
{
throw JMXExceptionDecoder.decode(e);
}
}
Integer opID = serviceOpMap.get(name);
if (opID != null && hasOp[opID.intValue()] == true)
{
// deal with those pesky JMX exceptions
try
{
String[] sig = {};
server.invoke(objectName, name, args, sig);
}
catch (Exception e)
{
throw JMXExceptionDecoder.decode(e);
}
}
return null;
}
Map the method name to a Service interface method index and if the
corresponding hasOp array element is true, dispatch the method to the
mbean we are proxying. |