jPOS 1.6.5 API Documentation

org.jpos.space
Class SpaceMUX

java.lang.Object
  extended by org.jpos.util.SimpleLogSource
      extended by org.jpos.space.SpaceMUX
All Implemented Interfaces:
Configurable, ReConfigurable, MUX, SpaceListener, LogSource

public class SpaceMUX
extends SimpleLogSource
implements MUX, ReConfigurable, SpaceListener

Space based MUX implementation

Version:
$Revision: 2776 $ $Date: 2009-09-18 18:53:31 -0700 (Fri, 18 Sep 2009) $
Author:
Alejandro Revilla
See Also:
MUX

Constructor Summary
SpaceMUX()
           
SpaceMUX(java.lang.String to, java.lang.String from, java.lang.String unhandled)
           
 
Method Summary
static MUX getMUX(java.lang.String name)
           
 java.lang.String getName()
           
 boolean isConnected()
           
 void notify(java.lang.Object k, java.lang.Object value)
          Called by Space implementation whenever an object with the given key is being placed in the Space.
 ISOMsg request(ISOMsg m, long timeout)
           
 void request(ISOMsg m, long timeout, ISOResponseListener r, java.lang.Object handBack)
           
 void setConfiguration(Configuration cfg)
          reads "to", "from" and optional "unhandled" properties
 void setName(java.lang.String name)
          associates this MUX with a name using NameRegistrar
 
Methods inherited from class org.jpos.util.SimpleLogSource
error, error, getLogger, getRealm, info, info, setLogger, setRealm, warning, warning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpaceMUX

public SpaceMUX()

SpaceMUX

public SpaceMUX(java.lang.String to,
                java.lang.String from,
                java.lang.String unhandled)
Parameters:
to - output queue
from - input queue
unhandled - optional unhandled queue (may be null)
Method Detail

setConfiguration

public void setConfiguration(Configuration cfg)
                      throws ConfigurationException
reads "to", "from" and optional "unhandled" properties

Specified by:
setConfiguration in interface Configurable
Parameters:
cfg -
Throws:
ConfigurationException

request

public ISOMsg request(ISOMsg m,
                      long timeout)
               throws ISOException
Specified by:
request in interface MUX
Parameters:
m - message to send
timeout - amount of time in millis to wait for a response
Returns:
response or null
Throws:
ISOException

notify

public void notify(java.lang.Object k,
                   java.lang.Object value)
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
Parameters:
k - Object's key
value - Object's value

setName

public void setName(java.lang.String name)
associates this MUX with a name using NameRegistrar

Parameters:
name - name to register
See Also:
NameRegistrar

getName

public java.lang.String getName()
Returns:
this ISOMUX's name ("" if no name was set)

getMUX

public static MUX getMUX(java.lang.String name)
                  throws NameRegistrar.NotFoundException
Returns:
MUX instance with given name.
Throws:
NameRegistrar.NotFoundException;
NameRegistrar.NotFoundException
See Also:
NameRegistrar

isConnected

public boolean isConnected()
Specified by:
isConnected in interface MUX
Returns:
true if connected

request

public void request(ISOMsg m,
                    long timeout,
                    ISOResponseListener r,
                    java.lang.Object handBack)
             throws ISOException
Specified by:
request in interface MUX
Throws:
ISOException

jPOS.org