org.hibernate.search.backend.jgroups.impl

## Class DispatchMessageSender

- java.lang.Object
- - org.hibernate.search.backend.jgroups.impl.DispatchMessageSender

- All Implemented Interfaces:
    MessageSenderService, Service, Startable, Stoppable

      public final class DispatchMessageSender
      extends Object
      implements MessageSenderService, Startable, Stoppable

  We use the MessageDispatcher instead of the JChannel to be able to use blocking operations (optionally) without having to rely on the RSVP protocol being configured on the stack.
  Author:
    Lukasz Moren, Sanne Grinovero (C) 2012 Red Hat Inc., Ales Justin, Hardy Ferentschik

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CHANNEL_INJECT`
    `static String` | `CLASSLOADER`
    `static String` | `CLUSTER_NAME`
    `static String` | `CONFIGURATION_FILE`
    `static String` | `JGROUPS_PREFIX`
    `static String` | `MUX_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DispatchMessageSender()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Address` | `getAddress()` Get sender's address.
    `View` | `getView()` Get current view.
    `void` | `send(Message message, boolean synchronous, long timeout)` Send message.
    `void` | `start(Properties props, BuildContext context)` Start phase notification.
    `void` | `stop()` Stop phase notification

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

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

- - ### Field Detail

    - #### JGROUPS_PREFIX

          public static final String JGROUPS_PREFIX

      See Also:
        Constant Field Values

    - #### CONFIGURATION_FILE

          public static final String CONFIGURATION_FILE

      See Also:
        Constant Field Values

    - #### CLUSTER_NAME

          public static final String CLUSTER_NAME

      See Also:
        Constant Field Values

    - #### CHANNEL_INJECT

          public static final String CHANNEL_INJECT

      See Also:
        Constant Field Values

    - #### CLASSLOADER

          public static final String CLASSLOADER

      See Also:
        Constant Field Values

    - #### MUX_ID

          public static final String MUX_ID

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DispatchMessageSender

          public DispatchMessageSender()

  - ### Method Detail

    - #### getAddress

          public Address getAddress()

      Description copied from interface: `MessageSenderService`
      Get sender's address.
      Specified by:
        `getAddress` in interface `MessageSenderService`
      Returns:
        the sender's address

    - #### getView

          public View getView()

      Description copied from interface: `MessageSenderService`
      Get current view.
      Specified by:
        `getView` in interface `MessageSenderService`
      Returns:
        the current cluster view

    - #### send

          public void send(Message message,
                           boolean synchronous,
                           long timeout)
                    throws Exception

      Description copied from interface: `MessageSenderService`
      Send message.
      Specified by:
        `send` in interface `MessageSenderService`
      Parameters:
        `message` - the JGroups message
        `synchronous` - set to true if we need to block until an ACK is received
        `timeout` - in milliseconds
      Throws:
        `Exception` - for any error

    - #### start

          public void start(Properties props,
                            BuildContext context)

      Description copied from interface: `Startable`
      Start phase notification.
      Specified by:
        `start` in interface `Startable`
      Parameters:
        `props` - the configuration properties
        `context` - the current context instance

    - #### stop

          public void stop()

      Description copied from interface: `Stoppable`
      Stop phase notification
      Specified by:
        `stop` in interface `Stoppable`

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved