com.bigdata.jini.start
Class ServicesManagerServer.AdministrableServicesManagerService

java.lang.Object
  extended by com.bigdata.service.AbstractService
      extended by com.bigdata.jini.start.AbstractServicesManagerService
          extended by com.bigdata.jini.start.ServicesManagerServer.AdministrableServicesManagerService
All Implemented Interfaces:
IServiceListener, IServicesManagerService, IService, IServiceShutdown, RemoteAdministrable, RemoteDestroyAdmin, com.sun.jini.admin.DestroyAdmin, Remote, net.jini.admin.Administrable
Enclosing class:
ServicesManagerServer

public static class ServicesManagerServer.AdministrableServicesManagerService
extends AbstractServicesManagerService
implements RemoteAdministrable, RemoteDestroyAdmin

Adds jini administration interfaces.

Version:
$Id$
Author:
Bryan Thompson

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.bigdata.service.IServiceShutdown
IServiceShutdown.Options
 
Field Summary
protected  ServicesManagerServer server
           
 
Fields inherited from class com.bigdata.jini.start.AbstractServicesManagerService
monitorCreatePhysicalServiceLocksTask, startupRunning
 
Constructor Summary
ServicesManagerServer.AdministrableServicesManagerService(ServicesManagerServer server, Properties properties)
           
 
Method Summary
protected  void clearLoggingContext()
          Clear the logging context.
 void destroy()
          Destroy the service.
 Object getAdmin()
           
 JiniFederation<?> getFederation()
          Strengthen the return type.
 String getServiceName()
          Extends the base behavior to return a Name of the service from the Configuration.
protected  void setupLoggingContext()
          Adds the following parameters to the MDC clientname The hostname or IP address of the client making the request. Note: InetAddress.getHostName() is used.
 void shutdown()
          Kill the child processes, using RemoteDestroyAdmin.shutdown() where supported.
 void shutdownNow()
          Kill the child processes, using RemoteDestroyAdmin.shutdownNow() where supported.
 void sighup(boolean pushConfig, boolean restartServices)
          Initiates a service configuration push and restarts any stopped processes.
 ServicesManagerServer.AdministrableServicesManagerService start()
          Starts the AbstractService.
 
Methods inherited from class com.bigdata.jini.start.AbstractServicesManagerService
add, getProperties, getServiceIface, isOpen, killChildProcesses, remove, setup
 
Methods inherited from class com.bigdata.service.AbstractService
getHostname, getServiceUUID, setServiceUUID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

server

protected final ServicesManagerServer server
Constructor Detail

ServicesManagerServer.AdministrableServicesManagerService

public ServicesManagerServer.AdministrableServicesManagerService(ServicesManagerServer server,
                                                                 Properties properties)
Method Detail

getAdmin

public Object getAdmin()
                throws RemoteException
Specified by:
getAdmin in interface net.jini.admin.Administrable
Throws:
RemoteException

setupLoggingContext

protected void setupLoggingContext()
Adds the following parameters to the MDC
clientname
The hostname or IP address of the client making the request.
Note: InetAddress.getHostName() is used. This method makes a one-time best effort attempt to resolve the host name from the InetAddress.

Overrides:
setupLoggingContext in class AbstractService
TODO:
we could pass the class ClientSubject to obtain the authenticated identity of the client (if any) for an incoming remote call.

clearLoggingContext

protected void clearLoggingContext()
Description copied from class: AbstractService
Clear the logging context.

Overrides:
clearLoggingContext in class AbstractService

destroy

public void destroy()
Description copied from interface: IService
Destroy the service. If the service is running, it is shutdown immediately and then destroyed. This method has the same signature as DestroyAdmin.destroy().

Specified by:
destroy in interface IService
Specified by:
destroy in interface RemoteDestroyAdmin
Specified by:
destroy in interface com.sun.jini.admin.DestroyAdmin
Overrides:
destroy in class AbstractService

shutdown

public void shutdown()
Description copied from class: AbstractServicesManagerService
Kill the child processes, using RemoteDestroyAdmin.shutdown() where supported. FIXME This should also bring down any processes that are being managed on this host regardless of whether or not they are child processes. For example, you KILL -9 the ServicesManager [leaves children running], start it, and then kill -s TERM it [should have discovered processes on this host for which it has responsibility and sent them shutdown() requests].

Add a private killManagedProcesses() method for this.

Specified by:
shutdown in interface IServiceShutdown
Specified by:
shutdown in interface RemoteDestroyAdmin
Overrides:
shutdown in class AbstractServicesManagerService

shutdownNow

public void shutdownNow()
Description copied from class: AbstractServicesManagerService
Kill the child processes, using RemoteDestroyAdmin.shutdownNow() where supported.

Specified by:
shutdownNow in interface IServiceShutdown
Specified by:
shutdownNow in interface RemoteDestroyAdmin
Overrides:
shutdownNow in class AbstractServicesManagerService

getFederation

public JiniFederation<?> getFederation()
Description copied from class: AbstractServicesManagerService
Strengthen the return type.

Specified by:
getFederation in class AbstractServicesManagerService

getServiceName

public String getServiceName()
Extends the base behavior to return a Name of the service from the Configuration. If no name was specified in the Configuration then the value returned by the base class is returned instead.

Specified by:
getServiceName in interface IService
Overrides:
getServiceName in class AbstractService

start

public ServicesManagerServer.AdministrableServicesManagerService start()
Description copied from class: AbstractService
Starts the AbstractService.

Note: A AbstractService.start() is required in order to give subclasses an opportunity to be fully initialized before they are required to begin operations. It is impossible to encapsulate the startup logic cleanly without this ctor() + start() pattern. Those familiar with Objective-C will recognized this.

Overrides:
start in class AbstractServicesManagerService
Returns:
this (the return type should be strengthened by the concrete implementation to return the actual type).

sighup

public void sighup(boolean pushConfig,
                   boolean restartServices)
            throws net.jini.config.ConfigurationException
Description copied from interface: IServicesManagerService
Initiates a service configuration push and restarts any stopped processes. This is the same behavior as SIGHUP. It is exposed for RMI both for remote purposes and because some platforms (for example, Windows) don't support SIGHUP.

Specified by:
sighup in interface IServicesManagerService
Parameters:
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.
Throws:
net.jini.config.ConfigurationException - if there is a problem re-processing the Configuration.


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