private Object makeInstance( PicoContainer container, Constructor constructor, ComponentMonitor monitor) { long startTime = System.currentTimeMillis(); Constructor constructorToUse = monitor.instantiating(container, IterativeInjector.this, constructor); Object componentInstance; try { componentInstance = newInstance(constructorToUse, null); } catch (InvocationTargetException e) { monitor.instantiationFailed(container, IterativeInjector.this, constructorToUse, e); if (e.getTargetException() instanceof RuntimeException) { throw (RuntimeException) e.getTargetException(); } else if (e.getTargetException() instanceof Error) { throw (Error) e.getTargetException(); } throw new PicoCompositionException(e.getTargetException()); } catch (InstantiationException e) { return caughtInstantiationException(monitor, constructor, e, container); } catch (IllegalAccessException e) { return caughtIllegalAccessException(monitor, constructor, e, container); } monitor.instantiated( container, IterativeInjector.this, constructorToUse, componentInstance, NONE, System.currentTimeMillis() - startTime); return componentInstance; }
public <T> Constructor<T> instantiating( PicoContainer container, ComponentAdapter<T> componentAdapter, Constructor<T> constructor) { out.println(format(ComponentMonitorHelper.INSTANTIATING, ctorToString(constructor))); return delegate.instantiating(container, componentAdapter, constructor); }
public <T> Constructor<T> instantiating( PicoContainer container, ComponentAdapter<T> componentAdapter, Constructor<T> constructor) { return delegate.instantiating(container, componentAdapter, constructor); }