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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.glassfish.api.invocation.ComponentInvocation
org.glassfish.api.invocation.ComponentInvocation.ComponentInvocationType -
Field Summary
FieldsModifier and TypeFieldDescriptionHome, Remote, LocalHome, Local, WebService, or business interface through which a synchronous ejb invocation was made.jakarta.transaction.TransactionThe client's transaction if any.The EJB instance to be invoked.The EJBObject/EJBLocalObject which created this EjbInvocation object.This reflects any exception that has occurred during this invocation, including preInvoke, bean method execution, and postInvoke.Set to any exception directly thrown from bean method invocation, which could be either an application exception or a runtime exception.booleanTells if a CMP2.x bean was found in the Tx cache.InvocationInfo object caches information about the current methodbooleanTrue if this invocation was made through a local business interface or bean local view or a remote business interface.booleantrue if this is an invocation on the home object this is required for jacc.booleanLocal 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.booleantrue if this is a message-driven bean invocationbooleanTrue if this invocation was made through the 2.x (or earlier) Remote client view or the 3.x remote client view.booleantrue if this is an ejb timeout method invocationbooleantrue if this is a web service invocationMethod to be invoked.Object[]Used for JACC PolicyContextHandlers.jakarta.ejb.TimerintThe transaction attribute of the bean method.booleanTells if a fast path can be taken for a business method invocation.Fields inherited from class org.glassfish.api.invocation.ComponentInvocation
appName, componentId, container, instance, jndiEnvironment, moduleName, oldSecurityContext, transaction -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidclone()voidCalled by the UserTransaction when transaction is started.Returns CachedPermission associated with this invocation, or null if not available.booleanjakarta.ejb.EJBContextcom.sun.enterprise.security.SecurityManagerObject[]longgetInvId()This is for EJB JAXWS only.This method returns the method interface constant for this EjbInvocation.Object[]Object[]org.glassfish.api.invocation.ResourceHandlerjakarta.xml.soap.SOAPMessageThis is for EJB JAXWS only.getTimer()booleanbooleanCalled from Interceptor Chain to invoke the actual bean method.booleanbooleanisCallerInRole(String role) Implements the method in org.glassfish.ejb.api.EJBInvocationbooleanbooleanproceed()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) toString()Print most useful fields.voidCalled by the UserTransaction lookup to verify access to the UserTransaction itself.booleanCalled 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 Details
-
context
-
ejbObject
The EJBObject/EJBLocalObject which created this EjbInvocation object. This identifies the target bean. -
isLocal
public boolean isLocalLocal 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 isRemoteTrue if this invocation was made through the 2.x (or earlier) Remote client view or the 3.x remote client view. -
invocationInfo
InvocationInfo object caches information about the current method -
isBusinessInterface
public boolean isBusinessInterfaceTrue if this invocation was made through a local business interface or bean local view or a remote business interface. -
isWebService
public boolean isWebServicetrue if this is a web service invocation -
isTimerCallback
public boolean isTimerCallbacktrue if this is an ejb timeout method invocation -
isMessageDriven
public boolean isMessageDriventrue if this is a message-driven bean invocation -
isHome
public boolean isHometrue if this is an invocation on the home object this is required for jacc. -
clientInterface
Home, Remote, LocalHome, Local, WebService, or business interface through which a synchronous ejb invocation was made. -
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
The EJB instance to be invoked. Set by Container and used by EJBObject/EJBHome. -
exception
This reflects any exception that has occurred during this invocation, including preInvoke, bean method execution, and postInvoke. -
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 clientTxThe client's transaction if any. Set by the Container during preInvoke() and used by the Container during postInvoke(). -
transactionAttribute
public int transactionAttributeThe transaction attribute of the bean method. Set in generated EJBObject/Home/LocalObject/LocalHome class. -
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 foundInTxCacheTells if a CMP2.x bean was found in the Tx cache. Applicable only for CMP2.x beans -
useFastPath
public boolean useFastPathTells if a fast path can be taken for a business method invocation. -
beanMethod
-
-
Method Details
-
getOriginalContextClassLoader
-
setOriginalContextClassLoader
-
getEjbFutureTask
-
setEjbFutureTask
-
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
- Overrides:
clonein classorg.glassfish.api.invocation.ComponentInvocation
-
getJaccEjb
- Specified by:
getJaccEjbin interfaceorg.glassfish.ejb.api.EJBInvocation
-
getMethodInterface
This method returns the method interface constant for this EjbInvocation. -
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
-
setPreInvokeTxStatus
-
getCMCLock
-
setCMCLock
-
holdingSFSBSerializedLock
public boolean holdingSFSBSerializedLock() -
setHoldingSFSBSerializedLock
public void setHoldingSFSBSerializedLock(boolean flag) -
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
Called 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
-
getTarget
- Specified by:
getTargetin interfacejakarta.interceptor.InvocationContext- Returns:
- Returns the bean instance.
-
getTimer
- Specified by:
getTimerin interfacejakarta.interceptor.InvocationContext- Returns:
- Returns the timer instance.
-
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
-
getConstructor
- Specified by:
getConstructorin interfacejakarta.interceptor.InvocationContext
-
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
Set the parameters that will be used to invoke the business method.- Specified by:
setParametersin interfacejakarta.interceptor.InvocationContext
-
setWebServiceContext
- Specified by:
setWebServiceContextin interfaceorg.glassfish.ejb.api.EJBInvocation
-
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
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
- Specified by:
proceedin interfacejakarta.interceptor.InvocationContext- Throws:
Exception
-
toString
Print most useful fields. Don't do all of them (yet) since there are a large number.- Overrides:
toStringin classorg.glassfish.api.invocation.ComponentInvocation- Returns:
-
getInterceptorInstances
- Specified by:
getInterceptorInstancesin interfaceInterceptorManager.AroundInvokeContext
-
invokeBeanMethod
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
- Specified by:
getMethodParamsin interfaceorg.glassfish.ejb.api.EJBInvocation
-
authorizeWebService
- Specified by:
authorizeWebServicein interfaceorg.glassfish.ejb.api.EJBInvocation- Throws:
Exception
-
isCallerInRole
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
- Specified by:
setWebServiceMethodin interfaceorg.glassfish.ejb.api.EJBInvocation
-
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)
-