KickJava   Java API By Example, From Geeks To Geeks.

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


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 Hammaant *
9  *****************************************************************************/

10
11 package org.picocontainer.monitors;
12
13 import org.picocontainer.ComponentMonitor;
14 import org.picocontainer.PicoLifecycleException;
15
16 import java.lang.reflect.Method JavaDoc;
17 import java.lang.reflect.Constructor JavaDoc;
18 import java.io.Serializable JavaDoc;
19
20 public class DefaultComponentMonitor implements ComponentMonitor, Serializable JavaDoc {
21
22     private static DefaultComponentMonitor instance;
23
24     public void instantiating(Constructor JavaDoc constructor) {
25     }
26
27     public void instantiated(Constructor JavaDoc constructor, long duration) {
28     }
29
30     public void instantiated(Constructor JavaDoc constructor, Object JavaDoc instantiated, Object JavaDoc[] injected, long duration) {
31     }
32
33     public void instantiationFailed(Constructor JavaDoc constructor, Exception JavaDoc e) {
34     }
35
36     public void invoking(Method JavaDoc method, Object JavaDoc instance) {
37     }
38
39     public void invoked(Method JavaDoc method, Object JavaDoc instance, long duration) {
40     }
41
42     public void invocationFailed(Method JavaDoc method, Object JavaDoc instance, Exception JavaDoc e) {
43     }
44
45     public void lifecycleInvocationFailed(Method JavaDoc method, Object JavaDoc instance, RuntimeException JavaDoc 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