public class ServerStartupNotifier
extends java.lang.Object
waitForStartup
or
registerForStartup
methods to ensure that your code
executes after they are available.Constructor and Description |
---|
ServerStartupNotifier() |
Modifier and Type | Method and Description |
---|---|
void |
registerForStartup(java.lang.String service,
IData pipeline)
Registers a service to be called when the Integration Server completes its startup
sequence.
|
void |
waitForStartup()
Blocks the calling thread until Integration Server completes its startup
sequence.
|
public void waitForStartup()
This method should not be called directly from a startup service as the service will block and keep the server from completing its startup sequence. Your startup service should create a separate thread and call it from there. For example:
public static void myStartup(IData pipeline) { Thread thread = new Thread() { public void run() { ServerStartupNotifier notifier = ServerStartupNotifier(); notifier.waitForStartup(); // // Perform initialization tasks here. // } } thread.start(); }
public void registerForStartup(java.lang.String service, IData pipeline)
Unlike waitForStartup
, registerForStartup
does not block. Once the server has started, registered services are
invoked. Note that order of execution is not guaranteed. The services
are passed into the server's main thread pool and may be executed out
of order.
If the server's startup sequence is complete when this method is called, no registration occurs and the services are not invoked.
service
- Fully qualified name of the service to invoke when the
server's startup sequence is complete. If the service
throws an Exception, it will appear in the error log.pipeline
- Pipeline to pass to service
. May be null.