Package org.glassfish.api.invocation

Examples of org.glassfish.api.invocation.InvocationManager


    public boolean handleRequest(MessageContext context) {
        EJBInvocation inv = null;
        try {
            WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance();
            InvocationManager invManager = wscImpl.getInvocationManager();
            inv = (EJBInvocation) invManager.getCurrentInvocation();
            Method webServiceMethodInPreHandler = inv.getWebServiceMethod();
            if( webServiceMethodInPreHandler != null ) {
                // Now that application handlers have run, do another method
                // lookup and compare the results with the original one.  This
                // ensures that the application handlers have not changed
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();
                    if (logger.isLoggable(Level.FINE)) {
                        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

    public boolean handleRequest(MessageContext context) {
        WebComponentInvocation inv = null;

        try {
            WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance();
            InvocationManager invManager = wscImpl.getInvocationManager();
            inv = (WebComponentInvocation) invManager.getCurrentInvocation();
            com.sun.xml.rpc.spi.runtime.Tie tie =
                    (com.sun.xml.rpc.spi.runtime.Tie) inv.getWebServiceTie();
            if (tie == null) {
                Implementor implementor = (Implementor)
                        context.getProperty(MessageContextProperties.IMPLEMENTOR);
View Full Code Here

                    implementorCache_.put(targetEndpoint, implementor);
                }
            }

            WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance();
            InvocationManager invManager = wscImpl.getInvocationManager();
            ComponentInvocation inv = invManager.getCurrentInvocation();
            if (inv instanceof EJBInvocation)
                ((EJBInvocation)inv).setWebServiceTie(implementor.getTie());
        } catch(Throwable t) {
            RuntimeException re = new RuntimeException();
            re.initCause(t);
View Full Code Here

        // This is a servlet endpoint
        p = this.jaxwsContextDelegate.getUserPrincipal();
        //handling for WebService with WS-Security
        if (p == null && secServ != null) {
            WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance();
            InvocationManager mgr = wscImpl.getInvocationManager();
            boolean isWeb = ComponentInvocation.ComponentInvocationType.SERVLET_INVOCATION.
                    equals(mgr.getCurrentInvocation().getInvocationType()) ? true : false;
            p = secServ.getUserPrincipal(isWeb);
        }
        return p;
    }
View Full Code Here

        return p;
    }

    public boolean isUserInRole(String role) {
        WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance();
        InvocationManager mgr = wscImpl.getInvocationManager();
        if (ComponentInvocation.ComponentInvocationType.EJB_INVOCATION.equals(mgr.getCurrentInvocation().getInvocationType())) {
           EJBInvocation inv = (EJBInvocation)mgr.getCurrentInvocation();
           boolean res = inv.isCallerInRole(role);
           return res;
        }
        // This is a servlet endpoint
        boolean ret = this.jaxwsContextDelegate.isUserInRole(role);
        //handling for webservice with WS-Security
        if (!ret && secServ != null) {
            if (mgr != null && mgr.getCurrentInvocation() != null) {
                if (mgr.getCurrentInvocation().getContainer() instanceof WebModule) {
                    Principal p = getUserPrincipal();
                    ret = secServ.isUserInRole((WebModule)mgr.getCurrentInvocation().getContainer(), p, servletName, role);
                }
            }
        }
        return ret;
    }
View Full Code Here

    public boolean handleRequest(MessageContext context) {
        WebComponentInvocation inv = null;

        try {
            WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance();
            InvocationManager invManager = wscImpl.getInvocationManager();
            inv = (WebComponentInvocation) invManager.getCurrentInvocation();
            Method webServiceMethodInPreHandler = inv.getWebServiceMethod();
            if( webServiceMethodInPreHandler != null ) {
                // Now that application handlers have run, do another method
                // lookup and compare the results with the original one.  This
                // ensures that the application handlers have not changed
View Full Code Here

    public boolean handleRequest(MessageContext context) {
        EJBInvocation inv = null;

        try {
            WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance();
            InvocationManager invManager = wscImpl.getInvocationManager();
            inv = (EJBInvocation) invManager.getCurrentInvocation();
            Method method = wsUtil.getInvMethod(
                    (com.sun.xml.rpc.spi.runtime.Tie)inv.getWebServiceTie(), context);
            inv.setWebServiceMethod(method);
            if ( !inv.authorizeWebService(method)  ) {
                throw new Exceptionformat( rb.getString ("client.unauthorized")
View Full Code Here

    public boolean handleRequest(MessageContext context) {
        EJBInvocation inv = null;
        try {
            WebServiceContractImpl wscImpl = WebServiceContractImpl.getInstance();
            InvocationManager invManager = wscImpl.getInvocationManager();
            inv = (EJBInvocation) invManager.getCurrentInvocation();
            Method webServiceMethodInPreHandler = inv.getWebServiceMethod();
            if( webServiceMethodInPreHandler != null ) {
                // Now that application handlers have run, do another method
                // lookup and compare the results with the original one.  This
                // ensures that the application handlers have not changed
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.