|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.util.dispatch.DispatchConnectionsHandler
public abstract class DispatchConnectionsHandler
Holding all necessary infos to establish a remote connection and invoke update()/updateOneway()/ping().
This instance is a 'logical connection' hiding multiple 'physical' connections (called DispatchConnection).
One instance of this is used for each DispatchManager (one logical connection).
State chart of the 'logical connection', initially UNDEF: +<-----------------initialize()--------------+ | | | +<--toAlive()----+ +<-initialize()+ | | | initialize() | | | | | | | | | | ######### ########## ########## # # # # # # # ALIVE # # POLLING # # DEAD # # # # # # # ######### ########## ########## | | | | | | | +--toPolling()-->+ +--toDead()-->+ | | initialize() initialize() | | | +------------------toDead()----------------->+ initialize()
Note: Recovery from dead state is only possible if new callback addresses are passed with initialize()
Note: toAlive(), toPolling() and toDead() are called by a single DispatchConnection only, telling its state change.
Field Summary | |
---|---|
protected I_DispatchManager |
dispatchManager
|
protected Global |
glob
|
java.lang.String |
ME
|
protected I_PostSendListener |
postSendListener
|
protected DispatchStatistic |
statistic
|
Constructor Summary | |
---|---|
DispatchConnectionsHandler(Global glob,
I_DispatchManager dispatchManager)
You need to call initialize() after construction. |
Method Summary | |
---|---|
void |
addDispatchConnection(DispatchConnection con)
|
void |
clearDispatchConnectionList()
|
abstract DispatchConnection |
createDispatchConnection(AddressBase address)
Create a DispatchConnection instance and load the protocol plugin. |
abstract void |
createFakedReturnObjects(I_QueueEntry[] entries,
java.lang.String state,
java.lang.String stateInfo)
If no connection is available but the message is for example save queued, we can generate here valid return objects |
abstract java.util.ArrayList |
filterDistributorEntries(java.util.ArrayList entries,
java.lang.Throwable ex)
|
AddressBase |
getAliveAddress()
|
DispatchConnection |
getAliveDispatchConnection()
|
int |
getCountDispatchConnection()
|
DispatchConnection |
getCurrentDispatchConnection()
|
AddressBase |
getDeadAddress()
|
DispatchConnection |
getDeadDispatchConnection()
|
DispatchConnection[] |
getDispatchConnectionArr()
|
I_DispatchManager |
getDispatchManager()
|
DispatchStatistic |
getDispatchStatistic()
|
DispatchConnection |
getPollingDispatchConnection()
|
I_PostSendListener |
getPostSendListener()
Access the listener for send messages. |
ConnectionStateEnum |
getState()
|
void |
initialize(AddressBase[] cbAddr)
Overwrite existing connections with new configuration |
boolean |
isAlive()
|
boolean |
isDead()
|
boolean |
isPolling()
|
boolean |
isUndef()
|
abstract boolean |
isUserThread()
|
void |
registerPostSendListener(I_PostSendListener postSendListener)
Register a listener to get notifications when a messages is successfully send. |
void |
send(MsgQueueEntry[] msgArr,
boolean isAsyncMode)
Send the messages back to the client. |
void |
shutdown()
Stop all callback drivers of this client. |
java.lang.String |
toXml(java.lang.String extraOffset)
Dump state of this object into a XML ASCII string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final java.lang.String ME
protected final Global glob
protected final I_DispatchManager dispatchManager
protected final DispatchStatistic statistic
protected I_PostSendListener postSendListener
Constructor Detail |
---|
public DispatchConnectionsHandler(Global glob, I_DispatchManager dispatchManager) throws XmlBlasterException
dispatchManager
- The message queue witch i belong tocbAddr
- The addresses i shall connect to
XmlBlasterException
Method Detail |
---|
public final I_DispatchManager getDispatchManager()
public final I_PostSendListener getPostSendListener()
public final void registerPostSendListener(I_PostSendListener postSendListener)
postSendListener
- The postSendListener to set.public final void initialize(AddressBase[] cbAddr) throws XmlBlasterException
XmlBlasterException
public abstract DispatchConnection createDispatchConnection(AddressBase address) throws XmlBlasterException
XmlBlasterException
public final DispatchConnection getCurrentDispatchConnection()
public final DispatchConnection getAliveDispatchConnection()
public final DispatchConnection getPollingDispatchConnection()
public final AddressBase getAliveAddress()
public final AddressBase getDeadAddress()
public final DispatchConnection getDeadDispatchConnection()
public DispatchConnection[] getDispatchConnectionArr()
public int getCountDispatchConnection()
public void addDispatchConnection(DispatchConnection con)
public void clearDispatchConnectionList()
public final boolean isUndef()
public final boolean isAlive()
public final boolean isPolling()
public final boolean isDead()
public ConnectionStateEnum getState()
public abstract void createFakedReturnObjects(I_QueueEntry[] entries, java.lang.String state, java.lang.String stateInfo) throws XmlBlasterException
state
- e.g. Constants.STATE_OK
XmlBlasterException
public void send(MsgQueueEntry[] msgArr, boolean isAsyncMode) throws java.lang.Throwable, XmlBlasterException
The RETURN value is transferred in the msgArr[i].getReturnObj(), for oneway updates it is null
isAsyncMode
- true if coming from queue
java.lang.Throwable
XmlBlasterException
public final DispatchStatistic getDispatchStatistic()
public abstract boolean isUserThread()
public final void shutdown()
public final java.lang.String toXml(java.lang.String extraOffset)
extraOffset
- indenting of tags for nice output
public abstract java.util.ArrayList filterDistributorEntries(java.util.ArrayList entries, java.lang.Throwable ex)
|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |