Package net.sf.eBus.client
Class ERequestMonitorFeed.Builder
- java.lang.Object
 - 
- net.sf.eBus.client.EFeed.Builder<F,T,B>
 - 
- net.sf.eBus.client.ERequestMonitorFeed.Builder
 
 
 
- 
- Enclosing class:
 - ERequestMonitorFeed
 
public static final class ERequestMonitorFeed.Builder extends EFeed.Builder<F,T,B>
ERequestMonitorFeed.Builderis used to create anERequestMonitorFeedinstance. ABuilderinstance is acquired fromERequestMonitorFeed.builder(). The following example shows how to create aERequestMonitorFeedinstance using aBuilder. The example also shows howERequestMonitorinterface methods may be replaced with lambda expressions.@Override public void startup() { final EMessageKey = new EMessageKey(com.acme.CatalogOrder.class, subject); final ERequestMonitorFeed feed (ERequestMonitorFeed.builder()).target(this) .messageKey(key) .requestCallback(this::onRequest) .replyCallback(this::onReply) .cancelCallback(this::onCancel) .build(); ... } private void onRequest(final ERequestMessage request, final String replier) { ... } private void onReply(final EReplyMessage reply, final String replier) { ... } private void onCancel(final ERequestMessage request, final String replier) { ... }- See Also:
 ERequestMonitorFeed.builder()
 
- 
- 
Field Summary
- 
Fields inherited from class net.sf.eBus.client.EFeed.Builder
mEClient, mLocation, mScope, mTarget, mTargetClass 
 - 
 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ERequestMonitorFeedbuildImpl()Returns a newERequestMonitorFeedinstance based onthis Builder's configuration.ERequestMonitorFeed.BuildercancelCallback(MessageCallback<ERequestMessage> cb)Puts inbound request cancellation callback in place.protected net.sf.eBus.client.ESubjectgetSubject()Returns eBus subject for the configured message key.ERequestMonitorFeed.BuilderreplyCallback(MessageCallback<EReplyMessage> cb)Puts outbound reply callback in place.ERequestMonitorFeed.BuilderrequestCallback(MessageCallback<ERequestMessage> cb)Puts inbound request callback in place.ERequestMonitorFeed.Builderscope(EFeed.FeedScope scope)ThrowsUnsupportedOperationExceptionbecause request monitor feeds have local-only scope which may not be overridden.protected ERequestMonitorFeed.Builderself()Returnsthis Builderreference.protected Validatorvalidate(Validator problems)Verifies that message key is for a request subject and that both request and reply callbacks are set.- 
Methods inherited from class net.sf.eBus.client.EFeed.Builder
build, isOverridden, target 
 - 
 
 - 
 
- 
- 
Method Detail
- 
getSubject
protected net.sf.eBus.client.ESubject getSubject()
Returns eBus subject for the configured message key.- Returns:
 - eBus feed subject.
 
 
- 
validate
protected Validator validate(Validator problems)
Verifies that message key is for a request subject and that both request and reply callbacks are set.- Parameters:
 problems- place invalid configuration settings in this problems list.- Returns:
 problemsto allow for method chaining.
 
- 
buildImpl
protected ERequestMonitorFeed buildImpl()
Returns a newERequestMonitorFeedinstance based onthis Builder's configuration.- Specified by:
 buildImplin classEFeed.Builder<ERequestMonitorFeed,ERequestMonitor,ERequestMonitorFeed.Builder>- Returns:
 - new request monitor feed.
 
 
- 
self
protected ERequestMonitorFeed.Builder self()
Returnsthis Builderreference.- Specified by:
 selfin classEFeed.Builder<ERequestMonitorFeed,ERequestMonitor,ERequestMonitorFeed.Builder>- Returns:
 this Builderreference.
 
- 
scope
public ERequestMonitorFeed.Builder scope(EFeed.FeedScope scope)
ThrowsUnsupportedOperationExceptionbecause request monitor feeds have local-only scope which may not be overridden.- Overrides:
 scopein classEFeed.Builder<ERequestMonitorFeed,ERequestMonitor,ERequestMonitorFeed.Builder>- Parameters:
 scope- feed scope.- Returns:
 this Builderinstance.- Throws:
 java.lang.UnsupportedOperationException- default local-only feed scope may not be overridden.
 
- 
requestCallback
public ERequestMonitorFeed.Builder requestCallback(@Nullable MessageCallback<ERequestMessage> cb)
Puts inbound request callback in place. Ifcbis notnull, requests will be passed tocbrather thanERequestMonitor.request(ERequestMessage, String). Ifcbisnull, then request messages are passed to theERequestMonitor.request(ERequestMessage, String)override.- Parameters:
 cb- request callback. May benull.- Returns:
 this Builderinstance.
 
- 
replyCallback
public ERequestMonitorFeed.Builder replyCallback(@Nullable MessageCallback<EReplyMessage> cb)
Puts outbound reply callback in place. Ifcbis notnull, replies will be passed tocbrather thanERequestMonitor.reply(EReplyMessage, String). Ifcbisnull, then reply messages are passed to theERequestMonitor.reply(EReplyMessage, String)override.- Parameters:
 cb- reply callback. May benull.- Returns:
 this Builderinstance.
 
- 
cancelCallback
public ERequestMonitorFeed.Builder cancelCallback(@Nullable MessageCallback<ERequestMessage> cb)
Puts inbound request cancellation callback in place. ifcbis notnull, cancellations will be passed tocbrather thanERequestMonitor.cancel(ERequestMessage, String). Ifcbisnull, then request messages are passed to theERequestMonitor.cancel(ERequestMessage, String)override.- Parameters:
 cb- cancellation callback. May benull.- Returns:
 this Builderinstance.
 
 - 
 
 -