Java 类org.glassfish.jersey.server.spring.scope.RequestContextFilter 实例源码

项目:redirector    文件:WebServiceClientHelper.java   
public static HttpServer httpBuilder (String connectionUrl, String profileName) {
    try {
        URL url = new URL(connectionUrl);

        System.setProperty("spring.profiles.active", profileName);
        AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext(SpringAnnotationConfig.class);

        ResourceConfig resourceConfig = new ResourceConfig();
        resourceConfig.register(RequestContextFilter.class);
        resourceConfig.property("contextConfig", annotationConfigApplicationContext);
        resourceConfig.register(RestSupport.class);

        URI baseUri = URI.create(url.getProtocol() + "://" + url.getAuthority());
        return  GrizzlyHttpServerFactory.createHttpServer(baseUri, resourceConfig, false);
    } catch (Exception e) {
        Assert.fail("Could'n parse configfile." + e.getMessage());
    }
    return null;
}
项目:wechat-mall    文件:WechatMallApplication.java   
public WechatMallApplication() {

        String admin = "org.jiumao.wechatMall.admin.resource";
        String mall = "org.jiumao.wechatMall.mall.resource";
        String api = "org.jiumao.wechatMall.api.resource";
        String user = "org.jiumao.wechatMall.user.resource";
        packages(admin, mall, api, user);
        register(RequestContextFilter.class);
        register(JacksonFeature.class);
        register(AppkeyServiceFeature.class);
        register(AuthServiceFeature.class);
        register(LoggingResponseFilter.class);
        register(CORSResponseFilter.class);


    }
项目:redirector    文件:WebServiceClientHelper.java   
public static HttpServer httpBuilder (String connectionUrl) {
    try {
        URL url = new URL(connectionUrl);

        AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext(SpringAnnotationConfig.class);

        ResourceConfig resourceConfig = new ResourceConfig();
        resourceConfig.register(RequestContextFilter.class);
        resourceConfig.property("contextConfig", annotationConfigApplicationContext);
        resourceConfig.register(RestSupport.class);

        URI baseUri = URI.create(url.getProtocol() + "://" + url.getAuthority());
        return  GrizzlyHttpServerFactory.createHttpServer(baseUri, resourceConfig, false);
    } catch (Exception e) {
        Assert.fail("Could'n parse configfile." + e.getMessage());
    }
    return null;
}
项目:java-restful-tutorial    文件:RestJaxRsApplication.java   
/**
 * Register JAX-RS application components.
 */
