Package org.apache.wink.server.internal

Examples of org.apache.wink.server.internal.DeploymentConfiguration


        getRequestProcessor().handleRequest(httpServletRequest, httpServletResponse);
    }

    protected RequestProcessor createRequestProcessor() throws ClassNotFoundException,
        InstantiationException, IllegalAccessException, IOException {
        DeploymentConfiguration deploymentConfiguration = getDeploymentConfiguration();
        RequestProcessor requestProcessor = new RequestProcessor(deploymentConfiguration);
        deploymentConfiguration.addApplication(getApplication());
        return requestProcessor;
    }
View Full Code Here


        return requestProcessor;
    }

    protected DeploymentConfiguration getDeploymentConfiguration() throws ClassNotFoundException,
        InstantiationException, IllegalAccessException, IOException {
        DeploymentConfiguration deploymentConfiguration = createDeploymentConfiguration();
        deploymentConfiguration.setServletConfig(getServletConfig());
        deploymentConfiguration.setServletContext(getServletContext());
        deploymentConfiguration.setProperties(getProperties());
        deploymentConfiguration.init();
        return deploymentConfiguration;
    }
View Full Code Here

        String initParameter = getInitParameter(DEPLYMENT_CONF_PARAM);
        if (initParameter != null) {
            Class<?> confClass = Class.forName(initParameter);
            return (DeploymentConfiguration)confClass.newInstance();
        }
        return new DeploymentConfiguration();
    }
View Full Code Here

            msgContext.getUriInfo().getQueryParameters()
                .getFirst(RestConstants.REST_PARAM_MEDIA_TYPE);
        String acceptValue = null;
        if (alternateParameter != null) {
            // try to map alternate parameter shortcut to a real media type
            DeploymentConfiguration deploymentConfiguration =
                msgContext.getAttribute(DeploymentConfiguration.class);
            Map<String, String> alternateShortcutMap =
                deploymentConfiguration.getAlternateShortcutMap();
            if (alternateShortcutMap != null) {
                acceptValue = alternateShortcutMap.get(alternateParameter);
            }
            if (acceptValue == null) {
                acceptValue = alternateParameter;
View Full Code Here

                .getFirst(RestConstants.REST_PARAM_MEDIA_TYPE);
        String acceptValue = null;
        logger.debug("alternateParameter is {}", alternateParameter);
        if (alternateParameter != null) {
            // try to map alternate parameter shortcut to a real media type
            DeploymentConfiguration deploymentConfiguration =
                msgContext.getAttribute(DeploymentConfiguration.class);
            Map<String, String> alternateShortcutMap =
                deploymentConfiguration.getAlternateShortcutMap();
            logger.debug("alternateShortcutMap is {}", alternateShortcutMap);
            if (alternateShortcutMap != null) {
                acceptValue = alternateShortcutMap.get(alternateParameter);
            }
            if (acceptValue == null) {
View Full Code Here

        @Override
        protected DeploymentConfiguration getDeploymentConfiguration()
            throws ClassNotFoundException, InstantiationException, IllegalAccessException,
            IOException {
            DeploymentConfiguration deploymentConfiguration = super.getDeploymentConfiguration();
            deploymentConfiguration.setFilterConfig(filterConfig);
            return deploymentConfiguration;
        }
View Full Code Here

        getRequestProcessor().handleRequest(httpServletRequest, httpServletResponse);
    }

    protected RequestProcessor createRequestProcessor() throws ClassNotFoundException,
        InstantiationException, IllegalAccessException, IOException {
        DeploymentConfiguration deploymentConfiguration = getDeploymentConfiguration();
        RequestProcessor requestProcessor = new RequestProcessor(deploymentConfiguration);
        logger.debug("Creating request processor {} for servlet {}", requestProcessor, this);
        deploymentConfiguration.addApplication(getApplication(), false);
        return requestProcessor;
    }
View Full Code Here

        return requestProcessor;
    }

    protected DeploymentConfiguration getDeploymentConfiguration() throws ClassNotFoundException,
        InstantiationException, IllegalAccessException, IOException {
        DeploymentConfiguration deploymentConfiguration = createDeploymentConfiguration();
        deploymentConfiguration.setServletConfig(getServletConfig());
        deploymentConfiguration.setServletContext(getServletContext());
        deploymentConfiguration.setProperties(getProperties());
        deploymentConfiguration.init();
        return deploymentConfiguration;
    }
View Full Code Here

                        initParameter,
                        DEPLYMENT_CONF_PARAM);
            Class<?> confClass = Class.forName(initParameter);
            return (DeploymentConfiguration)confClass.newInstance();
        }
        return new DeploymentConfiguration();
    }
View Full Code Here

                                                     registry.getServiceDiscovery(),
                                                     "javax.ws.rs.ext.RuntimeDelegate",
                                                     "/META-INF/wink-alternate-shortcuts.properties",
                                                     "/META-INF/server/wink-providers");

        DeploymentConfiguration config = null;
        try {
            config = super.getDeploymentConfiguration();
        } finally {
            if (cl != null) {
                // return previous classLoader
                Thread.currentThread().setContextClassLoader(cl);
            }
        }

        // [rfeng] FIXME: This is a hack to fool Apache wink to not remove the servlet path
        config.setFilterConfig(new FilterConfig() {

            public ServletContext getServletContext() {
                return getServletContext();
            }

            public Enumeration getInitParameterNames() {
                return getInitParameterNames();
            }

            public String getInitParameter(String arg0) {
                return getInitParameter(arg0);
            }

            public String getFilterName() {
                return getServletName();
            }
        });

        ProvidersRegistry providers = config.getProvidersRegistry();
        providers.addProvider(new DataBindingJAXRSReader(registry), 0.001, true);
        providers.addProvider(new DataBindingJAXRSWriter(registry), 0.001, true);

        config.getResponseUserHandlers().add(new TuscanyResponseHandler());

        return config;
    }
View Full Code Here

TOP

Related Classes of org.apache.wink.server.internal.DeploymentConfiguration

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.