net.i2p.router.startup

## Class RouterAppManager

- java.lang.Object
- - net.i2p.app.ClientAppManagerImpl
  - - net.i2p.router.startup.RouterAppManager

- All Implemented Interfaces:
    ClientAppManager

      public class RouterAppManager
      extends ClientAppManagerImpl

  Notify the router of events, and provide methods for client apps to find each other.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `RouterAppManager.Shutdown` Shutdown task for router applications.

  - ### Field Summary

    - ### Fields inherited from class net.i2p.app.ClientAppManagerImpl

      `_registered`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RouterAppManager(RouterContext ctx)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `addAndStart(ClientApp app, String[] args)`
    `ClientApp` | `getClientApp(String className, String[] args)` Get the first known ClientApp with this class name and exact arguments.
    `void` | `notify(ClientApp app, ClientAppState state, String message, Exception e)` Must be called on all state transitions except from UNINITIALIZED to INITIALIZED.
    `boolean` | `register(ClientApp app)` Register with the manager under the given name, so that other clients may find it.
    `void` | `renderStatusHTML(Writer out)` debug
    `void` | `shutdown()`
    `void` | `unregister(ClientApp app)` Unregister with the manager.

    - ### Methods inherited from class net.i2p.app.ClientAppManagerImpl

      `getRegisteredApp`

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

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

- - ### Constructor Detail

    - #### RouterAppManager

          public RouterAppManager(RouterContext ctx)

  - ### Method Detail

    - #### addAndStart

          public boolean addAndStart(ClientApp app,
                                     String[] args)

      Parameters:
        `args` - the args that were used to instantiate the app, non-null, may be zero-length
      Returns:
        success
      Throws:
        `IllegalArgumentException` - if already added

    - #### getClientApp

          public ClientApp getClientApp(String className,
                                        String[] args)

      Get the first known ClientApp with this class name and exact arguments. Caller may then retrieve or control the state of the returned client. A client will generally be found only if it is running or transitioning; after it is stopped it will not be tracked by the manager.
      Parameters:
        `args` - non-null, may be zero-length
      Returns:
        client app or null

    - #### notify

          public void notify(ClientApp app,
                             ClientAppState state,
                             String message,
                             Exception e)

      Must be called on all state transitions except from UNINITIALIZED to INITIALIZED.
      Specified by:
        `notify` in interface `ClientAppManager`
      Overrides:
        `notify` in class `ClientAppManagerImpl`
      Parameters:
        `app` - non-null
        `state` - non-null
        `message` - may be null
        `e` - may be null

    - #### register

          public boolean register(ClientApp app)

      Register with the manager under the given name, so that other clients may find it. Only required for apps used by other apps.
      Specified by:
        `register` in interface `ClientAppManager`
      Overrides:
        `register` in class `ClientAppManagerImpl`
      Parameters:
        `app` - non-null
      Returns:
        true if successful, false if duplicate name

    - #### renderStatusHTML

          public void renderStatusHTML(Writer out)
                                throws IOException

      debug
      Throws:
        `IOException`

    - #### shutdown

          public void shutdown()

    - #### unregister

          public void unregister(ClientApp app)

      Unregister with the manager. Name must be the same as that from register(). Only required for apps used by other apps.
      Specified by:
        `unregister` in interface `ClientAppManager`
      Overrides:
        `unregister` in class `ClientAppManagerImpl`
      Parameters:
        `app` - non-null