Package com.sun.ejb
Class EjbInvocation
- java.lang.Object
-
- org.glassfish.api.invocation.ComponentInvocation
-
- com.sun.ejb.EjbInvocation
-
- All Implemented Interfaces:
InterceptorManager.AroundInvokeContext,com.sun.enterprise.transaction.spi.TransactionOperationsManager,jakarta.interceptor.InvocationContext,Cloneable,org.glassfish.ejb.api.EJBInvocation
public class EjbInvocation extends org.glassfish.api.invocation.ComponentInvocation implements jakarta.interceptor.InvocationContext, com.sun.enterprise.transaction.spi.TransactionOperationsManager, org.glassfish.ejb.api.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.
-
-
Field Summary
Fields Modifier and Type Field Description MethodbeanMethodClassclientInterfaceHome, Remote, LocalHome, Local, WebService, or business interface through which a synchronous ejb invocation was made.jakarta.transaction.TransactionclientTxThe client's transaction if any.ComponentContextcontextObjectejbThe EJB instance to be invoked.EJBLocalRemoteObjectejbObjectThe EJBObject/EJBLocalObject which created this EjbInvocation object.ThrowableexceptionThis reflects any exception that has occurred during this invocation, including preInvoke, bean method execution, and postInvoke.ThrowableexceptionFromBeanMethodSet to any exception directly thrown from bean method invocation, which could be either an application exception or a runtime exception.booleanfoundInTxCacheTells if a CMP2.x bean was found in the Tx cache.InvocationInfoinvocationInfoInvocationInfo object caches information about the current methodbooleanisBusinessInterfaceTrue if this invocation was made through a local business interface or bean local view or a remote business interface.booleanisHometrue if this is an invocation on the home object this is required for jacc.booleanisLocalLocal 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.booleanisMessageDriventrue if this is a message-driven bean invocationbooleanisRemoteTrue if this invocation was made through the 2.x (or earlier) Remote client view or the 3.x remote client view.booleanisTimerCallbacktrue if this is an ejb timeout method invocationbooleanisWebServicetrue if this is a web service invocationMethodmethodMethod to be invoked.Object[]methodParamsUsed for JACC PolicyContextHandlers.jakarta.ejb.TimertimerinttransactionAttributeThe transaction attribute of the bean method.booleanuseFastPathTells if a fast path can be taken for a business method invocation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanauthorizeWebService(Method m)voidclearYetToSubmitStatus()EjbInvocationclone()voiddoAfterUtxBegin()Called by the UserTransaction when transaction is started.MethodgetBeanMethod()ObjectgetCachedPermission()Returns CachedPermission associated with this invocation, or null if not available.LockgetCMCLock()ConstructorgetConstructor()Map<String,Object>getContextData()booleangetDoTxProcessingInPostInvoke()jakarta.ejb.EJBContextgetEJBContext()EjbFutureTaskgetEjbFutureTask()com.sun.enterprise.security.SecurityManagergetEjbSecurityManager()InterceptorManager.InterceptorChaingetInterceptorChain()Object[]getInterceptorInstances()longgetInvId()ObjectgetJaccEjb()Used by JACC implementation to get an enterprise bean instance for the EnterpriseBean policy handler.ObjectgetMessage()This is for EJB JAXWS only.MethodgetMethod()StringgetMethodInterface()This method returns the method interface constant for this EjbInvocation.Object[]getMethodParams()ClassLoadergetOriginalContextClassLoader()Object[]getParameters()IntegergetPreInvokeTxStatus()org.glassfish.api.invocation.ResourceHandlergetResourceHandler()jakarta.xml.soap.SOAPMessagegetSOAPMessage()This is for EJB JAXWS only.ObjectgetTarget()ObjectgetTimer()ObjectgetTransactionOperationsManager()booleangetWasCancelCalled()MethodgetWebServiceMethod()booleanholdingSFSBSerializedLock()ObjectinvokeBeanMethod()Called from Interceptor Chain to invoke the actual bean method.booleanisAWebService()booleanisCallerInRole(String role)Implements the method in org.glassfish.ejb.api.EJBInvocationbooleanisContainerStartsTx()booleanmustInvokeAsynchronously()Objectproceed()voidsetCMCLock(Lock l)voidsetContainerStartsTx(boolean containerStartsTx)voidsetDoTxProcessingInPostInvoke(boolean doTxProcessingInPostInvoke)voidsetEjbFutureTask(EjbFutureTask future)voidsetHoldingSFSBSerializedLock(boolean flag)voidsetInvId(long invId)<T> voidsetMessage(T message)This is for EJB JAXWS only.voidsetOriginalContextClassLoader(ClassLoader originalContextClassLoader)voidsetParameters(Object[] params)Set the parameters that will be used to invoke the business method.voidsetPreInvokeTxStatus(Integer txStatus)voidsetTransactionOperationsManager(com.sun.enterprise.transaction.spi.TransactionOperationsManager transactionOperationsManager)voidsetWasCancelCalled(boolean flag)voidsetWebServiceContext(Object webServiceContext)voidsetWebServiceMethod(Method method)StringtoString()Print most useful fields.voiduserTransactionLookupAllowed()Called by the UserTransaction lookup to verify access to the UserTransaction itself.booleanuserTransactionMethodsAllowed()Called by the UserTransaction implementation to verify access to the UserTransaction methods.-
Methods inherited from class org.glassfish.api.invocation.ComponentInvocation
clearRegistry, getAppName, getAuth, getComponentId, getContainer, getContainerContext, getInstance, getInstanceName, getInvocationType, getJNDIEnvironment, getModuleName, getOldSecurityContext, getRegistryFor, getResourceTableKey, getTransaction, isPreInvokeDone, isTransactionCompleting, setAuth, setComponentInvocationType, setInstanceName, setJNDIEnvironment, setOldSecurityContext, setPreInvokeDone, setRegistryFor, setResourceHandler, setResourceTableKey, setTransaction, setTransactionCompeting, setTransactionOperationsManager
-
-
-
-
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 jakarta.transaction.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.
-
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 jakarta.ejb.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
-
getOriginalContextClassLoader
public ClassLoader getOriginalContextClassLoader()
-
setOriginalContextClassLoader
public void setOriginalContextClassLoader(ClassLoader originalContextClassLoader)
-
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:
clonein classorg.glassfish.api.invocation.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:
getJaccEjbin interfaceorg.glassfish.ejb.api.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 jakarta.ejb.EJBContext getEJBContext()
- Specified by:
getEJBContextin interfaceorg.glassfish.ejb.api.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:
getTransactionOperationsManagerin classorg.glassfish.api.invocation.ComponentInvocation
-
setTransactionOperationsManager
public void setTransactionOperationsManager(com.sun.enterprise.transaction.spi.TransactionOperationsManager transactionOperationsManager)
-
userTransactionMethodsAllowed
public boolean userTransactionMethodsAllowed()
Called by the UserTransaction implementation to verify access to the UserTransaction methods.- Specified by:
userTransactionMethodsAllowedin interfacecom.sun.enterprise.transaction.spi.TransactionOperationsManager
-
userTransactionLookupAllowed
public void userTransactionLookupAllowed() throws NameNotFoundExceptionCalled by the UserTransaction lookup to verify access to the UserTransaction itself.- Specified by:
userTransactionLookupAllowedin interfacecom.sun.enterprise.transaction.spi.TransactionOperationsManager- Throws:
NameNotFoundException
-
doAfterUtxBegin
public void doAfterUtxBegin()
Called by the UserTransaction when transaction is started.- Specified by:
doAfterUtxBeginin interfacecom.sun.enterprise.transaction.spi.TransactionOperationsManager
-
getInterceptorChain
public InterceptorManager.InterceptorChain getInterceptorChain()
-
getTarget
public Object getTarget()
- Specified by:
getTargetin interfacejakarta.interceptor.InvocationContext- Returns:
- Returns the bean instance.
-
getTimer
public Object getTimer()
- Specified by:
getTimerin interfacejakarta.interceptor.InvocationContext- Returns:
- Returns the timer instance.
-
getMethod
public Method getMethod()
- Specified by:
getMethodin interfaceorg.glassfish.ejb.api.EJBInvocation- Specified by:
getMethodin interfacejakarta.interceptor.InvocationContext- Returns:
- For AroundInvoke/AroundTimeout methods, returns the bean class method being invoked. For lifecycle callback methods, returns null.
-
getBeanMethod
public Method getBeanMethod()
-
getConstructor
public Constructor getConstructor()
- Specified by:
getConstructorin interfacejakarta.interceptor.InvocationContext
-
getParameters
public Object[] getParameters()
- Specified by:
getParametersin interfacejakarta.interceptor.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:
setParametersin interfacejakarta.interceptor.InvocationContext
-
setWebServiceContext
public void setWebServiceContext(Object webServiceContext)
- Specified by:
setWebServiceContextin interfaceorg.glassfish.ejb.api.EJBInvocation
-
getContextData
public Map<String,Object> getContextData()
- Specified by:
getContextDatain interfacejakarta.interceptor.InvocationContext- Returns:
- Returns the contextMetaData.
-
setMessage
public <T> void setMessage(T message)
This is for EJB JAXWS only.- Specified by:
setMessagein interfaceorg.glassfish.ejb.api.EJBInvocation- Parameters:
message- an unconsumed message
-
getMessage
public Object getMessage()
This is for EJB JAXWS only.- Specified by:
getMessagein interfaceorg.glassfish.ejb.api.EJBInvocation- Returns:
- the JAXWS message
-
getSOAPMessage
public jakarta.xml.soap.SOAPMessage getSOAPMessage()
This is for EJB JAXWS only.
-
proceed
public Object proceed() throws Exception
- Specified by:
proceedin interfacejakarta.interceptor.InvocationContext- Throws:
Exception
-
toString
public String toString()
Print most useful fields. Don't do all of them (yet) since there are a large number.
-
getInterceptorInstances
public Object[] getInterceptorInstances()
- Specified by:
getInterceptorInstancesin interfaceInterceptorManager.AroundInvokeContext
-
invokeBeanMethod
public Object invokeBeanMethod() throws Throwable
Description copied from interface:InterceptorManager.AroundInvokeContextCalled 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:
invokeBeanMethodin interfaceInterceptorManager.AroundInvokeContext- Throws:
Throwable
-
getEjbSecurityManager
public com.sun.enterprise.security.SecurityManager getEjbSecurityManager()
-
isAWebService
public boolean isAWebService()
- Specified by:
isAWebServicein interfaceorg.glassfish.ejb.api.EJBInvocation
-
getMethodParams
public Object[] getMethodParams()
- Specified by:
getMethodParamsin interfaceorg.glassfish.ejb.api.EJBInvocation
-
authorizeWebService
public boolean authorizeWebService(Method m) throws Exception
- Specified by:
authorizeWebServicein interfaceorg.glassfish.ejb.api.EJBInvocation- Throws:
Exception
-
isCallerInRole
public boolean isCallerInRole(String role)
Implements the method in org.glassfish.ejb.api.EJBInvocation- Specified by:
isCallerInRolein interfaceorg.glassfish.ejb.api.EJBInvocation- Returns:
- true if the SecurityManager reports that the caller is in role
-
setWebServiceMethod
public void setWebServiceMethod(Method method)
- Specified by:
setWebServiceMethodin interfaceorg.glassfish.ejb.api.EJBInvocation
-
getWebServiceMethod
public Method getWebServiceMethod()
- Specified by:
getWebServiceMethodin interfaceorg.glassfish.ejb.api.EJBInvocation
-
getResourceHandler
public org.glassfish.api.invocation.ResourceHandler getResourceHandler()
- Overrides:
getResourceHandlerin classorg.glassfish.api.invocation.ComponentInvocation
-
isContainerStartsTx
public boolean isContainerStartsTx()
-
setContainerStartsTx
public void setContainerStartsTx(boolean containerStartsTx)
-
-