@Override public Set<Class<?>> getClasses() { return componentBag.getClasses(); }
@Override public Set<Class<?>> getClasses() { return componentBag.getClasses(); }
private void configureExternalObjects(InjectionManager injectionManager) { componentBag.getInstances(model -> ComponentBag.EXTERNAL_ONLY.test(model, injectionManager)) .forEach(injectionManager::register); componentBag.getClasses(model -> ComponentBag.EXTERNAL_ONLY.test(model, injectionManager)) .forEach(injectionManager::register); }
private void configureExternalObjects(InjectionManager injectionManager) { componentBag.getInstances(model -> ComponentBag.EXTERNAL_ONLY.test(model, injectionManager)) .forEach(injectionManager::register); componentBag.getClasses(model -> ComponentBag.EXTERNAL_ONLY.test(model, injectionManager)) .forEach(injectionManager::register); }
componentBag.getClasses(ComponentBag.EXECUTOR_SERVICE_PROVIDER_ONLY).stream() .map(injectionManager::createAndInitialize), componentBag.getInstances(ComponentBag.EXECUTOR_SERVICE_PROVIDER_ONLY).stream()) componentBag.getClasses(ComponentBag.SCHEDULED_EXECUTOR_SERVICE_PROVIDER_ONLY).stream() .map(injectionManager::createAndInitialize), componentBag.getInstances(ComponentBag.SCHEDULED_EXECUTOR_SERVICE_PROVIDER_ONLY).stream())
componentBag.getClasses(ComponentBag.EXECUTOR_SERVICE_PROVIDER_ONLY).stream() .map(injectionManager::createAndInitialize), componentBag.getInstances(ComponentBag.EXECUTOR_SERVICE_PROVIDER_ONLY).stream()) componentBag.getClasses(ComponentBag.SCHEDULED_EXECUTOR_SERVICE_PROVIDER_ONLY).stream() .map(injectionManager::createAndInitialize), componentBag.getInstances(ComponentBag.SCHEDULED_EXECUTOR_SERVICE_PROVIDER_ONLY).stream())
@Override public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) { ServerBootstrapBag serverBag = (ServerBootstrapBag) bootstrapBag; ResourceConfig runtimeConfig = serverBag.getRuntimeConfig(); ComponentBag componentBag = runtimeConfig.getComponentBag(); OptionsMethodProcessor optionsMethodProcessor = new OptionsMethodProcessor(); injectionManager.register(Bindings.service(optionsMethodProcessor).to(ModelProcessor.class)); // Get all model processors, registered as an instance or class List<ModelProcessor> modelProcessors = Stream.concat( componentBag.getClasses(CONTRACT_PROVIDER_MODEL_PROCESSOR_ONLY).stream() .map(injectionManager::createAndInitialize), componentBag.getInstances(CONTRACT_PROVIDER_MODEL_PROCESSOR_ONLY).stream()) .map(CAST_TO_MODEL_PROCESSOR) .collect(Collectors.toList()); modelProcessors.add(optionsMethodProcessor); // model processors registered using binders List<ModelProcessor> modelProcessorsFromBinders = ComponentBag .getFromBinders(injectionManager, componentBag, CAST_TO_MODEL_PROCESSOR, BINDING_MODEL_PROCESSOR_ONLY); modelProcessors.addAll(modelProcessorsFromBinders); serverBag.setModelProcessors(modelProcessors); } }
@Override public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) { ServerBootstrapBag serverBag = (ServerBootstrapBag) bootstrapBag; ResourceConfig runtimeConfig = serverBag.getRuntimeConfig(); ComponentBag componentBag = runtimeConfig.getComponentBag(); OptionsMethodProcessor optionsMethodProcessor = new OptionsMethodProcessor(); injectionManager.register(Bindings.service(optionsMethodProcessor).to(ModelProcessor.class)); // Get all model processors, registered as an instance or class List<ModelProcessor> modelProcessors = Stream.concat( componentBag.getClasses(CONTRACT_PROVIDER_MODEL_PROCESSOR_ONLY).stream() .map(injectionManager::createAndInitialize), componentBag.getInstances(CONTRACT_PROVIDER_MODEL_PROCESSOR_ONLY).stream()) .map(CAST_TO_MODEL_PROCESSOR) .collect(Collectors.toList()); modelProcessors.add(optionsMethodProcessor); // model processors registered using binders List<ModelProcessor> modelProcessorsFromBinders = ComponentBag .getFromBinders(injectionManager, componentBag, CAST_TO_MODEL_PROCESSOR, BINDING_MODEL_PROCESSOR_ONLY); modelProcessors.addAll(modelProcessorsFromBinders); serverBag.setModelProcessors(modelProcessors); } }
Set<Class<?>> classes = new LinkedHashSet<>(componentBag.getClasses(filter)); if (constrainedTo != null) { classes = classes.stream()
Set<Class<?>> classes = new LinkedHashSet<>(componentBag.getClasses(filter)); if (constrainedTo != null) { classes = classes.stream()
componentBag.getClasses(ComponentBag.excludeMetaProviders(injectionManager)).stream() .filter(correctlyConfigured) .collect(Collectors.toSet());
componentBag.getClasses(ComponentBag.excludeMetaProviders(injectionManager)).stream() .filter(correctlyConfigured) .collect(Collectors.toSet());
final Set<Class<?>> providerClasses = componentBag.getClasses(ComponentBag.excludeMetaProviders(injectionManager)); if (!providerClasses.isEmpty()) { injectionManager = Injections.createInjectionManager(injectionManager);
final Set<Class<?>> providerClasses = componentBag.getClasses(ComponentBag.excludeMetaProviders(injectionManager)); if (!providerClasses.isEmpty()) { injectionManager = Injections.createInjectionManager(injectionManager);
@Override public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) { ServerBootstrapBag serverBag = (ServerBootstrapBag) bootstrapBag; ResourceConfig runtimeConfig = serverBag.getRuntimeConfig(); ComponentBag componentBag = runtimeConfig.getComponentBag(); OptionsMethodProcessor optionsMethodProcessor = new OptionsMethodProcessor(); injectionManager.register(Bindings.service(optionsMethodProcessor).to(ModelProcessor.class)); // Get all model processors, registered as an instance or class List<ModelProcessor> modelProcessors = Stream.concat( componentBag.getClasses(CONTRACT_PROVIDER_MODEL_PROCESSOR_ONLY).stream() .map(injectionManager::createAndInitialize), componentBag.getInstances(CONTRACT_PROVIDER_MODEL_PROCESSOR_ONLY).stream()) .map(CAST_TO_MODEL_PROCESSOR) .collect(Collectors.toList()); modelProcessors.add(optionsMethodProcessor); // model processors registered using binders List<ModelProcessor> modelProcessorsFromBinders = ComponentBag .getFromBinders(injectionManager, componentBag, CAST_TO_MODEL_PROCESSOR, BINDING_MODEL_PROCESSOR_ONLY); modelProcessors.addAll(modelProcessorsFromBinders); serverBag.setModelProcessors(modelProcessors); } }
componentBag.getClasses(ComponentBag.excludeMetaProviders(injectionManager)).stream() .filter(correctlyConfigured) .collect(Collectors.toSet());
final Set<Class<?>> providerClasses = componentBag.getClasses(ComponentBag.excludeMetaProviders(injectionManager)); if (!providerClasses.isEmpty()) { injectionManager = Injections.createInjectionManager(injectionManager);
@Override public Set<Class<?>> getClasses() { return componentBag.getClasses(); }
private void configureExternalObjects(InjectionManager injectionManager) { componentBag.getInstances(model -> ComponentBag.EXTERNAL_ONLY.test(model, injectionManager)) .forEach(injectionManager::register); componentBag.getClasses(model -> ComponentBag.EXTERNAL_ONLY.test(model, injectionManager)) .forEach(injectionManager::register); }
private void configureExternalObjects(InjectionManager injectionManager) { componentBag.getInstances(model -> ComponentBag.EXTERNAL_ONLY.test(model, injectionManager)) .forEach(injectionManager::register); componentBag.getClasses(model -> ComponentBag.EXTERNAL_ONLY.test(model, injectionManager)) .forEach(injectionManager::register); }