org.appng.core.controller.messaging

## Class TribesReceiver

- java.lang.Object
- - org.appng.core.controller.messaging.TribesReceiver

- All Implemented Interfaces:
    Closeable, AutoCloseable, Runnable, org.apache.catalina.tribes.ChannelListener, Receiver

      public class TribesReceiver
      extends Object
      implements Receiver, Runnable, org.apache.catalina.tribes.ChannelListener

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TribesReceiver()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `accept(Serializable msg, org.apache.catalina.tribes.Member sender)`
    `TribesReceiver` | `configure(Serializer eventSerializer)` Configures the receiver
    `Sender` | `createSender()` Creates and returns a `Sender` capable of sending `Event`s that can be received by this type of receiver.
    `protected String` | `getGroupAddress()`
    `protected Integer` | `getGroupPort()`
    `protected org.apache.catalina.tribes.ChannelInterceptor` | `getMessageDispatchInterceptor()`
    `protected InetAddress` | `getNodeAddress()`
    `protected boolean` | `isSameAddress(String hostAddress)`
    `void` | `messageReceived(Serializable msg, org.apache.catalina.tribes.Member sender)`
    `void` | `registerHandler(EventHandler<?> handler)` Registers a new `EventHandler`
    `void` | `run()`
    `void` | `runWith(ExecutorService executorService)` Since a receiver runs as a thread, the given `ExecutorService` should be used to run this thread.
    `void` | `setDefaultHandler(EventHandler<?> defaultHandler)` Sets the default `EventHandler`, used when no other handler is registered for a certain event type
    `protected void` | `setGroupAddress(String address)`
    `protected void` | `setGroupPort(Integer port)`

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

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

    - ### Methods inherited from interface org.appng.api.messaging.Receiver

      `close`

    - ### Methods inherited from interface org.apache.catalina.tribes.ChannelListener

      `equals, hashCode`

- - ### Constructor Detail

    - #### TribesReceiver

          public TribesReceiver()

  - ### Method Detail

    - #### configure

          public TribesReceiver configure(Serializer eventSerializer)

      Description copied from interface: `Receiver`
      Configures the receiver
      Specified by:
        `configure` in interface `Receiver`
      Parameters:
        `eventSerializer` - the `Serializer` for this receiver
      Returns:
        the configured receiver

    - #### runWith

          public void runWith(ExecutorService executorService)

      Description copied from interface: `Receiver`
      Since a receiver runs as a thread, the given `ExecutorService` should be used to run this thread.
      Specified by:
        `runWith` in interface `Receiver`
      Parameters:
        `executorService` - the `ExecutorService` to run this receiver with

    - #### createSender

          public Sender createSender()

      Description copied from interface: `Receiver`
      Creates and returns a `Sender` capable of sending `Event`s that can be received by this type of receiver.
      Specified by:
        `createSender` in interface `Receiver`
      Returns:
        the `Sender`

    - #### run

          public void run()

      Specified by:
        `run` in interface `Runnable`

    - #### getMessageDispatchInterceptor

          protected org.apache.catalina.tribes.ChannelInterceptor getMessageDispatchInterceptor()
                                                                                         throws ReflectiveOperationException

      Throws:
        `ReflectiveOperationException`

    - #### messageReceived

          public void messageReceived(Serializable msg,
                                      org.apache.catalina.tribes.Member sender)

      Specified by:
        `messageReceived` in interface `org.apache.catalina.tribes.ChannelListener`

    - #### accept

          public boolean accept(Serializable msg,
                                org.apache.catalina.tribes.Member sender)

      Specified by:
        `accept` in interface `org.apache.catalina.tribes.ChannelListener`

    - #### getNodeAddress

          protected InetAddress getNodeAddress()
                                        throws UnknownHostException

      Throws:
        `UnknownHostException`

    - #### registerHandler

          public void registerHandler(EventHandler<?> handler)

      Description copied from interface: `Receiver`
      Registers a new `EventHandler`
      Specified by:
        `registerHandler` in interface `Receiver`
      Parameters:
        `handler` - the `EventHandler` to register

    - #### setDefaultHandler

          public void setDefaultHandler(EventHandler<?> defaultHandler)

      Description copied from interface: `Receiver`
      Sets the default `EventHandler`, used when no other handler is registered for a certain event type
      Specified by:
        `setDefaultHandler` in interface `Receiver`
      Parameters:
        `defaultHandler` - the default `EventHandler` to use

    - #### getGroupPort

          protected Integer getGroupPort()

    - #### getGroupAddress

          protected String getGroupAddress()

    - #### setGroupPort

          protected void setGroupPort(Integer port)

    - #### setGroupAddress

          protected void setGroupAddress(String address)

    - #### isSameAddress

          protected boolean isSameAddress(String hostAddress)
                                   throws UnknownHostException,
                                          SocketException

      Throws:
        `UnknownHostException`
        `SocketException`

Copyright © 2011–2023 aiticon GmbH. All rights reserved.