Class SpaceSource

java.lang.Object
org.jpos.space.SpaceSource
All Implemented Interfaces:
Serializable, ISOSource, SpaceListener<String,ISOMsg>

Serializable ISOSource that forwards outbound messages through a Space, decoupling the originating source from the response-routing thread. Used by SendResponse and other deferred-send participants.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpaceSource(LocalSpace sp, ISOSource source, long timeout)
    Constructs a SpaceSource that publishes the original source into the internal jPOS space and listens on the correlation key for responses.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    init(LocalSpace sp, long timeout)
    Re-initialises the space binding after deserialization.
    boolean
    Indicates whether this source is currently connected and able to send messages.
    void
    notify(String key, ISOMsg m)
    Called by Space implementation whenever an object with the given key is being placed in the Space.
    void
    sends (or hands back) an ISOMsg

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SpaceSource

      public SpaceSource(LocalSpace sp, ISOSource source, long timeout)
      Constructs a SpaceSource that publishes the original source into the internal jPOS space and listens on the correlation key for responses.
      Parameters:
      sp - local space used for response delivery
      source - originating source whose connectivity is captured at construction
      timeout - space-entry lease in milliseconds
  • Method Details

    • init

      public void init(LocalSpace sp, long timeout)
      Re-initialises the space binding after deserialization.
      Parameters:
      sp - local space used for response delivery
      timeout - space-entry lease in milliseconds
    • send

      public void send(ISOMsg m) throws IOException, ISOException
      Description copied from interface: ISOSource
      sends (or hands back) an ISOMsg
      Specified by:
      send in interface ISOSource
      Parameters:
      m - the Message to be sent
      Throws:
      IOException - on I/O failure
      ISOException - on ISO packing failure
    • isConnected

      public boolean isConnected()
      Description copied from interface: ISOSource
      Indicates whether this source is currently connected and able to send messages.
      Specified by:
      isConnected in interface ISOSource
      Returns:
      true if source is connected and usable
    • notify

      public void notify(String key, ISOMsg m)
      Description copied from interface: SpaceListener

      Called by Space implementation whenever an object with the given key is being placed in the Space.

      Specified by:
      notify in interface SpaceListener<String,ISOMsg>
      Parameters:
      key - Object's key
      m - Object's value