tigase.component.modules

## Class AbstractModule<CTX extends Context>

- java.lang.Object
- - tigase.component.modules.AbstractModule<CTX>

- Type Parameters:
    `CTX` - context of component.
  All Implemented Interfaces:
    ContextAware, InitializingModule, Module
  Direct Known Subclasses:
    AbstractEventBusModule, AdHocCommandModule, DiscoveryModule, JabberVersionModule, XmppPingModule

      public abstract class AbstractModule<CTX extends Context>
      extends Object
      implements Module, ContextAware, InitializingModule

  Abstract class for help building a module. It has implemented few default methods from `Module`, `ContextAware` and `InitializingModule`.
  Author:
    bmalkow

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected CTX` | `context`
    `protected Logger` | `log`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractModule()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterRegistration()` Called after registration.
    `void` | `beforeRegister()` Called before registering.
    `protected void` | `fireEvent(Element event)` Fires event.
    `void` | `setContext(Context context)`
    `void` | `unregisterModule()` Called before module is unregistered.
    `protected void` | `write(Packet packet)` Writes single Packet.
    `protected void` | `write(Packet packet, AsyncCallback asyncCallback)`

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

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

    - ### Methods inherited from interface tigase.component.modules.Module

      `getFeatures, getModuleCriteria, process`

- - ### Field Detail

    - #### context

          protected CTX extends Context context

    - #### log

          protected final Logger log

  - ### Constructor Detail

    - #### AbstractModule

          public AbstractModule()

  - ### Method Detail

    - #### afterRegistration

          public void afterRegistration()

      Description copied from interface: `InitializingModule`
      Called after registration.
      Specified by:
        `afterRegistration` in interface `InitializingModule`

    - #### beforeRegister

          public void beforeRegister()

      Description copied from interface: `InitializingModule`
      Called before registering.
      Specified by:
        `beforeRegister` in interface `InitializingModule`

    - #### fireEvent

          protected void fireEvent(Element event)

      Fires event.
      Parameters:
        `event` - event to fire.

    - #### setContext

          public void setContext(Context context)

      Specified by:
        `setContext` in interface `ContextAware`

    - #### unregisterModule

          public void unregisterModule()

      Description copied from interface: `InitializingModule`
      Called before module is unregistered.
      Specified by:
        `unregisterModule` in interface `InitializingModule`

    - #### write

          protected void write(Packet packet)

      Writes single Packet.
      Parameters:
        `packet` - `Packet` to be written.

    - #### write

          protected void write(Packet packet,
                               AsyncCallback asyncCallback)

Copyright © 2022 "Tigase, Inc.". All rights reserved.