public static final class EReplyFeed.ERequest extends EFeed
ERequest is responsible for matching an
ERequestFeed.ERequest with a single
EReplyFeed. The replier uses
reply(EReplyMessage) to post a
reply message back to the requesting
client. Replies cannot be sent using EReplyFeed
nor can ERequest instances be retrieved from
EReplyFeed. It is the application's responsibility
to track active ERequest instances in order to
send reply messages back to requestors.
(EReplyFeed does track the active ERequest
instances but for internal purposes only. The reason is
due to ERequest not having the original request
message. Without the request message, an ERequest
object is unusable by the application.)
A request client does not directly
interact with ERequest instances but with its
ERequestFeed.ERequest. This is because there is a
one-to-one
relationship between ERequestFeed.ERequest and
EReplyFeed.ERequest.
Each request is given an identifier that is unique for the
request lifespan. Once the request reaches the
done or
canceled state, this
identifier is returned an identifier pool for re-use. It
is likely that a later request will be assigned the same
identifier.
ERequestFeed,
ERequestFeed.ERequest,
EReplyFeed,
ERequestMessage,
EReplyMessage| Modifier and Type | Class and Description |
|---|---|
protected static class |
ESingleFeed.FeedType
Enumerates the supported feed types.
|
EFeed.AbstractClientTask, EFeed.FeedScope, EFeed.NotifyTask, EFeed.StatusTask<T extends IEFeed>| Modifier and Type | Field and Description |
|---|---|
protected int |
mActivationCount
Tracks the number of contra-feeds matched to this feed.
|
protected static List<EFeed> |
mAdvertisers
Track the advertised feeds in order to generate
advertise messages. |
protected ESingleFeed.FeedType |
mFeedType
Specifies whether this is a publish, subscribe, request,
or reply feed.
|
protected net.sf.eBus.client.ESubject |
mSubject
The feed interfaces with this eBus subject.
|
mEClient, mFeedId, mFeedState, mInPlace, mIsActive, mScope, NO_CONDITION, NOTIFY_METHOD| Modifier and Type | Method and Description |
|---|---|
int |
activationCount()
Returns the feed activation count.
|
protected void |
inactivate()
Cancels this request if still active.
|
EMessageKey |
key()
Returns the feed message key.
|
String |
messageSubject()
Returns the feed
message key subect. |
EReplyFeed |
replier()
Returns the associated reply feed.
|
void |
reply(EReplyMessage msg)
Forwards the reply message to the request feed.
|
ERequestMessage |
request()
Returns the associated request message.
|
ERequestFeed.RequestState |
state()
Returns the current request state.
|
String |
toString()
Returns a containing the feed message key and data member
values.
|
addAllKeys, addKey, checkScopes, clientId, close, defaultDispatcher, eClient, equals, feedId, feedState, findKeys, findKeys, findKeys, hashCode, inPlace, isActive, isFeedUp, isOverridden, loadKeys, location, register, register, register, scope, shutdown, shutdown, shutdownAll, startup, startup, startupAll, storeKeys, storeKeys, storeKeysprotected static final List<EFeed> mAdvertisers
advertise messages.protected final ESingleFeed.FeedType mFeedType
protected final net.sf.eBus.client.ESubject mSubject
feed type.protected int mActivationCount
protected void inactivate()
inactivate in class EFeedpublic String toString()
public ERequestMessage request()
public ERequestFeed.RequestState state()
public EReplyFeed replier()
public void reply(EReplyMessage msg) throws IllegalArgumentException, IllegalStateException
msg - the reply message.IllegalArgumentException - if msg is null or is not a valid reply
message class for this request.IllegalStateException - if the request state is done.public final EMessageKey key()
EPublishFeed, then a
notification
message key is returned.public final String messageSubject()
message key subect.public final int activationCount()
Copyright © 2019. All rights reserved.