private ObjectCreator<?> getPlan() { if (plan == null) { String description = String.format("Invoking constructor %s (for service '%s')", creatorDescription, resources.getServiceId()); plan = InternalUtils.createConstructorConstructionPlan(resources.getTracker(), resources, createInjectionResources(), logger, description, constructor); } return plan; }
private ObjectCreator<?> getPlan() { if (plan == null) { String description = String.format("Invoking constructor %s (for service '%s')", creatorDescription, resources.getServiceId()); plan = InternalUtils.createConstructorConstructionPlan(resources.getTracker(), resources, createInjectionResources(), logger, description, constructor); } return plan; }
@Override public <T> T autobuild(final Class<T> clazz) { assert clazz != null; final Constructor constructor = InternalUtils.findAutobuildConstructor(clazz); if (constructor == null) { throw new RuntimeException(IOCMessages.noAutobuildConstructor(clazz)); } Map<Class, Object> resourcesMap = CollectionFactory.newMap(); resourcesMap.put(OperationTracker.class, RegistryImpl.this); InjectionResources resources = new MapInjectionResources(resourcesMap); ObjectCreator<T> plan = InternalUtils.createConstructorConstructionPlan(this, this, resources, null, "Invoking " + proxyFactory.getConstructorLocation(constructor).toString(), constructor); return plan.createObject(); }
@Override public <T> T autobuild(final Class<T> clazz) { assert clazz != null; final Constructor constructor = InternalUtils.findAutobuildConstructor(clazz); if (constructor == null) { throw new RuntimeException(IOCMessages.noAutobuildConstructor(clazz)); } Map<Class, Object> resourcesMap = CollectionFactory.newMap(); resourcesMap.put(OperationTracker.class, RegistryImpl.this); InjectionResources resources = new MapInjectionResources(resourcesMap); ObjectCreator<T> plan = InternalUtils.createConstructorConstructionPlan(this, this, resources, null, "Invoking " + proxyFactory.getConstructorLocation(constructor).toString(), constructor); return plan.createObject(); }