|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.easybeans.rpc.AbsInvocationHandler
public abstract class AbsInvocationHandler
Abstract class used by remote or local invocation handler.
Field Summary | |
---|---|
private java.lang.Long |
beanId
Bean id. |
private java.lang.String |
containerId
Container id. |
private java.lang.String |
factoryName
Factory name. |
private java.util.Map<java.lang.reflect.Method,java.lang.Long> |
hashedMethods
Map between method and its hash. |
private java.lang.String |
interfaceClassName
Interface used by this handler. |
private boolean |
isItfExtendingRmiRemote
Boolean used to know if this class extends java.rmi.Remote class. |
private boolean |
removed
Bean has been removed. |
private boolean |
useID
useID true if all instance build with this ref are unique (stateful), false if it references the same object (stateless). |
Constructor Summary | |
---|---|
AbsInvocationHandler(java.lang.String containerId,
java.lang.String factoryName,
boolean useID)
Build a new Invocation handler. |
Method Summary | |
---|---|
java.lang.Long |
getBeanId()
Gets the bean id. |
protected java.lang.String |
getContainerId()
|
java.lang.String |
getFactoryName()
|
protected java.util.Map<java.lang.reflect.Method,java.lang.Long> |
getHashedMethods()
|
java.lang.String |
getInterfaceClassName()
|
protected java.lang.Object |
handleObjectMethods(java.lang.reflect.Method method,
java.lang.Object[] args)
Manages all methods of java.lang.Object class. |
protected void |
handleThrowable(java.lang.Throwable originalThrowable,
boolean isApplicationException,
java.lang.reflect.Method method,
RPCException rpcException)
Handle the given throwable and throw the correct exception to the client. |
boolean |
isExtendingRmiRemote()
|
boolean |
isRemoved()
|
boolean |
isUsingID()
|
protected void |
setBeanId(java.lang.Long beanId)
Sets the id of the bean. |
protected void |
setContainerId(java.lang.String containerId)
Sets the container ID. |
void |
setExtendingRmiRemote(boolean isItfExtendingRmiRemote)
Sets the flag if interface is extending java.rmi.Remote. |
protected void |
setFactoryName(java.lang.String factoryName)
Sets the factory's name. |
protected void |
setHashedMethods(java.util.Map<java.lang.reflect.Method,java.lang.Long> hashedMethods)
Sets the hashed methods. |
void |
setInterfaceClass(java.lang.Class clz)
Sets the interface that represents this handler. |
protected void |
setInterfaceClassName(java.lang.String interfaceClassName)
Sets the name of the interface that represents this handler. |
void |
setRemoved(boolean removed)
Sets the removed flag. |
void |
setUseID(boolean useID)
Sets the flag if all instance build with this ref are unique or not. |
java.lang.String |
toString()
Gets a string representation for this handler. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.lang.reflect.InvocationHandler |
---|
invoke |
Field Detail |
---|
private boolean removed
private java.lang.String containerId
private java.lang.String factoryName
private java.lang.Long beanId
private transient java.util.Map<java.lang.reflect.Method,java.lang.Long> hashedMethods
private java.lang.String interfaceClassName
private boolean isItfExtendingRmiRemote
private boolean useID
Constructor Detail |
---|
public AbsInvocationHandler(java.lang.String containerId, java.lang.String factoryName, boolean useID)
containerId
- the id of the container that will be called on the
remote side.factoryName
- the name of the remote factory.useID
- true if all instance build with this ref are unique
(stateful), false if it references the same object (stateless)Method Detail |
---|
protected java.lang.Object handleObjectMethods(java.lang.reflect.Method method, java.lang.Object[] args)
method
- the Method
instance corresponding to the
interface method invoked on the proxy instance. The declaring
class of the Method
object will be the interface
that the method was declared in, which may be a superinterface of
the proxy interface that the proxy class inherits the method
through.args
- an array of objects containing the values of the arguments
passed in the method invocation on the proxy instance
protected void handleThrowable(java.lang.Throwable originalThrowable, boolean isApplicationException, java.lang.reflect.Method method, RPCException rpcException) throws java.lang.Exception
originalThrowable
- the exception that has been thrown on the server side.isApplicationException
- true if it is an application exception, else false.method
- the Method
instance corresponding to the
interface method invoked on the proxy instance.rpcException
- the RPC exception if any
java.lang.Exception
- the exception that has been wrapped or not for the client.protected void setBeanId(java.lang.Long beanId)
beanId
- the new ID.protected void setHashedMethods(java.util.Map<java.lang.reflect.Method,java.lang.Long> hashedMethods)
hashedMethods
- the hash for each method.public java.lang.Long getBeanId()
protected java.lang.String getContainerId()
public java.lang.String getFactoryName()
protected java.util.Map<java.lang.reflect.Method,java.lang.Long> getHashedMethods()
protected void setContainerId(java.lang.String containerId)
containerId
- the identifier of the container.protected void setFactoryName(java.lang.String factoryName)
factoryName
- the name of the factory.public java.lang.String getInterfaceClassName()
protected void setInterfaceClassName(java.lang.String interfaceClassName)
interfaceClassName
- the name of the interface.public void setInterfaceClass(java.lang.Class clz)
clz
- the instance of the interface.public void setExtendingRmiRemote(boolean isItfExtendingRmiRemote)
isItfExtendingRmiRemote
- true if it extending, else false.public boolean isExtendingRmiRemote()
public void setUseID(boolean useID)
useID
- true : (stateful), false if it references the same object (stateless).public boolean isUsingID()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isRemoved()
public void setRemoved(boolean removed)
removed
- if bean has been removed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |