Package org.glassfish.jersey.servlet

Examples of org.glassfish.jersey.servlet.ServletContainer


        this.lifecycleEnvironment = new LifecycleEnvironment();

        final DropwizardResourceConfig jerseyConfig = new DropwizardResourceConfig(metricRegistry);

        this.jerseyServletContainer = new JerseyContainerHolder(new ServletContainer(jerseyConfig));
        this.jerseyEnvironment = new JerseyEnvironment(jerseyServletContainer, jerseyConfig);
    }
View Full Code Here


    @Override
    protected DeploymentContext configureDeployment() {
        forceSet(TestProperties.CONTAINER_PORT, "0");

        return ServletDeploymentContext.forServlet(new ServletContainer(new ResourceConfig(TestResource.class))).build();
    }
View Full Code Here

    }


    @Override
    protected DeploymentContext configureDeployment() {
        return ServletDeploymentContext.forServlet(new ServletContainer(new ResourceConfig(TestResource.class))).build();
    }
View Full Code Here

    }


    @Override
    protected DeploymentContext configureDeployment() {
        return ServletDeploymentContext.forServlet(new ServletContainer(new ResourceConfig(Resource.class))).build();
    }
View Full Code Here

        // classloader set
        ClassLoader myClassLoader = getClass().getClassLoader();
        ClassLoader originalContextClassLoader = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(myClassLoader);
            httpService.registerServlet("/jersey-http-service", new ServletContainer(), getJerseyServletParams(), null);
        } finally {
            Thread.currentThread().setContextClassLoader(originalContextClassLoader);
        }
        // END of workaround - after grizzly updated to the recent version, only the inner call from try block will remain:
        // httpService.registerServlet("/jersey-http-service", new ServletContainer(), getJerseyServletParams(), null);
View Full Code Here

            if (registration.getClassName() != null) {
                // class name present - complete servlet registration from container point of view
                Utils.store(resourceConfig, context);
            } else {
                // no class name - no complete servlet registration from container point of view
                final ServletContainer servlet = new ServletContainer(resourceConfig);
                registration = context.addServlet(registration.getName(), servlet);
                ((ServletRegistration.Dynamic) registration).setLoadOnStartup(1);

                if (registration.getMappings().isEmpty()) {
                    // Error
View Full Code Here

        final ApplicationPath ap = clazz.getAnnotation(ApplicationPath.class);
        if (ap != null) {
            // App is annotated with ApplicationPath
            final ResourceConfig resourceConfig = ResourceConfig.forApplicationClass(clazz, defaultClasses)
                    .addProperties(Utils.getContextParams(context));
            final ServletContainer s = new ServletContainer(resourceConfig);
            final ServletRegistration.Dynamic dsr = context.addServlet(clazz.getName(), s);
            dsr.setAsyncSupported(true);
            dsr.setLoadOnStartup(1);

            final String mapping = createMappingPath(ap);
View Full Code Here

        if (registration.getClassName() != null) {
            // class name present - complete servlet registration from container point of view
            Utils.store(resourceConfig, context);
        } else {
            // no class name - no complete servlet registration from container point of view
            final ServletContainer servlet = new ServletContainer(resourceConfig);
            final ServletRegistration.Dynamic dynamicRegistration = context.addServlet(clazz.getName(), servlet);
            dynamicRegistration.setAsyncSupported(true);
            dynamicRegistration.setLoadOnStartup(1);

            if (dynamicRegistration.getMappings().isEmpty()) {
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

  public JerseyContext( HttpService httpService, String rootPath ) {
    this.httpService = httpService;
    this.rootPath = rootPath == null ? "/services" : rootPath;
    this.application = new RootApplication();
    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.