org.oddjob.jmx.server
Class ServerAllOperationsHandler<T>

java.lang.Object
  extended by org.oddjob.jmx.server.ServerAllOperationsHandler<T>
All Implemented Interfaces:
ServerInterfaceHandler

public class ServerAllOperationsHandler<T>
extends Object
implements ServerInterfaceHandler

Handle invoking operation on a target object. Essentially provides a translation from JMX style argument to Method.

Author:
rob

Constructor Summary
ServerAllOperationsHandler(Class<T> cl, T target)
          Constructor.
 
Method Summary
 void destroy()
          Clear up any resource this handler might have created.
 Object invoke(RemoteOperation<?> operation, Object[] params)
          Invoke an operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerAllOperationsHandler

public ServerAllOperationsHandler(Class<T> cl,
                                  T target)
Constructor.

Parameters:
target - The object operations will be invoked on.
Method Detail

invoke

public Object invoke(RemoteOperation<?> operation,
                     Object[] params)
              throws MBeanException,
                     ReflectionException
Description copied from interface: ServerInterfaceHandler
Invoke an operation.

Note that this method is not parameterised on return type. This is because it is called from JMX which has no interest in the return type. Adding a return type would also require that return values from the methods were cast to the parameter which would be a lot of code for no advantage.

Specified by:
invoke in interface ServerInterfaceHandler
params - The parameter object array.
Returns:
The result if any.
Throws:
MBeanException
ReflectionException

destroy

public void destroy()
Description copied from interface: ServerInterfaceHandler
Clear up any resource this handler might have created.

Specified by:
destroy in interface ServerInterfaceHandler