com.bigdata.jini.start.process
Class JiniServiceProcessHelper
java.lang.Object
com.bigdata.jini.start.process.ProcessHelper
com.bigdata.jini.start.process.JiniServiceProcessHelper
public class JiniServiceProcessHelper
- extends ProcessHelper
Class for managing a service written using the jini framework. This extends
the base class to prefer RemoteDestroyAdmin for
kill(boolean). It will use RemoteDestroyAdmin.shutdown()
(normal shutdown, allowing a service to be restarted) if defined and
otherwise DestroyAdmin.destroy() (destroys the service along with its
persistent state).
Note: RemoteDestroyAdmin is defined for the bigdata services.
- Version:
- $Id$
- Author:
- Bryan Thompson
JiniServiceProcessHelper
public JiniServiceProcessHelper(String name,
ProcessBuilder builder,
IServiceListener listener)
throws IOException
- Parameters:
name - builder - listener -
- Throws:
IOException
setServiceItem
public void setServiceItem(net.jini.core.lookup.ServiceItem serviceItem)
kill
public int kill(boolean immediateShutdown)
throws InterruptedException
- If
setServiceItem(ServiceItem) was invoked and the service
implements RemoteAdministrable, then uses
RemoteAdministrable to obtain the Administrable object
and then requests RemoteDestroyAdmin.shutdown() if defined (the
bigdata services define this method which shuts down the services without
destroying its persistent state) and otherwise
RemoteDestroyAdmin.destroy(), which destroy both the service and
its persistent state. In any of those methods was defined, we then wait
for the exit value of the process before messaging the listener.
If none of those options was available, we delegate the behavior to the
super class.
Note: Normal termination of some services can have significant latency
(seconds or more). For example, services may refuse new operations while
permitting running operations to complete.
- Overrides:
kill in class ProcessHelper
- Parameters:
immediateShutdown - processes with APIs that differentiate immediate shutdown and
normal shutdown will use the appropriate behavior as selected
by this parameter.
- Returns:
- The exitValue of the process.
- Throws:
InterruptedException - if interrupted - the process may or may not have been killed
and the listener will not have been notified.
Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.