Package net.sf.eBus.client
Interface ERequestMonitor
-
- All Superinterfaces:
EObject
public interface ERequestMonitor extends EObject
Classes needing to monitorEReplier
request processing must implement this interface. A request monitor must:-
build
the request monitor feed, -
monitor
for requests to and replies from localrepliers
, -
retract
monitoring when no longer necessary, and -
close
feed when no longer needed.
ERequestMonitor
supports three callbacks:-
request(ERequestMessage, String)
: request message delivered to named replier. Because eBus maintains only weak references to eBus objects, the replier's name is passed to the request monitor and not theEReplier
instance itself. Therefore, the developer is encouraged to give repliers unique, meaningful names. -
reply(EReplyMessage, String)
: reply message sent from named replier. -
cancel(ERequestMessage, String)
: request message is now canceled on named replier.
As mentioned previously, a request monitor can only monitor requests posted to and replies from local
EReplier
objects. Requests and replies with remote repliers cannot be locally monitored.Note: unlike the other four roles (publisher, subscriber, requester, and replier) the request monitor is not informed if requester and repliers for the configured request message key are in place or not. That is because the request monitor is not interacting with requesters and repliers; instead the monitor is standing to the side and watching the interaction between the two.
- Author:
- Charles W. Rapp
- See Also:
ERequestMonitorFeed
,EReplier
,ERequestMessage
-
-
Field Summary
-
Fields inherited from interface net.sf.eBus.client.EObject
NAME_NOT_SET
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default void
cancel(ERequestMessage message, java.lang.String replier)
An existing request is being automatically canceled.default void
reply(EReplyMessage reply, java.lang.String replier)
An outgoing reply from given replier.default void
request(ERequestMessage request, java.lang.String replier)
An incoming request for given replier.
-
-
-
Method Detail
-
request
default void request(ERequestMessage request, java.lang.String replier)
An incoming request for given replier.- Parameters:
request
- inbound request message.replier
- request delivered to replier with this eBus object name.- Throws:
java.lang.UnsupportedOperationException
- if this method is not overridden or replaced by a lambda expression.
-
reply
default void reply(EReplyMessage reply, java.lang.String replier)
An outgoing reply from given replier.- Parameters:
reply
- outbound reply message.replier
- reply send from replier with this eBus object name.- Throws:
java.lang.UnsupportedOperationException
- if this method is not overridden or replaced by a lambda expression.
-
cancel
default void cancel(ERequestMessage message, java.lang.String replier)
An existing request is being automatically canceled.- Parameters:
message
- canceled request.replier
- eBus object name of replier handling this request- Throws:
java.lang.UnsupportedOperationException
- if this method is not overridden or replaced by a lambda expression.
-
-