CassandraDaemon (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.service

## Class CassandraDaemon

- java.lang.Object
- - org.apache.cassandra.service.CassandraDaemon

-     public class CassandraDaemon
      extends java.lang.Object

  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()`).

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `CassandraDaemon.Server`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `MBEAN_NAME`
    `CassandraDaemon.Server` | `nativeServer`
    `protected StartupChecks` | `startupChecks`
    `CassandraDaemon.Server` | `thriftServer`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CassandraDaemon()`
    `CassandraDaemon(boolean runManaged)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `activate()` A convenience method to initialize and start the daemon in one shot.
    `void` | `completeSetup()`
    `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.
    `static void` | `main(java.lang.String[] args)`
    `protected void` | `setup()` This is a hook for concrete daemons to initialize themselves suitably.
    `boolean` | `setupCompleted()`
    `void` | `start()` Start the Cassandra Daemon, assuming that it has already been initialized via `init(String[])` Hook for JSVC
    `void` | `stop()` Stop the daemon, ideally in an idempotent manner.
    `static void` | `stop(java.lang.String[] args)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### MBEAN_NAME

          public static final java.lang.String MBEAN_NAME

      See Also:
        Constant Field Values

    - #### thriftServer

          public CassandraDaemon.Server thriftServer

    - #### nativeServer

          public CassandraDaemon.Server nativeServer

    - #### startupChecks

          protected final StartupChecks startupChecks

  - ### Constructor Detail

    - #### CassandraDaemon

          public CassandraDaemon()

    - #### CassandraDaemon

          public CassandraDaemon(boolean runManaged)

  - ### Method Detail

    - #### setup

          protected void setup()

      This is a hook for concrete daemons to initialize themselves suitably. Subclasses should override this to finish the job (listening on ports, etc.)

    - #### completeSetup

          public void completeSetup()

    - #### setupCompleted

          public boolean setupCompleted()

    - #### 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.
      Parameters:
        `arguments` - the arguments passed in from JSVC
      Throws:
        `java.io.IOException`

    - #### start

          public void start()

      Start the Cassandra Daemon, assuming that it has already been initialized via `init(String[])` Hook for JSVC

    - #### stop

          public void stop()

      Stop the daemon, ideally in an idempotent manner. Hook for JSVC / Procrun

    - #### destroy

          public void destroy()

      Clean up all resources obtained during the lifetime of the daemon. This is a hook for JSVC.

    - #### activate

          public void activate()

      A convenience method to initialize and start the daemon in one shot.

    - #### deactivate

          public void deactivate()

      A convenience method to stop and destroy the daemon in one shot.

    - #### stop

          public static void stop(java.lang.String[] args)

    - #### main

          public static void main(java.lang.String[] args)

Copyright © 2018 The Apache Software Foundation