001 /***************************************************************************** 002 * Copyright (C) PicoContainer Organization. All rights reserved. * 003 * ------------------------------------------------------------------------- * 004 * The software in this package is published under the terms of the BSD * 005 * style license a copy of which has been included with this distribution in * 006 * the LICENSE.txt file. * 007 * * 008 * Original code by Paul Hammaant * 009 *****************************************************************************/ 010 011 package org.picocontainer.monitors; 012 013 import org.picocontainer.ComponentMonitor; 014 import org.picocontainer.PicoLifecycleException; 015 016 import java.lang.reflect.Method; 017 import java.lang.reflect.Constructor; 018 import java.io.Serializable; 019 020 public class DefaultComponentMonitor implements ComponentMonitor, Serializable { 021 022 private static DefaultComponentMonitor instance; 023 024 public void instantiating(Constructor constructor) { 025 } 026 027 public void instantiated(Constructor constructor, long duration) { 028 } 029 030 public void instantiated(Constructor constructor, Object instantiated, Object[] injected, long duration) { 031 } 032 033 public void instantiationFailed(Constructor constructor, Exception e) { 034 } 035 036 public void invoking(Method method, Object instance) { 037 } 038 039 public void invoked(Method method, Object instance, long duration) { 040 } 041 042 public void invocationFailed(Method method, Object instance, Exception e) { 043 } 044 045 public void lifecycleInvocationFailed(Method method, Object instance, RuntimeException cause) { 046 throw new PicoLifecycleException(method, instance, cause); 047 } 048 049 public static synchronized DefaultComponentMonitor getInstance() { 050 if (instance == null) { 051 instance = new DefaultComponentMonitor(); 052 } 053 return instance; 054 } 055 056 057 }