@Override public void register(Iterable<Binding> bindings) { for (Binding binding : bindings) { this.bindings.bind(binding); } }
private void invokeConfigure() { if (!configured) { configure(); configured = true; } } }
@Override public Collection<Binding> getBindings() { invokeConfigure(); List<Binding> bindings = installed.stream() .flatMap(binder -> Bindings.getBindings(injectionManager, binder).stream()) .collect(Collectors.toList()); bindings.addAll(internalBindings); return bindings; }
@Override public void completeRegistration() throws IllegalStateException { bindings.bind(Bindings.service(this).to(InjectionManager.class)); bindings.install(new ContextInjectionResolverImpl.Binder(this::getBeanManager)); SeContainerInitializer containerInitializer = SeContainerInitializer.newInstance(); containerInitializer.addExtensions(new SeBeanRegisterExtension(bindings)); this.container = containerInitializer.initialize(); this.beanManager = container.getBeanManager(); }
public static Collection<Binding> getBindings(InjectionManager injectionManager, Binder binder) { if (binder instanceof AbstractBinder) { ((AbstractBinder) binder).setInjectionManager(injectionManager); } return binder.getBindings(); }
Collection<Binding> bindings = this.bindings.getBindings();
public static Collection<Binding> getBindings(InjectionManager injectionManager, Binder binder) { if (binder instanceof AbstractBinder) { ((AbstractBinder) binder).setInjectionManager(injectionManager); } return binder.getBindings(); }
/** * Ignores the classes which are manually added using bindings (through {@link Application} class) and scanned by CDI. * The manual adding is privileged and the beans scanned using CDI are ignored. * <p> * TODO: The method counts with the condition that the all bindings are known before the CDI scanning has been started, * can be changed during the migration from CDI SE to JAVA EE environment. * * @param pat processed type. * @param <T> type of the scanned bean. */ public <T> void ignoreManuallyRegisteredComponents( @Observes @WithAnnotations({ Path.class, Provider.class }) ProcessAnnotatedType<T> pat) { for (Binding binding : bindings.getBindings()) { if (ClassBinding.class.isAssignableFrom(binding.getClass())) { ClassBinding<?> classBinding = (ClassBinding<?>) binding; if (pat.getAnnotatedType().getJavaClass() == classBinding.getService()) { pat.veto(); return; } } else if (InstanceBinding.class.isAssignableFrom(binding.getClass())) { InstanceBinding<?> instanceBinding = (InstanceBinding<?>) binding; if (pat.getAnnotatedType().getJavaClass() == instanceBinding.getService().getClass()) { pat.veto(); return; } } } }
@Override public void register(Iterable<Binding> bindings) { for (Binding binding : bindings) { this.bindings.bind(binding); } }
@Override public Collection<Binding> getBindings() { invokeConfigure(); List<Binding> bindings = installed.stream() .flatMap(binder -> Bindings.getBindings(injectionManager, binder).stream()) .collect(Collectors.toList()); bindings.addAll(internalBindings); return bindings; }
private void invokeConfigure() { if (!configured) { configure(); configured = true; } } }
public static Collection<Binding> getBindings(InjectionManager injectionManager, Binder binder) { if (binder instanceof AbstractBinder) { ((AbstractBinder) binder).setInjectionManager(injectionManager); } return binder.getBindings(); }
@Override public void register(Iterable<Binding> bindings) { for (Binding binding : bindings) { this.bindings.bind(binding); } }
@Override public Collection<Binding> getBindings() { invokeConfigure(); List<Binding> bindings = installed.stream() .flatMap(binder -> Bindings.getBindings(injectionManager, binder).stream()) .collect(Collectors.toList()); bindings.addAll(internalBindings); return bindings; }
private void invokeConfigure() { if (!configured) { configure(); configured = true; } } }
public static Collection<Binding> getBindings(InjectionManager injectionManager, Binder binder) { if (binder instanceof AbstractBinder) { ((AbstractBinder) binder).setInjectionManager(injectionManager); } return binder.getBindings(); }
@Override public void register(Binding binding) { bindings.bind(binding); }
@Override public Collection<Binding> getBindings() { invokeConfigure(); List<Binding> bindings = installed.stream() .flatMap(binder -> Bindings.getBindings(injectionManager, binder).stream()) .collect(Collectors.toList()); bindings.addAll(internalBindings); return bindings; }
private void invokeConfigure() { if (!configured) { configure(); configured = true; } } }
@Override public void register(Binder binder) { for (Binding binding : Bindings.getBindings(this, binder)) { bindings.bind(binding); } }