com.silveregg.wrapper
Interface WrapperListener

All Known Implementing Classes:
WrapperSimpleApp, WrapperStartStopApp

public interface WrapperListener


Method Summary
 void controlEvent(int event)
          Called whenever the native wrapper code traps a system control signal against the Java process.
 java.lang.Integer start(java.lang.String[] args)
          The start method is called when the WrapperManager is signaled by the native wrapper code that it can start its application.
 int stop(int exitCode)
          Called when the application is shutting down.
 

Method Detail

start

public java.lang.Integer start(java.lang.String[] args)
The start method is called when the WrapperManager is signaled 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.


stop

public int stop(int exitCode)
Called when the application is shutting down. The Wrapper assumes that this method will return fairly quickly. If the shutdown code code could potentially take a long time, then WrapperManager.stopping() should be called to extend the timeout period. If for some reason, the stop method can not return, then it must call WrapperManager.stopped() to avoid warning messages from the Wrapper.

Parameters:
exitCode - The suggested exit code that will be returned to the OS when the JVM exits.
Returns:
The exit code to actually return to the OS. In most cases, this should just be the value of exitCode, however the user code has the option of changing the exit code if there are any problems during shutdown.

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



Copyright 2000, 2001 SilverEgg Technology Corp. All Rights Reserved.