KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > management > monitor > CallFlowMonitorImpl


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 package com.sun.enterprise.management.monitor;
25
26 import java.util.Map JavaDoc;
27 import java.util.HashMap JavaDoc;
28 import java.util.List JavaDoc;
29 import java.util.Collections JavaDoc;
30
31 import com.sun.appserv.management.base.XTypes;
32 import com.sun.appserv.management.monitor.CallFlowMonitor;
33 import com.sun.enterprise.admin.monitor.callflow.Agent;
34 import com.sun.enterprise.Switch;
35 /**
36     @see CallFlowMonitor
37 */

38 public final class CallFlowMonitorImpl extends MonitoringImplBase
39     //implements CallFlowMonitor
40
{
41     private boolean mCallFlowEnabled;
42     
43     public CallFlowMonitorImpl()
44     {
45         super( XTypes.CALL_FLOW_MONITOR );
46         mCallFlowEnabled = false;
47             
48     }
49               
50     public boolean getEnabled() {
51         return mCallFlowEnabled;
52     }
53
54     public void setEnabled(final boolean enabled) {
55         final Agent callflowAgent = Switch.getSwitch().getCallFlowAgent();
56         callflowAgent.setEnable(enabled);
57         mCallFlowEnabled = callflowAgent.isEnabled ();
58     }
59     
60
61     public void clearData (){
62         final Agent callflowAgent = Switch.getSwitch().getCallFlowAgent();
63         callflowAgent.clearData();
64     }
65     
66     public boolean deleteRequestIDs (String JavaDoc[] requestId){
67         final Agent callflowAgent = Switch.getSwitch().getCallFlowAgent();
68         return callflowAgent.deleteRequestIds(requestId);
69     }
70     public List JavaDoc<Map JavaDoc<String JavaDoc, String JavaDoc>> queryRequestInformation (){
71         Agent callflowAgent = Switch.getSwitch().getCallFlowAgent();
72         return callflowAgent.getRequestInformation ();
73     }
74
75     public List JavaDoc<Map JavaDoc<String JavaDoc, String JavaDoc>> queryCallStackForRequest(String JavaDoc rid){
76         Agent callflowAgent = Switch.getSwitch().getCallFlowAgent();
77         return callflowAgent.getCallStackForRequest (rid);
78     }
79     
80
81     public Map JavaDoc<String JavaDoc, String JavaDoc> queryPieInformation (String JavaDoc rid){
82         Agent callflowAgent = Switch.getSwitch().getCallFlowAgent();
83         return callflowAgent.getPieInformation(rid);
84     }
85
86     public String JavaDoc getCallerIPFilter (){
87         Agent callflowAgent = Switch.getSwitch().getCallFlowAgent();
88         return callflowAgent.getCallerIPFilter();
89     }
90     
91     public void setCallerIPFilter(String JavaDoc filter) {
92         Agent callflowAgent = Switch.getSwitch().getCallFlowAgent();
93         callflowAgent.setCallerIPFilter(filter);
94     }
95     public String JavaDoc getCallerPrincipalFilter() {
96         Agent callflowAgent = Switch.getSwitch().getCallFlowAgent();
97         return callflowAgent.getCallerPrincipalFilter();
98     }
99     
100     public void setCallerPrincipalFilter(String JavaDoc filter) {
101         Agent callflowAgent = Switch.getSwitch().getCallFlowAgent();
102         callflowAgent.setCallerPrincipalFilter(filter);
103     }
104     
105     public String JavaDoc[] queryRequestTypeKeys (){
106         String JavaDoc[] requestType =
107             {
108             CallFlowMonitor.REMOTE_ASYNC_MESSAGE,
109             CallFlowMonitor.REMOTE_EJB,
110             CallFlowMonitor.REMOTE_WEB,
111             CallFlowMonitor.REMOTE_WEB_SERVICE,
112             CallFlowMonitor.TIMER_EJB
113             };
114             
115             return requestType;
116     }
117     public String JavaDoc[] queryComponentTypeKeys (){
118         String JavaDoc[] componentType =
119         {
120             CallFlowMonitor.BEAN_MANAGED_PERSISTENCE,
121             CallFlowMonitor.CONTAINER_MANAGED_PERSISTENCE,
122             CallFlowMonitor.MESSAGE_DRIVEN_BEAN,
123             CallFlowMonitor.SERVLET,
124             CallFlowMonitor.SERVLET_FILTER,
125             CallFlowMonitor.STATEFUL_SESSION_BEAN,
126             CallFlowMonitor.STATELESS_SESSION_BEAN
127         };
128         return componentType;
129     }
130     public String JavaDoc[] queryContainerTypeOrApplicationTypeKeys (){
131         String JavaDoc[] containerType =
132         {
133             CallFlowMonitor.WEB_CONTAINER,
134             CallFlowMonitor.EJB_CONTAINER,
135             CallFlowMonitor.ORB,
136             CallFlowMonitor.WEB_APPLICATION,
137             CallFlowMonitor.EJB_APPLICATION,
138             CallFlowMonitor.OTHER
139         };
140         return containerType;
141     }
142 }
143
144
Popular Tags