examples.plugin

## Class DemoServerPlugin

- java.lang.Object
- - org.java.plugin.Plugin
  - - com.tibbo.aggregate.common.plugin.BasePlugin
    - - com.tibbo.aggregate.common.plugin.AbstractContextPlugin
      - - examples.plugin.DemoServerPlugin

- All Implemented Interfaces:
    AggreGatePlugin, ContextPlugin, java.lang.Comparable<AggreGatePlugin>

      public class DemoServerPlugin
      extends AbstractContextPlugin

  This demo plugin creates a tracker to show user's device count under every user account. The tracker uses status table to color-code different device numbers. There is a global configuration setting that may be used to disable tracker creation.

- - ### Field Summary

    - ### Fields inherited from class com.tibbo.aggregate.common.plugin.BasePlugin

      `INDEX_HIGH, INDEX_HIGHER, INDEX_HIGHEST, INDEX_LOW, INDEX_LOWER, INDEX_LOWEST, INDEX_NORMAL, INDEX_VERY_HIGH, INDEX_VERY_LOW`

    - ### Fields inherited from class org.java.plugin.Plugin

      `log`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DemoServerPlugin()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `globalInit(Context rootContext)` This method is called once during server startup.
    `void` | `install(ServerContext context)` This method is called when a new server context is created or loaded upon server startup.

    - ### Methods inherited from class com.tibbo.aggregate.common.plugin.AbstractContextPlugin

      `deinitialize, deinstall, deinstall, initialize, install, launch, shutdown`

    - ### Methods inherited from class com.tibbo.aggregate.common.plugin.BasePlugin

      `compareTo, createGlobalConfigContext, createGlobalConfigContext, createUserConfigContext, doStart, doStop, getDescription, getGlobalConfigContext, getId, getPluginDirector, getShortId, getSortIndex, getUserConfigContext, globalDeinit, globalStart, globalStop, setDescription, setId, setIndex, setPluginDirector, userDeinit, userInit`

    - ### Methods inherited from class org.java.plugin.Plugin

      `getDescriptor, getManager, isActive, toString`

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

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

    - ### Methods inherited from interface com.tibbo.aggregate.common.plugin.AggreGatePlugin

      `createGlobalConfigContext, createUserConfigContext, getDescription, getGlobalConfigContext, getId, getShortId, getSortIndex, getUserConfigContext, globalDeinit, globalStart, globalStop, userDeinit, userInit`

- - ### Constructor Detail

    - #### DemoServerPlugin

          public DemoServerPlugin()

  - ### Method Detail

    - #### globalInit

          public void globalInit(Context rootContext)
                          throws PluginException

      Description copied from interface: `AggreGatePlugin`
      This method is called once during server startup. Its implementation will in most cases call createGlobalConfigContext() to create plugin global configuration. Another typical use is opening some listening server socket to accept connections or receive network datagrams. Note, that this method is called during server context tree initialization. Not all server contexts may be available at the time of its call. To access any server context during plugin startup, override globalStart() method.
      Specified by:
        `globalInit` in interface `AggreGatePlugin`
      Overrides:
        `globalInit` in class `BasePlugin`
      Throws:
        `PluginException` - If an error occurred during initialization

    - #### install

          public void install(ServerContext context)
                       throws ContextException,
                              PluginException

      Description copied from interface: `ContextPlugin`
      This method is called when a new server context is created or loaded upon server startup.
      Specified by:
        `install` in interface `ContextPlugin`
      Overrides:
        `install` in class `AbstractContextPlugin`
      Parameters:
        `context` - Server context
      Throws:
        `ContextException` - If some context API calls from within this method have thrown an exception
        `PluginException` - If plugin internal error occurred