org.ow2.carol.cmi.ejb2_1.rpc.ha
Class HAEJBObjectInvocationHandler

java.lang.Object
  extended by org.ow2.carol.cmi.rpc.CMIInvocationHandler<javax.ejb.EJBObject>
      extended by org.ow2.carol.cmi.ejb2_1.rpc.ha.HAEJBObjectInvocationHandler
All Implemented Interfaces:
java.io.Serializable, java.lang.reflect.InvocationHandler

public class HAEJBObjectInvocationHandler
extends org.ow2.carol.cmi.rpc.CMIInvocationHandler<javax.ejb.EJBObject>

This class intercepts the invocations on the remote interface of a stateful or entity 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, Serialized Form

Field Summary
 
Fields inherited from class org.ow2.carol.cmi.rpc.CMIInvocationHandler
clusterViewManager, cmiProxyHandle, itf, objectName, protocolName
 
Constructor Summary
HAEJBObjectInvocationHandler(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, HAEJBHomeInvocationHandler homeInvocationHandler, javax.ejb.EJBHome ejbHomeProxy, org.ow2.carol.cmi.ha.SessionId sessionId, CreateMethodWrapper createMethodWrapper, org.ow2.carol.cmi.reference.CMIReferenceable<javax.ejb.EJBObject> wrappedRemoteStub)
          Build a new EJB2 Invocation Handler.
 
Method Summary
protected  void checkInitialized()
           
protected  org.ow2.carol.cmi.reference.CMIReferenceable<javax.ejb.EJBObject> getCMIReferenceable(org.ow2.carol.cmi.reference.CMIReference cmiReference)
           
protected  EJBObjectHandle getHandle(org.ow2.carol.cmi.rpc.CMIProxy cmiProxy)
           
protected  java.lang.Object invokeRemoteMethod(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object... args)
          Handles remote methods.
protected  void onExceptionHook(java.lang.String objectName, org.ow2.carol.cmi.reference.CMIReferenceable<javax.ejb.EJBObject> cmiReferenceable)
           
protected  void onFinallyHook(java.lang.String objectName, org.ow2.carol.cmi.reference.CMIReferenceable<javax.ejb.EJBObject> cmiReferenceable)
           
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, getHandleMethodName, invoke, postInvokeHook, preInvokeHook, setClassLoader, setCmiProxyHandle, setCurrentRef
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HAEJBObjectInvocationHandler

public HAEJBObjectInvocationHandler(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,
                                    HAEJBHomeInvocationHandler homeInvocationHandler,
                                    javax.ejb.EJBHome ejbHomeProxy,
                                    org.ow2.carol.cmi.ha.SessionId sessionId,
                                    CreateMethodWrapper createMethodWrapper,
                                    org.ow2.carol.cmi.reference.CMIReferenceable<javax.ejb.EJBObject> wrappedRemoteStub)
Build a new EJB2 Invocation Handler.

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 -
remoteClass - interface of the object
homeInvocationHandler -
ejbHomeProxy -
sessionId -
createMethodWrapper -
wrappedRemoteStub -
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<javax.ejb.EJBObject>

invokeRemoteMethod

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

Overrides:
invokeRemoteMethod in class org.ow2.carol.cmi.rpc.CMIInvocationHandler<javax.ejb.EJBObject>
Throws:
java.lang.Throwable

onExceptionHook

protected void onExceptionHook(java.lang.String objectName,
                               org.ow2.carol.cmi.reference.CMIReferenceable<javax.ejb.EJBObject> cmiReferenceable)
                        throws java.lang.Throwable
Specified by:
onExceptionHook in class org.ow2.carol.cmi.rpc.CMIInvocationHandler<javax.ejb.EJBObject>
Throws:
java.lang.Throwable

checkInitialized

protected void checkInitialized()
                         throws HAEJBInvocationHandlerException
Specified by:
checkInitialized in class org.ow2.carol.cmi.rpc.CMIInvocationHandler<javax.ejb.EJBObject>
Throws:
HAEJBInvocationHandlerException

getHandle

protected EJBObjectHandle getHandle(org.ow2.carol.cmi.rpc.CMIProxy cmiProxy)
Specified by:
getHandle in class org.ow2.carol.cmi.rpc.CMIInvocationHandler<javax.ejb.EJBObject>

getCMIReferenceable

protected org.ow2.carol.cmi.reference.CMIReferenceable<javax.ejb.EJBObject> getCMIReferenceable(org.ow2.carol.cmi.reference.CMIReference cmiReference)
                                                                                         throws java.lang.Exception
Specified by:
getCMIReferenceable in class org.ow2.carol.cmi.rpc.CMIInvocationHandler<javax.ejb.EJBObject>
Throws:
java.lang.Exception

onFinallyHook

protected void onFinallyHook(java.lang.String objectName,
                             org.ow2.carol.cmi.reference.CMIReferenceable<javax.ejb.EJBObject> cmiReferenceable)
Specified by:
onFinallyHook in class org.ow2.carol.cmi.rpc.CMIInvocationHandler<javax.ejb.EJBObject>


Copyright © 2008 OW2 Consortium. All Rights Reserved.