public RestJaxRsApplication() {

    // register application resources
    this.register(UserResource.class);
    this.register(OrderResource.class);

    // register filters
    register(RequestContextFilter.class);
    //register(LoggingResponseFilter.class);
    //register(CORSResponseFilter.class);

    // register exception mappers
    //register(GenericExceptionMapper.class);
    //register(AppExceptionMapper.class);
    //register(NotFoundExceptionMapper.class);

    // register features
    register(JacksonFeature.class);
    //register(MultiPartFeature.class);
}
项目:Cheddar    文件:RestResourceConfig.java   
@Autowired
public RestResourceConfig(final ApplicationContext applicationContext) {
    property("contextConfig", applicationContext);
    scanner = new ClassPathScanningCandidateComponentProvider(true);
    scanner.resetFilters(false);
    scanner.addIncludeFilter(new AnnotationTypeFilter(Path.class));
    scanner.addIncludeFilter(new AnnotationTypeFilter(Provider.class));
    register(RequestContextFilter.class);
    register(MultiPartFeature.class);
    register(ObjectMapperProvider.class);
    register(JacksonFeature.class);
    registerResources("com.clicktravel.cheddar.rest.exception.mapper", "com.clicktravel.cheddar.server.http.filter",
            "com.clicktravel.cheddar.server.rest.resource.status", "com.clicktravel.services",
            "com.clicktravel.cheddar.rest.body.writer");
    property(ServerProperties.LOCATION_HEADER_RELATIVE_URI_RESOLUTION_DISABLED, true);
}
项目:devicehive-java-server    文件:JerseyConfig.java   
public JerseyConfig() {
    scan("com.devicehive.resource.converters",
            "com.devicehive.resource.exceptions",
            "com.devicehive.resource.filter");

    registerClasses(AuthApiInfoResourceImpl.class,
            JwtTokenResourceImpl.class);

    property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);

    register(RequestContextFilter.class);
    register(LoggingFeature.class);
    register(ContentTypeFilter.class);

    register(io.swagger.jaxrs.listing.ApiListingResource.class);
    register(io.swagger.jaxrs.listing.SwaggerSerializers.class);
}
项目:devicehive-java-server    文件:JerseyConfig.java   
public JerseyConfig() {
    scan("com.devicehive.resource.converters",
            "com.devicehive.resource.exceptions",
            "com.devicehive.resource.filter");

    registerClasses(ApiInfoResourceImpl.class,
            ConfigurationResourceImpl.class,
            DeviceCommandResourceImpl.class,
            DeviceNotificationResourceImpl.class,
            DeviceResourceImpl.class,
            NetworkResourceImpl.class,
            DeviceTypeResourceImpl.class,
            WelcomeResourceImpl.class,
            UserResourceImpl.class);

    property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);

    register(RequestContextFilter.class);
    register(LoggingFeature.class);
    register(ContentTypeFilter.class);

    register(io.swagger.jaxrs.listing.ApiListingResource.class);
    register(io.swagger.jaxrs.listing.SwaggerSerializers.class);
}
项目:devicehive-java-server    文件:JerseyConfig.java   
public JerseyConfig() {
    scan("com.devicehive.resource.converters",
            "com.devicehive.resource.exceptions",
            "com.devicehive.resource.filter");

    registerClasses(PluginApiInfoResourceImpl.class,
            PluginResourceImpl.class);

    property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);

    register(RequestContextFilter.class);
    register(LoggingFeature.class);
    register(ContentTypeFilter.class);

    register(io.swagger.jaxrs.listing.ApiListingResource.class);
    register(io.swagger.jaxrs.listing.SwaggerSerializers.class);
}
项目:factcast    文件:RootDocumentation0Test.java   
@Override
public ResourceConfig configure() {
    ResourceConfig rc = new FactCastRestApplication();
    ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
    rc.property("contextConfig", ctx);

    rc.register(SpringLifecycleListener.class);
    rc.register(RequestContextFilter.class);

    return rc;
}
项目:factcast    文件:EventsDocumentation0Test.java   
@Override
public ResourceConfig configure() {
    ResourceConfig rc = new FactCastRestApplication();
    ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
    rc.property("contextConfig", ctx);

    rc.register(SpringLifecycleListener.class);
    rc.register(RequestContextFilter.class);

    return rc;
}
项目:factcast    文件:TransactionDocumentation0Test.java   
@Override
public ResourceConfig configure() {
    ResourceConfig rc = new FactCastRestApplication();
    ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
    rc.property("contextConfig", ctx);

    rc.register(SpringLifecycleListener.class);
    rc.register(RequestContextFilter.class);

    return rc;
}
项目:jrestless-examples    文件:RequestHandler.java   
public RequestHandler() {
    // configure the application with the resource
    ResourceConfig resourceConfig = new ResourceConfig()
            .register(GatewayFeature.class)
            .register(RequestContextFilter.class)
            .packages("com.jrestless.aws.examples");
    resourceConfig.property("contextConfig", new AnnotationConfigApplicationContext(SpringConfig.class));
    init(resourceConfig);
    start();
}
项目:Todo-Jersey-Spring-MyBatis    文件:MyDemoApplication.java   
/**
* Register JAX-RS application components.
*/  
public MyDemoApplication(){
    register(RequestContextFilter.class);
    register(JacksonFeature.class);     
    //register(LoggingResponseFilter.class);
    register(CORSResponseFilter.class);

       register(EventRestService.class);
       register(UserRestService.class);
       register(AuthenticationRequestFilter.class);
       register(AuthenticationSecurityContext.class);

}
项目:spring-security-jwt    文件:JerseyConfig.java   
public JerseyConfig() {
    // Enable Spring and Jackson support
    register(RequestContextFilter.class);
    register(JacksonObjectMapperConfig.class);

    // Application resources
    register(GreetingsResource.class);
}
项目:agate    文件:JerseyConfiguration.java   
public JerseyConfiguration() {
  register(RequestContextFilter.class);
  packages("org.obiba.agate.web", "org.obiba.jersey", "com.fasterxml.jackson");
  register(LoggingFilter.class);
  register(AuthenticationInterceptor.class);
  register(AuditInterceptor.class);
  // validation errors will be sent to the client
  property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);
}
项目:CloudAtlas    文件:MyApplication.java   
/**
 * Register JAX-RS application components.
 */
public MyApplication () {
    register(RequestContextFilter.class);
    register(JerseyResource.class);
    register(SpringSingletonResource.class);
    register(SpringRequestResource.class);
    register(CustomExceptionMapper.class);

    register(UserResource.class);

}
项目:dohko    文件:ApplicationConfig.java   
/**
 * Register JAX-RS application components.
 */
public ApplicationConfig()
{
    Reflections reflections = new Reflections("org.excalibur");
    RESOURCES = Collections.unmodifiableList(new ArrayList<Class<?>>(reflections.getTypesAnnotatedWith(Path.class)));

    register(RequestContextFilter.class);
    registerResources(RESOURCES);
    registerResources(reflections.getTypesAnnotatedWith(Provider.class));


}
项目:jersey2-spring4-grizzly2    文件:MyDemoApplication.java   
/**
 * Register JAX-RS application components.
 */
