Examples of ResourceConfig


Examples of org.apache.pluto.driver.services.impl.resource.ResourceConfig

    @Override
    public void start(BundleContext bundleContext) throws Exception {
        InputStream in = bundleContext.getBundle().getResource(ResourceConfigReader.CONFIG_FILE).openStream();
        ClassLoader tccl = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(new BundleClassLoader(bundleContext.getBundle()));
        ResourceConfig config;
        try {
            config = new ResourceConfigReader(new BundleClassLoader(bundleContext.getBundle())).parse(in);
        } finally {
            Thread.currentThread().setContextClassLoader(tccl);
        }
View Full Code Here

Examples of org.g4studio.core.resource.support.ResourceConfig

        String mimeType = uriMapping.getMimeType();
        String oldPrefix = uriMapping.getOldPrefix();
        String newPrefix = uriMapping.getNewPrefix();
        boolean cache = uriMapping.isCache();
        String[] hanlderNameArray = StringUtils.tokenizeToStringArray(handlerNames, Constants.SPLITER);
        ResourceConfig result = new ResourceConfig(loaderName, hanlderNameArray, charset, mimeType, oldPrefix,
            newPrefix, cache);
        return result;
      }

    }
View Full Code Here

Examples of org.glassfish.jersey.server.ResourceConfig

    @SuppressWarnings("unchecked")
    private ResourceConfig buildResourceConfig(final boolean enableGzip,
                                               final boolean enableCors,
                                               final Set<Resource> additionalResources) {
        ResourceConfig rc = new ResourceConfig()
                .property(NettyContainer.PROPERTY_BASE_URI, configuration.getRestListenUri())
                .registerClasses(
                        JacksonPropertyExceptionMapper.class,
                        AnyExceptionClassMapper.class,
                        WebApplicationExceptionMapper.class)
                .register(ObjectMapperProvider.class)
                .register(JacksonFeature.class)
                .registerFinder(new PackageNamesScanner(new String[]{
                        "org.graylog2.rest.resources",
                        "org.graylog2.radio.rest.resources",
                        "org.graylog2.shared.rest.resources"
                }, true))
                .registerResources(additionalResources);

        for (Class<? extends ExceptionMapper> exceptionMapper : exceptionMappers) {
            rc.registerClasses(exceptionMapper);
        }

        for (Class<? extends DynamicFeature> dynamicFeatureClass : dynamicFeatures) {
            rc.registerClasses(dynamicFeatureClass);
        }

        for (Class<? extends ContainerResponseFilter> responseFilter : containerResponseFilters) {
            rc.registerClasses(responseFilter);
        }

        if (enableGzip) {
            EncodingFilter.enableFor(rc, GZipEncoder.class);
        }

        if (enableCors) {
            LOG.info("Enabling CORS for REST API");
            rc.register(CORSFilter.class);
        }

        if (LOG.isDebugEnabled()) {
            rc.register(PrintModelProcessor.class);
        }

        return rc;
    }
View Full Code Here

Examples of org.glassfish.jersey.server.ResourceConfig

    @Override
    protected Application configure() {
        this.registry = new MetricRegistry();

        ResourceConfig config = new ResourceConfig();
        config = config.register(new MetricsFeature(this.registry));
        config = config.register(InstrumentedResource.class);

        return config;
    }
View Full Code Here

Examples of org.glassfish.jersey.server.ResourceConfig

        connector.setPort(port);
        return connector;
    }

    private static ServletContainer createJerseyServlet() throws IOException {
        ResourceConfig resourceConfig = new ResourceConfig();
        resourceConfig.register(JacksonFeature.class);

        resourceConfig.register(new ApiResource());

        return new ServletContainer(resourceConfig);
    }
View Full Code Here

Examples of org.glassfish.jersey.server.ResourceConfig

    public ResourceConfig getResourceConfig(Set<Class<?>> classes,
                                            final ServerContext sc,
                                            final ServiceLocator habitat,
                                            final Class<? extends Factory<Ref<Subject>>> subjectReferenceFactory)
            throws EndpointRegistrationException {
        ResourceConfig rc = super.getResourceConfig(classes, sc, habitat, subjectReferenceFactory);
        rc.addClasses(ExceptionFilter.class);
        return rc;
    }
View Full Code Here

Examples of org.glassfish.jersey.server.ResourceConfig

        sslContext.setKeyStoreFile("./keystore_server"); // contains server keypair
        sslContext.setKeyStorePass("asdfgh");
        sslContext.setTrustStoreFile("./truststore_server"); // contains client certificate
        sslContext.setTrustStorePass("asdfgh");

        ResourceConfig rc = new ResourceConfig();
        rc.registerClasses(RootResource.class, SecurityFilter.class, AuthenticationExceptionMapper.class);

        try {
            webServer = GrizzlyHttpServerFactory.createHttpServer(
                    getBaseURI(),
                    rc,
View Full Code Here

Examples of org.glassfish.jersey.server.ResourceConfig

     * @throws TestContainerException if the default test container factory
     *                                cannot be obtained, or the application descriptor is not
     *                                supported by the test container factory.
     */
    public JerseyTest() throws TestContainerException {
        ResourceConfig config = getResourceConfig(configure());
        config.register(new ServiceFinderBinder<TestContainerFactory>(TestContainerFactory.class));

        if (isLogRecordingEnabled()) {
            registerLogHandler();
        }
        this.application = new ApplicationHandler(config);
View Full Code Here

Examples of org.glassfish.jersey.server.ResourceConfig

     *                                supported by the test container factory.
     */
    public JerseyTest(TestContainerFactory testContainerFactory) {
        setTestContainerFactory(testContainerFactory);

        ResourceConfig config = getResourceConfig(configure());
        config.register(new ServiceFinderBinder<TestContainerFactory>(TestContainerFactory.class));
        if (isLogRecordingEnabled()) {
            registerLogHandler();
        }
        this.application = new ApplicationHandler(config);
        this.tc = getContainer(application, testContainerFactory);
View Full Code Here

Examples of org.glassfish.jersey.server.ResourceConfig

     * @throws TestContainerException if the default test container factory
     *                                cannot be obtained, or the application descriptor is not
     *                                supported by the test container factory.
     */
    public JerseyTest(Application jaxrsApplication) throws TestContainerException {
        ResourceConfig config = getResourceConfig(jaxrsApplication);
        config.register(new ServiceFinderBinder<TestContainerFactory>(TestContainerFactory.class));
        if (isLogRecordingEnabled()) {
            registerLogHandler();
        }
        this.application = new ApplicationHandler(config);
        this.tc = getContainer(application, getTestContainerFactory());
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.