Examples of PackagesResourceConfig


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

        server = new Server();
        SelectChannelConnector selectChannelConnector = new SelectChannelConnector();
        selectChannelConnector.setPort(11060);
        server.setConnectors(new Connector[]{selectChannelConnector});

        PackagesResourceConfig packagesResourceConfig = new PackagesResourceConfig("com/ngdata/hbaseindexer/rest");

        ServletHolder servletHolder = new ServletHolder(new ServletContainer(packagesResourceConfig));
        servletHolder.setName("HBase-Indexer");

View Full Code Here

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

    public static final URI BASE_URI = getBaseURI();

    protected static HttpServer startServer() throws IOException {

        ResourceConfig rc = new PackagesResourceConfig("com.sun.jersey.samples.atomserver.resources");

        System.out.println("Starting grizzly...");
        return GrizzlyServerFactory.createHttpServer(BASE_URI, rc);
    }
View Full Code Here

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

    }
    return authFilter;
  }

  public PackagesResourceConfig makeJerseyConfig() {
    PackagesResourceConfig rc
      = new PackagesResourceConfig("org.apache.hive.hcatalog.templeton");
    HashMap<String, Object> props = new HashMap<String, Object>();
    props.put("com.sun.jersey.api.json.POJOMappingFeature", "true");
    props.put("com.sun.jersey.config.property.WadlGeneratorConfig",
      "org.apache.hive.hcatalog.templeton.WadlConfig");
    rc.setPropertiesAndFeatures(props);

    return rc;
  }
View Full Code Here

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

            // use the packages resource config
            String packages = webConfig.getInitParameter(
                    PackagesResourceConfig.PROPERTY_PACKAGES);
            if (packages != null) {
                props.put(PackagesResourceConfig.PROPERTY_PACKAGES, packages);
                return new PackagesResourceConfig(props);
            }

            ResourceConfig defaultConfig = webConfig.getDefaultResourceConfig(props);
            if (defaultConfig != null)
                return defaultConfig;
View Full Code Here

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

            // use the packages resource config
            String packages = webConfig.getInitParameter(
                    PackagesResourceConfig.PROPERTY_PACKAGES);
            if (packages != null) {
                props.put(PackagesResourceConfig.PROPERTY_PACKAGES, packages);
                return new PackagesResourceConfig(props);
            }

            ResourceConfig defaultConfig = webConfig.getDefaultResourceConfig(props);
            if (defaultConfig != null)
                return defaultConfig;
View Full Code Here

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

  public static final URI BASE_URI = getBaseURI();

  protected static HttpServer startServer() throws IOException {
    System.out.println("Starting grizzly...");
    ResourceConfig rc = new PackagesResourceConfig("restful.insecurity.resources");
    HashMap<String, Object> config = new HashMap<String, Object>();
    config.put(FeaturesAndProperties.FEATURE_DISABLE_XML_SECURITY, Boolean.TRUE);
    config.put(FeaturesAndProperties.FEATURE_FORMATTED, Boolean.TRUE);
    rc.setPropertiesAndFeatures(config);
   
    return GrizzlyServerFactory.createHttpServer(BASE_URI, rc);
  }
View Full Code Here

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

            protected void configureServlets() {

                super.configureServlets();

                // Configuring Jersey via Guice:
                ResourceConfig resourceConfig = new PackagesResourceConfig("ngdemo/web");
                for (Class<?> resource : resourceConfig.getClasses()) {
                    bind(resource);
                }

                // hook Jackson into Jersey as the POJO <-> JSON mapper
                bind(JacksonJsonProvider.class).in(Scopes.SINGLETON);
View Full Code Here

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

                // hook Jackson into Jersey as the POJO <-> JSON mapper
                bind(JacksonJsonProvider.class).in(Scopes.SINGLETON);
            }
        });

        ResourceConfig rc = new PackagesResourceConfig("ngdemo.web");
        IoCComponentProviderFactory ioc = new GuiceComponentProviderFactory(rc, injector);
        server = GrizzlyServerFactory.createHttpServer(BASE_URI + "web/", rc, ioc);

        System.out.println(String.format("Jersey app started with WADL available at "
                + "%srest/application.wadl\nTry out %sngdemo\nHit enter to stop it...",
View Full Code Here

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

    public static final URI BASE_URI = getBaseURI();

    public static HttpServer startServer() throws IOException {
       
        final PackagesResourceConfig rc =
                new PackagesResourceConfig(new String[]{
                        BaseResource.class.getPackage().getName(),
                        AuthenticationExceptionMapper.class.getPackage().getName()});
       
        rc.getContainerRequestFilters().add(SecurityFilter.class.getName());
        rc.getResourceFilterFactories().add(RolesAllowedResourceFilterFactory.class.getName());

//        System.out.println("Starting grizzly...");
        return GrizzlyServerFactory.createHttpServer(BASE_URI, rc);
    }
View Full Code Here

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

  public static void main(String[] args) throws IOException {
    Map<String, String> mapArgs = parseArgs(args);
    System.out.println("Starting Ambari API server using the following properties: " + mapArgs);
    System.setProperty("ambariapi.dbfile", mapArgs.get("db"));

    ResourceConfig config = new PackagesResourceConfig("org.apache.ambari.server.api.services");
    System.out.println("Starting server: http://localhost:" + mapArgs.get("port") + '/');
    HttpServer server = HttpServerFactory.create("http://localhost:" + mapArgs.get("port") + '/', config);
    server.start();

    System.out.println("SERVER RUNNING: http://localhost:" + mapArgs.get("port") + '/');
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.