|
| Services |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
java.lang.Object | +--com.sas.services.deployment.servicewrapper.AbstractServiceWrapper
Provides integration with the Java Service Wrapper provided by Tanuki Software by registering its WrapperListener implementation with the WrapperManager.
Our class is controlled by the native Wrapper by registering it with the Tanuki Software WrapperManager. The WrapperManager is the middle-man between us and the native Wrapper.
All service wrapper implementations should extend this class and fully implement the ServiceWrapperInterface. In this way the implementation does not have to be concerned with the semantics of the native wrapper. An example follows:
import com.sas.services.InitializationException;
import com.sas.services.ServiceException;
...
public class xxxxImpl extends AbstractServiceWrapper {
private xxxxImpl(String[] args) {
super(args);
}
public static void main(String[] args) {
new xxxxImpl(args);
}
public void init(String[] args) throws
InitializationException, ServiceException {
....
}
public void destroy() throws
ServiceException, RemoteException {
....
}
}
|
| Field Summary | |
static int |
LOG_LEVEL_DEBUG
|
static int |
LOG_LEVEL_ERROR
|
static int |
LOG_LEVEL_FATAL
|
static int |
LOG_LEVEL_INFO
|
static int |
LOG_LEVEL_STATUS
|
static int |
LOG_LEVEL_WARN
|
| Constructor Summary | |
protected |
AbstractServiceWrapper(String[] args)
AbstractServiceWrapper constructor. |
| Method Summary | |
void |
controlEvent(int event)
The native wrapper will trap the following system control signals: WrapperManager.WRAPPER_CTRL_C_EVENT, WrapperManager.WRAPPER_CTRL_CLOSE_EVENT, WrapperManager.WRAPPER_CTRL_LOGOFF_EVENT, WrapperManager.WRAPPER_CTRL_SHUTDOWN_EVENT. |
abstract void |
destroy()
Destroy a Foundation Services deployment. |
abstract void |
init(String[] args)
Initialize a Foundation Services deployment. |
protected void |
log(int level,
String s)
Log a message to the service wrapper log. |
Integer |
start(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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int LOG_LEVEL_DEBUG
public static final int LOG_LEVEL_ERROR
public static final int LOG_LEVEL_FATAL
public static final int LOG_LEVEL_INFO
public static final int LOG_LEVEL_STATUS
public static final int LOG_LEVEL_WARN
| Constructor Detail |
protected AbstractServiceWrapper(String[] args)
args - Main program arguments.| Method Detail |
public abstract void init(String[] args)
throws InitializationException,
ServiceException
init in interface ServiceWrapperInterfaceargs - Main program arguments.InitializationException - if problems initializing foundation services.ServiceException - if problems deploying foundation services.
public abstract void destroy()
throws ServiceException,
RemoteException
destroy in interface ServiceWrapperInterfaceServiceException - if problems destroying foundation services.RemoteException - if a network failure occurs.
protected void log(int level,
String s)
level - logging priority level.s - message to log.public Integer start(String[] args)
start in interface org.tanukisoftware.wrapper.WrapperListenerargs - List of arguments used to initialize the application.public int stop(int exitCode)
stop in interface org.tanukisoftware.wrapper.WrapperListenerexitCode - The suggested exit code that will be returned to the OS
when the JVM exits.public void controlEvent(int event)
controlEvent in interface org.tanukisoftware.wrapper.WrapperListenerevent - The system control signal.
|
| Services |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||