org.jboss.jmx.connector.invoker
Class InvokerAdaptorService

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.jmx.connector.invoker.InvokerAdaptorService
All Implemented Interfaces:
MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , ServerConstants (src) , Service (src) , ServiceMBean (src)

public class InvokerAdaptorService
extends ServiceMBeanSupport (src)
implements ServerConstants (src)

A JBoss service exposes an invoke(Invocation) operation that maps calls to the ExposedInterface onto the MBeanServer this service is registered with. It is used in conjunction with a proxy factory to expose the MBeanServer to remote clients through arbitrary protocols.

It sets up the correct classloader before unmarshalling the arguments, this relies on the ObjectName being seperate from from the other method arguments to avoid unmarshalling them before the classloader is determined from the ObjectName.

The interface is configurable, it must be similar to MBeanServer, though not necessarily derived from it

The invoker is configurable and must be specified


Field Summary
protected  java.util.HashMap remoteListeners
          A HashSet for the registered listeners
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.mx.server.ServerConstants (src)
CLASS_REMOVED, CLASSLOADER, CLASSLOADER_ADDED, CLASSLOADER_REMOVED, DEFAULT_DOMAIN, DEFAULT_LOADER_NAME, DEFAULT_LOADER_REPOSITORY_CLASS, DEFAULT_MBEAN_REGISTRY_CLASS, DEFAULT_MBEAN_SERVER_BUILDER_CLASS, DEFAULT_REQUIRED_MODELMBEAN_CLASS, DEFAULT_SCOPED_REPOSITORY_CLASS, DEFAULT_SCOPED_REPOSITORY_PARSER_CLASS, IMPLEMENTATION_NAME, IMPLEMENTATION_VENDOR, IMPLEMENTATION_VERSION, JMI_DOMAIN, LOADER_REPOSITORY_CLASS_PROPERTY, MBEAN_REGISTRY, MBEAN_REGISTRY_CLASS_PROPERTY, MBEAN_SERVER_BUILDER_CLASS_PROPERTY, MBEAN_SERVER_CONFIGURATION, MBEAN_SERVER_DELEGATE, OPTIMIZE_REFLECTED_DISPATCHER, REQUIRED_MODELMBEAN_CLASS_PROPERTY, SPECIFICATION_NAME, SPECIFICATION_VENDOR, SPECIFICATION_VERSION, UNIFIED_LOADER_REPOSITORY_CLASS
 
Fields inherited from interface org.jboss.system.ServiceMBean (src)
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
InvokerAdaptorService()
           
 
Method Summary
 void addNotificationListener(ObjectName (src)  name, RMINotificationListener (src)  listener, NotificationFilter (src)  filter, java.lang.Object handback)
           
 java.lang.Class[] getExportedInterfaces()
           
 java.util.Map getMethodMap()
          Expose the service interface mapping as a read-only attribute
 java.lang.Object invoke(Invocation (src)  invocation)
          Expose the MBeanServer service via JMX to invokers.
 void removeNotificationListener(ObjectName (src)  name, RMINotificationListener (src)  listener)
           
 void setExportedInterfaces(java.lang.Class[] exportedInterfaces)
           
protected  void startService()
          Sub-classes should override this method to provide custum 'start' logic.
protected  void stopService()
          Sub-classes should override this method to provide custum 'stop' logic.
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

remoteListeners

protected java.util.HashMap remoteListeners
A HashSet for the registered listeners

Constructor Detail

InvokerAdaptorService

public InvokerAdaptorService()
Method Detail

getExportedInterfaces

public java.lang.Class[] getExportedInterfaces()

setExportedInterfaces

public void setExportedInterfaces(java.lang.Class[] exportedInterfaces)

startService

protected void startService()
                     throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'start' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
startService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

stopService

protected void stopService()
                    throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'stop' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
stopService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

getMethodMap

public java.util.Map getMethodMap()
Expose the service interface mapping as a read-only attribute

Returns:
A Map of the MBeanServer

invoke

public java.lang.Object invoke(Invocation (src)  invocation)
                        throws java.lang.Exception
Expose the MBeanServer service via JMX to invokers.

Parameters:
invocation - A pointer to the invocation object
Returns:
Return value of method invocation.
Throws:
java.lang.Exception - Failed to invoke method.

addNotificationListener

public void addNotificationListener(ObjectName (src)  name,
                                    RMINotificationListener (src)  listener,
                                    NotificationFilter (src)  filter,
                                    java.lang.Object handback)
                             throws InstanceNotFoundException (src) ,
                                    java.rmi.RemoteException
Throws:
InstanceNotFoundException (src)
java.rmi.RemoteException

removeNotificationListener

public void removeNotificationListener(ObjectName (src)  name,
                                       RMINotificationListener (src)  listener)
                                throws InstanceNotFoundException (src) ,
                                       ListenerNotFoundException (src) ,
                                       java.rmi.RemoteException
Throws:
InstanceNotFoundException (src)
ListenerNotFoundException (src)
java.rmi.RemoteException