Class SpaceInterceptor<K,V>

java.lang.Object
org.jpos.space.SpaceInterceptor<K,V>
All Implemented Interfaces:
AutoCloseable, Space<K,V>

public class SpaceInterceptor<K,V> extends Object implements Space<K,V>
Intercepts space operations.
Since:
1.4.7
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Space<K,V>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    existAny(K[] keys)
     
    boolean
    existAny(K[] keys, long timeout)
     
    in(K key)
    Take an entry from the space, waiting forever until one exists.
    in(K key, long timeout)
    Take an entry from the space, waiting a limited amount of time until one exists.
    inp(K key)
    In probe takes an entry from the space if one exists, return null otherwise.
    void
    nrd(K key)
    Nrd (not read) waits forever until Key is not present in space.
    Resolution for expiring entries is implementation dependant, but a minimum one-second is suggested.
    nrd(K key, long timeout)
    Nrd (not read) waits up to timeout until Key is not present in space.
    Resolution for expiring entries is implementation dependant, but a minimum one-second is suggested.
    void
    out(K key, V value)
    Write a new entry into the Space
    void
    out(K key, V value, long timeout)
    Write a new entry into the Space, with an timeout value
    void
    push(K key, V value)
    Write a new entry at the head of a queue.
    void
    push(K key, V value, long timeout)
    Write a new entry at the head of the queue with a timeout value
    void
    put(K key, V value)
    Write a single entry at the head of the queue discarding the other entries
    void
    put(K key, V value, long timeout)
    Write a single entry at the head of the queue discarding the other entries, with timeout.
    rd(K key)
    Read an entry from the space, waiting forever until one exists.
    rd(K key, long timeout)
    Read an entry from the space, waiting a limited amount of time until one exists.
    rdp(K key)
    Read probe reads an entry from the space if one exists, return null otherwise.

    Methods inherited from class Object

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

    Methods inherited from interface Space

    close
  • Field Details

  • Constructor Details

  • Method Details

    • out

      public void out(K key, V value)
      Description copied from interface: Space
      Write a new entry into the Space
      Specified by:
      out in interface Space<K,V>
      Parameters:
      key - Entry's key
      value - Object value
    • out

      public void out(K key, V value, long timeout)
      Description copied from interface: Space
      Write a new entry into the Space, with an timeout value
      Specified by:
      out in interface Space<K,V>
      Parameters:
      key - Entry's key
      value - Object value
      timeout - timeout value in millis
    • push

      public void push(K key, V value)
      Description copied from interface: Space
      Write a new entry at the head of a queue.
      Specified by:
      push in interface Space<K,V>
      Parameters:
      key - Entry's key
      value - Object value
    • push

      public void push(K key, V value, long timeout)
      Description copied from interface: Space
      Write a new entry at the head of the queue with a timeout value
      Specified by:
      push in interface Space<K,V>
      Parameters:
      key - Entry's key
      value - Object value
      timeout - timeout value in millis
    • put

      public void put(K key, V value)
      Description copied from interface: Space
      Write a single entry at the head of the queue discarding the other entries
      Specified by:
      put in interface Space<K,V>
      Parameters:
      key - Entry's key
      value - Object value
    • put

      public void put(K key, V value, long timeout)
      Description copied from interface: Space
      Write a single entry at the head of the queue discarding the other entries, with timeout.
      Specified by:
      put in interface Space<K,V>
      Parameters:
      key - Entry's key
      value - Object value
      timeout - timeout value in millis
    • in

      public V in(K key)
      Description copied from interface: Space
      Take an entry from the space, waiting forever until one exists.
      Specified by:
      in in interface Space<K,V>
      Parameters:
      key - Entry's key
      Returns:
      value
    • rd

      public V rd(K key)
      Description copied from interface: Space
      Read an entry from the space, waiting forever until one exists.
      Specified by:
      rd in interface Space<K,V>
      Parameters:
      key - Entry's key
      Returns:
      value
    • in

      public V in(K key, long timeout)
      Description copied from interface: Space
      Take an entry from the space, waiting a limited amount of time until one exists.
      Specified by:
      in in interface Space<K,V>
      Parameters:
      key - Entry's key
      timeout - millis to wait
      Returns:
      value or null
    • rd

      public V rd(K key, long timeout)
      Description copied from interface: Space
      Read an entry from the space, waiting a limited amount of time until one exists.
      Specified by:
      rd in interface Space<K,V>
      Parameters:
      key - Entry's key
      timeout - millis to wait
      Returns:
      value or null
    • inp

      public V inp(K key)
      Description copied from interface: Space
      In probe takes an entry from the space if one exists, return null otherwise.
      Specified by:
      inp in interface Space<K,V>
      Parameters:
      key - Entry's key
      Returns:
      value or null
    • rdp

      public V rdp(K key)
      Description copied from interface: Space
      Read probe reads an entry from the space if one exists, return null otherwise.
      Specified by:
      rdp in interface Space<K,V>
      Parameters:
      key - Entry's key
      Returns:
      value or null
    • nrd

      public void nrd(K key)
      Description copied from interface: Space
      Nrd (not read) waits forever until Key is not present in space.
      Resolution for expiring entries is implementation dependant, but a minimum one-second is suggested.
      Specified by:
      nrd in interface Space<K,V>
      Parameters:
      key - Entry's key
    • nrd

      public V nrd(K key, long timeout)
      Description copied from interface: Space
      Nrd (not read) waits up to timeout until Key is not present in space.
      Resolution for expiring entries is implementation dependant, but a minimum one-second is suggested.
      Specified by:
      nrd in interface Space<K,V>
      Parameters:
      key - Entry's key
      timeout - millis to wait
      Returns:
      value or null
    • existAny

      public boolean existAny(K[] keys)
      Specified by:
      existAny in interface Space<K,V>
      Parameters:
      keys - array of keys to check
      Returns:
      true if one or more keys are available in the space
    • existAny

      public boolean existAny(K[] keys, long timeout)
      Specified by:
      existAny in interface Space<K,V>
      Parameters:
      keys - array of keys to check
      timeout - to wait for any of the entries to become available in millis
      Returns:
      true if one or more keys are available in the space