org.openejb.client
Class EJBObjectHandler
java.lang.Object
org.openejb.client.EJBInvocationHandler
org.openejb.client.EJBObjectHandler
- All Implemented Interfaces:
- Serializable, InvocationHandler, RequestMethods, ResponseCodes
- Direct Known Subclasses:
- EntityEJBObjectHandler, StatefulEJBObjectHandler, StatelessEJBObjectHandler
public abstract class EJBObjectHandler
- extends EJBInvocationHandler
- Since:
- 11/25/2001
- Author:
- David Blevins
- See Also:
- Serialized Form
Fields inherited from class org.openejb.client.EJBInvocationHandler |
client, ejb, EQUALS, HASHCODE, inProxyMap, isInvalidReference, liveHandleRegistry, primaryKey, request, server, TOSTRING |
Fields inherited from interface org.openejb.client.ResponseCodes |
AUTH_DENIED, AUTH_GRANTED, AUTH_REDIRECT, EJB_APP_EXCEPTION, EJB_ERROR, EJB_OK, EJB_OK_CREATE, EJB_OK_FOUND, EJB_OK_FOUND_COLLECTION, EJB_OK_FOUND_ENUMERATION, EJB_OK_NOT_FOUND, EJB_SYS_EXCEPTION, JNDI_CONTEXT, JNDI_EJBHOME, JNDI_ENUMERATION, JNDI_ERROR, JNDI_NAMING_EXCEPTION, JNDI_NOT_FOUND, JNDI_OK, JNDI_RUNTIME_EXCEPTION |
Fields inherited from interface org.openejb.client.RequestMethods |
AUTH_REQUEST, EJB_HOME_CREATE, EJB_HOME_FIND, EJB_HOME_GET_EJB_META_DATA, EJB_HOME_GET_HOME_HANDLE, EJB_HOME_REMOVE_BY_HANDLE, EJB_HOME_REMOVE_BY_PKEY, EJB_OBJECT_BUSINESS_METHOD, EJB_OBJECT_GET_EJB_HOME, EJB_OBJECT_GET_HANDLE, EJB_OBJECT_GET_PRIMARY_KEY, EJB_OBJECT_IS_IDENTICAL, EJB_OBJECT_REMOVE, EJB_REQUEST, JNDI_LIST, JNDI_LIST_BINDINGS, JNDI_LOOKUP, JNDI_REQUEST, STOP_REQUEST_quit, STOP_REQUEST_Quit, STOP_REQUEST_stop, STOP_REQUEST_Stop |
Method Summary |
Object |
_invoke(Object p,
Method m,
Object[] a)
Overridden by subclasses and called by EJBInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) . |
protected Object |
businessMethod(Method method,
Object[] args,
Object proxy)
|
static EJBObjectHandler |
createEJBObjectHandler(EJBMetaDataImpl ejb,
ServerMetaData server,
ClientMetaData client,
Object primaryKey)
|
EJBObjectProxy |
createEJBObjectProxy()
|
protected Object |
getEJBHome(Method method,
Object[] args,
Object proxy)
|
protected Object |
getHandle(Method method,
Object[] args,
Object proxy)
|
protected abstract Object |
getPrimaryKey(Method method,
Object[] args,
Object proxy)
|
abstract Object |
getRegistryId()
The Registry id is a logical identifier that is used as a key when placing EjbObjectProxyHanlders into
the BaseEjbProxyHanlder's liveHandleRegistry. |
protected abstract Object |
isIdentical(Method method,
Object[] args,
Object proxy)
|
protected abstract Object |
remove(Method method,
Object[] args,
Object proxy)
|
protected void |
setEJBHomeProxy(EJBHomeProxy ejbHome)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GETEJBHOME
protected static final Method GETEJBHOME
GETHANDLE
protected static final Method GETHANDLE
GETPRIMARYKEY
protected static final Method GETPRIMARYKEY
ISIDENTICAL
protected static final Method ISIDENTICAL
REMOVE
protected static final Method REMOVE
GETHANDLER
protected static final Method GETHANDLER
registryId
public Object registryId
EJBObjectHandler
public EJBObjectHandler()
EJBObjectHandler
public EJBObjectHandler(EJBMetaDataImpl ejb,
ServerMetaData server,
ClientMetaData client)
EJBObjectHandler
public EJBObjectHandler(EJBMetaDataImpl ejb,
ServerMetaData server,
ClientMetaData client,
Object primaryKey)
setEJBHomeProxy
protected void setEJBHomeProxy(EJBHomeProxy ejbHome)
createEJBObjectHandler
public static EJBObjectHandler createEJBObjectHandler(EJBMetaDataImpl ejb,
ServerMetaData server,
ClientMetaData client,
Object primaryKey)
getRegistryId
public abstract Object getRegistryId()
- The Registry id is a logical identifier that is used as a key when placing EjbObjectProxyHanlders into
the BaseEjbProxyHanlder's liveHandleRegistry. EjbObjectProxyHanlders that represent the same
bean identity (keyed by the registry id) will be stored together so that they can be removed together
when the EJBInvocationHandler.invalidateAllHandlers is invoked.
This method is implemented by the subclasses to return an id that logically identifies
bean identity for a specific deployment id and container. For example, the EntityEJBObjectHandler
overrides this method to return a compound key composed of the bean's primary key, deployment id, and
container id. This uniquely identifies the bean identity that is proxied by this handler. Another example
is the StatefulEjbObjectHanlder which overrides this method to return the stateful bean's hidden primary key,
which is a java.rmi.dgc.VMID.
createEJBObjectProxy
public EJBObjectProxy createEJBObjectProxy()
_invoke
public Object _invoke(Object p,
Method m,
Object[] a)
throws Throwable
- Description copied from class:
EJBInvocationHandler
- Overridden by subclasses and called by
EJBInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
.
Subclasses implement the main behavior of calling invoke on the
Container that the bean deployment lives in.
- Specified by:
_invoke
in class EJBInvocationHandler
- Parameters:
p
- The Proxy subclass that is the bean's EJBObject or EJBHome.m
- The bean method that the caller is attempting to invoke.a
- The arguments to the method being invoked.
- Returns:
- The result of invoking the appropriate method on the bean instance.
- Throws:
Throwable
getEJBHome
protected Object getEJBHome(Method method,
Object[] args,
Object proxy)
throws Throwable
- Throws:
Throwable
getHandle
protected Object getHandle(Method method,
Object[] args,
Object proxy)
throws Throwable
- Throws:
Throwable
getPrimaryKey
protected abstract Object getPrimaryKey(Method method,
Object[] args,
Object proxy)
throws Throwable
- Throws:
Throwable
isIdentical
protected abstract Object isIdentical(Method method,
Object[] args,
Object proxy)
throws Throwable
- Throws:
Throwable
remove
protected abstract Object remove(Method method,
Object[] args,
Object proxy)
throws Throwable
- Throws:
Throwable
businessMethod
protected Object businessMethod(Method method,
Object[] args,
Object proxy)
throws Throwable
- Throws:
Throwable
Copyright © 1999-2012 OpenEJB. All Rights Reserved.