Package org.glassfish.api.invocation

Examples of org.glassfish.api.invocation.ComponentInvocation


  if (isEjbEndpoint) {
            if (invManager == null){
                throw new RuntimeException(localStrings.getLocalString("enterprise.webservice.noEjbInvocationManager",
                        "Cannot validate request : invocation manager null for EJB WebService"));
            }
            ComponentInvocation inv = (ComponentInvocation) invManager.getCurrentInvocation();
            // one need to copy message here, otherwise the message may be
            // consumed
            if (ejbDelegate != null) {
                ejbDelegate.setSOAPMessage(request.getMessage(), inv);
            }
View Full Code Here


        }
    }

    void setTransactionalTransactionOperationsManger(boolean userTransactionMethodsAllowed) {
        if (testTransactionManager != null) return; //test
        ComponentInvocation currentInvocation = getCurrentInvocation();
        if (currentInvocation == null) {
          _logger.log(java.util.logging.Level.WARNING, CDI_JTA_NOCOMPONENT);
            return;
        }
        preexistingTransactionOperationsManager =
                (TransactionOperationsManager) currentInvocation.getTransactionOperationsManager();
        currentInvocation.setTransactionOperationsManager(userTransactionMethodsAllowed ?
                transactionalTransactionOperationsManagerTransactionMethodsAllowed :
                transactionalTransactionOperationsManagerTransactionMethodsNotAllowed);
    }
View Full Code Here

                transactionalTransactionOperationsManagerTransactionMethodsNotAllowed);
    }

    void resetTransactionOperationsManager() {
        if (testTransactionManager != null) return; //test
        ComponentInvocation currentInvocation = getCurrentInvocation();
        if (currentInvocation == null) {
            //there should always be a currentInvocation and so this would seem a bug
            // but not a fatal one as app should not be relying on this, so log warning only
            System.out.println("TransactionalInterceptorBase.markThreadAsTransactional currentInvocation==null");
            return;
        }
        currentInvocation.setTransactionOperationsManager(preexistingTransactionOperationsManager);
    }
View Full Code Here

            }
        }

        // If ejb, use isCallerInRole 
        if (isContainerContextAEJBContainerObject() && roleName == null) {
            ComponentInvocation componentInvocation =
                    ConnectorRuntime.getRuntime().getInvocationManager().getCurrentInvocation();
            EJBInvocation ejbInvocation = (EJBInvocation) componentInvocation;
            EJBContext ejbcontext = ejbInvocation.getEJBContext();
            Set<Map.Entry> s = (Set<Map.Entry>) groupNameSecurityMap.entrySet();
            Iterator i = s.iterator();
View Full Code Here

     * @exception <code>PoolingException<code>
     */
    public Transaction getTransaction() throws PoolingException {
        InvocationManager invmgr = ConnectorRuntime.getRuntime().getInvocationManager();

        ComponentInvocation inv = invmgr.getCurrentInvocation();
        if (inv == null) {
      try {
                return ConnectorRuntime.getRuntime().getTransaction();
            } catch (Exception ex) {
          return null;
      }
        }
        return (Transaction) inv.getTransaction();
    }
View Full Code Here

     * @return Handle to the component.
     */
    public Object getComponent(){
       
        InvocationManager invmgr = ConnectorRuntime.getRuntime().getInvocationManager();
        ComponentInvocation inv = invmgr.getCurrentInvocation();
        if (inv == null) {
            return null;
        }
       
        return inv.getInstance();
    }
View Full Code Here

            JavaEETransactionManager tm = ConnectorRuntime.getRuntime().getTransactionManager();

            // enlist if necessary
            if (handle.isTransactional()) {
                InvocationManager invmgr = ConnectorRuntime.getRuntime().getInvocationManager();
                ComponentInvocation inv = invmgr.getCurrentInvocation();
                             
                if (inv == null) {
                    //throw new InvocationException();
                   
                    //Go to the tm and get the transaction
        //This is mimicking the current behavior of
        //the SystemResourceManagerImpl registerResource method
        //in that, you return the transaction from the TxManager
        try {
                        tran = tm.getTransaction();  
                    } catch( Exception e ) {
            tran = null;
      _logger.log(Level.INFO, e.getMessage());
        }
                } else {
                    tran = (Transaction) inv.getTransaction();
                    tm.registerComponentResource(handle);
                }
               
                if (tran != null) {
          try{           
View Full Code Here

        InvocationManager invmgr = ConnectorRuntime.getRuntime().getInvocationManager();

  JavaEETransactionManager tm = ConnectorRuntime.getRuntime().getTransactionManager();
  Transaction tran = null;
        try {
            ComponentInvocation inv = invmgr.getCurrentInvocation();
            if (inv == null) {
                //throw new InvocationException();
                   
               //Go to the tm and get the transaction
               //This is mimicking the current behavior of
               //the SystemResourceManagerImpl registerResource method
               //in that, you return the transaction from the TxManager
         try {
                   tran = tm.getTransaction();  
               } catch( Exception e ) {
             tran = null;
                   _logger.log(Level.INFO, e.getMessage());
               }

            } else {
                tran = (Transaction) inv.getTransaction();
      }
            if (tran != null) {
                tran.setRollbackOnly();
            }
        } catch (SystemException ex) {
View Full Code Here

        try {
            // delist with TMSUCCESS if necessary
            if (resource.isTransactional()) {
                InvocationManager invmgr = ConnectorRuntime.getRuntime().getInvocationManager();

                ComponentInvocation inv = invmgr.getCurrentInvocation();
                if (inv == null) {
                    //throw new InvocationException();

                    //Go to the tm and get the transaction
                    //This is mimicking the current behavior of
                    //the SystemResourceManagerImpl registerResource method
                    //in that, you return the transaction from the TxManager
                    try {
                        tran = tm.getTransaction();
                    } catch (Exception e) {
                        tran = null;
                        _logger.log(Level.INFO, e.getMessage());
                    }
                } else {
                    tran = (Transaction) inv.getTransaction();
                    tm.unregisterComponentResource(resource);
                }
                if (tran != null && resource.isEnlisted()) {
                    tm.delistResource(tran, resource, xaresFlag);
                }
View Full Code Here

        //List invList = Switch.getSwitch().getInvocationManager().getAllInvocations();
        List invList = ConnectorRuntime.getRuntime().getInvocationManager().getAllInvocations();

        ResourceHandle h = null;
        for ( int j = invList.size(); j > 0; j-- ) {
            ComponentInvocation inv = (ComponentInvocation) invList.get( j - 1 );
            Object comp = inv.getInstance();

            List l = tm.getResourceList( comp, inv );
           
            ListIterator it = l.listIterator();
            while( it.hasNext()) {
View Full Code Here

TOP

Related Classes of org.glassfish.api.invocation.ComponentInvocation

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.