org.tanukisoftware.wrapper.jmx
Class WrapperManager
java.lang.Object
org.tanukisoftware.wrapper.jmx.WrapperManager
- WrapperManagerMBean
public class WrapperManager
extends java.lang.Object
String | getBuildTime() - Obtain the build time of Wrapper.
|
boolean | getHasShutdownHookBeenTriggered() - Returns true if the ShutdownHook for the JVM has already been triggered.
|
int | getJVMId() - Returns the Id of the current JVM.
|
int | getJavaPID() - Returns the PID of the Java process.
|
String | getVersion() - Obtain the current version of Wrapper.
|
int | getWrapperPID() - Returns the PID of the Wrapper process.
|
boolean | isControlledByNativeWrapper() - Returns true if the JVM was launched by the Wrapper application.
|
boolean | isDebugEnabled() - Returns true if the wrapper.debug property, or any of the logging
channels are set to DEBUG in the wrapper configuration file.
|
boolean | isLaunchedAsService() - Returns true if the Wrapper was launched as an NT service on Windows or
as a daemon process on UNIX platforms.
|
void | requestThreadDump() - Requests that the current JVM process request a thread dump.
|
void | restart() - Tells the native wrapper that the JVM wants to restart, then informs
all listeners that the JVM is about to shutdown before killing the JVM.
|
void | setConsoleTitle(String title) - Sets the title of the console in which the Wrapper is running.
|
void | stop(int exitCode) - Tells the native wrapper that the JVM wants to shut down, then informs
all listeners that the JVM is about to shutdown before killing the JVM.
|
getBuildTime
public String getBuildTime()
Obtain the build time of Wrapper.
- getBuildTime in interface WrapperManagerMBean
- The time that the Wrapper was built.
getHasShutdownHookBeenTriggered
public boolean getHasShutdownHookBeenTriggered()
Returns true if the ShutdownHook for the JVM has already been triggered.
Some code needs to know whether or not the system is shutting down.
- getHasShutdownHookBeenTriggered in interface WrapperManagerMBean
- True if the ShutdownHook for the JVM has already been triggered.
getJVMId
public int getJVMId()
Returns the Id of the current JVM. JVM Ids increment from 1 each time
the wrapper restarts a new one.
- getJVMId in interface WrapperManagerMBean
- The Id of the current JVM.
getJavaPID
public int getJavaPID()
Returns the PID of the Java process.
A PID of 0 will be returned if the native library has not been initialized.
This value can also be obtained using the 'wrapper.java.pid' system property.
- getJavaPID in interface WrapperManagerMBean
- The PID of the Java process.
getVersion
public String getVersion()
Obtain the current version of Wrapper.
- getVersion in interface WrapperManagerMBean
- The version of the Wrapper.
getWrapperPID
public int getWrapperPID()
Returns the PID of the Wrapper process.
A PID of 0 will be returned if the JVM was launched standalone.
This value can also be obtained using the 'wrapper.pid' system property.
- getWrapperPID in interface WrapperManagerMBean
- The PID of the Wrpper process.
isControlledByNativeWrapper
public boolean isControlledByNativeWrapper()
Returns true if the JVM was launched by the Wrapper application. False
if the JVM was launched manually without the Wrapper controlling it.
- isControlledByNativeWrapper in interface WrapperManagerMBean
- True if the current JVM was launched by the Wrapper.
isDebugEnabled
public boolean isDebugEnabled()
Returns true if the wrapper.debug property, or any of the logging
channels are set to DEBUG in the wrapper configuration file. Useful
for deciding whether or not to output certain information to the
console.
- isDebugEnabled in interface WrapperManagerMBean
- True if the Wrapper is logging any Debug level output.
isLaunchedAsService
public boolean isLaunchedAsService()
Returns true if the Wrapper was launched as an NT service on Windows or
as a daemon process on UNIX platforms. False if launched as a console.
This can be useful if you wish to display a user interface when in
Console mode. On UNIX platforms, this is not as useful because an
X display may not be visible even if launched in a console.
- isLaunchedAsService in interface WrapperManagerMBean
- True if the Wrapper is running as an NT service or daemon
process.
requestThreadDump
public void requestThreadDump()
Requests that the current JVM process request a thread dump. This is
the same as pressing CTRL-BREAK (under Windows) or CTRL-\ (under Unix)
in the the console in which Java is running. This method does nothing
if the native library is not loaded.
- requestThreadDump in interface WrapperManagerMBean
restart
public void restart()
Tells the native wrapper that the JVM wants to restart, then informs
all listeners that the JVM is about to shutdown before killing the JVM.
The restart is actually performed in a background thread allowing JMX
a chance to respond to the client.
- restart in interface WrapperManagerMBean
setConsoleTitle
public void setConsoleTitle(String title)
Sets the title of the console in which the Wrapper is running. This
is currently only supported on Windows platforms.
As an alternative, it is also possible to set the console title from
within the wrapper.conf file using the wrapper.console.title property.
- setConsoleTitle in interface WrapperManagerMBean
title
- The new title. The specified string will be encoded
to a byte array using the default encoding for the
current platform.
stop
public void stop(int exitCode)
Tells the native wrapper that the JVM wants to shut down, then informs
all listeners that the JVM is about to shutdown before killing the JVM.
The stop is actually performed in a background thread allowing JMX
a chance to respond to the client.
- stop in interface WrapperManagerMBean
exitCode
- The exit code that the Wrapper will return when it exits.
Copyright 1999, 2006 Tanuki Software Inc., All Rights Reserved.