@Override public <T> ActiveDescriptor<T> addActiveDescriptor(ActiveDescriptor<T> activeDescriptor, boolean requiresDeepCopy) throws IllegalArgumentException { checkState(); checkDescriptor(activeDescriptor); if (!activeDescriptor.isReified()) { throw new IllegalArgumentException(); } checkReifiedDescriptor(activeDescriptor); SystemDescriptor<T> retVal = new SystemDescriptor<T>(activeDescriptor, requiresDeepCopy, locator, locator.getNextServiceId()); allDescriptors.add(retVal); return retVal; }
@Override public <T> ActiveDescriptor<T> addActiveDescriptor(ActiveDescriptor<T> activeDescriptor, boolean requiresDeepCopy) throws IllegalArgumentException { checkState(); checkDescriptor(activeDescriptor); if (!activeDescriptor.isReified()) { throw new IllegalArgumentException(); } checkReifiedDescriptor(activeDescriptor); SystemDescriptor<T> retVal = new SystemDescriptor<T>(activeDescriptor, requiresDeepCopy, locator, locator.getNextServiceId()); allDescriptors.add(retVal); return retVal; }
/* package */ FactoryCreator(ServiceLocator locator, ActiveDescriptor<?> factoryDescriptor) { this.locator = locator; this.factoryDescriptor = factoryDescriptor; if (!factoryDescriptor.isReified()) { factoryDescriptor = locator.reifyDescriptor(factoryDescriptor); } InstantiationServiceImpl found = null; for (Injectee factoryInjectee : factoryDescriptor.getInjectees()) { if (InstantiationService.class.equals(factoryInjectee.getRequiredType())) { found = locator.getService(InstantiationServiceImpl.class); break; } } // Will ONLY be non-null if the factory has injected the InstantiationService instantiationService = found; }
/* package */ FactoryCreator(ServiceLocator locator, ActiveDescriptor<?> factoryDescriptor) { this.locator = locator; this.factoryDescriptor = factoryDescriptor; if (!factoryDescriptor.isReified()) { factoryDescriptor = locator.reifyDescriptor(factoryDescriptor); } InstantiationServiceImpl found = null; for (Injectee factoryInjectee : factoryDescriptor.getInjectees()) { if (InstantiationService.class.equals(factoryInjectee.getRequiredType())) { found = locator.getService(InstantiationServiceImpl.class); break; } } // Will ONLY be non-null if the factory has injected the InstantiationService instantiationService = found; }
@Override public <T> ActiveDescriptor<T> addActiveDescriptor(ActiveDescriptor<T> activeDescriptor, boolean requiresDeepCopy) throws IllegalArgumentException { checkState(); checkDescriptor(activeDescriptor); if (!activeDescriptor.isReified()) { throw new IllegalArgumentException(); } checkReifiedDescriptor(activeDescriptor); SystemDescriptor<T> retVal = new SystemDescriptor<T>(activeDescriptor, requiresDeepCopy, locator, locator.getNextServiceId()); allDescriptors.add(retVal); return retVal; }
/* package */ FactoryCreator(ServiceLocator locator, ActiveDescriptor<?> factoryDescriptor) { this.locator = locator; this.factoryDescriptor = factoryDescriptor; if (!factoryDescriptor.isReified()) { factoryDescriptor = locator.reifyDescriptor(factoryDescriptor); } InstantiationServiceImpl found = null; for (Injectee factoryInjectee : factoryDescriptor.getInjectees()) { if (InstantiationService.class.equals(factoryInjectee.getRequiredType())) { found = locator.getService(InstantiationServiceImpl.class); break; } } // Will ONLY be non-null if the factory has injected the InstantiationService instantiationService = found; }
/* package */ FactoryCreator(ServiceLocator locator, ActiveDescriptor<?> factoryDescriptor) { this.locator = locator; this.factoryDescriptor = factoryDescriptor; if (!factoryDescriptor.isReified()) { factoryDescriptor = locator.reifyDescriptor(factoryDescriptor); } InstantiationServiceImpl found = null; for (Injectee factoryInjectee : factoryDescriptor.getInjectees()) { if (InstantiationService.class.equals(factoryInjectee.getRequiredType())) { found = locator.getService(InstantiationServiceImpl.class); break; } } // Will ONLY be non-null if the factory has injected the InstantiationService instantiationService = found; }
@Override public <T> ActiveDescriptor<T> addActiveDescriptor(ActiveDescriptor<T> activeDescriptor, boolean requiresDeepCopy) throws IllegalArgumentException { checkState(); checkDescriptor(activeDescriptor); if (!activeDescriptor.isReified()) { throw new IllegalArgumentException(); } checkReifiedDescriptor(activeDescriptor); SystemDescriptor<T> retVal = new SystemDescriptor<T>(activeDescriptor, requiresDeepCopy, locator, locator.getNextServiceId()); allDescriptors.add(retVal); return retVal; }
boolean serviceActive; if (!root.isReified()) return;
public Class getClassForFullName(String configBeanClassName) { ActiveDescriptor<?> descriptor = serviceLocator.getBestDescriptor(BuilderHelper.createContractFilter(configBeanClassName)); if (descriptor != null) { if (!descriptor.isReified()) { descriptor = serviceLocator.reifyDescriptor(descriptor); } return getClassFromDescriptor(descriptor); } else { descriptor = serviceLocator.getBestDescriptor(BuilderHelper.createContractFilter(configBeanClassName + "Injector")); if (!descriptor.isReified()) { descriptor = serviceLocator.reifyDescriptor(descriptor); } ConfigInjector injector = (ConfigInjector) serviceLocator.getServiceHandle(descriptor).getService(); return getClassFromInjector(injector); } }
if (active.isReified()) { activeDescriptor = active; reified = true;
if (active.isReified()) { activeDescriptor = active; reified = true;
if (active.isReified()) { activeDescriptor = active; reified = true;
if (active.isReified()) { activeDescriptor = active; reified = true;
boolean serviceActive; if (!root.isReified()) return;
boolean serviceActive; if (!root.isReified()) return;
if (active.isReified()) return active;
if (active.isReified()) return active;
if (active.isReified()) return active;
if (active.isReified()) return active;