org.apache.cassandra.service
Class AbstractCassandraDaemon

java.lang.Object
  extended by org.apache.cassandra.service.AbstractCassandraDaemon
All Implemented Interfaces:
CassandraDaemon
Direct Known Subclasses:
CassandraDaemon, CassandraDaemon

public abstract class AbstractCassandraDaemon
extends java.lang.Object
implements CassandraDaemon

The CassandraDaemon is an abstraction for a Cassandra daemon service, which defines not only a way to activate and deactivate it, but also hooks into its lifecycle methods (see setup(), start(), stop() and setup()).


Constructor Summary
AbstractCassandraDaemon()
           
 
Method Summary
 void activate()
          A convenience method to initialize and start the daemon in one shot.
 void deactivate()
          A convenience method to stop and destroy the daemon in one shot.
 void destroy()
          Clean up all resources obtained during the lifetime of the daemon.
 void init(java.lang.String[] arguments)
          Initialize the Cassandra Daemon based on the given Commons Daemon-specific arguments.
protected abstract  void setup()
          This is a hook for concrete daemons to initialize themselves suitably.
abstract  void start()
          Start the Cassandra Daemon, assuming that it has already been initialized, via either init(String[]) or #load(String[]).
abstract  void stop()
          Stop the daemon, ideally in an idempotent manner.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCassandraDaemon

public AbstractCassandraDaemon()
Method Detail

setup

protected abstract void setup()
                       throws java.io.IOException
This is a hook for concrete daemons to initialize themselves suitably.

Throws:
java.io.IOException

init

public void init(java.lang.String[] arguments)
          throws java.io.IOException
Initialize the Cassandra Daemon based on the given Commons Daemon-specific arguments. To clarify, this is a hook for JSVC.

Specified by:
init in interface CassandraDaemon
Parameters:
arguments - the arguments passed in from JSVC
Throws:
java.io.IOException

start

public abstract void start()
                    throws java.io.IOException
Start the Cassandra Daemon, assuming that it has already been initialized, via either init(String[]) or #load(String[]).

Specified by:
start in interface CassandraDaemon
Throws:
java.io.IOException

stop

public abstract void stop()
Stop the daemon, ideally in an idempotent manner.

Specified by:
stop in interface CassandraDaemon

destroy

public void destroy()
Clean up all resources obtained during the lifetime of the daemon. This is a hook for JSVC.

Specified by:
destroy in interface CassandraDaemon

activate

public void activate()
A convenience method to initialize and start the daemon in one shot.

Specified by:
activate in interface CassandraDaemon

deactivate

public void deactivate()
A convenience method to stop and destroy the daemon in one shot.

Specified by:
deactivate in interface CassandraDaemon


Copyright © 2010 The Apache Software Foundation