org.modeshape.jcr.clustering

## Class MessageConsumer<T extends Serializable>

- java.lang.Object
- - org.modeshape.jcr.clustering.MessageConsumer<T>

- Type Parameters:
    `T` - the payload type that this consumer expects
  Direct Known Subclasses:
    ClusteredJournal, ClusteredRepositoryChangeBus

      public abstract class MessageConsumer<T extends Serializable>
      extends Object

  Interface allowing participants in a cluster to communicate to each other using different messages.
  See Also:
    `ClusteringService.sendMessage(java.io.Serializable)`

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `MessageConsumer(Class<T> payloadType)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `consume(T payload)` Consumes a payload of the given type.
    `Class<T>` | `getPayloadType()` Returns the type of the payload;

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

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

- - ### Constructor Detail

    - #### MessageConsumer

          protected MessageConsumer(Class<T> payloadType)

  - ### Method Detail

    - #### getPayloadType

          public Class<T> getPayloadType()

      Returns the type of the payload;
      Returns:
        a `Class` instance never null;

    - #### consume

          public abstract void consume(T payload)

      Consumes a payload of the given type.
      Parameters:
        `payload` - a `Serializable` payload.

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.