public class MUXPool extends QBeanSupport implements MUX, MUXPoolMBean
Modifier and Type | Class and Description |
---|---|
static interface |
MUXPool.StrategyHandler
A class implementing this interface can be added to a
MUXPool to override the classical built-in strategies.It could be added to a MUXPool like this: |
Modifier and Type | Field and Description |
---|---|
static int |
PRIMARY_SECONDARY |
static int |
ROUND_ROBIN |
static int |
ROUND_ROBIN_WITH_OVERRIDE |
static int |
SPLIT_BY_DIVISOR |
cfg, log, scheduledThreadPoolExecutor
Constructor and Description |
---|
MUXPool() |
Modifier and Type | Method and Description |
---|---|
protected MUX |
firstAvailableMUX(long maxWait) |
java.lang.String[] |
getMuxNames() |
int |
getStrategy() |
MUXPool.StrategyHandler |
getStrategyHandler() |
protected void |
initHandler(org.jdom2.Element e) |
void |
initService() |
boolean |
isConnected() |
protected MUX |
nextAvailableMUX(int mnumber,
long maxWait) |
ISOMsg |
request(ISOMsg m,
long timeout)
Sends a message to remote host and wait for response
|
void |
request(ISOMsg m,
long timeout,
ISOResponseListener r,
java.lang.Object handBack)
Sends a message to remote host in async way
|
void |
send(ISOMsg m)
sends (or hands back) an ISOMsg
|
void |
stopService() |
addAttr, close, createElement, destroy, destroyService, 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, startService, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDump, getLoader, getLoaderURLS, getLogger, getName, getRealm, getServer, setLogger, setName, setPersist, setRealm, setServer
destroy, getState, getStateAsString, init, start, stop
getPersist, isModified
public static final int PRIMARY_SECONDARY
public static final int ROUND_ROBIN
public static final int ROUND_ROBIN_WITH_OVERRIDE
public static final int SPLIT_BY_DIVISOR
public void initService() throws ConfigurationException
initService
in class QBeanSupport
ConfigurationException
public void stopService()
stopService
in class QBeanSupport
protected void initHandler(org.jdom2.Element e) throws ConfigurationException
ConfigurationException
public ISOMsg request(ISOMsg m, long timeout) throws ISOException
MUX
request
in interface MUX
m
- message to sendtimeout
- time to wait for a messageISOException
public void request(ISOMsg m, long timeout, ISOResponseListener r, java.lang.Object handBack) throws ISOException
MUX
request
in interface MUX
m
- message to sendtimeout
- time to wait for the responser
- reference to response listenerhandBack
- optional handback to be given to reponse listenerISOException
public void send(ISOMsg m) throws ISOException, java.io.IOException
ISOSource
send
in interface ISOSource
m
- the Message to be sentISOException
java.io.IOException
protected MUX firstAvailableMUX(long maxWait)
protected MUX nextAvailableMUX(int mnumber, long maxWait)
public java.lang.String[] getMuxNames()
getMuxNames
in interface MUXPoolMBean
public int getStrategy()
getStrategy
in interface MUXPoolMBean
public MUXPool.StrategyHandler getStrategyHandler()
public boolean isConnected()
isConnected
in interface ISOSource