Package org.apache.wink.server.internal

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


        fixed = true;
    }

    @Override
    public RequestProcessor getRequestProcessor() {
        RequestProcessor processor = super.getRequestProcessor();
        // The 1st call returns null
        if (processor != null) {
            fixMediaTypes(processor.getConfiguration());
        }
        return processor;
    }
View Full Code Here


 
  private void init() {
    ThreadRootResourceDeploymentConfiguration configuration = new ThreadRootResourceDeploymentConfiguration();
    configuration.init();
    configuration.getProperties().setProperty("wink.rootResource", "none");
    requestProcessor = new RequestProcessor(configuration);
    for (Object component : components) {
      registerComponent(component);
    }
        for (Class componentClass : componentClasses) {
      registerComponentClass(componentClass);
View Full Code Here

            super.init();
            // try to get the request processor
            // the request processor can be available if it was loaded by a
            // listener
            // or when working with Spring
            RequestProcessor requestProcessor = getRequestProcessor();
            if (requestProcessor == null) {
                // create the request processor
                requestProcessor = createRequestProcessor();
                if (requestProcessor == null) {
                    throw new IllegalStateException(Messages
                        .getMessage("restServletRequestProcessorCouldNotBeCreated")); //$NON-NLS-1$
                }
                storeRequestProcessorOnServletContext(requestProcessor);
            }
            if (requestProcessor.getConfiguration().getServletConfig() == null) {
                requestProcessor.getConfiguration().setServletConfig(getServletConfig());
            }
            if (requestProcessor.getConfiguration().getServletContext() == null) {
                requestProcessor.getConfiguration().setServletContext(getServletContext());
            }
        } catch (Exception e) {
            // when exception occurs during the servlet initialization
            // it should be marked as unavailable
            logger.error(e.getMessage(), e);
View Full Code Here

        Application app = getApplication();
        if (app == null) {
            app = getApplication(deploymentConfiguration);
        }
        deploymentConfiguration.addApplication(app, false);
        RequestProcessor requestProcessor = new RequestProcessor(deploymentConfiguration);
        logger.debug("Creating request processor {} for servlet {}", requestProcessor, this); //$NON-NLS-1$
        return requestProcessor;
    }
View Full Code Here

    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException,
        ServletException {

        RequestProcessor requestProcessor = getRequestProcessor();
        if (requestProcessor == null) {
            throw new ServletException(Messages
                .getMessage("adminServletRequestProcessorInitBeforeAdmin")); //$NON-NLS-1$
        }
        ResourceRegistry registry = requestProcessor.getConfiguration().getResourceRegistry();

        String[] parameterValues = request.getParameterValues(DOCUMENT_TYPE);
        if (parameterValues == null || parameterValues.length == 0) {
            buildAdminHome(response);
            return;
View Full Code Here

        // to actually inspect the list in the 'data' object in the MessageBodyReaders in the ProvidersRegistry would take a lot of
        // reflection and hacking.  We'll at least confirm that only 5 (due to AssetProvider) are in the ProvidersRegistry.

        RestServlet servlet = (RestServlet)this.getServlet();
        ServletContext context = servlet.getServletContext();
        RequestProcessor processor = (RequestProcessor) context.getAttribute(RequestProcessor.class.getName());
        DeploymentConfiguration config = processor.getConfiguration();
        ProvidersRegistry providersRegistry = config.getProvidersRegistry();
        // to confirm that the ignores are indeed happening, I need to get the private field
        // "messageBodyReaders" object, then it's superclass "data" object and inspect it:
        Field field = providersRegistry.getClass().getDeclaredField("messageBodyReaders");
        field.setAccessible(true);
View Full Code Here

        String requestProcessorAttribute = "MOCK_REQUEST_PROCESSOR";
        DeploymentConfiguration configuration = new DeploymentConfiguration();
        configuration.init();

        RequestProcessor requestProcessor = new RequestProcessor(configuration);

        MockServletContext servletContext = new MockServletContext();
        servletContext.setAttribute(requestProcessorAttribute, requestProcessor);

        MockServletConfig servletConfig = new MockServletConfig(servletContext);
View Full Code Here

 
  private void init() {
    ThreadRootResourceDeploymentConfiguration configuration = new ThreadRootResourceDeploymentConfiguration();
    configuration.init();
    configuration.getProperties().setProperty("wink.rootResource", "none");
    requestProcessor = new RequestProcessor(configuration);
    for (Object component : components) {
      registerComponent(component);
    }
  }
View Full Code Here

             * applications
             */
            new Providers(deploymentConfiguration.getProvidersRegistry()).log();
        }

        RequestProcessor requestProcessor = new RequestProcessor(deploymentConfiguration);
        logger.trace("Creating request processor {} for servlet {}", requestProcessor, this); //$NON-NLS-1$

        if (LoggerFactory.getLogger(Resources.class).isTraceEnabled()) {
            /*
             * if full trace is enabled, then log everything
View Full Code Here

    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException,
        ServletException {

        RequestProcessor requestProcessor = getRequestProcessor();
        if (requestProcessor == null) {
            throw new ServletException(Messages
                .getMessage("adminServletRequestProcessorInitBeforeAdmin")); //$NON-NLS-1$
        }
        ResourceRegistry registry = requestProcessor.getConfiguration().getResourceRegistry();

        String[] parameterValues = request.getParameterValues(DOCUMENT_TYPE);
        if (parameterValues == null || parameterValues.length == 0) {
            buildAdminHome(response);
            return;
View Full Code Here

TOP

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

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.