|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface CommBridge
A bridge between communications used internally by the application, and communications used outside the application. Essentially this is a messaging adaptor callback interface implemented by a node to support moving from the internal messaging mechanism to one outside the application.
As an example, consider an application that communicates via direct messaging within a server, and JMS when going across servers. If this application also wants to support web services, but doesn't want that to pervade their core messaging implementation, then the web service adaptor is going to need an anchor point into the application to do its work. This interface describes that anchor point.
The callback for synchronous communications is through the onReceive method. Asynchronous communications can be done either through a thread interrupt, or polling/buffering. The settings depend on the technology being adapted. For a standard messaging conversion, you would expect a short polling interval and small retention buffer. For something more batch oriented, the interval might be long with a correspondingly large retention buffer. The correct values depend on the bridge.
The CommBridge is responsible for authentication. This is typically handled by decrypting an incoming message using the key for the specified user, to confirm that the message is in fact coming from them. Broadcast messages are encrypted as needed to prevent unauthorized receipt.
| Method Summary | |
|---|---|
AuthUserLookup |
getAuthUserLookup()
Return an AuthUserLookup instance used for authenticating the source of an incoming request. |
AuthWrapper |
getBufferedMessages()
Return the currently buffered messages. |
SandEncryptor |
getEncryptor()
Return a SandEncryptor instance used for decyphering the request message and returning the result. |
Logger |
getLogger()
Return a logger for output messages. |
int |
getMaxRetention()
Returns the maximum number of asynchronous send messages that can be retained. |
long |
getMinSendIntervalMillis()
The minimum number of milliseconds between each asynchronous message arrival. |
int |
getPreferredRetention()
Returns the preferred number of asynchronous send messages to be retained. |
int |
getRetention()
Returns the number of asynchronous send messages currently being retained. |
CharSerializer |
getSerializer()
Return a CharSerializer instance used for reconstituting the request message or result message. |
AuthWrapper |
onReceive(AuthWrapper message)
Process the given message and return the result. |
void |
popBufferedMessages(SandMessage[] messages)
Remove the specified messages from the front of the message buffer as they have now been processed. |
void |
setAsynchThread(java.lang.Thread thread)
When a message is delivered to the bridge asynchronously, it can signal the bridged comms technology that a new message has arrived by calling the interrupt method of the given thread. |
void |
setRetention(int numMessages)
Sets the maximum number of asynchronous send messages that should be maintained. |
| Method Detail |
|---|
AuthUserLookup getAuthUserLookup()
SandEncryptor getEncryptor()
CharSerializer getSerializer()
AuthWrapper onReceive(AuthWrapper message)
throws SandException
SandException
void setAsynchThread(java.lang.Thread thread)
throws SandException
This is not a mechanism for managing broadcast to a multitude of client processes. However this thread may be for a broadcast manager which takes care of this.
SandExceptionlong getMinSendIntervalMillis()
AuthWrapper getBufferedMessages()
void popBufferedMessages(SandMessage[] messages)
int getMaxRetention()
int getPreferredRetention()
int getRetention()
void setRetention(int numMessages)
Logger getLogger()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||