Package org.jpos.q2.iso
Class QMUX
- java.lang.Object
-
- org.jpos.q2.QBeanSupport
-
- org.jpos.q2.iso.QMUX
-
- All Implemented Interfaces:
Configurable
,ISOSource
,MUX
,QMUXMBean
,QBean
,QBeanSupportMBean
,QPersist
,SpaceListener
,Loggeable
,MetricsProvider
public class QMUX extends QBeanSupport implements SpaceListener, MUX, QMUXMBean, Loggeable, MetricsProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
QMUX.AsyncRequest
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
ignorerc
protected java.lang.String
in
protected java.lang.String[]
key
protected java.lang.String[]
mtiMapping
protected java.lang.String
out
protected java.lang.String[]
ready
protected LocalSpace
sp
protected java.lang.String
unhandled
-
Fields inherited from class org.jpos.q2.QBeanSupport
cfg, log, scheduledThreadPoolExecutor
-
-
Constructor Summary
Constructors Constructor Description QMUX()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addISORequestListener(ISORequestListener l)
void
destroyService()
void
dump(java.io.PrintStream p, java.lang.String indent)
java.lang.String
getCountersAsString()
long
getIdleTimeInMillis()
java.lang.String
getInQueue()
java.lang.String
getKey(ISOMsg m)
long
getLastTxnTimestampInMillis()
Metrics
getMetrics()
static MUX
getMUX(java.lang.String name)
java.lang.String
getOutQueue()
java.lang.String[]
getReadyIndicatorNames()
int
getRXCounter()
int
getRXExpired()
int
getRXForwarded()
int
getRXPending()
int
getRXUnhandled()
Space
getSpace()
int
getTXCounter()
int
getTXExpired()
int
getTXPending()
java.lang.String
getUnhandledQueue()
void
initService()
boolean
isConnected()
protected boolean
isNotifyEligible(ISOMsg msg)
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.protected void
processUnhandled(ISOMsg m)
boolean
removeISORequestListener(ISORequestListener l)
ISOMsg
request(ISOMsg m, long timeout)
Sends a message to remote host and wait for responsevoid
request(ISOMsg m, long timeout, ISOResponseListener rl, java.lang.Object handBack)
Sends a message to remote host in async wayvoid
resetCounters()
void
send(ISOMsg m)
sends (or hands back) an ISOMsgvoid
setInQueue(java.lang.String in)
void
setOutQueue(java.lang.String out)
void
setUnhandledQueue(java.lang.String unhandled)
void
startService()
void
stopService()
-
Methods inherited from class org.jpos.q2.QBeanSupport
addAttr, close, createElement, destroy, getAttrs, getAttrs, getConfiguration, getDump, getFactory, getLoader, getLoaderURLS, getLog, getLogger, getName, getPersist, getProperties, getProperty, getRealm, getScheduledThreadPoolExecutor, getServer, getState, getStateAsString, init, isModified, running, setAttr, setConfiguration, setLogger, setModified, setName, setPersist, setProperty, setRealm, setServer, setState, start, stop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jpos.q2.QBean
destroy, getState, getStateAsString, init, start, stop
-
Methods inherited from interface org.jpos.q2.QBeanSupportMBean
getDump, getLoader, getLoaderURLS, getLogger, getName, getRealm, getServer, setLogger, setName, setPersist, setRealm, setServer
-
Methods inherited from interface org.jpos.q2.QPersist
getPersist, isModified
-
-
-
-
Field Detail
-
sp
protected LocalSpace sp
-
in
protected java.lang.String in
-
out
protected java.lang.String out
-
unhandled
protected java.lang.String unhandled
-
ready
protected java.lang.String[] ready
-
key
protected java.lang.String[] key
-
ignorerc
protected java.lang.String ignorerc
-
mtiMapping
protected java.lang.String[] mtiMapping
-
-
Constructor Detail
-
QMUX
public QMUX()
-
-
Method Detail
-
initService
public void initService() throws ConfigurationException
- Overrides:
initService
in classQBeanSupport
- Throws:
ConfigurationException
-
startService
public void startService()
- Overrides:
startService
in classQBeanSupport
-
stopService
public void stopService()
- Overrides:
stopService
in classQBeanSupport
-
destroyService
public void destroyService()
- Overrides:
destroyService
in classQBeanSupport
-
getMUX
public static MUX getMUX(java.lang.String name) throws NameRegistrar.NotFoundException
- Returns:
- MUX with name using NameRegistrar
- Throws:
NameRegistrar.NotFoundException
- See Also:
NameRegistrar
-
request
public ISOMsg request(ISOMsg m, long timeout) throws ISOException
Description copied from interface:MUX
Sends a message to remote host and wait for response- Specified by:
request
in interfaceMUX
- Parameters:
m
- message to sendtimeout
- amount of time in millis to wait for a response- Returns:
- response or null
- Throws:
ISOException
-
request
public void request(ISOMsg m, long timeout, ISOResponseListener rl, java.lang.Object handBack) throws ISOException
Description copied from interface:MUX
Sends a message to remote host in async way- Specified by:
request
in interfaceMUX
- Parameters:
m
- message to sendtimeout
- time to wait for the responserl
- reference to response listenerhandBack
- optional handback to be given to reponse listener- Throws:
ISOException
-
isNotifyEligible
protected boolean isNotifyEligible(ISOMsg msg)
-
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 interfaceSpaceListener
- Parameters:
k
- Object's keyvalue
- Object's value
-
getKey
public java.lang.String getKey(ISOMsg m) throws ISOException
- Throws:
ISOException
-
getMetrics
public Metrics getMetrics()
- Specified by:
getMetrics
in interfaceMetricsProvider
-
setInQueue
public void setInQueue(java.lang.String in)
- Specified by:
setInQueue
in interfaceQMUXMBean
-
getInQueue
public java.lang.String getInQueue()
- Specified by:
getInQueue
in interfaceQMUXMBean
-
setOutQueue
public void setOutQueue(java.lang.String out)
- Specified by:
setOutQueue
in interfaceQMUXMBean
-
getOutQueue
public java.lang.String getOutQueue()
- Specified by:
getOutQueue
in interfaceQMUXMBean
-
setUnhandledQueue
public void setUnhandledQueue(java.lang.String unhandled)
- Specified by:
setUnhandledQueue
in interfaceQMUXMBean
-
getUnhandledQueue
public java.lang.String getUnhandledQueue()
- Specified by:
getUnhandledQueue
in interfaceQMUXMBean
-
getReadyIndicatorNames
public java.lang.String[] getReadyIndicatorNames()
-
addISORequestListener
public void addISORequestListener(ISORequestListener l)
-
removeISORequestListener
public boolean removeISORequestListener(ISORequestListener l)
-
resetCounters
public void resetCounters()
- Specified by:
resetCounters
in interfaceQMUXMBean
-
getCountersAsString
public java.lang.String getCountersAsString()
- Specified by:
getCountersAsString
in interfaceQMUXMBean
-
getTXCounter
public int getTXCounter()
- Specified by:
getTXCounter
in interfaceQMUXMBean
-
getRXCounter
public int getRXCounter()
- Specified by:
getRXCounter
in interfaceQMUXMBean
-
getTXExpired
public int getTXExpired()
- Specified by:
getTXExpired
in interfaceQMUXMBean
-
getTXPending
public int getTXPending()
- Specified by:
getTXPending
in interfaceQMUXMBean
-
getRXExpired
public int getRXExpired()
- Specified by:
getRXExpired
in interfaceQMUXMBean
-
getRXPending
public int getRXPending()
- Specified by:
getRXPending
in interfaceQMUXMBean
-
getRXUnhandled
public int getRXUnhandled()
- Specified by:
getRXUnhandled
in interfaceQMUXMBean
-
getRXForwarded
public int getRXForwarded()
- Specified by:
getRXForwarded
in interfaceQMUXMBean
-
getLastTxnTimestampInMillis
public long getLastTxnTimestampInMillis()
- Specified by:
getLastTxnTimestampInMillis
in interfaceQMUXMBean
-
getIdleTimeInMillis
public long getIdleTimeInMillis()
- Specified by:
getIdleTimeInMillis
in interfaceQMUXMBean
-
processUnhandled
protected void processUnhandled(ISOMsg m)
-
send
public void send(ISOMsg m) throws java.io.IOException, ISOException
sends (or hands back) an ISOMsg- Specified by:
send
in interfaceISOSource
- Parameters:
m
- the Message to be sent- Throws:
java.io.IOException
ISOException
-
isConnected
public boolean isConnected()
- Specified by:
isConnected
in interfaceISOSource
- Returns:
- true if source is connected and usable
-
-