Package com.sun.jersey.api.core

Examples of com.sun.jersey.api.core.ApplicationAdapter


      e.printStackTrace();
    }
  }

  private void setupServer(Application application) {
    ResourceConfig rc = new ApplicationAdapter(application);

    Map<String, Object> properties = new HashMap<String, Object>();
    properties.put(ResourceConfig.FEATURE_TRACE, "true");
    rc.setPropertiesAndFeatures(properties);

    Properties serverProperties = readProperties();
    int port = Integer.parseInt(serverProperties.getProperty(PORT_PROPERTY));
    URI serverUri = UriBuilder.fromPath(ROOT_RESOURCE_PATH).scheme("http").host("localhost").port(port).build();
    try {
View Full Code Here


            throw new IllegalArgumentException();

        if (app instanceof ResourceConfig) {
            resourceConfig = (ResourceConfig) app;
        } else {
            resourceConfig = new ApplicationAdapter(app);
        }
    }
View Full Code Here

        if (application instanceof ResourceConfig) {
            return ContainerFactory.createContainer(endpointType,
                    (ResourceConfig)application);
        } else {
            return ContainerFactory.createContainer(endpointType,
                    new ApplicationAdapter(application));
        }
    }
View Full Code Here

            throw new IllegalArgumentException();

        if (app instanceof ResourceConfig) {
            resourceConfig = (ResourceConfig) app;
        } else {
            resourceConfig = new ApplicationAdapter(app);
        }
    }
View Full Code Here

            throw new IllegalArgumentException();

        if (app instanceof ResourceConfig) {
            resourceConfig = (ResourceConfig) app;
        } else {
            resourceConfig = new ApplicationAdapter(app);
        }
    }
View Full Code Here

        if (application instanceof ResourceConfig) {
            return ContainerFactory.createContainer(endpointType,
                    (ResourceConfig)application);
        } else {
            return ContainerFactory.createContainer(endpointType,
                    new ApplicationAdapter(application));
        }
    }
View Full Code Here

                } catch(Exception e) {
                    throw new ServletException(e);
                }
            } else if (Application.class.isAssignableFrom(resourceConfigClass)) {
                try {
                    ResourceConfig rc = new ApplicationAdapter(
                            (Application)resourceConfigClass.newInstance());
                    rc.getProperties().putAll(props);
                    return rc;
                } catch(Exception e) {
                    throw new ServletException(e);
                }
            } else {
View Full Code Here

            throw new IllegalArgumentException();
       
        if (app instanceof ResourceConfig) {
            resourceConfig = (ResourceConfig)app;
        } else {
            resourceConfig = new ApplicationAdapter(app);
        }
    }
View Full Code Here

        if (application instanceof ResourceConfig) {
            return ContainerFactory.createContainer(endpointType,
                    (ResourceConfig)application);
        } else {
            return ContainerFactory.createContainer(endpointType,
                    new ApplicationAdapter(application));
        }
    }
View Full Code Here

    public static final URI BASE_URI = getBaseURI();

    public static HttpServer startServer() throws IOException{
       
        ApplicationAdapter rc = new ApplicationAdapter(new MyApplication());
        rc.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
       
        return GrizzlyServerFactory.createHttpServer(BASE_URI, rc);
    }
View Full Code Here

TOP

Related Classes of com.sun.jersey.api.core.ApplicationAdapter

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.