When a service is exported it is sometimes necessary for it to be
initialized in a domain specific manner. This is done in the hook method
deactivate(). For example:
protected void activate() {
Timer timer = new Timer(3000);
timer.startup();
addExportedService(TimerService.SERVICE_NAME, timer, null);
}
To perform custom domain clean up of an exported service the hook method
deactivate() should be overridden. For example:
protected void deactivate() {
Timer timer = (Timer) getExportedService(TimerService.SERVICE_NAME);
timer.shutdown();
}
Copyright © 2001, 2007 IBM Corporation and others. All Rights Reserved.