@Override protected void initialize(Config config, Environment env) { CONFIG = config; env.jersey().setUrlPattern("/echo/*"); }
@Override public void run(final ExampleConfiguration configuration, final Environment environment) { // JAX-RS are all under /api environment.jersey().setUrlPattern("/api/*"); // Register each JAX-RS resoruce environment.jersey().register(ProfileResource.class); } }
@Override public void run(ShoppingConfiguration configuration, Environment environment) throws Exception { CartRepository cartRepository = new InMemoryCartRepository(); final Client client = new JerseyClientBuilder(environment).using(configuration.httpClient).build(getName()); ProductCatalogClient productCatalogClient = ProductCatalogClient.create(client, configuration.productCatalogServiceUrl); environment.jersey().register(new CartResource(productCatalogClient, cartRepository)); environment.jersey().setUrlPattern("/service/*"); logger.info("ShoppingApplication started!"); }
private void registerAPIs(Environment environment, DoctorKafka doctorKafka) { environment.jersey().setUrlPattern("/api/*"); environment.jersey().register(new BrokerApi()); environment.jersey().register(new ClusterApi(doctorKafka)); environment.jersey().register(new MaintenanceApi(doctorKafka)); }
@Override public void run(OrderApplicationConfiguration configuration, Environment environment) throws Exception { ObjectMapper objectMapper = environment.getObjectMapper(); objectMapper.enable(INDENT_OUTPUT); objectMapper.enable(WRITE_DATES_AS_TIMESTAMPS); OrderProjectionRepository orderRepository = new InMemOrderProjectionRepository(); DomainEventBus domainEventBus = new GuavaDomainEventBus(); OrderListDenormalizer orderListDenormalizer = domainEventBus.register(new OrderListDenormalizer(orderRepository)); OrdersPerDayAggregator ordersPerDayAggregator = domainEventBus.register(new OrdersPerDayAggregator()); ProductCatalogClient catalogClient = ProductCatalogClient.create(ClientBuilder.newClient(), configuration.productCatalogServiceUrl); DomainEventStore domainEventStore = (DomainEventStore) configuration.eventStore.newInstance(); QueryService queryService = new QueryService(orderListDenormalizer, ordersPerDayAggregator, catalogClient); logger.info("Using eventStore: " + domainEventStore.getClass().getName()); Repository aggregateRepository = new DefaultRepository(domainEventBus, domainEventStore); CommandBus commandBus = GuavaCommandBus.asyncGuavaCommandBus(); commandBus.register(new OrderCommandHandler(aggregateRepository)); commandBus.register(new PublisherContractCommandHandler(aggregateRepository)); // Create and register Sagas PurchaseRegistrationSaga purchaseRegistrationSaga = new PurchaseRegistrationSaga(queryService, commandBus); domainEventBus.register(purchaseRegistrationSaga); environment.jersey().register(new QueryResource(queryService, domainEventStore)); environment.jersey().register(new OrderResource(commandBus)); environment.jersey().register(new PublisherContractResource(commandBus)); environment.jersey().setUrlPattern("/service/*"); environment.admin().addTask(new ReplayEventsTask(domainEventStore, domainEventBus)); configureCors(environment); logger.info("OrderApplication started!"); }
@Override public void run(TexeraWebConfiguration texeraWebConfiguration, Environment environment) throws Exception { environment.jersey().setUrlPattern("/api/*");
jerseyEnvironment.register(LoggingApis.class); jerseyEnvironment.register(binder); jerseyEnvironment.setUrlPattern(jerseyConfig.getUrlPattern()); jerseyEnvironment.register(new JacksonMessageBodyProvider(environment.getObjectMapper()));
@Override public void run(MacroBaseConf configuration, Environment environment) throws Exception { configuration.loadSystemProperties(); environment.jersey().register(new AnalyzeResource(configuration)); environment.jersey().register(new SchemaResource(configuration)); environment.jersey().register(new RowSetResource(configuration)); environment.jersey().register(new FormattedRowSetResource(configuration)); environment.jersey().register(new MultipleRowSetResource(configuration)); environment.healthChecks().register("basic", new HealthCheck() { @Override protected Result check() throws Exception { return null; } }); environment.jersey().setUrlPattern("/api/*"); } }
env.jersey().setUrlPattern(ROOT_PATH);