org.apache.activemq.apollo.util
Class JavaBaseService

java.lang.Object
  extended by org.apache.activemq.apollo.util.JavaBaseService
All Implemented Interfaces:
Service

public abstract class JavaBaseService
extends java.lang.Object
implements Service

The BaseService provides helpers for dealing async service state.

Author:
Hiram Chirino

Nested Class Summary
static class JavaBaseService.STARTING
           
static class JavaBaseService.State
           
static class JavaBaseService.STOPPING
           
 
Field Summary
protected  JavaBaseService.State _serviceState
           
static JavaBaseService.State CREATED
           
static JavaBaseService.State STARTED
           
static JavaBaseService.State STOPPED
           
 
Constructor Summary
JavaBaseService()
           
 
Method Summary
protected abstract  void _start(java.lang.Runnable onCompleted)
           
protected abstract  void _stop(java.lang.Runnable onCompleted)
           
protected abstract  org.fusesource.hawtdispatch.DispatchQueue getDispatchQueue()
           
protected  JavaBaseService.State getServiceState()
           
 void start()
          Starts the service.
 void start(java.lang.Runnable onCompleted)
          Starts the service.
 void stop()
          Stops the service.
 void stop(java.lang.Runnable onCompleted)
          Stops the service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CREATED

public static final JavaBaseService.State CREATED

STARTED

public static final JavaBaseService.State STARTED

STOPPED

public static final JavaBaseService.State STOPPED

_serviceState

protected JavaBaseService.State _serviceState
Constructor Detail

JavaBaseService

public JavaBaseService()
Method Detail

start

public final void start()
Description copied from interface: Service
Starts the service. No guarantee is given that the service has fully started by the time this method returns.

Specified by:
start in interface Service

stop

public final void stop()
Description copied from interface: Service
Stops the service. No guarantee is given that the service has fully stopped by the time this method returns.

Specified by:
stop in interface Service

start

public final void start(java.lang.Runnable onCompleted)
Description copied from interface: Service
Starts the service. Executes the onComplete runnable once the service has fully started up.

Specified by:
start in interface Service
Parameters:
onCompleted - my be set to null if not interested in a callback.

stop

public final void stop(java.lang.Runnable onCompleted)
Description copied from interface: Service
Stops the service. Executes the onComplete runnable once the service has fully stopped.

Specified by:
stop in interface Service
Parameters:
onCompleted - my be set to null if not interested in a callback.

getServiceState

protected JavaBaseService.State getServiceState()

getDispatchQueue

protected abstract org.fusesource.hawtdispatch.DispatchQueue getDispatchQueue()

_start

protected abstract void _start(java.lang.Runnable onCompleted)

_stop

protected abstract void _stop(java.lang.Runnable onCompleted)


Copyright © 2005-2011 The Apache Software Foundation. All Rights Reserved.