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:
034: import java.util.Date;
035:
036: /**
037: * Management interface for the watchdog thread watching a server.
038: *
039: * <pre>
040: * resin:type=Watchdog,name=a
041: * </pre>
042: */
043: @Description("The Watchdog for a Server")
044: public interface WatchdogMXBean {
045: //
046: // ID attributes
047: //
048:
049: /**
050: * Returns the -server id.
051: */
052: @Description("The server id used when starting this instance" + " of Resin, the value of `--server'")
053: public String getId();
054:
055: /**
056: * Returns the resinHome
057: */
058: @Description("Returns the resin.home value")
059: public String getResinHome();
060:
061: /**
062: * Returns the resinRoot
063: */
064: @Description("Returns the resin.root value")
065: public String getResinRoot();
066:
067: /**
068: * Returns the resinConf
069: */
070: @Description("Returns the resin.conf value")
071: public String getResinConf();
072:
073: /**
074: * Returns the userName
075: */
076: @Description("Returns the user-name value")
077: public String getUserName();
078:
079: //
080: // state
081: //
082:
083: /**
084: * The current lifecycle state.
085: */
086: @Description("The current lifecycle state")
087: public String getState();
088:
089: /**
090: * Returns the last start time.
091: */
092: @Description("The time that the watchdog was started")
093: public Date getInitialStartTime();
094:
095: /**
096: * Returns the last start time.
097: */
098: @Description("The time that this instance was last started or restarted")
099: public Date getStartTime();
100:
101: //
102: // statistics
103: //
104:
105: /**
106: * Returns the number of times the server has been restarted.
107: */
108: @Description("The number of times the server has been restarted")
109: public int getStartCount();
110:
111: //
112: // operations
113: //
114:
115: /**
116: * Start the Resin process
117: */
118: @Description("Starts the Resin process")
119: public void start();
120:
121: /**
122: * Stop the Resin process
123: */
124: @Description("Stops the Resin process")
125: public void stop();
126:
127: /**
128: * Kills the Resin process
129: */
130: @Description("Stops the Resin process")
131: public void kill();
132: }
|