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> void instantiated( PicoContainer container, ComponentAdapter<T> componentAdapter, Constructor<T> constructor, Object instantiated, Object[] parameters, long duration) { delegate.instantiated( container, componentAdapter, constructor, instantiated, parameters, duration); }
public <T> void instantiated( PicoContainer container, ComponentAdapter<T> componentAdapter, Constructor<T> constructor, Object instantiated, Object[] injected, long duration) { out.println( format( ComponentMonitorHelper.INSTANTIATED, ctorToString(constructor), duration, instantiated.getClass().getName(), parmsToString(injected))); delegate.instantiated( container, componentAdapter, constructor, instantiated, injected, duration); }