org.tanukisoftware.wrapper
public class WrapperSimpleApp extends Object implements WrapperListener, Runnable
Using the waitForStartMain property will cause the startup to wait indefinitely. This is fine if the main method will always return within a predefined period of time. But if there is any chance that it could hang, then the maxStartMainWait property may be a better option. It allows the 2 second wait time to be overridden. To wait for up to 5 minutes for the startup main method to complete, set the property to 300 as follows (defaults to 2 seconds): -Dorg.tanukisoftware.wrapper.WrapperSimpleApp.maxStartMainWait=300
It is possible to extend this class but make absolutely sure that any overridden methods call their super method or the class will fail to function correctly. Most users will have no need to override this class.
NOTE - The main methods of many applications are designed not to return. In these cases, you must either stick with the default 2 second startup timeout or specify a slightly longer timeout, using the maxStartMainWait property, to simulate the amount of time your application takes to start up.
WARNING - If the waitForStartMain is specified for an application whose start method never returns, the Wrapper will appear at first to be functioning correctly. However the Wrapper will never enter a running state, this means that the Windows Service Manager and several of the Wrapper's error recovery mechanisms will not function correctly.
Constructor Summary | |
---|---|
protected | WrapperSimpleApp(String[] args)
Creates an instance of a WrapperSimpleApp.
|
Method Summary | |
---|---|
void | controlEvent(int event)
Called whenever the native wrapper code traps a system control signal
against the Java process. |
static void | main(String[] args)
Used to Wrapper enable a standard Java application. |
void | run()
Used to launch the application in a separate thread. |
protected void | showUsage()
Displays application usage |
Integer | start(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. |
Parameters: The full list of arguments passed to the JVM.