/** * Load all particular implementations of the type {@code T} using {@link ServiceFinder}. * * @param applicationProperties map containing application properties. May be {@code null} * @return all registered classes of the type {@code T}. */ protected List<Class<T>> loadImplementations(Map<String, Object> applicationProperties) { boolean METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT = false; boolean disableMetaInfServicesLookup = METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT; if (applicationProperties != null) { disableMetaInfServicesLookup = CommonProperties.getValue(applicationProperties, runtimeType, CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE, METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT, Boolean.class); } if (!disableMetaInfServicesLookup) { return Stream.of(ServiceFinder.find(contract, true).toClassArray()) .collect(Collectors.toList()); } return Collections.emptyList(); } }
/** * Load all particular implementations of the type {@code T} using {@link ServiceFinder}. * * @param applicationProperties map containing application properties. May be {@code null} * @return all registered classes of the type {@code T}. */ protected List<Class<T>> loadImplementations(Map<String, Object> applicationProperties) { boolean METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT = false; boolean disableMetaInfServicesLookup = METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT; if (applicationProperties != null) { disableMetaInfServicesLookup = CommonProperties.getValue(applicationProperties, runtimeType, CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE, METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT, Boolean.class); } if (!disableMetaInfServicesLookup) { return Stream.of(ServiceFinder.find(contract, true).toClassArray()) .collect(Collectors.toList()); } return Collections.emptyList(); } }
@Override public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) { ServerBootstrapBag serverBag = (ServerBootstrapBag) bootstrapBag; Class<ExternalRequestScope>[] extScopes = ServiceFinder.find(ExternalRequestScope.class, true).toClassArray(); boolean extScopeBound = false; if (extScopes.length == 1) { for (ComponentProvider p : serverBag.getComponentProviders().get()) { if (p.bind(extScopes[0], Collections.singleton(ExternalRequestScope.class))) { extScopeBound = true; break; } } } else if (extScopes.length > 1) { if (LOGGER.isLoggable(Level.WARNING)) { StringBuilder scopeList = new StringBuilder("\n"); for (Class<ExternalRequestScope> ers : extScopes) { scopeList.append(" ").append(ers.getTypeParameters()[0]).append('\n'); } LOGGER.warning(LocalizationMessages.WARNING_TOO_MANY_EXTERNAL_REQ_SCOPES(scopeList.toString())); } } if (!extScopeBound) { injectionManager.register(new NoopExternalRequestScopeBinder()); } }
@Override public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) { ServerBootstrapBag serverBag = (ServerBootstrapBag) bootstrapBag; Class<ExternalRequestScope>[] extScopes = ServiceFinder.find(ExternalRequestScope.class, true).toClassArray(); boolean extScopeBound = false; if (extScopes.length == 1) { for (ComponentProvider p : serverBag.getComponentProviders().get()) { if (p.bind(extScopes[0], Collections.singleton(ExternalRequestScope.class))) { extScopeBound = true; break; } } } else if (extScopes.length > 1) { if (LOGGER.isLoggable(Level.WARNING)) { StringBuilder scopeList = new StringBuilder("\n"); for (Class<ExternalRequestScope> ers : extScopes) { scopeList.append(" ").append(ers.getTypeParameters()[0]).append('\n'); } LOGGER.warning(LocalizationMessages.WARNING_TOO_MANY_EXTERNAL_REQ_SCOPES(scopeList.toString())); } } if (!extScopeBound) { injectionManager.register(new NoopExternalRequestScopeBinder()); } }
.toClassArray()) { forcedAutoDiscroverables.add(injectionManager.createAndInitialize(forcedADType));
.toClassArray()) { forcedAutoDiscroverables.add(injectionManager.createAndInitialize(forcedADType));
@Override protected void configure() { final boolean METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT = false; boolean disableMetainfServicesLookup = METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT; if (applicationProperties != null) { disableMetainfServicesLookup = CommonProperties.getValue(applicationProperties, runtimeType, CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE, METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT, Boolean.class); } if (!disableMetainfServicesLookup) { for (Class<T> t : ServiceFinder.find(contract, true).toClassArray()) { bind(t).to(contract); } } } }
@Override protected void configure() { final boolean METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT = false; boolean disableMetainfServicesLookup = METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT; if (applicationProperties != null) { disableMetainfServicesLookup = CommonProperties.getValue(applicationProperties, runtimeType, CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE, METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT, Boolean.class); } if (!disableMetainfServicesLookup) { for (Class<T> t : ServiceFinder.find(contract, true).toClassArray()) { bind(t).to(contract); } } } }
@Override public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) { ServerBootstrapBag serverBag = (ServerBootstrapBag) bootstrapBag; Class<ExternalRequestScope>[] extScopes = ServiceFinder.find(ExternalRequestScope.class, true).toClassArray(); boolean extScopeBound = false; if (extScopes.length == 1) { for (ComponentProvider p : serverBag.getComponentProviders().get()) { if (p.bind(extScopes[0], Collections.singleton(ExternalRequestScope.class))) { extScopeBound = true; break; } } } else if (extScopes.length > 1) { if (LOGGER.isLoggable(Level.WARNING)) { StringBuilder scopeList = new StringBuilder("\n"); for (Class<ExternalRequestScope> ers : extScopes) { scopeList.append(" ").append(ers.getTypeParameters()[0]).append('\n'); } LOGGER.warning(LocalizationMessages.WARNING_TOO_MANY_EXTERNAL_REQ_SCOPES(scopeList.toString())); } } if (!extScopeBound) { injectionManager.register(new NoopExternalRequestScopeBinder()); } }
/** * Load all particular implementations of the type {@code T} using {@link ServiceFinder}. * * @param applicationProperties map containing application properties. May be {@code null} * @return all registered classes of the type {@code T}. */ protected List<Class<T>> loadImplementations(Map<String, Object> applicationProperties) { boolean METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT = false; boolean disableMetaInfServicesLookup = METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT; if (applicationProperties != null) { disableMetaInfServicesLookup = CommonProperties.getValue(applicationProperties, runtimeType, CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE, METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT, Boolean.class); } if (!disableMetaInfServicesLookup) { return Stream.of(ServiceFinder.find(contract, true).toClassArray()) .collect(Collectors.toList()); } return Collections.emptyList(); } }
/** * Load all particular implementations of the type {@code T} using {@link ServiceFinder}. * * @param applicationProperties map containing application properties. May be {@code null} * @return all registered classes of the type {@code T}. */ protected List<Class<T>> loadImplementations(Map<String, Object> applicationProperties) { boolean METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT = false; boolean disableMetaInfServicesLookup = METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT; if (applicationProperties != null) { disableMetaInfServicesLookup = CommonProperties.getValue(applicationProperties, runtimeType, CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE, METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT, Boolean.class); } if (!disableMetaInfServicesLookup) { return Stream.of(ServiceFinder.find(contract, true).toClassArray()) .collect(Collectors.toList()); } return Collections.emptyList(); } }
.toClassArray()) { forcedAutoDiscroverables.add(injectionManager.createAndInitialize(forcedADType));
@Override public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) { ServerBootstrapBag serverBag = (ServerBootstrapBag) bootstrapBag; Class<ExternalRequestScope>[] extScopes = ServiceFinder.find(ExternalRequestScope.class, true).toClassArray(); boolean extScopeBound = false; if (extScopes.length == 1) { for (ComponentProvider p : serverBag.getComponentProviders().get()) { if (p.bind(extScopes[0], Collections.singleton(ExternalRequestScope.class))) { extScopeBound = true; break; } } } else if (extScopes.length > 1) { if (LOGGER.isLoggable(Level.WARNING)) { StringBuilder scopeList = new StringBuilder("\n"); for (Class<ExternalRequestScope> ers : extScopes) { scopeList.append(" ").append(ers.getTypeParameters()[0]).append('\n'); } LOGGER.warning(LocalizationMessages.WARNING_TOO_MANY_EXTERNAL_REQ_SCOPES(scopeList.toString())); } } if (!extScopeBound) { injectionManager.register(new NoopExternalRequestScopeBinder()); } }
.toClassArray()) { forcedAutoDiscroverables.add(injectionManager.createAndInitialize(forcedADType));
.toClassArray()) { forcedAutoDiscroverables.add(locator.createAndInitialize(forcedADType));
@Override protected void configure() { final boolean METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT = false; boolean disableMetainfServicesLookup = METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT; if (applicationProperties != null) { disableMetainfServicesLookup = CommonProperties.getValue(applicationProperties, runtimeType, CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE, METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT, Boolean.class); } if (!disableMetainfServicesLookup) { for (Class<T> t : ServiceFinder.find(contract, true).toClassArray()) { bind(t).to(contract); } } } }
@Override protected void configure() { final boolean METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT = false; boolean disableMetainfServicesLookup = METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT; if (applicationProperties != null) { disableMetainfServicesLookup = CommonProperties.getValue(applicationProperties, runtimeType, CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE, METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT, Boolean.class); } if (!disableMetainfServicesLookup) { for (Class<T> t : ServiceFinder.find(contract, true).toClassArray()) { bind(t).to(contract); } } } }
@Override protected void configure() { final boolean METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT = false; boolean disableMetainfServicesLookup = METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT; if (applicationProperties != null) { disableMetainfServicesLookup = CommonProperties.getValue(applicationProperties, runtimeType, CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE, METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT, Boolean.class); } if (!disableMetainfServicesLookup) { for (Class<T> t : ServiceFinder.find(contract, true).toClassArray()) { bind(t).to(contract); } } } }
@Override protected void configure() { final boolean METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT = false; boolean disableMetainfServicesLookup = METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT; if (applicationProperties != null) { disableMetainfServicesLookup = CommonProperties.getValue(applicationProperties, runtimeType, CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE, METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT, Boolean.class); } if (!disableMetainfServicesLookup) { for (Class<T> t : ServiceFinder.find(contract, true).toClassArray()) { bind(t).to(contract); } } } }
@Override protected void configure() { final boolean METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT = false; boolean disableMetainfServicesLookup = METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT; if (applicationProperties != null) { disableMetainfServicesLookup = CommonProperties.getValue(applicationProperties, runtimeType, CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE, METAINF_SERVICES_LOOKUP_DISABLE_DEFAULT, Boolean.class); } if (!disableMetainfServicesLookup) { for (Class<T> t : ServiceFinder.find(contract, true).toClassArray()) { bind(t).to(contract); } } } }