com.sun.ejb
Class EjbInvocation

java.lang.Object
  extended by org.glassfish.api.invocation.ComponentInvocation
      extended by com.sun.ejb.EjbInvocation
All Implemented Interfaces:
InterceptorManager.AroundInvokeContext, TransactionOperationsManager, Cloneable, InvocationContext, EJBInvocation

public class EjbInvocation
extends ComponentInvocation
implements InvocationContext, TransactionOperationsManager, Cloneable, EJBInvocation, InterceptorManager.AroundInvokeContext

The EjbInvocation object contains state associated with an invocation on an EJB or EJBHome (local/remote). It is usually created by generated code in *ObjectImpl and *HomeImpl classes. It is passed as a parameter to Container.preInvoke() * and postInvoke(), which are called by the EJB(Local)Object/EJB(Local)Home before and after an invocation.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.glassfish.api.invocation.ComponentInvocation
ComponentInvocation.ComponentInvocationType
 
Field Summary
 Method beanMethod
           
 Class clientInterface
          Home, Remote, LocalHome, Local, WebService, or business interface through which a synchronous ejb invocation was made.
 Transaction clientTx
          The client's transaction if any.
 boolean containerStartsTx
          Used by MessageBeanContainer.
 ComponentContext context
           
 Object ejb
          The EJB instance to be invoked.
 EJBLocalRemoteObject ejbObject
          The EJBObject/EJBLocalObject which created this EjbInvocation object.
 Throwable exception
          This reflects any exception that has occurred during this invocation, including preInvoke, bean method execution, and postInvoke.
 Throwable exceptionFromBeanMethod
          Set to any exception directly thrown from bean method invocation, which could be either an application exception or a runtime exception.
 boolean foundInTxCache
          Tells if a CMP2.x bean was found in the Tx cache.
 InvocationInfo invocationInfo
          InvocationInfo object caches information about the current method
 boolean isBusinessInterface
          True if this invocation was made through a local business interface or bean local view or a remote business interface.
 boolean isHome
          true if this is an invocation on the home object this is required for jacc.
 boolean isLocal
          Local flag: true if this invocation was through the 2.x (or earlier) Local client view, the 3.x local client view or a no-interface client view.
 boolean isMessageDriven
          true if this is a message-driven bean invocation
 boolean isRemote
          True if this invocation was made through the 2.x (or earlier) Remote client view or the 3.x remote client view.
 boolean isTimerCallback
          true if this is an ejb timeout method invocation
 boolean isWebService
          true if this is a web service invocation
 javax.xml.rpc.handler.MessageContext messageContext
          Used for web service invocations to hold SOAP message context.
 Method method
          Method to be invoked.
 Object[] methodParams
          Used for JACC PolicyContextHandlers.
 ClassLoader originalContextClassLoader
          Used by MessageBeanContainer to keep track of the context class loader that was active before message delivery began.
 int securityPermissions
          The security attribute of the bean method.
 Timer timer
           
 int transactionAttribute
          The transaction attribute of the bean method.
 boolean useFastPath
          Tells if a fast path can be taken for a business method invocation.
 
Fields inherited from class org.glassfish.api.invocation.ComponentInvocation
componentId, container, instance, jndiEnvironment, oldSecurityContext, transaction
 
