org.rhq.enterprise.server.remote
Class RemoteSafeInvocationHandler

java.lang.Object
  extended by org.rhq.enterprise.server.remote.RemoteSafeInvocationHandler
All Implemented Interfaces:
org.jboss.remoting.ServerInvocationHandler

public class RemoteSafeInvocationHandler
extends Object
implements org.jboss.remoting.ServerInvocationHandler

Handle remote invocations. Note that we perform only invocations defined in the remote interfaces. Although, we execute only locals to bypass the serialization performed by a remote invocation. Even though this handler is co-located, for remotes, remoting will serialize the return data immediately. This is bad for us because since we return domain objects we ned to scrub the data, removing hibernate proxies (see HibernateDetachUtility. Additionally, we set our serialization strategy for REMOTEAPI, indicating to classes implementing Externalizable that we need to serialize all data expected by the remote api (as opposed to say, thin versions for agent-server comm).

Author:
Greg Hinkle

Constructor Summary
RemoteSafeInvocationHandler()
           
 
Method Summary
 void addListener(org.jboss.remoting.callback.InvokerCallbackHandler handler)
           
 Object invoke(org.jboss.remoting.InvocationRequest invocationRequest)
           
 void registerMetricsMBean(MBeanServer mbs)
          Registers the MBean used to monitor the remote API processing.
 void removeListener(org.jboss.remoting.callback.InvokerCallbackHandler handler)
           
 void setInvoker(org.jboss.remoting.ServerInvoker invoker)
           
 void setMBeanServer(MBeanServer mbs)
           
 void unregisterMetricsMBean(MBeanServer mbs)
          Unregisters the MBean that was used to monitor the remote API processing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.remoting.ServerInvocationHandler
toString
 

Constructor Detail

RemoteSafeInvocationHandler

public RemoteSafeInvocationHandler()
Method Detail

invoke

public Object invoke(org.jboss.remoting.InvocationRequest invocationRequest)
              throws Throwable
Specified by:
invoke in interface org.jboss.remoting.ServerInvocationHandler
Throws:
Throwable

registerMetricsMBean

public void registerMetricsMBean(MBeanServer mbs)
Registers the MBean used to monitor the remote API processing.

Parameters:
mbs - the MBeanServer where the metrics MBean should be registered

unregisterMetricsMBean

public void unregisterMetricsMBean(MBeanServer mbs)
Unregisters the MBean that was used to monitor the remote API processing.

Parameters:
mbs - the MBeanServer where the metrics MBean is registered

addListener

public void addListener(org.jboss.remoting.callback.InvokerCallbackHandler handler)
Specified by:
addListener in interface org.jboss.remoting.ServerInvocationHandler

removeListener

public void removeListener(org.jboss.remoting.callback.InvokerCallbackHandler handler)
Specified by:
removeListener in interface org.jboss.remoting.ServerInvocationHandler

setInvoker

public void setInvoker(org.jboss.remoting.ServerInvoker invoker)
Specified by:
setInvoker in interface org.jboss.remoting.ServerInvocationHandler

setMBeanServer

public void setMBeanServer(MBeanServer mbs)
Specified by:
setMBeanServer in interface org.jboss.remoting.ServerInvocationHandler


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.