|
xmlBlaster 1.6.2 client API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.xmlBlaster.util.protocol.RequestReplyExecutor
Request/reply simulates a local method invocation.
A common base class for socket or email based messaging. Allows to block during a request and deliver the return message to the waiting thread.
| Field Summary | |
protected AddressBase |
addressConfig
|
protected org.xmlBlaster.engine.qos.AddressServer |
addressServer
|
protected I_CallbackExtended |
cbClient
This is the client side |
protected boolean |
compressZlib
|
protected boolean |
compressZlibStream
|
protected ContextNode |
contextNode
|
protected Global |
glob
|
protected java.lang.Object |
mbeanHandle
My JMX registration, can be done optionally by implementing classes |
protected int |
minSizeForCompression
|
static boolean |
ONEWAY
Used for execute() |
protected long |
pingResponseTimeout
How long to block on remote call waiting on ping responses |
protected java.lang.String |
prefix
The prefix to create a unique requestId namspace (is set to the loginName) |
protected I_ProgressListener |
progressListener
A listener may register to receive send/receive progress informations |
protected java.util.Map |
responseListenerMap
For listeners who want to be informed about return messages or exceptions, the invocation is blocking during this period. |
protected long |
responseTimeout
How long to block on remote call waiting on response |
protected long |
updateResponseTimeout
How long to block on remote call waiting on update responses |
protected boolean |
useEmailExpiryTimestamp
|
static boolean |
WAIT_ON_RESPONSE
Used for execute() |
| Constructor Summary | |
RequestReplyExecutor()
|
|
| Method Summary | |
void |
addResponseListener(java.lang.String requestId,
I_ResponseListener l)
Adds the listener to receive response/exception events. |
void |
clearResponseListenerMap()
|
protected void |
executeException(MsgInfo receiver,
XmlBlasterException e,
boolean udp)
Send a one way exception back to the other side |
protected void |
executeResponse(MsgInfo receiver,
java.lang.Object response,
boolean udp)
Send a one way response message back to the other side |
void |
freePendingThreads()
If we detect somewhere that the socket is down use this method to free blocking threads which wait on responses |
org.xmlBlaster.engine.qos.AddressServer |
getAddressServer()
|
I_CallbackExtended |
getCbClient()
|
long |
getDefaultPingResponseTimeout()
How long to block on remote call waiting on a ping response. |
long |
getDefaultResponseTimeout()
How long to block on remote call waiting on response. |
long |
getDefaultUpdateResponseTimeout()
How long to block on remote call waiting on a update() response. |
java.sql.Timestamp |
getExpiryTimestamp(MethodName methodName)
Return the time in future when the email can be deleted. |
int |
getMinSizeForCompression()
Compressing too small messages won't reduce the size |
java.lang.String |
getPendingRequestList()
For logging only |
long |
getPingResponseTimeout()
The invocation timeout for "ping" method calls. |
I_ProgressListener |
getProgressListener()
|
I_ResponseListener |
getResponseListener(java.lang.String requestId)
Get the response listener object |
long |
getResponseTimeout()
The invocation timeout for all remaining method calls like "publish", "connect", "subscribe" but NOT for "ping" and "update" |
long |
getResponseTimeout(MethodName methodName)
|
long |
getResponseTimeout(java.lang.String methodName)
Access the timeout for method invocation. |
java.lang.String |
getResponseTimeoutPropertyName(MethodName methodName)
For logging. |
abstract java.lang.String |
getType()
The protocol type, used for logging |
long |
getUpdateResponseTimeout()
|
org.xmlBlaster.protocol.I_XmlBlaster |
getXmlBlasterCore()
|
protected boolean |
hasConnection()
|
protected void |
initialize(Global glob,
AddressBase addressConfig)
Used by SocketCallbackImpl on client side, uses I_CallbackExtended to invoke client classes Used by HandleClient on server side, uses I_XmlBlaster to invoke xmlBlaster core This executor has mixed client and server specific code for two reasons: - Possibly we can use the same socket between two xmlBlaster server (load balance) - Everything is together |
int |
interruptInvocation()
Interrupts a blocking request with a not returning reply. |
boolean |
isCompressZlib()
|
boolean |
isCompressZlibStream()
|
boolean |
isShutdown()
Check status |
boolean |
isUseEmailExpiryTimestamp()
|
boolean |
receiveReply(MsgInfo receiver,
boolean udp)
Handle common messages |
I_ProgressListener |
registerProgressListener(I_ProgressListener listener)
|
void |
removeResponseListener(java.lang.String requestId)
Removes the specified listener. |
java.lang.Object |
requestAndBlockForReply(MsgInfo msgInfo,
boolean expectingResponse,
boolean udp)
Send a message and block until the response arrives. |
protected abstract void |
sendMessage(MsgInfo msgInfo,
java.lang.String requestId,
MethodName methodName,
boolean udp)
Flush the data to the protocol layer (socket, email, ...). |
void |
setCbClient(I_CallbackExtended cbClient)
|
void |
setCompressZlib(boolean compress)
|
void |
setCompressZlibStream(boolean compress)
|
protected void |
setLoginName(java.lang.String loginName)
Sets the loginName and automatically the requestId as well |
void |
setMinSizeForCompression(int minSizeForCompression)
|
void |
setPingResponseTimeout(long millis)
Set the given millis to protect against blocking client for ping invocations. |
void |
setResponseTimeout(long millis)
Set the given millis to protect against blocking client. |
void |
setUpdateResponseTimeout(long millis)
Set the given millis to protect against blocking client for update() invocations. |
void |
setUseEmailExpiryTimestamp(boolean useEmailExpiryTimestamp)
|
void |
setXmlBlasterCore(org.xmlBlaster.protocol.I_XmlBlaster xmlBlaster)
|
void |
shutdown()
Shutdown the plugin, free resources. |
java.lang.String |
usage()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.xmlBlaster.util.admin.I_AdminPlugin |
getVersion |
| Methods inherited from interface org.xmlBlaster.util.admin.I_AdminUsage |
getUsageUrl, setUsageUrl |
| Field Detail |
protected Global glob
protected java.lang.String prefix
protected long responseTimeout
protected long pingResponseTimeout
protected long updateResponseTimeout
protected I_CallbackExtended cbClient
protected AddressBase addressConfig
protected org.xmlBlaster.engine.qos.AddressServer addressServer
protected I_ProgressListener progressListener
protected int minSizeForCompression
protected boolean compressZlib
protected boolean compressZlibStream
protected boolean useEmailExpiryTimestamp
protected final java.util.Map responseListenerMap
public static final boolean ONEWAY
public static final boolean WAIT_ON_RESPONSE
protected java.lang.Object mbeanHandle
protected ContextNode contextNode
| Constructor Detail |
public RequestReplyExecutor()
| Method Detail |
protected void initialize(Global glob,
AddressBase addressConfig)
addressConfig - The configuration to usepublic org.xmlBlaster.engine.qos.AddressServer getAddressServer()
public abstract java.lang.String getType()
getType in interface I_AdminPluginpublic I_ProgressListener registerProgressListener(I_ProgressListener listener)
public final I_ProgressListener getProgressListener()
public long getDefaultResponseTimeout()
public long getDefaultPingResponseTimeout()
public long getDefaultUpdateResponseTimeout()
public final void setResponseTimeout(long millis)
setResponseTimeout in interface RequestReplyExecutorMBeanmillis - If <= 0 it is set to the default (forever).
An argument less than or equal to zero means not to wait at all
and is not supportedpublic final void setPingResponseTimeout(long millis)
setPingResponseTimeout in interface RequestReplyExecutorMBeanmillis - If <= 0 it is set to the default (one minute).
An argument less than or equal to zero means not to wait at all
and is not supportedpublic final void setUpdateResponseTimeout(long millis)
setUpdateResponseTimeout in interface RequestReplyExecutorMBeanmillis - If <= 0 it is set to the default (one minute).
An argument less than or equal to zero means not to wait at all
and is not supportedpublic long getResponseTimeout(MethodName methodName)
public long getResponseTimeout(java.lang.String methodName)
getResponseTimeout in interface RequestReplyExecutorMBeanmethodName - e.g. "PING", "UPDATE", "SUBSCRIBE", "PUBLISH", ...
public java.sql.Timestamp getExpiryTimestamp(MethodName methodName)
public java.lang.String getResponseTimeoutPropertyName(MethodName methodName)
methodName -
public final void setCbClient(I_CallbackExtended cbClient)
public final void setXmlBlasterCore(org.xmlBlaster.protocol.I_XmlBlaster xmlBlaster)
public final org.xmlBlaster.protocol.I_XmlBlaster getXmlBlasterCore()
public final I_CallbackExtended getCbClient()
protected void setLoginName(java.lang.String loginName)
public final void addResponseListener(java.lang.String requestId,
I_ResponseListener l)
public final void removeResponseListener(java.lang.String requestId)
public final I_ResponseListener getResponseListener(java.lang.String requestId)
public final java.lang.String getPendingRequestList()
public void clearResponseListenerMap()
public boolean receiveReply(MsgInfo receiver,
boolean udp)
throws XmlBlasterException,
java.io.IOException
XmlBlasterException
java.io.IOExceptionprotected boolean hasConnection()
public java.lang.Object requestAndBlockForReply(MsgInfo msgInfo,
boolean expectingResponse,
boolean udp)
throws XmlBlasterException,
java.io.IOException
expectingResponse - WAIT_ON_RESPONSE=true or ONEWAY=falseudp - Some user info which is passed through
XmlBlasterException
java.io.IOExceptionpublic void shutdown()
I_AdminPlugin
shutdown in interface I_AdminPluginpublic int interruptInvocation()
interruptInvocation in interface RequestReplyExecutorMBeanpublic final void freePendingThreads()
protected final void executeResponse(MsgInfo receiver,
java.lang.Object response,
boolean udp)
throws XmlBlasterException,
java.io.IOException
XmlBlasterException
java.io.IOException
protected final void executeException(MsgInfo receiver,
XmlBlasterException e,
boolean udp)
throws XmlBlasterException,
java.io.IOException
XmlBlasterException
java.io.IOException
protected abstract void sendMessage(MsgInfo msgInfo,
java.lang.String requestId,
MethodName methodName,
boolean udp)
throws XmlBlasterException,
java.io.IOException
XmlBlasterException
java.io.IOExceptionpublic boolean isCompressZlib()
isCompressZlib in interface RequestReplyExecutorMBeanpublic void setCompressZlib(boolean compress)
setCompressZlib in interface RequestReplyExecutorMBeanpublic int getMinSizeForCompression()
getMinSizeForCompression in interface RequestReplyExecutorMBeanpublic boolean isCompressZlibStream()
isCompressZlibStream in interface RequestReplyExecutorMBeanpublic void setCompressZlibStream(boolean compress)
setCompressZlibStream in interface RequestReplyExecutorMBeanpublic final long getUpdateResponseTimeout()
getUpdateResponseTimeout in interface RequestReplyExecutorMBeanpublic boolean isUseEmailExpiryTimestamp()
isUseEmailExpiryTimestamp in interface RequestReplyExecutorMBeanpublic void setUseEmailExpiryTimestamp(boolean useEmailExpiryTimestamp)
setUseEmailExpiryTimestamp in interface RequestReplyExecutorMBeanuseEmailExpiryTimestamp - The useEmailExpiryTimestamp to set.public java.lang.String usage()
usage in interface I_AdminUsagepublic boolean isShutdown()
I_AdminPlugin
isShutdown in interface I_AdminPluginpublic final long getPingResponseTimeout()
getPingResponseTimeout in interface RequestReplyExecutorMBeanpublic final long getResponseTimeout()
getResponseTimeout in interface RequestReplyExecutorMBeanpublic void setMinSizeForCompression(int minSizeForCompression)
setMinSizeForCompression in interface RequestReplyExecutorMBeanminSizeForCompression - The minSizeForCompression to set.
|
xmlBlaster 1.6.2 client API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||