KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > monitor > callflow > Listener


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * Listener.java
26  * $Id: Listener.java,v 1.4 2005/12/25 04:10:35 tcfujii Exp $
27  * $Date: 2005/12/25 04:10:35 $
28  * $Revision: 1.4 $
29  */

30
31 package com.sun.enterprise.admin.monitor.callflow;
32
33 /**
34  * This interface exposes the call flow Listener API.
35  *
36  * This interface is implemented by listeners that are registered with the
37  * call flow agent, in order to receive the call flow trap point notifications.
38  *
39  * Note 1: There are no ordering guaratees for the various notifications.
40  *
41  * Note 2: A listener implementation must be stateless. This is allow the
42  * listener to be accessed concurrently by multiple threads, and yet avoid
43  * synchronization overhead associated with protected access to shared state,
44  * in a multi-threaded environment.
45  *
46  * Note 3: It is also imperative that the listener implementation is
47  * light-weight, and avoids time consuming operations such as disk access,
48  * logging, synchronization locks, et cetera. This will ensure that the
49  * listener does not negatively impact the performance of the
50  * application thread.
51  *
52  * @author Ram Jeyaraman
53  * @date October 11, 2005
54  */

55 public interface Listener {
56
57     /**
58      * This notification indicates that a request is being started.
59      *
60      * Allowed request types are:
61      *
62      * 1. Remote HTTP Web request.
63      * 2. Remote EJB request.
64      * 3. MDB request.
65      * 4. Timer EJB.
66      *
67      * @param requestType Type of the request.
68      *
69      * @param callerIPAddress Client host IP address of caller.
70      */

71     public void requestStart(
72             final String JavaDoc requestId, final RequestType requestType,
73             final String JavaDoc callerIPAddress, final String JavaDoc remoteUser);
74     
75     /**
76      * This notification indicates that a request is about to complete.
77      */

78     public void requestEnd(final String JavaDoc requestId);
79
80     /**
81      * This notification indicates that an EJB method is about to be invoked.
82      *
83      * This parameters provide information such as method name, component
84      * name, component type, application name, module name, caller principal.
85      */

86     public void ejbMethodStart(
87             final String JavaDoc requestId, final String JavaDoc methodName,
88             final String JavaDoc applicationName, final String JavaDoc moduleName,
89             final String JavaDoc componentName, final ComponentType componentType,
90             final String JavaDoc callerPrincipal, final String JavaDoc transactionId);
91     
92     /**
93      * This notification indicates that an EJB method has completed. The
94      * parameters provide information on the outcome of the invocation
95      * such as exception, if any.
96      */

97     public void ejbMethodEnd(final String JavaDoc requestId, final Throwable JavaDoc exception);
98     
99     /**
100      * This notification indicates that a web method is about to be invoked.
101      *
102      * This parameters provide information such as method name, component
103      * name, component type, application name, module name, caller principal,
104      * and caller IP address.
105      */

106     public void webMethodStart(
107             final String JavaDoc requestId, final String JavaDoc methodName,
108             final String JavaDoc applicationName, final String JavaDoc moduleName,
109             final String JavaDoc componentName, final ComponentType componentType,
110             final String JavaDoc callerPrincipal);
111     
112     /**
113      * This notification indicates that a web method has completed. The
114      * parameters provide information on the outcome of the invocation
115      * such as exception, if any.
116      */

117     public void webMethodEnd(final String JavaDoc requestId, final Throwable JavaDoc exception);
118 }
119
Popular Tags