org.jboss.ejb3.proxy.impl.handler.session
Class SessionProxyInvocationHandlerBase

java.lang.Object
  extended by org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase
All Implemented Interfaces:
java.io.Serializable, java.lang.reflect.InvocationHandler, SessionProxyInvocationHandler
Direct Known Subclasses:
SessionLocalProxyInvocationHandler, SessionRemoteProxyInvocationHandler

public abstract class SessionProxyInvocationHandlerBase
extends java.lang.Object
implements SessionProxyInvocationHandler, java.io.Serializable

SessionProxyInvocationHandlerBase Abstract base from which all JBoss Session Proxy InvocationHandlers may extend

See Also:
Serialized Form

Constructor Summary
protected SessionProxyInvocationHandlerBase(java.lang.String containerName, java.lang.String containerGuid, org.jboss.aop.advice.Interceptor[] interceptors, java.lang.String businessInterfaceType, java.lang.Object target)
          Constructor
 
Method Summary
protected  boolean canBeHandledDirectly(java.lang.reflect.Method invokedMethod)
          Returns whether or not this handler is capable of handling the invoked method request directly, without passing along to the container
 java.lang.String getBusinessInterfaceType()
           
protected abstract  org.jboss.ejb3.proxy.spi.container.InvokableContext getContainer(java.lang.reflect.Method method, java.lang.Object[] args)
          Obtains the Container upon which this Proxy should invoke
 java.lang.String getContainerGuid()
           
 java.lang.String getContainerName()
           
 org.jboss.aop.advice.Interceptor[] getInterceptors()
           
 java.lang.Object getTarget()
           
protected  java.lang.Object handleInvocationDirectly(java.lang.Object proxy, java.lang.Object[] args, java.lang.reflect.Method invokedMethod)
          Handles the current invocation directly in this invocation handler.
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          
protected  boolean invokeEquals(java.lang.Object proxy, java.lang.Object argument)
          Handles invocation of "equals(Object)" upon a Session Proxy EJB 3.0 Specification 3.4.5.1, 3.4.5.2
protected  int invokeHashCode(java.lang.Object proxy)
          Handles invocation of "hashCode()" upon the proxy
 void setBusinessInterfaceType(java.lang.String businessInterfaceType)
           
 void setContainerGuid(java.lang.String containerGuid)
           
 void setContainerName(java.lang.String containerName)
           
 void setInterceptors(org.jboss.aop.advice.Interceptor[] interceptors)
           
 void setTarget(java.lang.Object target)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionProxyInvocationHandlerBase

protected SessionProxyInvocationHandlerBase(java.lang.String containerName,
                                            java.lang.String containerGuid,
                                            org.jboss.aop.advice.Interceptor[] interceptors,
                                            java.lang.String businessInterfaceType,
                                            java.lang.Object target)
Constructor

Parameters:
containerName - The name of the target Container
containerGuid - The globally-unique name of the container
interceptors - The interceptors to apply to invocations upon this handler
businessInterfaceType - Possibly null FQN of business interface
target - The target object (Session ID)
Method Detail

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable

Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Throwable
See Also:
InvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])

handleInvocationDirectly

protected java.lang.Object handleInvocationDirectly(java.lang.Object proxy,
                                                    java.lang.Object[] args,
                                                    java.lang.reflect.Method invokedMethod)
                                             throws NotEligibleForDirectInvocationException
Handles the current invocation directly in this invocation handler. Only a subset of method invocations are eligible for this treatment, else a NotEligibleForDirectInvocationException will be thrown

Parameters:
proxy -
args - Arguments of the current invocation
invokedMethod - The method invoked
Returns:
Throws:
NotEligibleForDirectInvocationException

canBeHandledDirectly

protected boolean canBeHandledDirectly(java.lang.reflect.Method invokedMethod)
Returns whether or not this handler is capable of handling the invoked method request directly, without passing along to the container

Parameters:
invokedMethod - The invoked Method
Returns:

invokeEquals

protected boolean invokeEquals(java.lang.Object proxy,
                               java.lang.Object argument)
Handles invocation of "equals(Object)" upon a Session Proxy EJB 3.0 Specification 3.4.5.1, 3.4.5.2

Parameters:
proxy -
args -
Returns:

invokeHashCode

protected int invokeHashCode(java.lang.Object proxy)
Handles invocation of "hashCode()" upon the proxy

Parameters:
proxy -
Returns:

getContainer

protected abstract org.jboss.ejb3.proxy.spi.container.InvokableContext getContainer(java.lang.reflect.Method method,
                                                                                    java.lang.Object[] args)
Obtains the Container upon which this Proxy should invoke

Returns:

getTarget

public java.lang.Object getTarget()
Specified by:
getTarget in interface SessionProxyInvocationHandler

setTarget

public void setTarget(java.lang.Object target)
Specified by:
setTarget in interface SessionProxyInvocationHandler

getContainerName

public java.lang.String getContainerName()
Specified by:
getContainerName in interface SessionProxyInvocationHandler

setContainerName

public void setContainerName(java.lang.String containerName)
Specified by:
setContainerName in interface SessionProxyInvocationHandler

getInterceptors

public org.jboss.aop.advice.Interceptor[] getInterceptors()
Specified by:
getInterceptors in interface SessionProxyInvocationHandler

setInterceptors

public void setInterceptors(org.jboss.aop.advice.Interceptor[] interceptors)
Specified by:
setInterceptors in interface SessionProxyInvocationHandler

getContainerGuid

public java.lang.String getContainerGuid()
Specified by:
getContainerGuid in interface SessionProxyInvocationHandler

setContainerGuid

public void setContainerGuid(java.lang.String containerGuid)
Specified by:
setContainerGuid in interface SessionProxyInvocationHandler

getBusinessInterfaceType

public java.lang.String getBusinessInterfaceType()
Specified by:
getBusinessInterfaceType in interface SessionProxyInvocationHandler

setBusinessInterfaceType

public void setBusinessInterfaceType(java.lang.String businessInterfaceType)
Specified by:
setBusinessInterfaceType in interface SessionProxyInvocationHandler