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:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, UnifiedInvokerMBean, org.jboss.remoting.ServerInvocationHandler, org.jboss.system.Service, org.jboss.system.ServiceMBean

public class UnifiedInvoker
extends org.jboss.system.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.
 javax.management.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 subsystem that the invoker will be registered under within remoting connector
 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(javax.management.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 remoting subsystem
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, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
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
 

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()
Description copied from interface: UnifiedInvokerMBean
Gets the subsystem that the invoker will be registered under within remoting connector

Specified by:
getSubSystem in interface UnifiedInvokerMBean
Returns:

setSubSystem

public void setSubSystem(String subsystem)
Sets the remoting subsystem

Specified by:
setSubSystem in interface UnifiedInvokerMBean
Parameters:
subsystem -

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 org.jboss.system.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 org.jboss.system.ServiceMBeanSupport
Throws:
Exception

jmxBind

protected void jmxBind()

stopService

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

Overrides:
stopService in class org.jboss.system.ServiceMBeanSupport
Throws:
Exception

getName

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

Specified by:
getName in interface org.jboss.system.ServiceMBean
Overrides:
getName in class org.jboss.system.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(javax.management.MBeanServer server)
set the mbean server that the handler can reference

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

getServer

public javax.management.MBeanServer getServer()
Overrides:
getServer in class org.jboss.system.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 © 2002 JBoss Group, LLC. All Rights Reserved.