org.ow2.carol.cmi.ejb2_1.rpc
Class EJBObjectInvocationHandler

java.lang.Object
  extended by org.ow2.carol.cmi.rpc.CMIInvocationHandler
      extended by org.ow2.carol.cmi.ejb2_1.rpc.EJBObjectInvocationHandler
All Implemented Interfaces:
java.lang.reflect.InvocationHandler

@ThreadSafe
public class EJBObjectInvocationHandler
extends org.ow2.carol.cmi.rpc.CMIInvocationHandler

This class intercepts the invocations on the remote interface of a stateless ejb2. It is created by org.ow2.carol.cmi.rpc.CMIProxyFactory#newCMIProxy(ClusterViewManager, String, String).

Author:
The new CMI team
See Also:
org.ow2.carol.cmi.rpc.CMIProxyFactory

Field Summary
 
Fields inherited from class org.ow2.carol.cmi.rpc.CMIInvocationHandler
clusterViewManager, objectName, protocolName
 
Constructor Summary
EJBObjectInvocationHandler(java.lang.ClassLoader classLoader, org.ow2.carol.cmi.controller.common.ClusterViewManager clusterViewManager, java.lang.String objectName, java.lang.String protocolName, java.lang.Class<? extends javax.ejb.EJBHome> homeClass, java.lang.Class<? extends javax.ejb.EJBObject> remoteClass, javax.ejb.EJBHome ejbHomeProxy)
          Build a new EJB2 Invocation Handler for the remote interface of a stateless.
 
Method Summary
protected  java.lang.Object invokeRemoteMethod(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          Handles remote methods.
protected  java.lang.String proxyToString(java.lang.Object proxy)
          Returns a string representation for a proxy that uses this invocation handler.
 
Methods inherited from class org.ow2.carol.cmi.rpc.CMIInvocationHandler
getCurrentRef, invoke, onExceptionHook, postInvokeHook, preInvokeHook, setClassLoader, setCurrentRef
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EJBObjectInvocationHandler

public EJBObjectInvocationHandler(java.lang.ClassLoader classLoader,
                                  org.ow2.carol.cmi.controller.common.ClusterViewManager clusterViewManager,
                                  java.lang.String objectName,
                                  java.lang.String protocolName,
                                  java.lang.Class<? extends javax.ejb.EJBHome> homeClass,
                                  java.lang.Class<? extends javax.ejb.EJBObject> remoteClass,
                                  javax.ejb.EJBHome ejbHomeProxy)
Build a new EJB2 Invocation Handler for the remote interface of a stateless.

Parameters:
classLoader - the classloader to use (when the smart factory is used, it is the smart classloader)
clusterViewManager - A manager of the cluster view
objectName - a name of the object
protocolName - a protocol to perform the invocation
homeClass - a home interface
remoteClass - a remote interface
ejbHomeProxy - a home proxy
Method Detail

proxyToString

protected java.lang.String proxyToString(java.lang.Object proxy)
Returns a string representation for a proxy that uses this invocation handler.

Overrides:
proxyToString in class org.ow2.carol.cmi.rpc.CMIInvocationHandler

invokeRemoteMethod

protected java.lang.Object invokeRemoteMethod(java.lang.Object proxy,
                                              java.lang.reflect.Method method,
                                              java.lang.Object[] args)
                                       throws EJBInvocationHandlerException,
                                              java.lang.Throwable
Handles remote methods.

Overrides:
invokeRemoteMethod in class org.ow2.carol.cmi.rpc.CMIInvocationHandler
Throws:
EJBInvocationHandlerException
java.lang.Throwable


Copyright © 2007 OW2 Consortium. All Rights Reserved.