KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > picocontainer > monitors > NullComponentMonitor


1 /*****************************************************************************
2  * Copyright (C) PicoContainer Organization. All rights reserved. *
3  * ------------------------------------------------------------------------- *
4  * The software in this package is published under the terms of the BSD *
5  * style license a copy of which has been included with this distribution in *
6  * the LICENSE.txt file. *
7  * *
8  * Original code by Paul Hammant & Obie Fernandez & Aslak Hellesøy *
9  *****************************************************************************/

10
11 package org.picocontainer.monitors;
12
13 import java.io.Serializable JavaDoc;
14 import java.lang.reflect.Constructor JavaDoc;
15 import java.lang.reflect.Method JavaDoc;
16
17 import org.picocontainer.ComponentMonitor;
18
19 /**
20  * A {@link ComponentMonitor} which does nothing.
21  *
22  * @author Paul Hammant
23  * @author Obie Fernandez
24  * @version $Revision: 2971 $
25  */

26 public class NullComponentMonitor implements ComponentMonitor, Serializable JavaDoc {
27
28     private static NullComponentMonitor instance;
29
30     public void instantiating(Constructor JavaDoc constructor) {
31     }
32
33     public void instantiated(Constructor JavaDoc constructor, long duration) {
34     }
35
36     public void instantiationFailed(Constructor JavaDoc constructor, Exception JavaDoc e) {
37     }
38
39     public void instantiated(Constructor JavaDoc constructor, Object JavaDoc instantiated, Object JavaDoc[] injected, long duration) {
40     }
41
42     public void invoking(Method JavaDoc method, Object JavaDoc instance) {
43     }
44
45     public void invoked(Method JavaDoc method, Object JavaDoc instance, long duration) {
46     }
47
48     public void invocationFailed(Method JavaDoc method, Object JavaDoc instance, Exception JavaDoc e) {
49     }
50
51     public void lifecycleInvocationFailed(Method JavaDoc method, Object JavaDoc instance, RuntimeException JavaDoc cause) {
52     }
53
54     public static synchronized NullComponentMonitor getInstance() {
55         if (instance == null) {
56             instance = new NullComponentMonitor();
57         }
58         return instance;
59     }
60 }
61
Popular Tags