KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > management > server > ServerMXBean


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  *
23  * Free Software Foundation, Inc.
24  * 59 Temple Place, Suite 330
25  * Boston, MA 02111-1307 USA
26  *
27  * @author Scott Ferguson
28  */

29
30 package com.caucho.management.server;
31
32 import com.caucho.jmx.Description;
33 import com.caucho.jmx.Units;
34
35 import java.util.Date JavaDoc;
36
37 /**
38  * Management interface for the server. Each server corresponds to a
39  * JVM instance running Resin.
40  *
41  * <p>Since exactly on ServerMBean is running at a time it has a unique
42  * mbean name,
43  *
44  * <pre>
45  * resin:type=Server
46  * </pre>
47  */

48 @Description("The Resin Server running on this JVM instance")
49 public interface ServerMXBean {
50   //
51
// ID attributes
52
//
53

54   /**
55    * Returns the -server id.
56    */

57   @Description("The server id used when starting this instance"
58                + " of Resin, the value of `-server'")
59   public String JavaDoc getId();
60
61   //
62
// Hierarchy
63
//
64

65   /**
66    * Returns the cluster owning this server
67    */

68   @Description("The cluster contains the peer servers")
69   public ClusterMXBean getCluster();
70
71   /**
72    * Returns the array of ports.
73    */

74   @Description("Ports accept socket connections")
75   public PortMXBean []getPorts();
76
77   /**
78    * Returns the server's thread pool administration
79    */

80   @Description("The thread pool for the server")
81   public ThreadPoolMXBean getThreadPool();
82
83   /**
84    * Returns the cluster port
85    */

86   @Description("The cluster port handles management and cluster messages")
87   public PortMXBean getClusterPort();
88
89   //
90
// Configuration attributes
91
//
92

93   /**
94    * Returns true if a {@link com.caucho.server.port.AbstractSelectManager} is enabled and active
95    */

96   @Description("A SelectManager handles keepalive without requiring a thread")
97   public boolean isSelectManagerEnabled();
98
99   /**
100    * Returns true if detailed statistics are being kept.
101    */

102   @Description("Detailed statistics causes various parts of Resin to keep"
103                + " more detailed statistics at the possible expense of"
104                +" some performance")
105   public boolean isDetailedStatistics();
106
107   //
108
// state
109
//
110

111   /**
112    * The current lifecycle state.
113    */

114   @Description("The current lifecycle state")
115   public String JavaDoc getState();
116
117   /**
118    * Returns the last start time.
119    */

120   @Description("The time that this instance was last started or restarted")
121   public Date JavaDoc getStartTime();
122
123   //
124
// statistics
125
//
126

127   /**
128    * Returns the current number of threads that are servicing requests.
129    */

130   @Description("The current number of threads that are servicing requests")
131   public int getThreadActiveCount();
132
133   /**
134    * Returns the current number of connections that are in the keepalive
135    * state and are using a thread to maintain the connection.
136    */

137   @Description("The current number of connections that are" +
138                " in the keepalive state and are using" +
139                " a thread to maintain the connection")
140   public int getThreadKeepaliveCount();
141
142   /**
143    * Returns the current number of connections that are in the keepalive
144    * state and are using select to maintain the connection.
145    */

146   @Description("The current number of connections that are" +
147                " in the keepalive state and are using" +
148                " select to maintain the connection")
149   public int getSelectKeepaliveCount();
150
151   /**
152    * Returns the total number of requests serviced by the server
153    * since it started.
154    */

155   @Description("The total number of requests serviced by the"
156                + " server since it started")
157   public long getRequestCountTotal();
158
159   /**
160    * Returns the number of requests that have ended up in the keepalive state
161    * for this server in it's lifetime.
162    */

163   @Description("The total number of requests that have ended"
164                + " up in the keepalive state")
165   public long getKeepaliveCountTotal();
166
167   /**
168    * The total number of connections that have terminated with
169    * {@link com.caucho.vfs.ClientDisconnectException}.
170    */

171   @Description("The total number of connections that have" +
172                " terminated with a client disconnect")
173   long getClientDisconnectCountTotal();
174
175   /**
176    * Returns the total duration in milliseconds that requests serviced by
177    * this server have taken.
178    */

179   @Description("The total duration in milliseconds that"
180                + " requests serviced by this service have taken")
181   @Units("milliseconds")
182   long getRequestTimeTotal();
183
184   /**
185    * Returns the total number of bytes that requests serviced by this
186    * server have read.
187    */

188   @Description("The total number of bytes that requests"
189                + " serviced by this server have read")
190   @Units("bytes")
191   long getRequestReadBytesTotal();
192
193   /**
194    * Returns the total number of bytes that requests serviced by this
195    * server have written.
196    */

197   @Description("The total number of bytes that requests"
198                + " serviced by this server have written")
199   @Units("bytes")
200   long getRequestWriteBytesTotal();
201
202   /**
203    * Returns the invocation cache hit count.
204    */

205   @Description("The invocation cache is an internal cache used"
206                + " by Resin to optimize the handling of urls")
207   public long getInvocationCacheHitCountTotal();
208
209   /**
210    * Returns the invocation cache miss count.
211    */

212   @Description("The invocation cache is an internal cache used"
213                + " by Resin to optimize the handling of urls")
214   public long getInvocationCacheMissCountTotal();
215
216   /**
217    * Returns the current total amount of memory available for the JVM, in bytes.
218    */

219   @Description("The current total amount of memory available for the JVM, in bytes")
220   @Units("bytes")
221   public long getRuntimeMemory();
222
223   /**
224    * Returns the current free amount of memory available for the JVM, in bytes.
225    */

226   @Description("The current free amount of memory available for the JVM, in bytes")
227   @Units("bytes")
228   public long getRuntimeMemoryFree();
229
230   /**
231    * Returns the current CPU load average.
232    */

233   @Description("The current CPU load average")
234   public double getCpuLoadAvg();
235
236   //
237
// Operations
238
//
239

240   /**
241    * Restart this Resin server.
242    */

243   @Description("Exit this instance cleanly and allow the wrapper script to"
244                + " start a new JVM")
245   public void restart();
246
247 }
248
Popular Tags