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 Hammant & Obie Fernandez & Aslak Hellesøy * 009 *****************************************************************************/ 010 011 package org.picocontainer.monitors; 012 013 import java.io.Serializable; 014 import java.lang.reflect.Constructor; 015 import java.lang.reflect.Method; 016 017 import org.picocontainer.ComponentMonitor; 018 019 /** 020 * A {@link ComponentMonitor} which does nothing. 021 * 022 * @author Paul Hammant 023 * @author Obie Fernandez 024 * @version $Revision: 2971 $ 025 */ 026 public class NullComponentMonitor implements ComponentMonitor, Serializable { 027 028 private static NullComponentMonitor instance; 029 030 public void instantiating(Constructor constructor) { 031 } 032 033 public void instantiated(Constructor constructor, long duration) { 034 } 035 036 public void instantiationFailed(Constructor constructor, Exception e) { 037 } 038 039 public void instantiated(Constructor constructor, Object instantiated, Object[] injected, long duration) { 040 } 041 042 public void invoking(Method method, Object instance) { 043 } 044 045 public void invoked(Method method, Object instance, long duration) { 046 } 047 048 public void invocationFailed(Method method, Object instance, Exception e) { 049 } 050 051 public void lifecycleInvocationFailed(Method method, Object instance, RuntimeException cause) { 052 } 053 054 public static synchronized NullComponentMonitor getInstance() { 055 if (instance == null) { 056 instance = new NullComponentMonitor(); 057 } 058 return instance; 059 } 060 }