@SuppressWarnings("unchecked") public Constructor<T>[] run() { return (Constructor<T>[]) getComponentImplementation().getDeclaredConstructors(); } });
@SuppressWarnings("unchecked") public Constructor<T>[] run() { return (Constructor<T>[]) getComponentImplementation().getDeclaredConstructors(); } });
@Override @SuppressWarnings("synthetic-access") public T run(final Object instance) { CtorAndAdapters<T> ctorAndAdapters = getGreediestSatisfiableConstructor(guardedContainer, getComponentImplementation()); ComponentMonitor monitor = currentMonitor(); Constructor<T> ctor = ctorAndAdapters.getConstructor();
throw new PicoCompositionException(conflicts.size() + " satisfiable constructors is too many for '"+getComponentImplementation()+"'. Constructor List:" + conflicts.toString().replace(getComponentImplementation().getName(),"<init>").replace("public <i","<i")); } else if (greediestConstructor == null && !unsatisfiableDependencyTypes.isEmpty()) { throw new UnsatisfiableDependenciesException(this.getComponentImplementation().getName() + " has unsatisfied dependency '" + unsatisfiedDependency + "' for constructor '" + unsatisfiedConstructor + "'" + " from " + container); throw new PicoCompositionException("Either the specified parameters do not match any of the following constructors: " + nonMatching.toString() + "; OR the constructors were not accessible for '" + getComponentImplementation().getName() + "'");
throw new PicoCompositionException(conflicts.size() + " satisfiable constructors is too many for '"+getComponentImplementation()+"'. Constructor List:" + conflicts.toString().replace(getComponentImplementation().getName(),"<init>").replace("public <i","<i")); } else if (greediestConstructor == null && !unsatisfiableDependencyTypes.isEmpty()) { throw new UnsatisfiableDependenciesException(this.getComponentImplementation().getName() + " has unsatisfied dependency '" + unsatisfiedDependency + "' for constructor '" + unsatisfiedConstructor + "'" + " from " + container); throw new PicoCompositionException("Either the specified parameters do not match any of the following constructors: " + nonMatching.toString() + "; OR the constructors were not accessible for '" + getComponentImplementation().getName() + "'");
inst = instantiationGuard.observe(getComponentImplementation(), null); decorate(inst, container); } finally {
inst = instantiationGuard.observe(getComponentImplementation(), null); decorate(inst, container); } finally {
verifyingGuard.observe(getComponentImplementation(), null);
@Override @SuppressWarnings("synthetic-access") public T run(final Object instance) { CtorAndAdapters<T> ctorAndAdapters = getGreediestSatisfiableConstructor(guardedContainer, getComponentImplementation()); ComponentMonitor monitor = currentMonitor(); Constructor<T> ctor = ctorAndAdapters.getConstructor();
verifyingGuard.observe(getComponentImplementation(), null);
private CtorAndAdapters<T> getGreediestSatisfiableConstructor(final PicoContainer guardedContainer, final Class<? extends T> impl) { CtorAndAdapters<T> ctor = null; try { if (chosenConstructor == null) { ctor = getGreediestSatisfiableConstructor(guardedContainer); } if (rememberChosenConstructor) { if (chosenConstructor == null) { chosenConstructor = ctor; } else { ctor = chosenConstructor; } } } catch (AmbiguousComponentResolutionException e) { e.setComponent(getComponentImplementation()); throw e; } return ctor; }
private CtorAndAdapters<T> getGreediestSatisfiableConstructor(final PicoContainer guardedContainer, final Class<? extends T> impl) { CtorAndAdapters<T> ctor = null; try { if (chosenConstructor == null) { ctor = getGreediestSatisfiableConstructor(guardedContainer); } if (rememberChosenConstructor) { if (chosenConstructor == null) { chosenConstructor = ctor; } else { ctor = chosenConstructor; } } } catch (AmbiguousComponentResolutionException e) { e.setComponent(getComponentImplementation()); throw e; } return ctor; }