com.bigdata.jini.start
Class ServicesManagerStartupTask

java.lang.Object
  extended by com.bigdata.jini.start.ServicesManagerStartupTask
All Implemented Interfaces:
Callable<Void>

public class ServicesManagerStartupTask
extends Object
implements Callable<Void>

Used to start up the server and to handle SIGHUP. This DOES NOT start the monitor tasks since those are not cancelled unless the server is shutdown.

Version:
$Id$
Author:
Bryan Thompson

Field Summary
protected  net.jini.config.Configuration config
           
protected  JiniFederation fed
           
protected static org.apache.log4j.Logger log
           
protected  MonitorCreatePhysicalServiceLocksTask monitorCreatePhysicalServiceLocksTask
           
protected  AbstractServicesManagerService service
           
 
Constructor Summary
ServicesManagerStartupTask(JiniFederation fed, net.jini.config.Configuration config, boolean pushConfig, boolean restartServices, AbstractServicesManagerService service)
           
 
Method Summary
 Void call()
           
protected  void doStartup()
           
protected  boolean pushConfiguration(ServiceConfiguration[] serviceConfigurations)
          Make sure that the key znodes are defined and then push the service configurations into zookeeper.
 void pushConfiguration(org.apache.zookeeper.ZooKeeper zookeeper, String zconfig, List<org.apache.zookeeper.data.ACL> acl, ServiceConfiguration[] serviceConfigurations)
          Pushs the ServiceConfigurations for the federation into zookeeper.
protected  boolean startJiniCoreServices(net.jini.config.Configuration config)
          If necessary, start the jini core services on this host.
protected  boolean startZookeeperService(net.jini.config.Configuration config)
          If necessary, start a zookeeper service on this host.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Logger log

fed

protected final JiniFederation fed

config

protected final net.jini.config.Configuration config

service

protected final AbstractServicesManagerService service

monitorCreatePhysicalServiceLocksTask

protected final MonitorCreatePhysicalServiceLocksTask monitorCreatePhysicalServiceLocksTask
Constructor Detail

ServicesManagerStartupTask

public ServicesManagerStartupTask(JiniFederation fed,
                                  net.jini.config.Configuration config,
                                  boolean pushConfig,
                                  boolean restartServices,
                                  AbstractServicesManagerService service)
Parameters:
fed -
config - The configuration that will be pushed to zookeeper.
pushConfig - If you want to do a service configuration push.
restartServices - If you want the services manager that receives the message to restart any services for which it is responsible which are not currently running.
service -
Method Detail

call

public Void call()
          throws Exception
Specified by:
call in interface Callable<Void>
Throws:
Exception

doStartup

protected void doStartup()
                  throws Exception
Throws:
Exception

startZookeeperService

protected boolean startZookeeperService(net.jini.config.Configuration config)
                                 throws net.jini.config.ConfigurationException,
                                        IOException
If necessary, start a zookeeper service on this host.

Returns:
true if an instance was started successfully.
Throws:
net.jini.config.ConfigurationException
IOException

startJiniCoreServices

protected boolean startJiniCoreServices(net.jini.config.Configuration config)
If necessary, start the jini core services on this host.

Returns:
true if an instance was started successfully.

pushConfiguration

protected boolean pushConfiguration(ServiceConfiguration[] serviceConfigurations)
                             throws org.apache.zookeeper.KeeperException,
                                    InterruptedException,
                                    net.jini.config.ConfigurationException
Make sure that the key znodes are defined and then push the service configurations into zookeeper.

Parameters:
serviceConfigurations - The ServiceConfigurations to be pushed.
Throws:
net.jini.config.ConfigurationException
InterruptedException
org.apache.zookeeper.KeeperException

pushConfiguration

public void pushConfiguration(org.apache.zookeeper.ZooKeeper zookeeper,
                              String zconfig,
                              List<org.apache.zookeeper.data.ACL> acl,
                              ServiceConfiguration[] serviceConfigurations)
                       throws org.apache.zookeeper.KeeperException,
                              InterruptedException,
                              net.jini.config.ConfigurationException
Pushs the ServiceConfigurations for the federation into zookeeper. A new znode is created if none exists. Otherwise this overwrites the existing data for those znodes.

Throws:
net.jini.config.ConfigurationException
InterruptedException
org.apache.zookeeper.KeeperException


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