1 10 11 package org.picocontainer.monitors; 12 13 import org.picocontainer.ComponentMonitor; 14 import org.picocontainer.PicoLifecycleException; 15 16 import java.lang.reflect.Method ; 17 import java.lang.reflect.Constructor ; 18 import java.io.Serializable ; 19 20 public class DefaultComponentMonitor implements ComponentMonitor, Serializable { 21 22 private static DefaultComponentMonitor instance; 23 24 public void instantiating(Constructor constructor) { 25 } 26 27 public void instantiated(Constructor constructor, long duration) { 28 } 29 30 public void instantiated(Constructor constructor, Object instantiated, Object [] injected, long duration) { 31 } 32 33 public void instantiationFailed(Constructor constructor, Exception e) { 34 } 35 36 public void invoking(Method method, Object instance) { 37 } 38 39 public void invoked(Method method, Object instance, long duration) { 40 } 41 42 public void invocationFailed(Method method, Object instance, Exception e) { 43 } 44 45 public void lifecycleInvocationFailed(Method method, Object instance, RuntimeException cause) { 46 throw new PicoLifecycleException(method, instance, cause); 47 } 48 49 public static synchronized DefaultComponentMonitor getInstance() { 50 if (instance == null) { 51 instance = new DefaultComponentMonitor(); 52 } 53 return instance; 54 } 55 56 57 } 58 | Popular Tags |