Package org.glassfish.api.invocation

Examples of org.glassfish.api.invocation.InvocationManager


        habitat = h;
    }

    public void registerInterceptor(Object systemInterceptor) {

        InvocationManager invManager = habitat.getByContract(InvocationManager.class);

        ComponentInvocation currentInv = invManager.getCurrentInvocation();

        if(currentInv == null) {
            throw new IllegalStateException("no current invocation");
        } else if (currentInv.getInvocationType() !=
                       ComponentInvocation.ComponentInvocationType.SERVLET_INVOCATION) {
View Full Code Here


            this.componentInvocation = componentInvocation;
        }

        public void run() {
            ClassLoader previousClassLoader = null;
            InvocationManager invocationManager = EjbContainerUtilImpl.getInstance().getInvocationManager();
            try {
                previousClassLoader = Utility.setContextClassLoader(clsLoader);
                invocationManager.preInvoke(componentInvocation);
                // Cleanup the message bean client resources.
                mdbClient.close();
                _logger
                        .log(Level.FINE,
                                "[MDBContainer] ASync thread done with mdbClient.close()");
            } catch (Exception e) {
                _logger.log(Level.SEVERE, "containers.mdb.cleanup_exception",
                        new Object[] { appName, e.toString() });
                _logger.log(Level.SEVERE, e.getClass().getName(), e);
            } finally {
                synchronized (this) {
                    this.done = true;
                    this.notifyAll();
                }
                try {
                    mdbPool.close();
                } catch (Exception ex) {
                    _logger.log(Level.FINE, "Exception while closing pool", ex);
                }
                invocationManager.postInvoke(componentInvocation);
                if (previousClassLoader != null) {
                    Utility.setContextClassLoader(previousClassLoader);
                }
            }
        }
View Full Code Here

            "org.glassfish.jsp.monitor.probeEmitter",
            new JspProbeEmitterImpl(webModule));

        // Pass BeanManager's ELResolver as ServletContext attribute
        // (see IT 11168)
        InvocationManager invocationMgr =
            webContainer.getInvocationManager();
        WebComponentInvocation inv = new WebComponentInvocation(webModule);
        try {
            invocationMgr.preInvoke(inv);
            JCDIService jcdiService = defaultServices.getService(JCDIService.class);
            // JCDIService can be absent if weld integration is missing in the runtime, so check for null is needed.
            if (jcdiService != null && jcdiService.isCurrentModuleJCDIEnabled()) {
                jcdiService.setELResolver(servletContext);
            }
        } catch (NamingException e) {
            // Ignore
        } finally {
            invocationMgr.postInvoke(inv);
        }

    }
View Full Code Here

        JMSContextEntry contextEntry = contexts.get(id);
        JMSContext context = null;
        if (contextEntry == null) {
            context = createContext(ipId, metadata, connectionFactory);
            ServiceLocator serviceLocator = Globals.get(ServiceLocator.class);
            InvocationManager invMgr = serviceLocator.getService(InvocationManager.class);
            contexts.put(id, new JMSContextEntry(ipId, context, invMgr.getCurrentInvocation()));
        } else {
            context = contextEntry.getCtx();
        }
        return context;
    }
View Full Code Here

    // Close and remove the JMSContext instances
    @PreDestroy
    public synchronized void cleanup() {
        ServiceLocator serviceLocator = Globals.get(ServiceLocator.class);
        InvocationManager invMgr = serviceLocator.getService(InvocationManager.class);
        ComponentInvocation currentInv = invMgr.getCurrentInvocation();

        for (Entry<String, JMSContextEntry> entry : contexts.entrySet()) {
            JMSContextEntry contextEntry = entry.getValue();
            String ipId = contextEntry.getInjectionPointId();
            JMSContext context = contextEntry.getCtx();
            if (context != null) {
                ComponentInvocation inv = contextEntry.getComponentInvocation();
                if (inv != null && currentInv != inv) invMgr.preInvoke(inv);
                try {
                    context.close();
                    logger.log(Level.FINE, localStrings.getLocalString("JMSContext.impl.close",
                                           "Closed JMSContext instance associated with id {0}: {1}.",
                                           ipId, context.toString()));
                } catch (Exception e) {
                    logger.log(Level.SEVERE, localStrings.getLocalString("JMSContext.impl.close.failure",
                                             "Failed to close JMSContext instance associated with id {0}: {1}.",
                                             ipId, context.toString()), e);
                } finally {
                    if (inv != null && currentInv != inv) invMgr.postInvoke(inv);
                }
            }
        }
        contexts.clear();
   }
View Full Code Here

            "org.glassfish.jsp.monitor.probeEmitter",
            new JspProbeEmitterImpl(webModule));

        // Pass BeanManager's ELResolver as ServletContext attribute
        // (see IT 11168)
        InvocationManager invocationMgr =
            webContainer.getInvocationManager();
        WebComponentInvocation inv = new WebComponentInvocation(webModule);
        try {
            invocationMgr.preInvoke(inv);
            JCDIService jcdiService = defaultServices.getService(JCDIService.class);
            // JCDIService can be absent if weld integration is missing in the runtime, so check for null is needed.
            if (jcdiService != null && jcdiService.isCurrentModuleJCDIEnabled()) {
                jcdiService.setELResolver(servletContext);
            }
        } catch (NamingException e) {
            // Ignore
        } finally {
            invocationMgr.postInvoke(inv);
        }

    }
View Full Code Here

TOP

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

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.