Package org.glassfish.jersey.servlet

Examples of org.glassfish.jersey.servlet.ServletContainer


  }

  private void unregisterServletWhenNoresourcePresents() {
    if( !getRootApplication().hasResources() ) {
      httpService.unregister( rootPath );
      servletContainer = new ServletContainer( ResourceConfig.forApplication( application ) );
      isApplicationRegistered = false;
    }
  }
View Full Code Here


    private void rawRegisterServlets() throws ServletException, NamespaceException, InterruptedException {
        logger.info("JERSEY BUNDLE: REGISTERING SERVLETS");
        logger.info("JERSEY BUNDLE: HTTP SERVICE = " + httpService.toString());

        httpService.registerServlet("/jersey-http-service", new ServletContainer(), getJerseyServletParams(), null);

        sendAdminEvent();
        logger.info("JERSEY BUNDLE: SERVLETS REGISTERED");
    }
View Full Code Here

    errorHandler.setShowStacks(true);
    errorHandler.setShowMessageInTitle(true);
    context.setErrorHandler(errorHandler);
    context.setContextPath("/");
    embeddedJetty.setHandler(context);
    ServletHolder h = new ServletHolder(new ServletContainer(new DrillRestServer(manager)));
//    h.setInitParameter(ServerProperties.PROVIDER_PACKAGES, "org.apache.drill.exec.server");
    h.setInitOrder(1);
    context.addServlet(h, "/*");
    context.addServlet(new ServletHolder(new MetricsServlet(this.context.getMetrics())), "/status/metrics");
    context.addServlet(new ServletHolder(new ThreadDumpServlet()), "/status/threads");
View Full Code Here

        return application.sources(entryPointClass);
    }

    @Bean
    public ServletRegistrationBean jerseyServlet() {
        ServletRegistrationBean registration = new ServletRegistrationBean(new ServletContainer(), "/*");
        registration.addInitParameter(ServletProperties.JAXRS_APPLICATION_CLASS, JaxRsApplication.class.getName());
        return registration;
    }
View Full Code Here

  }

  @Bean
  public ServletRegistrationBean jerseyRegistrationBean() {
    ServletRegistrationBean reg = new ServletRegistrationBean(
        new ServletContainer(new Api1()), Api1.PATH + "*");
    reg.setName(Api1.class.getSimpleName());
    return reg;
  }
View Full Code Here

    }

    @Provides
    public static ServletContainer createServletContainer(ResourceConfig resourceConfig)
    {
        return new ServletContainer(resourceConfig);
    }
View Full Code Here

        ImmutableSet.Builder<Object> singletons = ImmutableSet.builder();
        singletons.addAll(adminJaxRsSingletons);
        singletons.add(new JsonMapper(objectMapper));

        Application application = new JaxRsApplication(singletons.build());
        return new ServletContainer(ResourceConfig.forApplication(application));
    }
View Full Code Here

    }

        ResourceConfig resourceConfig = new ResourceConfig();
        resourceConfig.packages("com.cisco.oss.foundation.tools");
   
    ServletContainer servletContainer = new ServletContainer(resourceConfig);
   
    ListMultimap<String, Servlet> servlets = ArrayListMultimap.create();
    servlets.put("/*", servletContainer);
   
    JettyHttpServerFactory.INSTANCE.startHttpServer(serverName, servlets);
View Full Code Here

    }

    @Provides
    public static ServletContainer createServletContainer(ResourceConfig resourceConfig)
    {
        return new ServletContainer(resourceConfig);
    }
View Full Code Here

  public JerseyContext( HttpService httpService, String rootPath ) {
    this.httpService = httpService;
    this.rootPath = rootPath == null ? "/services" : rootPath;
    this.application = new RootApplication();
    disableAutoDiscovery();
    this.servletContainer = new ServletContainer( ResourceConfig.forApplication( application ) );
  }
View Full Code Here

TOP

Related Classes of org.glassfish.jersey.servlet.ServletContainer

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.