public MyDemoApplication() {
    this.register(RequestContextFilter.class);
    this.register(TestResource.class);
    this.register(JacksonFeature.class);
    // Use this for registering a full set of resources.
    // this.packages("org.foo.rest;org.bar.rest");
}
项目:demo-restWS-spring-jersey-jpa2-hibernate    文件:MyDemoApplication.java   
/**
* Register JAX-RS application components.
*/  
public MyDemoApplication(){
    register(RequestContextFilter.class);
    register(PodcastRestService.class);
    register(PodcastLegacyRestService.class);
    register(JacksonFeature.class); 
    register(LoggingResponseFilter.class);
    register(CORSResponseFilter.class);
}
项目:SpringRestDemo    文件:MyDemoApplication.java   
/**
 * Register JAX-RS application components
 */
public MyDemoApplication() {
    register(RequestContextFilter.class);
    register(OrderRestService.class);
    register(JacksonFeature.class);
    register(LoggingResponseFilter.class);
    register(CORSResponseFilter.class);
}
项目:mica2    文件:JerseyConfiguration.java   
public JerseyConfiguration() {
  register(RequestContextFilter.class);
  packages("org.obiba.mica", "org.obiba.jersey", "com.fasterxml.jackson");
  register(LoggingFilter.class);
  register(AuthenticationInterceptor.class);
  register(ConfigurationInterceptor.class);
  register(AuditInterceptor.class);
  register(MultiPartFeature.class);
  // validation errors will be sent to the client
  property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);
}
项目:pegger    文件:JerseyConfig.java   
public JerseyConfig() {
    // Enable Spring DI and Jackson configuration
    register(RequestContextFilter.class);
    register(JacksonObjectMapperConfig.class);

    // Application resources
    register(GameResource.class);
    register(PegResource.class);
    register(ToolResource.class);
}
项目:demo-restWS-spring-jersey-tomcat-mybatis    文件:MyDemoApplication.java   
/**
* Register JAX-RS application components.
*/  
public MyDemoApplication(){
    register(RequestContextFilter.class);
    register(PodcastRestService.class);
    register(JacksonFeature.class);     
    register(LoggingResponseFilter.class);
    register(CORSResponseFilter.class);
}
项目:content-repo    文件:JerseyApplication.java   
/**
 * Register JAX-RS application components.
 */
public JerseyApplication() {
  packages("org.plos.repo.rest");

  register(MultiPartFeature.class);
  register(RequestContextFilter.class);
}
项目:gazpachoquest    文件:ApplicationConfig.java   
public ApplicationConfig() {
    register(RequestContextFilter.class);
    register(RolesAllowedDynamicFeature.class);
    register(Jackson2Feature.class);

    register(AuthorizationRequestFilter.class);
    register(QuestionnairResource.class);
    register(LoggingFilter.class);

    // register(JerseyResource.class);
    // register(SpringSingletonResource.class);
    // register(SpringRequestResource.class);
    // register(CustomExceptionMapper.class);

}
项目:demo-restWS-spring-jersey-tomcat-mybatis    文件:MyDemoApplication.java   
/**
* Register JAX-RS application components.
*/  
public MyDemoApplication(){
    register(RequestContextFilter.class);
    register(PodcastRestService.class);
    register(JacksonFeature.class);     
    register(LoggingResponseFilter.class);
    register(CORSResponseFilter.class);
}
项目:rabbitframework    文件:DefaultApplicationConfig.java   
public DefaultApplicationConfig() {
    super();
    register(RequestContextFilter.class);
    register(ExceptionMapperSupport.class);
    register(XSSFilter.class);
}
项目:GetSocial    文件:JerseyConfig.java   
public JerseyConfig() {
    register(RequestContextFilter.class);
    packages("info.getsocial.rest");
    register(LoggingFilter.class);
}
项目:auth-token    文件:JerseyBootstrap.java   
public JerseyBootstrap() {
register(RequestContextFilter.class);
packages(true, "io.github.tomacla.auth.server.api");
   }
项目:fmek    文件:HelloWorldRestApplication.java   
public HelloWorldRestApplication() {
    register(RequestContextFilter.class);
    register(HelloWorldResource.class);
}
项目:oauth2-provider    文件:RestResourceApplication.java   
public RestResourceApplication() {

        packages("com.porterhead.resource", "com.porterhead.user.resource",
        "com.porterhead.sample");

        register(RequestContextFilter.class);

        ApplicationContext rootCtx = ContextLoader.getCurrentWebApplicationContext();
        ContainerResponseFilter filter = rootCtx.getBean(JerseyCrossOriginResourceSharingFilter.class);
        register(filter);

        register(GenericExceptionMapper.class);
        register(AccessDeniedExceptionMapper.class);

        register(JacksonFeature.class);

    }
项目:auth-token    文件:JerseyBootstrap.java   
public JerseyBootstrap() {

    register(RequestContextFilter.class);

    packages(true, "io.github.tomacla.server.app.api");

    }