Method Summary
 boolean authorizeWebService(Method m)
           
 void clearYetToSubmitStatus()
           
 EjbInvocation clone()
           
 void doAfterUtxBegin()
          Called by the UserTransaction when transaction is started.
 Method getBeanMethod()
           
 Object getCachedPermission()
          Returns CachedPermission associated with this invocation, or null if not available.
 Lock getCMCLock()
           
 Map<String,Object> getContextData()
           
 boolean getDoTxProcessingInPostInvoke()
           
 EJBContext getEJBContext()
           
 EjbFutureTask getEjbFutureTask()
           
 SecurityManager getEjbSecurityManager()
           
 InterceptorManager.InterceptorChain getInterceptorChain()
           
 Object[] getInterceptorInstances()
           
 long getInvId()
           
 Object getJaccEjb()
          Used by JACC implementation to get an enterprise bean instance for the EnterpriseBean policy handler.
 Object getMessage()
          This is for EJB JAXWS only.
 Method getMethod()
           
 String getMethodInterface()
          This method returns the method interface constant for this EjbInvocation.
 Object[] getMethodParams()
           
 Object[] getParameters()
           
 Integer getPreInvokeTxStatus()
           
 ResourceHandler getResourceHandler()
           
 SOAPMessage getSOAPMessage()
          This is for EJB JAXWS only.
 Object getTarget()
           
 Object getTimer()
           
 Object getTransactionOperationsManager()
           
 boolean getWasCancelCalled()
           
 Method getWebServiceMethod()
           
 Object getWebServiceTie()
           
 boolean holdingSFSBSerializedLock()
           
 Object invokeBeanMethod()
          Called from Interceptor Chain to invoke the actual bean method.
 boolean isAWebService()
           
 boolean isCallerInRole(String role)
          Implements the method in org.glassfish.ejb.api.EJBInvocation
 boolean mustInvokeAsynchronously()
           
 Object proceed()
           
 void setCMCLock(Lock l)
           
 void setDoTxProcessingInPostInvoke(boolean doTxProcessingInPostInvoke)
           
 void setEjbFutureTask(EjbFutureTask future)
           
 void setHoldingSFSBSerializedLock(boolean flag)
           
 void setInvId(long invId)
           
<T> void
setMessage(T message)
          This is for EJB JAXWS only.
 void setMessageContext(javax.xml.rpc.handler.MessageContext msgContext)
           
 void setParameters(Object[] params)
          Set the parameters that will be used to invoke the business method.
 void setPreInvokeTxStatus(Integer txStatus)
           
 void setWasCancelCalled(boolean flag)
           
 void setWebServiceContext(Object webServiceContext)
           
 void setWebServiceMethod(Method method)
           
 void setWebServiceTie(Object tie)
           
 String toString()
          Print most useful fields.
 void userTransactionLookupAllowed()
          Called by the UserTransaction lookup to verify access to the UserTransaction itself.
 boolean userTransactionMethodsAllowed()
          Called by the UserTransaction implementation to verify access to the UserTransaction methods.
 
Methods inherited from class org.glassfish.api.invocation.ComponentInvocation
getAuth, getComponentId, getContainer, getContainerContext, getInstance, getInvocationType, getOldSecurityContext, getResourceTableKey, getTransaction, isPreInvokeDone, isTransactionCompleting, setAuth, setComponentInvocationType, setOldSecurityContext, setPreInvokeDone, setResourceHandler, setResourceTableKey, setTransaction, setTransactionCompeting
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

context

public ComponentContext context

ejbObject

public EJBLocalRemoteObject ejbObject
The EJBObject/EJBLocalObject which created this EjbInvocation object. This identifies the target bean.


isLocal

public boolean isLocal
Local flag: true if this invocation was through the 2.x (or earlier) Local client view, the 3.x local client view or a no-interface client view.


isRemote

public boolean isRemote
True if this invocation was made through the 2.x (or earlier) Remote client view or the 3.x remote client view.


invocationInfo

public InvocationInfo invocationInfo
InvocationInfo object caches information about the current method


isBusinessInterface

public boolean isBusinessInterface
True if this invocation was made through a local business interface or bean local view or a remote business interface.


isWebService

public boolean isWebService
true if this is a web service invocation


isTimerCallback

public boolean isTimerCallback
true if this is an ejb timeout method invocation


isMessageDriven

public boolean isMessageDriven
true if this is a message-driven bean invocation


isHome

public boolean isHome
true if this is an invocation on the home object this is required for jacc.


clientInterface

public Class clientInterface
Home, Remote, LocalHome, Local, WebService, or business interface through which a synchronous ejb invocation was made.


method

public Method method
Method to be invoked. This is a method of the EJB's local/remote component interface for invocations on EJB(Local)Objects, or of the local/remote Home interface for invocations on the EJBHome. Set by the EJB(Local)Object/EJB(Local)Home before calling Container.preInvoke().


ejb

public Object ejb
The EJB instance to be invoked. Set by Container and used by EJBObject/EJBHome.


exception

public Throwable exception
This reflects any exception that has occurred during this invocation, including preInvoke, bean method execution, and postInvoke.


exceptionFromBeanMethod

