org.apache.openejb.core.ivm
Class BaseEjbProxyHandler

java.lang.Object
  extended by org.apache.openejb.core.ivm.BaseEjbProxyHandler
All Implemented Interfaces:
Serializable, InvocationHandler
Direct Known Subclasses:
EjbHomeProxyHandler, EjbObjectProxyHandler

public abstract class BaseEjbProxyHandler
extends Object
implements InvocationHandler, Serializable

See Also:
Serialized Form

Field Summary
 RpcContainer container
           
 Object deploymentID
           
protected  boolean doCrossClassLoaderCopy
           
protected  boolean doIntraVmCopy
           
 boolean inProxyMap
           
protected  InterfaceType interfaceType
           
protected  boolean isInvalidReference
           
 Object primaryKey
           
 
Constructor Summary
BaseEjbProxyHandler(DeploymentInfo deploymentInfo, Object pk, InterfaceType interfaceType, List<Class> interfaces)
           
 
Method Summary
protected abstract  Object _invoke(Object proxy, Class interfce, Method method, Object[] args)
           
protected abstract  Object _writeReplace(Object proxy)
           
protected  void checkAuthorization(Method method)
           
protected  Throwable convertException(Throwable e, Method method, Class interfce)
          Renamed method so it shows up with a much more understandable purpose as it will be the top element in the stacktrace
protected  Object[] copyArgs(Object[] objects)
           
protected  Object copyObj(Object object)
           
 boolean equals(Object obj)
           
protected  Throwable getCause(Throwable e)
           
 CoreDeploymentInfo getDeploymentInfo()
           
 List<Class> getInterfaces()
           
protected  Class<?> getInvokedInterface(Method method)
          This method should be called to determine the corresponding business interface class to name as the invoking interface.
 Hashtable getLiveHandleRegistry()
           
 Class getMainInterface()
           
abstract  ProxyInfo getProxyInfo()
           
 int hashCode()
           
protected  void invalidateAllHandlers(Object key)
           
 void invalidateReference()
           
 Object invoke(Object proxy, Method method, Object[] args)
           
protected  void registerHandler(Object key, BaseEjbProxyHandler handler)
           
 void setDeploymentInfo(CoreDeploymentInfo deploymentInfo)
           
 void setIntraVmCopyMode(boolean on)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

deploymentID

public final Object deploymentID

primaryKey

public final Object primaryKey

inProxyMap

public boolean inProxyMap

container

public transient RpcContainer container

isInvalidReference

protected boolean isInvalidReference

doIntraVmCopy

protected boolean doIntraVmCopy

doCrossClassLoaderCopy

protected boolean doCrossClassLoaderCopy

interfaceType

protected final InterfaceType interfaceType
Constructor Detail

BaseEjbProxyHandler

public BaseEjbProxyHandler(DeploymentInfo deploymentInfo,
                           Object pk,
                           InterfaceType interfaceType,
                           List<Class> interfaces)
Method Detail

getInvokedInterface

protected Class<?> getInvokedInterface(Method method)
This method should be called to determine the corresponding business interface class to name as the invoking interface. This method should NOT be called on non-business-interface methods the proxy has such as java.lang.Object or IntraVmProxy.

Parameters:
method -
Returns:
the business (or component) interface matching this method

getMainInterface

public Class getMainInterface()

getInterfaces

public List<Class> getInterfaces()

checkAuthorization

protected void checkAuthorization(Method method)
                           throws OpenEJBException
Throws:
OpenEJBException

setIntraVmCopyMode

public void setIntraVmCopyMode(boolean on)

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
Specified by:
invoke in interface InvocationHandler
Throws:
Throwable

convertException

protected Throwable convertException(Throwable e,
                                     Method method,
                                     Class interfce)
Renamed method so it shows up with a much more understandable purpose as it will be the top element in the stacktrace

Parameters:
e -
method -
interfce -

getCause

protected Throwable getCause(Throwable e)

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

_invoke

protected abstract Object _invoke(Object proxy,
                                  Class interfce,
                                  Method method,
                                  Object[] args)
                           throws Throwable
Throws:
Throwable

copyArgs

protected Object[] copyArgs(Object[] objects)
                     throws IOException,
                            ClassNotFoundException
Throws:
IOException
ClassNotFoundException

copyObj

protected Object copyObj(Object object)
                  throws IOException,
                         ClassNotFoundException
Throws:
IOException
ClassNotFoundException

invalidateReference

public void invalidateReference()

invalidateAllHandlers

protected void invalidateAllHandlers(Object key)

_writeReplace

protected abstract Object _writeReplace(Object proxy)
                                 throws ObjectStreamException
Throws:
ObjectStreamException

registerHandler

protected void registerHandler(Object key,
                               BaseEjbProxyHandler handler)

getProxyInfo

public abstract ProxyInfo getProxyInfo()

getDeploymentInfo

public CoreDeploymentInfo getDeploymentInfo()

setDeploymentInfo

public void setDeploymentInfo(CoreDeploymentInfo deploymentInfo)

getLiveHandleRegistry

public Hashtable getLiveHandleRegistry()


Copyright © 1999-2011 The Apache OpenEJB development community. All Rights Reserved.