tigase.component.modules

## Class AbstractModule

- java.lang.Object
- - tigase.component.modules.AbstractModule

- All Implemented Interfaces:
    Module
  Direct Known Subclasses:
    AbstractEventBusModule, AdHocCommandModule, DiscoveryModule, JabberVersionModule, TestGeneratorModule, TestSpamModule, XmppPingModule

      public abstract class AbstractModule
      extends Object
      implements Module

  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 EventBus` | `eventBus`
    `protected Logger` | `log`
    `protected PacketWriter` | `writer`

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

      `EMPTY_FEATURES`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractModule()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `fireEvent(Element event)` Fires event.
    `EventBus` | `getEventBus()`
    `PacketWriter` | `getWriter()`
    `void` | `setEventBus(EventBus eventBus)`
    `void` | `setWriter(PacketWriter writer)`
    `protected void` | `write(Packet 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

      `canHandle, getFeatures, getModuleCriteria, process`

- - ### Field Detail

    - #### log

          protected final Logger log

    - #### eventBus

          @Inject(bean="eventBus")
          protected EventBus eventBus

    - #### writer

          @Inject
          protected PacketWriter writer

  - ### Constructor Detail

    - #### AbstractModule

          public AbstractModule()

  - ### Method Detail

    - #### getEventBus

          public EventBus getEventBus()

    - #### setEventBus

          public void setEventBus(EventBus eventBus)

    - #### getWriter

          public PacketWriter getWriter()

    - #### setWriter

          public void setWriter(PacketWriter writer)

    - #### fireEvent

          protected void fireEvent(Element event)

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

    - #### write

          protected void write(Packet packet)

    - #### write

          protected void write(Packet packet,
                               AsyncCallback asyncCallback)

Copyright © 2004–2020 "Tigase, Inc.". All rights reserved.