@Override public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) { ServerBootstrapBag serverBag = (ServerBootstrapBag) bootstrapBag; serverBag.setApplicationHandler(ApplicationHandler.this); serverBag.setConfiguration(ResourceConfig.createRuntimeConfig(serverBag.getApplication())); // TODO: Do we really need these three bindings in DI provider? What JAX-RS specification says? InstanceBinding<ApplicationHandler> handlerBinding = Bindings.service(ApplicationHandler.this) .to(ApplicationHandler.class); InstanceBinding<ResourceConfig> configBinding = Bindings.service(serverBag.getRuntimeConfig()) .to(Configuration.class) .to(ServerConfig.class); injectionManager.register(handlerBinding); injectionManager.register(configBinding); } }
@Override public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) { ServerBootstrapBag serverBag = (ServerBootstrapBag) bootstrapBag; serverBag.setApplicationHandler(ApplicationHandler.this); serverBag.setConfiguration(ResourceConfig.createRuntimeConfig(serverBag.getApplication())); // TODO: Do we really need these three bindings in DI provider? What JAX-RS specification says? InstanceBinding<ApplicationHandler> handlerBinding = Bindings.service(ApplicationHandler.this) .to(ApplicationHandler.class); InstanceBinding<ResourceConfig> configBinding = Bindings.service(serverBag.getRuntimeConfig()) .to(Configuration.class) .to(ServerConfig.class); injectionManager.register(handlerBinding); injectionManager.register(configBinding); } }
@Override public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) { ServerBootstrapBag serverBag = (ServerBootstrapBag) bootstrapBag; serverBag.setApplicationHandler(ApplicationHandler.this); serverBag.setConfiguration(ResourceConfig.createRuntimeConfig(serverBag.getApplication())); // TODO: Do we really need these three bindings in DI provider? What JAX-RS specification says? InstanceBinding<ApplicationHandler> handlerBinding = Bindings.service(ApplicationHandler.this) .to(ApplicationHandler.class); InstanceBinding<ResourceConfig> configBinding = Bindings.service(serverBag.getRuntimeConfig()) .to(Configuration.class) .to(ServerConfig.class); injectionManager.register(handlerBinding); injectionManager.register(configBinding); } }
/** * Create a new Jersey server-side application handler configured by a * {@link Application JAX-RS Application (sub-)class}. * * @param jaxrsApplicationClass JAX-RS {@code Application} (sub-)class that will be * instantiated and used to configure the new Jersey * application handler. */ public ApplicationHandler(final Class<? extends Application> jaxrsApplicationClass) { this.locator = Injections.createLocator(new ServerBinder(null), new ApplicationBinder()); locator.setDefaultClassAnalyzerName(JerseyClassAnalyzer.NAME); final LazyValue<Iterable<ComponentProvider>> componentProviders = getLazyInitializedComponentProviders(locator); this.application = createApplication(jaxrsApplicationClass, componentProviders); this.runtimeConfig = ResourceConfig.createRuntimeConfig(application); this.runtime = Errors.processWithException(new Producer<ServerRuntime>() { @Override public ServerRuntime call() { return initialize(componentProviders.get()); } }); this.containerLifecycleListeners = Providers.getAllProviders(locator, ContainerLifecycleListener.class); }
/** * Create a new Jersey server-side application handler configured by a * {@link Application JAX-RS Application (sub-)class}. * * @param jaxrsApplicationClass JAX-RS {@code Application} (sub-)class that will be * instantiated and used to configure the new Jersey * application handler. */ public ApplicationHandler(final Class<? extends Application> jaxrsApplicationClass) { this.locator = Injections.createLocator(new ServerBinder(null), new ApplicationBinder()); locator.setDefaultClassAnalyzerName(JerseyClassAnalyzer.NAME); final LazyValue<Iterable<ComponentProvider>> componentProviders = getLazyInitializedComponentProviders(locator); this.application = createApplication(jaxrsApplicationClass, componentProviders); this.runtimeConfig = ResourceConfig.createRuntimeConfig(application); this.runtime = Errors.processWithException(new Producer<ServerRuntime>() { @Override public ServerRuntime call() { return initialize(componentProviders.get()); } }); this.containerLifecycleListeners = Providers.getAllProviders(locator, ContainerLifecycleListener.class); }
/** * Create a new Jersey server-side application handler configured by a * {@link Application JAX-RS Application (sub-)class}. * * @param jaxrsApplicationClass JAX-RS {@code Application} (sub-)class that will be * instantiated and used to configure the new Jersey * application handler. */ public ApplicationHandler(final Class<? extends Application> jaxrsApplicationClass) { this.locator = Injections.createLocator(new ServerBinder(null), new ApplicationBinder()); locator.setDefaultClassAnalyzerName(JerseyClassAnalyzer.NAME); final LazyValue<Iterable<ComponentProvider>> componentProviders = getLazyInitializedComponentProviders(locator); this.application = createApplication(jaxrsApplicationClass, componentProviders); this.runtimeConfig = ResourceConfig.createRuntimeConfig(application); this.runtime = Errors.processWithException(new Producer<ServerRuntime>() { @Override public ServerRuntime call() { return initialize(componentProviders.get()); } }); this.containerLifecycleListeners = Providers.getAllProviders(locator, ContainerLifecycleListener.class); }
@Override public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) { ServerBootstrapBag serverBag = (ServerBootstrapBag) bootstrapBag; serverBag.setApplicationHandler(ApplicationHandler.this); serverBag.setConfiguration(ResourceConfig.createRuntimeConfig(serverBag.getApplication())); // TODO: Do we really need these three bindings in DI provider? What JAX-RS specification says? InstanceBinding<ApplicationHandler> handlerBinding = Bindings.service(ApplicationHandler.this) .to(ApplicationHandler.class); InstanceBinding<ResourceConfig> configBinding = Bindings.service(serverBag.getRuntimeConfig()) .to(Configuration.class) .to(ServerConfig.class); injectionManager.register(handlerBinding); injectionManager.register(configBinding); } }
this.runtimeConfig = ResourceConfig.createRuntimeConfig(application);
this.runtimeConfig = ResourceConfig.createRuntimeConfig(application);
this.runtimeConfig = ResourceConfig.createRuntimeConfig(application);