com.thinkaurelius.titan.diskstorage.log.util

## Class FutureMessage<M extends Message>

- java.lang.Object
- - com.google.common.util.concurrent.AbstractFuture<Message>
  - - com.thinkaurelius.titan.diskstorage.log.util.FutureMessage<M>

- All Implemented Interfaces:
    com.google.common.util.concurrent.ListenableFuture<Message>, Future<Message>

      public class FutureMessage<M extends Message>
      extends com.google.common.util.concurrent.AbstractFuture<Message>

  Implementation of a `Future` for `Message`s that are being added to the `Log` via `Log.add(com.thinkaurelius.titan.diskstorage.StaticBuffer)`. This class can be used by `Log` implementations to wrap messages.
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FutureMessage(M message)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `delivered()` This method should be called by `Log` implementations when the message was successfully added to the log.
    `void` | `failed(Throwable exception)` This method should be called by implementations when the message could not be added to the log with the respective exception object.
    `M` | `getMessage()` Returns the actual message that was added to the log
    `String` | `toString()`

    - ### Methods inherited from class com.google.common.util.concurrent.AbstractFuture

      `addListener, cancel, get, get, interruptTask, isCancelled, isDone, set, setException, wasInterrupted`

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

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

- - ### Constructor Detail

    - #### FutureMessage

          public FutureMessage(M message)

  - ### Method Detail

    - #### getMessage

          public M getMessage()

      Returns the actual message that was added to the log
      Returns:

    - #### delivered

          public void delivered()

      This method should be called by `Log` implementations when the message was successfully added to the log.

    - #### failed

          public void failed(Throwable exception)

      This method should be called by implementations when the message could not be added to the log with the respective exception object.
      Parameters:
        `exception` -

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2012–2014. All rights reserved.