@Override public <T> ActiveDescriptor<T> addActiveDescriptor(ActiveDescriptor<T> activeDescriptor) throws IllegalArgumentException { return addActiveDescriptor(activeDescriptor, true); }
@Override public <T> ActiveDescriptor<T> addActiveDescriptor(ActiveDescriptor<T> activeDescriptor) throws IllegalArgumentException { return addActiveDescriptor(activeDescriptor, true); }
@Override public <T> ActiveDescriptor<T> addActiveDescriptor(ActiveDescriptor<T> activeDescriptor) throws IllegalArgumentException { return addActiveDescriptor(activeDescriptor, true); }
@Override public <T> ActiveDescriptor<T> addActiveDescriptor(ActiveDescriptor<T> activeDescriptor) throws IllegalArgumentException { return addActiveDescriptor(activeDescriptor, true); }
@Override public <T> FactoryDescriptors addActiveFactoryDescriptor( Class<? extends Factory<T>> rawFactoryClass) throws MultiException, IllegalArgumentException { Collector collector = new Collector(); Utilities.checkFactoryType(rawFactoryClass, collector); collector.throwIfErrors(); final ActiveDescriptor<?> factoryDescriptor = addActiveDescriptor(rawFactoryClass); ActiveDescriptor<?> userMethodDescriptor = Utilities.createAutoFactoryDescriptor(rawFactoryClass, factoryDescriptor, locator); final ActiveDescriptor<?> methodDescriptor = addActiveDescriptor(userMethodDescriptor); return new FactoryDescriptorsImpl(factoryDescriptor, methodDescriptor); }
@Override public <T> FactoryDescriptors addActiveFactoryDescriptor( Class<? extends Factory<T>> rawFactoryClass) throws MultiException, IllegalArgumentException { Collector collector = new Collector(); Utilities.checkFactoryType(rawFactoryClass, collector); collector.throwIfErrors(); final ActiveDescriptor<?> factoryDescriptor = addActiveDescriptor(rawFactoryClass); ActiveDescriptor<?> userMethodDescriptor = Utilities.createAutoFactoryDescriptor(rawFactoryClass, factoryDescriptor, locator); final ActiveDescriptor<?> methodDescriptor = addActiveDescriptor(userMethodDescriptor); return new FactoryDescriptorsImpl(factoryDescriptor, methodDescriptor); }
@Override public <T> FactoryDescriptors addActiveFactoryDescriptor( Class<? extends Factory<T>> rawFactoryClass) throws MultiException, IllegalArgumentException { Collector collector = new Collector(); Utilities.checkFactoryType(rawFactoryClass, collector); collector.throwIfErrors(); final ActiveDescriptor<?> factoryDescriptor = addActiveDescriptor(rawFactoryClass); ActiveDescriptor<?> userMethodDescriptor = Utilities.createAutoFactoryDescriptor(rawFactoryClass, factoryDescriptor, locator); final ActiveDescriptor<?> methodDescriptor = addActiveDescriptor(userMethodDescriptor); return new FactoryDescriptorsImpl(factoryDescriptor, methodDescriptor); }
@Override public <T> FactoryDescriptors addActiveFactoryDescriptor( Class<? extends Factory<T>> rawFactoryClass) throws MultiException, IllegalArgumentException { Collector collector = new Collector(); Utilities.checkFactoryType(rawFactoryClass, collector); collector.throwIfErrors(); final ActiveDescriptor<?> factoryDescriptor = addActiveDescriptor(rawFactoryClass); ActiveDescriptor<?> userMethodDescriptor = Utilities.createAutoFactoryDescriptor(rawFactoryClass, factoryDescriptor, locator); final ActiveDescriptor<?> methodDescriptor = addActiveDescriptor(userMethodDescriptor); return new FactoryDescriptorsImpl(factoryDescriptor, methodDescriptor); }
@Override public <T> ActiveDescriptor<T> addActiveDescriptor(Class<T> rawClass) throws IllegalArgumentException { AutoActiveDescriptor<T> ad = Utilities.createAutoDescriptor(rawClass, locator); checkReifiedDescriptor(ad); ActiveDescriptor<T> retVal = addActiveDescriptor(ad, false); ad.resetSelfDescriptor(retVal); return retVal; }
@Override public <T> ActiveDescriptor<T> addActiveDescriptor(Class<T> rawClass) throws IllegalArgumentException { AutoActiveDescriptor<T> ad = Utilities.createAutoDescriptor(rawClass, locator); checkReifiedDescriptor(ad); ActiveDescriptor<T> retVal = addActiveDescriptor(ad, false); ad.resetSelfDescriptor(retVal); return retVal; }
@Override public <T> ActiveDescriptor<T> addActiveDescriptor(Class<T> rawClass) throws IllegalArgumentException { AutoActiveDescriptor<T> ad = Utilities.createAutoDescriptor(rawClass, locator); checkReifiedDescriptor(ad); ActiveDescriptor<T> retVal = addActiveDescriptor(ad, false); ad.resetSelfDescriptor(retVal); return retVal; }
@Override public <T> ActiveDescriptor<T> addActiveDescriptor(Class<T> rawClass) throws IllegalArgumentException { AutoActiveDescriptor<T> ad = Utilities.createAutoDescriptor(rawClass, locator); checkReifiedDescriptor(ad); ActiveDescriptor<T> retVal = addActiveDescriptor(ad, false); ad.resetSelfDescriptor(retVal); return retVal; }
= newThreeThirtyInjectionResolverDescriptor(locator); config.addActiveDescriptor(threeThirtyResolver); config.addActiveDescriptor(newGuiceInjectionResolverDescriptor( locator, threeThirtyResolver));
= newThreeThirtyInjectionResolverDescriptor(locator); config.addActiveDescriptor(threeThirtyResolver); config.addActiveDescriptor(newGuiceInjectionResolverDescriptor( locator, threeThirtyResolver));
dci.addActiveDescriptor(Utilities.getThreeThirtyDescriptor(sli));
dci.addActiveDescriptor(Utilities.getThreeThirtyDescriptor(sli));
= newThreeThirtyInjectionResolverDescriptor(locator); config.addActiveDescriptor(threeThirtyResolver); config.addActiveDescriptor(newGuiceInjectionResolverDescriptor( locator, threeThirtyResolver));
dci.addActiveDescriptor(Utilities.getThreeThirtyDescriptor(sli));
private ServiceLocator initialize(final String name, final ServiceLocator parent) { if (parent != null && !(parent instanceof ServiceLocatorImpl)) { throw new AssertionError("parent must be a " + ServiceLocatorImpl.class.getName() + " instead it is a " + parent.getClass().getName()); } final ServiceLocatorImpl sli = new ServiceLocatorImpl(name, (ServiceLocatorImpl) parent); final DynamicConfigurationImpl dci = new DynamicConfigurationImpl(sli); // The service locator itself dci.bind(Utilities.getLocatorDescriptor(sli)); // The injection resolver for three thirty dci.addActiveDescriptor(Utilities.getThreeThirtyDescriptor(sli)); // The dynamic configuration utility dci.bind(BuilderHelper.link(DynamicConfigurationServiceImpl.class, false). to(DynamicConfigurationService.class). in(Singleton.class.getName()). localOnly(). build()); dci.bind(BuilderHelper.createConstantDescriptor( new DefaultClassAnalyzer(sli))); dci.commit(); GuiceBridge.getGuiceBridge().initializeGuiceBridge(sli); GuiceIntoHK2Bridge guiceBridge = sli.getService(GuiceIntoHK2Bridge.class); guiceBridge.bridgeGuiceInjector(GuiceInjectorHolder.getInjector()); return sli; }
dci.addActiveDescriptor(Utilities.getThreeThirtyDescriptor(sli));