Package com.sun.ejb

Class EjbInvocation

    • Field Detail

      • 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)
      • 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)
      • 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
        Returns:
        EnterpriseBean instance or null if not applicable for this invocation.
      • 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:
        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)
      • setTransactionOperationsManager

        public void setTransactionOperationsManager​(TransactionOperationsManager transactionOperationsManager)
      • getTarget

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

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

        public Method getMethod()
        Specified by:
        getMethod in interface EJBInvocation
        Specified by:
        getMethod in interface jakarta.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:
        getConstructor in interface jakarta.interceptor.InvocationContext
      • getParameters

        public Object[] getParameters()
        Specified by:
        getParameters in interface jakarta.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:
        setParameters in interface jakarta.interceptor.InvocationContext
      • setWebServiceContext

        public void setWebServiceContext​(Object webServiceContext)
        Method takes Object to decouple EJBInvocation interface from jaxws (which isn't available in all profiles).
        Specified by:
        setWebServiceContext in interface EJBInvocation
        Parameters:
        webServiceContext - JAX-WS web service context used for the invocation
      • getContextData

        public Map<String,​Object> getContextData()
        Specified by:
        getContextData in interface jakarta.interceptor.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 jakarta.xml.soap.SOAPMessage getSOAPMessage()
        This is for EJB JAXWS only.
      • proceed

        public Object proceed()
                       throws Exception
        Specified by:
        proceed in interface jakarta.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.
        Overrides:
        toString in class ComponentInvocation
      • 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
      • isAWebService

        public boolean isAWebService()
        Specified by:
        isAWebService in interface EJBInvocation
        Returns:
        true if it is a webservice invocation
      • authorizeWebService

        public boolean authorizeWebService​(Method m)
                                    throws Exception
        Description copied from interface: EJBInvocation
        Use the underlying container to authorize this invocation
        Specified by:
        authorizeWebService in interface EJBInvocation
        Parameters:
        m - method to be invoked
        Returns:
        true if the invocation was authorized by the underlying container
        Throws:
        Exception
      • isCallerInRole

        public boolean isCallerInRole​(String role)
        Specified by:
        isCallerInRole in interface EJBInvocation
        Returns:
        true if the SecurityManager reports that the caller is in role
      • isContainerStartsTx

        public boolean isContainerStartsTx()
      • setContainerStartsTx

        public void setContainerStartsTx​(boolean containerStartsTx)
      • isClientInterfaceAssignableToOneOf

        public boolean isClientInterfaceAssignableToOneOf​(Class<?>... classes)
        Checks if the client interface is not null and is assignable to at least one of classes in parameter.
        Parameters:
        classes - must not be null
        Returns:
        true if the client interface is assignable to at least one of classes in parameter