org.jboss.dna.repository.observation
Class ObservationService.Administrator

java.lang.Object
  extended by org.jboss.dna.repository.services.AbstractServiceAdministrator
      extended by org.jboss.dna.repository.observation.ObservationService.Administrator
All Implemented Interfaces:
ServiceAdministrator
Enclosing class:
ObservationService

protected class ObservationService.Administrator
extends AbstractServiceAdministrator

The administrative component for this service.

Author:
Randall Hauch

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.dna.repository.services.ServiceAdministrator
ServiceAdministrator.State
 
Constructor Summary
protected ObservationService.Administrator()
           
 
Method Summary
 boolean awaitTermination(long timeout, TimeUnit unit)
          Blocks until the shutdown has completed, or the timeout occurs, or the current thread is interrupted, whichever happens first.
protected  boolean doCheckIsTerminated()
          Subclasses should implement this method to determine whether the service has completed shutdown.
protected  void doShutdown(ServiceAdministrator.State fromState)
          Implementation of the functionality to switch to the shutdown state.
 
Methods inherited from class org.jboss.dna.repository.services.AbstractServiceAdministrator
doPause, doStart, getServiceName, getServiceName, getState, isPaused, isShutdown, isStarted, isTerminated, pause, setState, setState, shutdown, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObservationService.Administrator

protected ObservationService.Administrator()
Method Detail

doShutdown

protected void doShutdown(ServiceAdministrator.State fromState)
Implementation of the functionality to switch to the shutdown state. This method is only called if the state from which the service is transitioning is appropriate (ServiceAdministrator.State.STARTED or ServiceAdministrator.State.PAUSED). This method does nothing by default, and should be overridden if needed.

Overrides:
doShutdown in class AbstractServiceAdministrator
Parameters:
fromState - the state from which this service is transitioning; never null

awaitTermination

public boolean awaitTermination(long timeout,
                                TimeUnit unit)
Blocks until the shutdown has completed, or the timeout occurs, or the current thread is interrupted, whichever happens first.

Parameters:
timeout - the maximum time to wait
unit - the time unit of the timeout argument
Returns:
true if this service complete shut down and false if the timeout elapsed before it was shut down completely

doCheckIsTerminated

protected boolean doCheckIsTerminated()
Subclasses should implement this method to determine whether the service has completed shutdown.

Specified by:
doCheckIsTerminated in class AbstractServiceAdministrator
Returns:
true if terminated, or false otherwise


Copyright © 2008-Present JBoss a division of Red Hat. All Rights Reserved.