com.bigdata.jini.start.config
Class ManagedServiceConfiguration.ManagedServiceStarter<V extends ProcessHelper>

java.lang.Object
  extended by com.bigdata.jini.start.config.ServiceConfiguration.AbstractServiceStarter<V>
      extended by com.bigdata.jini.start.config.JavaServiceConfiguration.JavaServiceStarter<V>
          extended by com.bigdata.jini.start.config.ManagedServiceConfiguration.ManagedServiceStarter<V>
Type Parameters:
V -
All Implemented Interfaces:
Callable<V>
Direct Known Subclasses:
JiniServiceConfiguration.JiniServiceStarter
Enclosing class:
ManagedServiceConfiguration

public class ManagedServiceConfiguration.ManagedServiceStarter<V extends ProcessHelper>
extends JavaServiceConfiguration.JavaServiceStarter<V>

This class and subclasses support re-start of persistent services. Restart is only possible for persistent services. Persistent services must satisify several criteria in order for restart to succeed, including the stable assignment of the physical service znode name and the stable assignment of the service directory.

Version:
$Id$
Author:
Bryan Thompson

Field Summary
protected  JiniFederation fed
           
 String logicalServiceZNode
          The znode for the logical service (the last component of the AbstractServiceStarter#logicalServiceZPath.
protected  String logicalServiceZPath
           
 boolean restart
          true iff this is a service restart and false if this is a new service start.
 File serviceDir
          The service instance directory.
 String serviceName
          The canonical service name.
 UUID serviceUUID
          The representation of the assigned ServiceID as a UUID.
 
Fields inherited from class com.bigdata.jini.start.config.JavaServiceConfiguration.JavaServiceStarter
cls
 
Fields inherited from class com.bigdata.jini.start.config.ServiceConfiguration.AbstractServiceStarter
listener
 
Constructor Summary
protected ManagedServiceConfiguration.ManagedServiceStarter(JiniFederation fed, IServiceListener listener, String logicalServiceZPath, net.jini.core.entry.Entry[] attributes)
           
 
Method Summary
protected  File getServiceDir()
          Returns the actual service directory which is choosen at runtime based on the logicalServiceZNode and the #serviceToken.
protected  void setUp()
          Extended to verify that the logicalServiceZPath, the BigdataZooDefs.PHYSICAL_SERVICES_CONTAINER, and the BigdataZooDefs.MASTER_ELECTION znodes exist.
 
Methods inherited from class com.bigdata.jini.start.config.JavaServiceConfiguration.JavaServiceStarter
addCommand, addCommandArgs, setUpEnvironment
 
Methods inherited from class com.bigdata.jini.start.config.ServiceConfiguration.AbstractServiceStarter
addServiceOptions, awaitServiceStart, call, getCommandLine, newProcessBuilder, newProcessBuilder, newProcessHelper, writeStartFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fed

protected final JiniFederation fed

logicalServiceZPath

protected final String logicalServiceZPath

logicalServiceZNode

public final String logicalServiceZNode
The znode for the logical service (the last component of the AbstractServiceStarter#logicalServiceZPath.


restart

public final boolean restart
true iff this is a service restart and false if this is a new service start.


serviceUUID

public final UUID serviceUUID
The representation of the assigned ServiceID as a UUID. This is pre-assigned so that we can recognize the service when it joins with a jini registrar, which is how we know that the service has started successfully. It is also used to watch for the create of the znode representing the physical service instance.


serviceName

public final String serviceName
The canonical service name. This is formed in much the same manner as the serviceDir using the service type, the logicalServiceZNode, and the unique #serviceToken. While the #serviceToken alone is unique, the path structure of the service name make is possible to readily classify a physical service by its type and logical instance.


serviceDir

public final File serviceDir
The service instance directory. This is where we put any configuration files and should be the default location for the persistent state associated with the service (services may of course be configured to put aspects of their state in a different location, such as the zookeeper log files).

The serviceDir is created using path components from the service type, the logicalServiceZNode, and finally the unique #serviceToken assigned to the service.

Constructor Detail

ManagedServiceConfiguration.ManagedServiceStarter

protected ManagedServiceConfiguration.ManagedServiceStarter(JiniFederation fed,
                                                            IServiceListener listener,
                                                            String logicalServiceZPath,
                                                            net.jini.core.entry.Entry[] attributes)
Parameters:
fed -
listener -
logicalServiceZPath - The zpath to the logical service.
attributes - This provides the information required to restart a persistent service. When not given a new service instance will be started. When given, the same service instance will be restarted.
Method Detail

getServiceDir

protected File getServiceDir()
Returns the actual service directory which is choosen at runtime based on the logicalServiceZNode and the #serviceToken.

Overrides:
getServiceDir in class ServiceConfiguration.AbstractServiceStarter<V extends ProcessHelper>
See Also:
ServiceConfiguration.serviceDir, ServiceConfiguration.getServiceDir(String, Configuration)

setUp

protected void setUp()
              throws Exception
Extended to verify that the logicalServiceZPath, the BigdataZooDefs.PHYSICAL_SERVICES_CONTAINER, and the BigdataZooDefs.MASTER_ELECTION znodes exist.

Overrides:
setUp in class JavaServiceConfiguration.JavaServiceStarter<V extends ProcessHelper>
Throws:
Exception


Copyright © 2006-2012 SYSTAP, LLC. All Rights Reserved.