001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.system.server;
023:
024: import java.util.Date;
025:
026: import javax.management.ObjectName;
027:
028: import org.jboss.mx.util.ObjectNameFactory;
029:
030: /**
031: * MBean interface.
032: */
033: public interface ServerImplMBean {
034: /** The default object name */
035: ObjectName OBJECT_NAME = ObjectNameFactory
036: .create("jboss.system:type=Server");
037:
038: // Attributes ----------------------------------------------------
039:
040: /** The server start date */
041: Date getStartDate();
042:
043: /** The server version */
044: String getVersion();
045:
046: /** The server version code name */
047: String getVersionName();
048:
049: /** The full server version number */
050: String getVersionNumber();
051:
052: /** The date the server was build (compiled) */
053: String getBuildNumber();
054:
055: /** The JVM used to build the server */
056: String getBuildJVM();
057:
058: /** The Operating System used to build the server */
059: String getBuildOS();
060:
061: /** The build id */
062: String getBuildID();
063:
064: /** The date the server was build */
065: String getBuildDate();
066:
067: /** The server state, true if started, false otherwise */
068: boolean isStarted();
069:
070: /** A flag indicating if shutdown has been called */
071: boolean isInShutdown();
072:
073: // Operations ----------------------------------------------------
074:
075: /**
076: * Shutdown the Server instance and run shutdown hooks.
077: *
078: * If the exit on shutdown flag is true, then {@link #exit} is called,
079: * else only the shutdown hook is run.
080: * @throws IllegalStateException No started.
081: */
082: void shutdown() throws IllegalStateException;
083:
084: /**
085: * Shutdown the server, the JVM and run shutdown hooks.
086: * @param exitcode The exit code returned to the operating system.
087: */
088: void exit(int exitcode);
089:
090: /**
091: * Shutdown the server, the JVM and run shutdown hooks. Exits with code 1.
092: */
093: void exit();
094:
095: /**
096: * Forcibly terminates the currently running Java virtual machine.
097: * @param exitcode The exit code returned to the operating system.
098: */
099: void halt(int exitcode);
100:
101: /**
102: * Forcibly terminates the currently running Java virtual machine. Exits with code 1.
103: */
104: void halt();
105:
106: /**
107: * Hint to the JVM to run the garbage collector.
108: */
109: void runGarbageCollector();
110:
111: /**
112: * Hint to the JVM to run any pending object finailizations.
113: */
114: void runFinalization();
115:
116: /**
117: * Enable or disable tracing method calls at the Runtime level.
118: */
119: void traceMethodCalls(Boolean flag);
120:
121: /**
122: * Enable or disable tracing instructions the Runtime level.
123: */
124: void traceInstructions(Boolean flag);
125:
126: }
|