public Throwable exceptionFromBeanMethod
Set to any exception directly thrown from bean method invocation, which could be either an application exception or a runtime exception. This is set *in addition to* the this.exception field. Some container processing logic, e.g. @Remove, depends specifically on whether a bean method threw an exception.


clientTx

public Transaction clientTx
The client's transaction if any. Set by the Container during preInvoke() and used by the Container during postInvoke().


transactionAttribute

public int transactionAttribute
The transaction attribute of the bean method. Set in generated EJBObject/Home/LocalObject/LocalHome class.


securityPermissions

public int securityPermissions
The security attribute of the bean method. Set in generated EJBObject/Home/LocalObject/LocalHome class.


containerStartsTx

public boolean containerStartsTx
Used by MessageBeanContainer. true if container started a transaction for this invocation.


originalContextClassLoader

public ClassLoader originalContextClassLoader
Used by MessageBeanContainer to keep track of the context class loader that was active before message delivery began.


messageContext

public javax.xml.rpc.handler.MessageContext messageContext
Used for web service invocations to hold SOAP message context. EJBs can access message context through SessionContext.


methodParams

public Object[] methodParams
Used for JACC PolicyContextHandlers. The handler can query the container back for parameters on the ejb. This is set during the method invocation and is not available for preInvoke calls.


timer

public Timer timer

foundInTxCache

public boolean foundInTxCache
Tells if a CMP2.x bean was found in the Tx cache. Applicable only for CMP2.x beans


useFastPath

public boolean useFastPath
Tells if a fast path can be taken for a business method invocation.


beanMethod

public Method beanMethod
Method Detail

getEjbFutureTask

public EjbFutureTask getEjbFutureTask()

setEjbFutureTask

public void setEjbFutureTask(EjbFutureTask future)

setWasCancelCalled

public void setWasCancelCalled(boolean flag)

getWasCancelCalled

public boolean getWasCancelCalled()

getInvId

public long getInvId()

setInvId

public void setInvId(long invId)

mustInvokeAsynchronously

public boolean mustInvokeAsynchronously()

clearYetToSubmitStatus

public void clearYetToSubmitStatus()

getDoTxProcessingInPostInvoke

public boolean getDoTxProcessingInPostInvoke()

setDoTxProcessingInPostInvoke

public void setDoTxProcessingInPostInvoke(boolean doTxProcessingInPostInvoke)

clone

public EjbInvocation clone()
Overrides:
clone in class ComponentInvocation

getJaccEjb

public Object getJaccEjb()
Used by JACC implementation to get an enterprise bean instance for the EnterpriseBean policy handler. The jacc implementation should use this method rather than directly accessing the ejb field.

Specified by:
getJaccEjb in interface EJBInvocation

getMethodInterface

public String getMethodInterface()
This method returns the method interface constant for this EjbInvocation.


getCachedPermission

public Object getCachedPermission()
Returns CachedPermission associated with this invocation, or null if not available.


getEJBContext

public EJBContext getEJBContext()
Specified by:
getEJBContext in interface EJBInvocation
Returns:
Returns the ejbCtx.

getPreInvokeTxStatus

public Integer getPreInvokeTxStatus()

setPreInvokeTxStatus

public void setPreInvokeTxStatus(Integer txStatus)

getCMCLock

public Lock getCMCLock()

setCMCLock

public void setCMCLock(Lock l)

holdingSFSBSerializedLock

public boolean holdingSFSBSerializedLock()

setHoldingSFSBSerializedLock

public void setHoldingSFSBSerializedLock(boolean flag)

getTransactionOperationsManager

public Object getTransactionOperationsManager()
Overrides:
getTransactionOperationsManager in class ComponentInvocation

userTransactionMethodsAllowed

public boolean userTransactionMethodsAllowed()
Called by the UserTransaction implementation to verify access to the UserTransaction methods.

Specified by:
userTransactionMethodsAllowed in interface TransactionOperationsManager

userTransactionLookupAllowed

public void userTransactionLookupAllowed()
                                  throws NameNotFoundException
Called by the UserTransaction lookup to verify access to the UserTransaction itself.

Specified by:
userTransactionLookupAllowed in interface TransactionOperationsManager
Throws:
NameNotFoundException

doAfterUtxBegin

public void doAfterUtxBegin()
Called by the UserTransaction when transaction is started.

Specified by:
doAfterUtxBegin in interface TransactionOperationsManager

