de.esprit.common.concurrent

## Class AbstractEventGate<E extends GenericEvent>

- java.lang.Object
- - de.esprit.common.concurrent.AbstractEventGate<E>

- Direct Known Subclasses:
    ABOChangeEventGate, AbstractClientEventGate, NetMessageEventGate

      public abstract class AbstractEventGate<E extends GenericEvent>
      extends java.lang.Object

  This gate opens when the expected event is being received.
  Author:
    Rainer Buesch

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected E` | `lastEvent`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractEventGate()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `E` | `awaitTimingOut(long time, java.util.concurrent.TimeUnit unit)`
    `protected void` | `deregister()` This method is called when isSingleUseOnly flag is set.
    `protected void` | `received(E e)`
    `void` | `setSingleUseOnly(boolean isSingleUseOnly)` Tells whether this gate can be reused or not.

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

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

- - ### Field Detail

    - #### lastEvent

          protected E extends GenericEvent lastEvent

  - ### Constructor Detail

    - #### AbstractEventGate

          public AbstractEventGate()

  - ### Method Detail

    - #### awaitTimingOut

          public E awaitTimingOut(long time,
                         java.util.concurrent.TimeUnit unit)
                                                throws java.util.concurrent.TimeoutException

      Throws:
        `java.util.concurrent.TimeoutException`

    - #### received

          protected void received(E e)

    - #### deregister

          protected void deregister()

      This method is called when isSingleUseOnly flag is set.

    - #### setSingleUseOnly

          public void setSingleUseOnly(boolean isSingleUseOnly)

      Tells whether this gate can be reused or not. If false, then the gate will be reclosed after receiving the expected event, ready to await the next one. If true, then `deregister()` is called after receiving the expected event and the gate remains open forever.

Copyright © 2014 EsprIT-Systems. All Rights Reserved.