org.jboss.invocation.unified.server
Class UnifiedInvoker

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.invocation.unified.server.UnifiedInvoker
All Implemented Interfaces:
MBeanRegistration, NotificationBroadcaster, NotificationEmitter, UnifiedInvokerMBean, org.jboss.kernel.spi.dependency.KernelControllerContextAware, org.jboss.remoting.ServerInvocationHandler, Service, ServiceMBean

public class UnifiedInvoker
extends ServiceMBeanSupport
implements org.jboss.remoting.ServerInvocationHandler, UnifiedInvokerMBean

This is a detached invoker which sits on top of jboss remoting. Since this uses remoting, the transport protocol used is defined within the remoting service and this, the UnifiedInvoker, is declared as the handler.

Author:
Tom Elrod

Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
UnifiedInvoker()
           
 
Method Summary
 void addListener(org.jboss.remoting.callback.InvokerCallbackHandler callbackHandler)
          Adds a callback handler that will listen for callbacks from the server invoker handler.
protected  void createService()
           
protected  org.jboss.remoting.ServerInvoker getInvoker()
           
 String getInvokerLocator()
          Gets the invoker locator string for this server
 String getName()
          Gives this JMX service a name.
 MBeanServer getServer()
           
 boolean getStrictRMIException()
          A return of true means that the UnifiedInvokerProxy (on the client side) will wrap all RemoteExceptions within a new ServerException.
 String getSubSystem()
          Gets the remoting subsystem being used.
 Object invoke(org.jboss.remoting.InvocationRequest invocationReq)
          Implementation of the server invoker handler interface.
protected  void jmxBind()
           
 void removeListener(org.jboss.remoting.callback.InvokerCallbackHandler callbackHandler)
          Removes the callback handler that was listening for callbacks from the server invoker handler.
 void setConnector(org.jboss.remoting.transport.ConnectorMBean connector)
          This may be called if set depends in config with optional-attribute-name.
 void setInvoker(org.jboss.remoting.ServerInvoker invoker)
          set the invoker that owns this handler
 void setMBeanServer(MBeanServer server)
          set the mbean server that the handler can reference
 void setStrictRMIException(boolean isStrict)
          If set to true, this will cause the UnifiedInvokerProxy (on the client side) to wrap all RemoteExceptions thrown from the server in a new ServerException.
 void setSubSystem(String subsystem)
          Sets the subsystem that the invoker will be registered under within remoting connector.
protected  void startService()
          Will get the invoker locator from the server invoker, start the server invoker, create the proxy, and bind the proxy.
 void stopService()
          Stops the server invoker.
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, destroy, destroyService, getDeploymentInfo, getLog, getNextNotificationSequenceNumber, getObjectName, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, pojoChange, pojoCreate, pojoDestroy, pojoStart, pojoStop, postDeregister, postRegister, preDeregister, preRegister, setKernelControllerContext, start, stop, unsetKernelControllerContext
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean
getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 
Methods inherited from interface org.jboss.remoting.ServerInvocationHandler
toString
 

Constructor Detail

UnifiedInvoker

public UnifiedInvoker()
Method Detail

setStrictRMIException

public void setStrictRMIException(boolean isStrict)
If set to true, this will cause the UnifiedInvokerProxy (on the client side) to wrap all RemoteExceptions thrown from the server in a new ServerException. If false, will unwrap the original exception thrown from withint the RemoteException and throw that. The default is false.

Specified by:
setStrictRMIException in interface UnifiedInvokerMBean
Parameters:
isStrict -

getStrictRMIException

public boolean getStrictRMIException()
A return of true means that the UnifiedInvokerProxy (on the client side) will wrap all RemoteExceptions within a new ServerException. A return of false, will unwrap the original exception thrown from within the RemoteException and throw that. The default, if not explicitly set, is false.

Specified by:
getStrictRMIException in interface UnifiedInvokerMBean
Returns:

getSubSystem

public String getSubSystem()
Gets the remoting subsystem being used.

Specified by:
getSubSystem in interface UnifiedInvokerMBean
Returns:

setSubSystem

public void setSubSystem(String subsystem)
Description copied from interface: UnifiedInvokerMBean
Sets the subsystem that the invoker will be registered under within remoting connector.

Specified by:
setSubSystem in interface UnifiedInvokerMBean

setConnector

public void setConnector(org.jboss.remoting.transport.ConnectorMBean connector)
This may be called if set depends in config with optional-attribute-name.

Specified by:
setConnector in interface UnifiedInvokerMBean
Parameters:
connector -

createService

protected void createService()
                      throws Exception
Overrides:
createService in class ServiceMBeanSupport
Throws:
Exception

startService

protected void startService()
                     throws Exception
Will get the invoker locator from the server invoker, start the server invoker, create the proxy, and bind the proxy.

Overrides:
startService in class ServiceMBeanSupport
Throws:
Exception

jmxBind

protected void jmxBind()

stopService

public void stopService()
                 throws Exception
Stops the server invoker.

Overrides:
stopService in class ServiceMBeanSupport
Throws:
Exception

getName

public String getName()
Gives this JMX service a name.

Specified by:
getName in interface ServiceMBean
Overrides:
getName in class ServiceMBeanSupport
Returns:
The Name value

getInvokerLocator

public String getInvokerLocator()
Gets the invoker locator string for this server

Specified by:
getInvokerLocator in interface UnifiedInvokerMBean
Returns:

invoke

public Object invoke(org.jboss.remoting.InvocationRequest invocationReq)
              throws Throwable
Implementation of the server invoker handler interface. Will take the invocation request and invoke down the interceptor chain.

Specified by:
invoke in interface org.jboss.remoting.ServerInvocationHandler
Parameters:
invocationReq -
Returns:
Throws:
Throwable

setMBeanServer

public void setMBeanServer(MBeanServer server)
set the mbean server that the handler can reference

Specified by:
setMBeanServer in interface org.jboss.remoting.ServerInvocationHandler
Parameters:
server -

getServer

public MBeanServer getServer()
Overrides:
getServer in class ServiceMBeanSupport

setInvoker

public void setInvoker(org.jboss.remoting.ServerInvoker invoker)
set the invoker that owns this handler

Specified by:
setInvoker in interface org.jboss.remoting.ServerInvocationHandler
Parameters:
invoker -

getInvoker

protected org.jboss.remoting.ServerInvoker getInvoker()

addListener

public void addListener(org.jboss.remoting.callback.InvokerCallbackHandler callbackHandler)
Adds a callback handler that will listen for callbacks from the server invoker handler. This is a no op as don't expect the detached invokers to have callbacks

Specified by:
addListener in interface org.jboss.remoting.ServerInvocationHandler
Parameters:
callbackHandler -

removeListener

public void removeListener(org.jboss.remoting.callback.InvokerCallbackHandler callbackHandler)
Removes the callback handler that was listening for callbacks from the server invoker handler. This is a no op as don't expect the detached invokers to have callbacks

Specified by:
removeListener in interface org.jboss.remoting.ServerInvocationHandler
Parameters:
callbackHandler -


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.