Class SpaceSource
java.lang.Object
org.jpos.space.SpaceSource
- All Implemented Interfaces:
Serializable, ISOSource, SpaceListener<String,ISOMsg>
public class SpaceSource
extends Object
implements ISOSource, SpaceListener<String,ISOMsg>, Serializable
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
ConstructorsConstructorDescriptionSpaceSource(LocalSpace sp, ISOSource source, long timeout) Constructs a SpaceSource that publishes the originalsourceinto the internal jPOS space and listens on the correlation key for responses. -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(LocalSpace sp, long timeout) Re-initialises the space binding after deserialization.booleanIndicates whether this source is currently connected and able to send messages.voidCalled by Space implementation whenever an object with the given key is being placed in the Space.voidsends (or hands back) an ISOMsg
-
Constructor Details
-
SpaceSource
Constructs a SpaceSource that publishes the originalsourceinto the internal jPOS space and listens on the correlation key for responses.- Parameters:
sp- local space used for response deliverysource- originating source whose connectivity is captured at constructiontimeout- space-entry lease in milliseconds
-
-
Method Details
-
init
Re-initialises the space binding after deserialization.- Parameters:
sp- local space used for response deliverytimeout- space-entry lease in milliseconds
-
send
Description copied from interface:ISOSourcesends (or hands back) an ISOMsg- Specified by:
sendin interfaceISOSource- Parameters:
m- the Message to be sent- Throws:
IOException- on I/O failureISOException- on ISO packing failure
-
isConnected
Description copied from interface:ISOSourceIndicates whether this source is currently connected and able to send messages.- Specified by:
isConnectedin interfaceISOSource- Returns:
- true if source is connected and usable
-
notify
Description copied from interface:SpaceListenerCalled by Space implementation whenever an object with the given key is being placed in the Space.
- Specified by:
notifyin interfaceSpaceListener<String,ISOMsg> - Parameters:
key- Object's keym- Object's value
-