Examples of HttpListener


Examples of org.apache.openejb.server.httpd.HttpListener

                Context context = webContext.getJndiEnc();
                Class target = classLoader.loadClass(servlet.servletClass);

                PortData port = WsBuilder.toPortData(portInfo, injections, moduleBaseUrl, classLoader);

                HttpListener container = createPojoWsContainer(moduleBaseUrl, port, portInfo.serviceLink, target, context, webApp.contextRoot);

                if (wsRegistry != null) {
                    // give servlet a reference to the webservice container
                    List<String> addresses = wsRegistry.setWsContainer(virtualHost, webApp.contextRoot, servlet.servletName, container);
View Full Code Here

Examples of org.apache.openejb.server.httpd.HttpListener

    public String getServletInfo() {
        return "Webservice Servlet " + getService();
    }

    public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
        HttpListener service = getService();
        if (service == null) throw new ServletException("WebServiceContainer has not been set");

        ServletEndpointContext context = getContext();
        endpointContext.set(new InvocationContext((HttpServletRequest) req));
        try {
            res.setContentType("text/xml");
            HttpRequest httpRequest = new ServletRequestAdapter((HttpServletRequest) req, (HttpServletResponse) res, config.getServletContext());
            HttpResponse httpResponse = new ServletResponseAdapter((HttpServletResponse) res);

            if (pojo != null) {
                req.setAttribute(WsConstants.POJO_INSTANCE, pojo);
            }

            try {
                service.onMessage(httpRequest, httpResponse);
            } catch (IOException e) {
                throw e;
            } catch (ServletException e) {
                throw e;
            } catch (Exception e) {
View Full Code Here

Examples of org.apache.openejb.server.httpd.HttpListener

                        if (portInfo == null) continue;

                        try {
                            PortData port = WsBuilder.toPortData(portInfo, beanContext.getInjections(), moduleBaseUrl, beanContext.getClassLoader());

                            HttpListener container = createEjbWsContainer(moduleBaseUrl, port, beanContext);

                            // generate a location if one was not assigned
                            String location = port.getLocation();
                            if (location == null) {
                                location = autoAssignWsLocation(bean, port, contextData, deploymentIdTemplate);
View Full Code Here

Examples of org.apache.openejb.server.httpd.HttpListener

                Context context = webContext.getJndiEnc();
                Class target = classLoader.loadClass(servlet.servletClass);

                PortData port = WsBuilder.toPortData(portInfo, injections, moduleBaseUrl, classLoader);

                HttpListener container = createPojoWsContainer(moduleBaseUrl, port, portInfo.serviceLink, target, context, webApp.contextRoot);

                if (wsRegistry != null) {
                    // give servlet a reference to the webservice container
                    List<String> addresses = wsRegistry.setWsContainer(virtualHost, webApp.contextRoot, servlet.servletName, container);
View Full Code Here

Examples of org.apache.openejb.server.httpd.HttpListener

            throw new OpenEJBRestRuntimeException("uri syntax is not correct", e);
        }
    }

    private void undeployRestObject(String context) {
        HttpListener listener = rsRegistry.removeListener(context);
        if (listener != null) {
            RsHttpListener.class.cast(listener).undeploy();
        }
    }
View Full Code Here

Examples of org.apache.openejb.server.httpd.HttpListener

    }

    @Override public HttpListener removeListener(String context) {
        String regex = addresses.get(context);
        if (regex != null) {
            HttpListener listener = registry.removeHttpListener(regex);
            if (listener instanceof ClassLoaderHttpListener)
            return ((ClassLoaderHttpListener) listener).getDelegate();
        }
        return null;
    }
View Full Code Here

Examples of org.apache.openejb.server.httpd.HttpListener

    public String getServletInfo() {
        return "Webservice Servlet " + getService();
    }

    public void service(final ServletRequest req, final ServletResponse res) throws ServletException, IOException {
        final HttpListener service = getService();
        if (service == null) throw new ServletException("WebServiceContainer has not been set");

        final ServletEndpointContext context = getContext();
        endpointContext.set(new InvocationContext((HttpServletRequest) req));
        try {
            res.setContentType("text/xml");
            final HttpRequest httpRequest = new ServletRequestAdapter((HttpServletRequest) req, (HttpServletResponse) res, config.getServletContext());
            final HttpResponse httpResponse = new ServletResponseAdapter((HttpServletResponse) res);

            if (pojo != null) {
                req.setAttribute(WsConstants.POJO_INSTANCE, pojo);
            }

            try {
                service.onMessage(httpRequest, httpResponse);
            } catch (final IOException e) {
                throw e;
            } catch (final ServletException e) {
                throw e;
            } catch (final Exception e) {
View Full Code Here

Examples of org.apache.openejb.server.httpd.HttpListener

        }
        return managedUrl + "/" + wildcard;
    }

    private void undeployRestObject(final String context) {
        HttpListener listener = rsRegistry.removeListener(context);
        if (listener != null) {

            if (BasicAuthHttpListenerWrapper.class.isInstance(listener)) {
                listener = BasicAuthHttpListenerWrapper.class.cast(listener).getHttpListener();
            }
View Full Code Here

Examples of org.apache.openejb.server.httpd.HttpListener

    @Override
    public HttpListener removeListener(final String context) {
        final String regex = addresses.get(context);
        if (regex != null) {
            final HttpListener listener = registry.removeHttpListener(regex);
            if (listener instanceof ClassLoaderHttpListener) {
                return ((ClassLoaderHttpListener) listener).getDelegate();
            }
        }
        return null;
View Full Code Here

Examples of org.apache.openejb.server.httpd.HttpListener

                    final ClassLoader old = Thread.currentThread().getContextClassLoader();
                    Thread.currentThread().setContextClassLoader(beanContext.getClassLoader());
                    try {
                        final PortData port = WsBuilder.toPortData(portInfo, beanContext.getInjections(), moduleBaseUrl, beanContext.getClassLoader());

                        final HttpListener container = createEjbWsContainer(moduleBaseUrl, port, beanContext, new ServiceConfiguration(beanContext.getProperties(), appInfo.services));

                        // generate a location if one was not assigned
                        String location = port.getLocation();
                        if (location == null) {
                            location = autoAssignWsLocation(bean, port, contextData, deploymentIdTemplate);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.