Setting the pausable property to true will cause the JVM to be
shutdown until the service is resumed or stopped. If, on the other
hand, it is false, the JVM will contine to run normally and the
Wrapper will send a service control event to the Wrapper.
The default is true.
Example: |
wrapper.ntservice.pausable.stop_jvm=true
|
This property has no effect unless the
wrapper.ntservice.pausable
property is also set.
To receive and handle the service control events in a JVM that is
left running, it is necessary to implement code like the following.
This example creates and registers a WrapperEventListener which is
flagged to only receive service events.
Example: |
WrapperManager.addWrapperEventListener( new WrapperEventListener() {
public void fired( WrapperEvent event ) {
if ( event instanceof WrapperServiceControlEvent ) {
WrapperServiceControlEvent scEvent = (WrapperServiceControlEvent)event;
switch ( scEvent.getServiceControlCode() ) {
case WrapperManager.SERVICE_CONTROL_CODE_PAUSE:
myPauseCallback();
break;
case WrapperManager.SERVICE_CONTROL_CODE_CONTINUE:
myContinueCallback();
break;
}
}
}
}, WrapperEventListener.EVENT_FLAG_SERVICE );
|
|