001: /*
002: * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: *
023: * Free Software Foundation, Inc.
024: * 59 Temple Place, Suite 330
025: * Boston, MA 02111-1307 USA
026: *
027: * @author Scott Ferguson
028: */
029:
030: package com.caucho.management.server;
031:
032: import com.caucho.jmx.Description;
033: import com.caucho.jmx.Units;
034:
035: import java.util.Date;
036:
037: /**
038: * Management interface for the server. Each server corresponds to a
039: * JVM instance running Resin.
040: *
041: * <p>Since exactly on ServerMBean is running at a time it has a unique
042: * mbean name,
043: *
044: * <pre>
045: * resin:type=Server
046: * </pre>
047: */
048: @Description("The Resin Server running on this JVM instance")
049: public interface ServerMXBean extends ManagedObjectMXBean {
050: //
051: // ID attributes
052: //
053:
054: /**
055: * Returns the -server id.
056: */
057: @Description("The server id used when starting this instance" + " of Resin, the value of `-server'")
058: public String getId();
059:
060: //
061: // Hierarchy
062: //
063:
064: /**
065: * Returns the cluster owning this server
066: */
067: @Description("The cluster contains the peer servers")
068: public ClusterMXBean getCluster();
069:
070: /**
071: * Returns the array of ports.
072: */
073: @Description("Ports accept socket connections")
074: public PortMXBean[] getPorts();
075:
076: /**
077: * Returns the server's thread pool administration
078: */
079: @Description("The thread pool for the server")
080: public ThreadPoolMXBean getThreadPool();
081:
082: /**
083: * Returns the cluster port
084: */
085: @Description("The cluster port handles management and cluster messages")
086: public PortMXBean getClusterPort();
087:
088: //
089: // Configuration attributes
090: //
091:
092: /**
093: * Returns true if a {@link com.caucho.server.port.AbstractSelectManager} is enabled and active
094: */
095: @Description("A SelectManager handles keepalive without requiring a thread")
096: public boolean isSelectManagerEnabled();
097:
098: /**
099: * Returns true if detailed statistics are being kept.
100: */
101: @Description("Detailed statistics causes various parts of Resin to keep" + " more detailed statistics at the possible expense of" + " some performance")
102: public boolean isDetailedStatistics();
103:
104: //
105: // state
106: //
107:
108: /**
109: * The current lifecycle state.
110: */
111: @Description("The current lifecycle state")
112: public String getState();
113:
114: /**
115: * Returns the current time according to the server.
116: */
117: @Description("The current time")
118: public Date getCurrentTime();
119:
120: /**
121: * Returns the last start time.
122: */
123: @Description("The time that this instance was last started or restarted")
124: public Date getStartTime();
125:
126: //
127: // statistics
128: //
129:
130: /**
131: * Returns the current number of threads that are servicing requests.
132: */
133: @Description("The current number of threads that are servicing requests")
134: public int getThreadActiveCount();
135:
136: /**
137: * Returns the current number of connections that are in the keepalive
138: * state and are using a thread to maintain the connection.
139: */
140: @Description("The current number of connections that are" + " in the keepalive state and are using" + " a thread to maintain the connection")
141: public int getThreadKeepaliveCount();
142:
143: /**
144: * Returns the current number of connections that are in the keepalive
145: * state and are using select to maintain the connection.
146: */
147: @Description("The current number of connections that are" + " in the keepalive state and are using" + " select to maintain the connection")
148: public int getSelectKeepaliveCount();
149:
150: /**
151: * Returns the total number of requests serviced by the server
152: * since it started.
153: */
154: @Description("The total number of requests serviced by the" + " server since it started")
155: public long getRequestCountTotal();
156:
157: /**
158: * Returns the number of requests that have ended up in the keepalive state
159: * for this server in it's lifetime.
160: */
161: @Description("The total number of requests that have ended" + " up in the keepalive state")
162: public long getKeepaliveCountTotal();
163:
164: /**
165: * The total number of connections that have terminated with
166: * {@link com.caucho.vfs.ClientDisconnectException}.
167: */
168: @Description("The total number of connections that have" + " terminated with a client disconnect")
169: long getClientDisconnectCountTotal();
170:
171: /**
172: * Returns the total duration in milliseconds that requests serviced by
173: * this server have taken.
174: */
175: @Description("The total duration in milliseconds that" + " requests serviced by this service have taken")
176: @Units("milliseconds")
177: long getRequestTimeTotal();
178:
179: /**
180: * Returns the total number of bytes that requests serviced by this
181: * server have read.
182: */
183: @Description("The total number of bytes that requests" + " serviced by this server have read")
184: @Units("bytes")
185: long getRequestReadBytesTotal();
186:
187: /**
188: * Returns the total number of bytes that requests serviced by this
189: * server have written.
190: */
191: @Description("The total number of bytes that requests" + " serviced by this server have written")
192: @Units("bytes")
193: long getRequestWriteBytesTotal();
194:
195: /**
196: * Returns the invocation cache hit count.
197: */
198: @Description("The invocation cache is an internal cache used" + " by Resin to optimize the handling of urls")
199: public long getInvocationCacheHitCountTotal();
200:
201: /**
202: * Returns the invocation cache miss count.
203: */
204: @Description("The invocation cache is an internal cache used" + " by Resin to optimize the handling of urls")
205: public long getInvocationCacheMissCountTotal();
206:
207: /**
208: * Returns the current total amount of memory available for the JVM, in bytes.
209: */
210: @Description("The current total amount of memory available for the JVM, in bytes")
211: @Units("bytes")
212: public long getRuntimeMemory();
213:
214: /**
215: * Returns the current free amount of memory available for the JVM, in bytes.
216: */
217: @Description("The current free amount of memory available for the JVM, in bytes")
218: @Units("bytes")
219: public long getRuntimeMemoryFree();
220:
221: /**
222: * Returns the current CPU load average.
223: */
224: @Description("The current CPU load average")
225: public double getCpuLoadAvg();
226:
227: //
228: // Operations
229: //
230:
231: /**
232: * Restart this Resin server.
233: */
234: @Description("Exit this instance cleanly and allow the watchdog to" + " start a new JVM")
235: public void restart();
236:
237: }
|