getInterceptorChain

public InterceptorManager.InterceptorChain getInterceptorChain()

getTarget

public Object getTarget()
Specified by:
getTarget in interface InvocationContext
Returns:
Returns the bean instance.

getTimer

public Object getTimer()
Specified by:
getTimer in interface InvocationContext
Returns:
Returns the timer instance.

getMethod

public Method getMethod()
Specified by:
getMethod in interface InvocationContext
Specified by:
getMethod in interface EJBInvocation
Returns:
For AroundInvoke/AroundTimeout methods, returns the bean class method being invoked. For lifecycle callback methods, returns null.

getBeanMethod

public Method getBeanMethod()

getParameters

public Object[] getParameters()
Specified by:
getParameters in interface InvocationContext
Returns:
Returns the parameters that will be used to invoke the business method. If setParameters has been called, getParameters() returns the values to which the parameters have been set.

setParameters

public void setParameters(Object[] params)
Set the parameters that will be used to invoke the business method.

Specified by:
setParameters in interface InvocationContext

setWebServiceContext

public void setWebServiceContext(Object webServiceContext)
Specified by:
setWebServiceContext in interface EJBInvocation

getContextData

public Map<String,Object> getContextData()
Specified by:
getContextData in interface InvocationContext
Returns:
Returns the contextMetaData.

setMessage

public <T> void setMessage(T message)
This is for EJB JAXWS only.

Specified by:
setMessage in interface EJBInvocation
Parameters:
message - an unconsumed message

getMessage

public Object getMessage()
This is for EJB JAXWS only.

Specified by:
getMessage in interface EJBInvocation
Returns:
the JAXWS message

getSOAPMessage

public SOAPMessage getSOAPMessage()
This is for EJB JAXWS only.


proceed

public Object proceed()
               throws Exception
Specified by:
proceed in interface InvocationContext
Throws:
Exception

toString

public String toString()
Print most useful fields. Don't do all of them (yet) since there are a large number.

Overrides:
toString in class Object
Returns:

getInterceptorInstances

public Object[] getInterceptorInstances()
Specified by:
getInterceptorInstances in interface InterceptorManager.AroundInvokeContext

invokeBeanMethod

public Object invokeBeanMethod()
                        throws Throwable
Description copied from interface: InterceptorManager.AroundInvokeContext
Called from Interceptor Chain to invoke the actual bean method. This method must throw any exception from the bean method *as is*, without being wrapped in an InvocationTargetException. The exception thrown from this method will be propagated through the application's interceptor code, so it must not be changed in order for any exception handling logic in that code to function properly.

Specified by:
invokeBeanMethod in interface InterceptorManager.AroundInvokeContext
Throws:
Throwable

getEjbSecurityManager

public SecurityManager getEjbSecurityManager()

isAWebService

public boolean isAWebService()
Specified by:
isAWebService in interface EJBInvocation

getMethodParams

public Object[] getMethodParams()
Specified by:
getMethodParams in interface EJBInvocation

authorizeWebService

public boolean authorizeWebService(Method m)
                            throws Exception
Specified by:
authorizeWebService in interface EJBInvocation
Throws:
Exception

isCallerInRole

public boolean isCallerInRole(String role)
Implements the method in org.glassfish.ejb.api.EJBInvocation

Specified by:
isCallerInRole in interface EJBInvocation
Returns:
true if the SecurityManager reports that the caller is in role

setWebServiceTie

public void setWebServiceTie(Object tie)
Specified by:
setWebServiceTie in interface EJBInvocation

getWebServiceTie

public Object getWebServiceTie()
Specified by:
getWebServiceTie in interface EJBInvocation

setWebServiceMethod

public void setWebServiceMethod(Method method)
Specified by:
setWebServiceMethod in interface EJBInvocation

getWebServiceMethod

public Method getWebServiceMethod()
Specified by:
getWebServiceMethod in interface EJBInvocation

setMessageContext

public void setMessageContext(javax.xml.rpc.handler.MessageContext msgContext)
Specified by:
setMessageContext in interface EJBInvocation

getResourceHandler

public ResourceHandler getResourceHandler()
Overrides:
getResourceHandler in class ComponentInvocation


Copyright © 2012 GlassFish Community. All Rights Reserved.