Package org.glassfish.api.invocation

Examples of org.glassfish.api.invocation.ComponentInvocation


        return rj == null ? null : rj.env;
    }

    public JndiNameEnvironment getCurrentJndiNameEnvironment() {
        JndiNameEnvironment desc = null;
        ComponentInvocation inv = invMgr.getCurrentInvocation();
        if (inv != null) {
            if (inv.componentId != null) {
                desc = getJndiNameEnvironment(inv.componentId);
                if (_logger.isLoggable(Level.FINEST)) {
                    _logger.finest("ComponentEnvManagerImpl: " +
View Full Code Here


    private synchronized BeanManager obtainBeanManager() throws NamingException {

        BeanManager beanManager = null;

        // Use invocation context to find applicable BeanDeploymentArchive.
        ComponentInvocation inv = invocationManager.getCurrentInvocation();

        if( inv != null ) {

            JndiNameEnvironment componentEnv = compEnvManager.getJndiNameEnvironment(inv.getComponentId());

            if( componentEnv != null ) {

                BundleDescriptor bundle = null;
View Full Code Here

      }
        }
        // END OF IASRI 4713234
        // END IASRI 4688449

        ComponentInvocation inv;
        if (eventType == InstanceEvent.EventType.BEFORE_INIT_EVENT) {
          // The servletName is not avaiable from servlet instance before servlet init.
          // We have to pass the servletName to ComponentInvocation so it can be retrieved
          // in RealmAdapter.getServletName().
          inv = new WebComponentInvocation(wm, instance, event.getWrapper().getName());
View Full Code Here

            String msg = _rb.getString(EXCEPTION_DURING_HANDLE_EVENT);
            msg = MessageFormat.format(msg, new Object[] { eventType, wm });
            _logger.log(Level.SEVERE, msg, ie);
        }

        ComponentInvocation inv = new WebComponentInvocation(wm, instance);
        try {
            im.postInvoke(inv);
        } catch (Exception ex) {
            String msg = _rb.getString(EXCEPTION_DURING_HANDLE_EVENT);
            msg = MessageFormat.format(msg, new Object[] { eventType, wm });
View Full Code Here

        }
    }

    void setTransactionalTransactionOperationsManger(boolean userTransactionMethodsAllowed) {
        if(testTransactionManager != null) return; //test
            ComponentInvocation currentInvocation = getCurrentInvocation();
            if (currentInvocation == null) {
                _logger.warning(
                        "No ComponentInvocation present for @Transactional annotation processing.  " +
                                "Restriction on use of UserTransaction will not be enforced");
                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

    @Override
    public ContextHandle saveContext(ContextService contextService, Map<String, String> contextObjectProperties) {
        // Capture the current thread context
        ClassLoader contextClassloader = null;
        AppServSecurityContext currentSecurityContext = null;
        ComponentInvocation savedInvocation = null;
        if (classloading) {
            contextClassloader = Utility.getClassLoader();
        }
        if (security) {
            currentSecurityContext = securityContext.getCurrentSecurityContext();
        }
        ComponentInvocation currentInvocation = invocationManager.getCurrentInvocation();
        if (currentInvocation != null) {
            savedInvocation = currentInvocation.clone();
            savedInvocation.instance = currentInvocation.instance;
            savedInvocation.setResourceTableKey(null);
            if (!naming) {
                savedInvocation.setJNDIEnvironment(null);
            }
View Full Code Here

        if (handle.getSecurityContext() != null) {
            resetSecurityContext = securityContext.getCurrentSecurityContext();
            securityContext.setCurrentSecurityContext(handle.getSecurityContext());
        }
        if (handle.getInvocation() != null) {
            ComponentInvocation invocation = handle.getInvocation();
            // Each invocation needs a ResourceTableKey that returns a unique hashCode for TransactionManager
            invocation.setResourceTableKey(new PairKey(invocation.getInstance(), Thread.currentThread()));
            invocationManager.preInvoke(invocation);
        }
        // Ensure that there is no existing transaction in the current thread
        if (transactionManager != null) {
            transactionManager.clearThreadTx();
View Full Code Here

    }

    public void injectInstance(Object instance, boolean invokePostConstruct)
        throws InjectionException {

        ComponentInvocation inv = invocationMgr.getCurrentInvocation();

        if( inv != null ) {

            JndiNameEnvironment componentEnv = compEnvManager.getJndiNameEnvironment(inv.getComponentId());

            if( componentEnv != null ) {
                inject(instance.getClass(), instance, componentEnv, null, invokePostConstruct);
            } else {
                throw new InjectionException(localStrings.getLocalString(
View Full Code Here

    public void injectInstance(Object instance,
                               String componentId,
                               boolean invokePostConstruct)
        throws InjectionException {

        ComponentInvocation inv = invocationMgr.getCurrentInvocation();

        if( inv != null ) {

            JndiNameEnvironment componentEnv =
                compEnvManager.getJndiNameEnvironment(componentId);
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.