com.atlassian.bamboo.container
Class AbstractStartable

java.lang.Object
  extended by com.atlassian.bamboo.container.AbstractStartable
All Implemented Interfaces:
Startable, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
BambooAgentStreamListener

public abstract class AbstractStartable
extends java.lang.Object
implements Startable, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean

An abstract base class for Startables, which implements lifecycle logic, and handles automatic start up and shutdown within Spring.


Constructor Summary
AbstractStartable()
           
 
Method Summary
 void afterPropertiesSet()
           
 void destroy()
           
 boolean isActive()
          Indicates whether this is currently active.
protected  void onStart()
          Override to perform startup initialisation.
protected  void onStop()
          Override to perform shutdown cleanup.
protected abstract  void runCycle()
          Perform a single cycle of processing.
 void start()
          Start the component
 void stop()
          Stop the component and clean up any resources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractStartable

public AbstractStartable()
Method Detail

start

public final void start()
                 throws java.lang.Exception
Description copied from interface: Startable
Start the component

Specified by:
start in interface Startable
Throws:
java.lang.Exception - A generic failure

onStart

protected void onStart()
                throws java.lang.Exception

Override to perform startup initialisation.

Throws:
java.lang.Exception

stop

public final void stop()
                throws java.lang.Exception
Description copied from interface: Startable
Stop the component and clean up any resources

Specified by:
stop in interface Startable
Throws:
java.lang.Exception - A generic failure

onStop

protected void onStop()
               throws java.lang.Exception

Override to perform shutdown cleanup.

Throws:
java.lang.Exception

isActive

public final boolean isActive()
Description copied from interface: Startable

Indicates whether this is currently active.

Specified by:
isActive in interface Startable
Returns:
true if this is active, false otherwise.

afterPropertiesSet

public final void afterPropertiesSet()
                              throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

destroy

public final void destroy()
                   throws java.lang.Exception
Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
java.lang.Exception

runCycle

protected abstract void runCycle()

Perform a single cycle of processing.



Copyright © 2011 Atlassian. All Rights Reserved.