runtime.daemon
Class WrapperSimpleApp

java.lang.Object
  extended by runtime.daemon.WrapperSimpleApp
All Implemented Interfaces:
java.lang.Runnable, org.tanukisoftware.wrapper.WrapperListener

public class WrapperSimpleApp
extends java.lang.Object
implements org.tanukisoftware.wrapper.WrapperListener, java.lang.Runnable

Version:
$Revision: 1.5 $
Author:
Leif Mortenson

Method Summary
 void controlEvent(int event)
          Called whenever the native wrapper code traps a system control signal against the Java process.
static void main(java.lang.String[] args)
          Used to Wrapper enable a standard Java application.
 void run()
          Used to launch the application in a separate thread.
 java.lang.Integer start(java.lang.String[] args)
          The start method is called when the WrapperManager is signalled by the native wrapper code that it can start its application.
 int stop(int exitCode)
          Called when the application is shutting down.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

run

public void run()
Used to launch the application in a separate thread.

Specified by:
run in interface java.lang.Runnable

start

public java.lang.Integer start(java.lang.String[] args)
The start method is called when the WrapperManager is signalled by the native wrapper code that it can start its application. This method call is expected to return, so a new thread should be launched if necessary. If there are any problems, then an Integer should be returned, set to the desired exit code. If the application should continue, return null.

Specified by:
start in interface org.tanukisoftware.wrapper.WrapperListener

stop

public int stop(int exitCode)
Called when the application is shutting down.

Specified by:
stop in interface org.tanukisoftware.wrapper.WrapperListener

controlEvent

public void controlEvent(int event)
Called whenever the native wrapper code traps a system control signal against the Java process. It is up to the callback to take any actions necessary. Possible values are: WrapperManager.WRAPPER_CTRL_C_EVENT, WRAPPER_CTRL_CLOSE_EVENT, WRAPPER_CTRL_LOGOFF_EVENT, or WRAPPER_CTRL_SHUTDOWN_EVENT

Specified by:
controlEvent in interface org.tanukisoftware.wrapper.WrapperListener

main

public static void main(java.lang.String[] args)
Used to Wrapper enable a standard Java application. This main expects the first argument to be the class name of the application to launch. All remaining arguments will be wrapped into a new argument list and passed to the main method of the specified application.