Package com.sun.ejb

Examples of com.sun.ejb.EjbInvocation


   
    // Implementation of Container method.
    // Called from UserTransactionImpl after the EJB started a Tx,
    // for TX_BEAN_MANAGED EJBs only.
    public final void doAfterBegin(ComponentInvocation ci) {
        EjbInvocation inv = (EjbInvocation)ci;
        try {
            // Associate the context with tx so that on subsequent
            // invocations with the same tx, we can do the appropriate
            // tx.resume etc.
            EJBContextImpl sc = (EJBContextImpl)inv.context;
View Full Code Here


    public boolean userTransactionMethodsAllowed(ComponentInvocation inv) {
        boolean utMethodsAllowed = false;
        if (isBeanManagedTran) {
            if (inv instanceof EjbInvocation) {
                EjbInvocation ejbInvocation = (EjbInvocation) inv;
                MessageBeanContextImpl mdc = (MessageBeanContextImpl) ejbInvocation.context;
                utMethodsAllowed = (mdc.operationsAllowed()) ? true: false;
            }
        }
        return utMethodsAllowed;
View Full Code Here

     * Instantiate and initialize a message-driven bean instance.
     */
    private MessageBeanContextImpl createMessageDrivenEJB()
            throws CreateException {

        EjbInvocation inv = null;
        MessageBeanContextImpl context = null;
        ClassLoader originalClassLoader = null;
        boolean methodCalled = false;
        boolean methodCallFailed = false;

View Full Code Here

                            new Object[] { appEJBName_ });

            throw new EJBException(errorMsg);
        }

        EjbInvocation invocation = createEjbInvocation();

        try {

            MessageBeanContextImpl context = (MessageBeanContextImpl) getContext(invocation);

            if( deliveryType == MessageDeliveryType.Timer ) {
                invocation.isTimerCallback = true;
            }
           
            // Set the context class loader here so that message producer will
            // have access to application class loader during message
            // processing.
            // The previous context class loader will be restored in
            // afterMessageDelivery.

            invocation.setOriginalContextClassLoader(
                    Utility.setContextClassLoader(getClassLoader()));
            invocation.isMessageDriven = true;
            invocation.method = method;

            context.setState(BeanState.INVOKING);
View Full Code Here

        }
    }

    public Object deliverMessage(Object[] params) throws Throwable {

        EjbInvocation invocation = null;
        boolean methodCalled = false; // for monitoring
        Object result = null;

        invocation = (EjbInvocation) invocationManager.getCurrentInvocation();
View Full Code Here

    private boolean afterMessageDeliveryInternal(ResourceHandle resourceHandle) {
        // return value. assume failure until proven otherwise.
        boolean success = false;

        EjbInvocation invocation = null;

        invocation = (EjbInvocation) invocationManager.getCurrentInvocation();
        if (invocation == null) {
            _logger.log(Level.SEVERE, "containers.mdb.no_invocation",
                    new Object[] { appEJBName_, "" });
        } else {
            try {
                if (invocation.containerStartsTx) {
                    // Unregister the session associated with
                    // the message-driven bean's destination.
                    unregisterMessageBeanResource(resourceHandle);
                }

                // counterpart of invocationManager.preInvoke
                invocationManager.postInvoke(invocation);

                // Commit/Rollback container-managed transaction.
                postInvokeTx(invocation);

                // Consider successful delivery. Commit failure will be
                // checked below.
                success = true;

                // TODO: Check if Tx existed / committed
                                ejbProbeNotifier.messageDeliveredEvent(getContainerId(),
                                        containerInfo.appName, containerInfo.modName,
                                        containerInfo.ejbName);

            } catch (Throwable ce) {
                _logger.log(Level.SEVERE,
                        "containers.mdb.postinvoke_exception", new Object[] {
                                appEJBName_, ce.toString() });
                _logger.log(Level.SEVERE, ce.getClass().getName(), ce);
            } finally {
                releaseContext(invocation);
            }

            // Reset original class loader
            Utility.setContextClassLoader(
                    invocation.getOriginalContextClassLoader());

            if (invocation.exception != null) {

                if (isSystemUncheckedException(invocation.exception)) {
                    success = false;
View Full Code Here

            if (!beanContext.isInState(BeanState.DESTROYED)) {

                // Called from pool implementation to reduce the pool size.
                // So we need to call ejb.ejbRemove() and
                // mark context as destroyed.
                EjbInvocation inv = null;

                try {
                    // NOTE : Context class-loader is already set by Pool

                    inv = createEjbInvocation(ejb, beanContext);
View Full Code Here

    /**
     * Create a new Session Bean and set Session Context.
     */
    private SessionContextImpl createBeanInstance()
            throws Exception {
        EjbInvocation ejbInv = null;
        try {

      SessionContextImpl context = (SessionContextImpl)
    createEjbInstanceAndContext();

View Full Code Here

        ComponentInvocation compInv = (ComponentInvocation)
                invocationManager.getCurrentInvocation();
        if (compInv != null) {
            if (compInv.getInvocationType() == ComponentInvocation.ComponentInvocationType.EJB_INVOCATION) {
                EjbInvocation ejbInv = (EjbInvocation) compInv;
                if (ejbInv.context instanceof SessionContextImpl) {
                    SessionContextImpl ctxImpl = (SessionContextImpl) ejbInv.context;
                    if (ctxImpl.container instanceof StatefulSessionContainer) {
                        em = ctxImpl.getExtendedEntityManager(emf);
                    }
View Full Code Here

    private void afterInstanceCreation(SessionContextImpl context)
            throws Exception {

        context.setState(BeanState.READY);

        EjbInvocation ejbInv = null;
        boolean inTx = false;
        try {
            // Need to do preInvoke because setSessionContext can access JNDI
            ejbInv = super.createEjbInvocation(context.getEJB(), context);
            invocationManager.preInvoke(ejbInv);
View Full Code Here

TOP

Related Classes of com.sun.ejb.EjbInvocation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.