/** * @author Arun Gupta */ @ApplicationPath("webresources") public class MyApplication extends Application { }
/** * @author Arun Gupta */ @ApplicationPath("webresources") public class MyApplication extends Application { }
/** * @author Arun Gupta */ @javax.ws.rs.ApplicationPath("webresources") public class MyApplication extends Application { }
/** * @author Arun Gupta */ @ApplicationPath("webresources") public class MyApplication extends Application { }
/** * @author Arun Gupta */ @ApplicationPath("webresources") public class MyApplication extends Application { }
/** * @author Arun Gupta */ @ApplicationPath("webresources") public class MyApplication extends Application { }
@ApplicationPath("/nottraced") public static class App extends Application { @Override public Set<Object> getSingletons() { return Collections.singleton(new Resource()); } }
@ApplicationPath("/unsampled") public static class Unsampled extends Application { @Override public Set<Object> getSingletons() { return new LinkedHashSet<>(asList(new Resource(), TracingApplicationEventListener.create( HttpTracing.create(Tracing.newBuilder() .sampler(Sampler.NEVER_SAMPLE) .spanReporter(Reporter.NOOP) .build()) ))); } }
@ApplicationPath("/traced") public static class TracedApp extends Application { @Override public Set<Object> getSingletons() { return new LinkedHashSet<>(asList(new Resource(), TracingApplicationEventListener.create( HttpTracing.create(Tracing.newBuilder().spanReporter(Reporter.NOOP).build()) ))); } }
@ApplicationPath("/") public static class App extends Application { @Override public Set<Object> getSingletons() { return Collections.singleton(new Resource()); } }
@ApplicationPath("/traced128") public static class Traced128App extends Application { @Override public Set<Object> getSingletons() { return new LinkedHashSet<>(asList(new Resource(), TracingApplicationEventListener.create( HttpTracing.create(Tracing.newBuilder() .traceId128Bit(true) .spanReporter(Reporter.NOOP) .build()) ))); } }
/** * JAX-RS Application subclass, defines the test application resources. * * @author Adam Lindenthal (adam.lindenthal at oracle.com) */ @ApplicationPath("/*") public class MyApplication extends Application { @Override public Set<Class<?>> getClasses() { final Set<Class<?>> classes = new HashSet<>(); classes.add(MethodInjectionResource.class); classes.add(ConstructorInjectionResource.class); classes.add(FieldInjectionResource.class); classes.add(ApplicationScopedResource.class); return classes; } }
@ApplicationPath("") public class DRPCApplication extends Application { private static DRPC _drpc; private static StormMetricsRegistry metricsRegistry; private final Set<Object> singletons = new HashSet<Object>(); /** * Constructor. * Creates new instance of DRPCResource, DRPCExceptionMapper and AuthorizationExceptionMapper * and adds them to a set which can be retrieved later. */ public DRPCApplication() { singletons.add(new DRPCResource(_drpc, metricsRegistry)); singletons.add(new DRPCExceptionMapper()); singletons.add(new AuthorizationExceptionMapper()); } @Override public Set<Object> getSingletons() { return singletons; } public static void setup(DRPC drpc, StormMetricsRegistry metricsRegistry) { _drpc = drpc; DRPCApplication.metricsRegistry = metricsRegistry; } }
/** * Entity Data Filtering application. * * @author Michal Gajdos */ @ApplicationPath("/") public class EntityFilteringApplication extends ResourceConfig { public EntityFilteringApplication() { // Register all resources present under the package. packages("org.glassfish.jersey.examples.entityfiltering"); // Entity Data Filtering feature. register(EntityFilteringFeature.class); // Configure MOXy Json provider. Comment this line to use Jackson. Uncomment to use MOXy. register(new MoxyJsonConfig().setFormattedOutput(true).resolver()); // Configure Jackson Json provider. Comment this line to use MOXy. Uncomment to use Jackson. // register(JacksonFeature.class); } }
/** * Entity Data Filtering application using security annotations. * * @author Michal Gajdos */ @ApplicationPath("/") public class SecurityEntityFilteringApplication extends ResourceConfig { public SecurityEntityFilteringApplication() { // Register all resources present under the package. packages("org.glassfish.jersey.examples.entityfiltering.security"); // Register entity-filtering security feature. register(SecurityEntityFilteringFeature.class); // Configure MOXy Json provider. Comment this line to use Jackson. Uncomment to use MOXy. register(new MoxyJsonConfig().setFormattedOutput(true).resolver()); // Configure Jackson Json provider. Comment this line to use MOXy. Uncomment to use Jackson. // register(JacksonFeature.class); } }
@ApplicationPath("/tracedextra") public static class TracedExtraApp extends Application { @Override public Set<Object> getSingletons() { return new LinkedHashSet<>(asList(new Resource(), TracingApplicationEventListener.create( HttpTracing.create(Tracing.newBuilder() .propagationFactory(ExtraFieldPropagation.newFactoryBuilder(B3Propagation.FACTORY) .addField("x-vcap-request-id") .addPrefixedFields("baggage-", asList("country-code", "user-id")) .build() ) .spanReporter(Reporter.NOOP) .build()) ))); } }
/** * Entity Data Filtering application using request parameters. * * @author Andy Pemberton (pembertona at gmail.com) * @author Michal Gajdos */ @ApplicationPath("/") public class SelectableEntityFilteringApplication extends ResourceConfig { public SelectableEntityFilteringApplication() { // Register all resources present under the package. packages("org.glassfish.jersey.examples.entityfiltering.selectable"); // Register entity-filtering selectable feature. register(SelectableEntityFilteringFeature.class); property(SelectableEntityFilteringFeature.QUERY_PARAM_NAME, "select"); // Configure MOXy Json provider. Comment this line to use Jackson. Uncomment to use MOXy. register(new MoxyJsonConfig().setFormattedOutput(true).resolver()); // Configure Jackson Json provider. Comment this line to use MOXy. Uncomment to use Jackson. // register(JacksonFeature.class); } }
@ApplicationPath("") public class LogviewerApplication extends Application { private static Map<String, Object> stormConf;
@ApplicationPath("") public final class OryxApplication extends Application {
@ApplicationPath("/") public class FakeElasticSearchRESTApplication extends Application { private List<String> responseCollector; public FakeElasticSearchRESTApplication(List<String> responseCollector) { this.responseCollector = responseCollector; } @Override public Set<Class<?>> getClasses() { return new HashSet<Class<?>>(); } @Override public Set<Object> getSingletons() { Set<Object> objects = new HashSet<Object>(); objects.add(new FakeElasticsearchRESTResource(responseCollector)); return objects; } }