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 |
net.sf.eBus.client.ESingleFeed.Builder<F extends net.sf.eBus.client.ESingleFeed,T extends EObject,B extends net.sf.eBus.client.ESingleFeed.Builder<F,T,?>>
Base class for single subject feeds.
|
protected static class |
net.sf.eBus.client.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 net.sf.eBus.client.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.
|
FEED_IS_INACTIVE, FEED_NOT_ADVERTISED, mEClient, mFeedId, mFeedState, mInPlace, mIsActive, mScope, NO_CONDITION, NOTIFY_METHOD, NULL_CLIENT
Modifier and Type | Method and Description |
---|---|
int |
activationCount()
Returns the feed activation count.
|
ECondition |
condition()
Returns associated request message condition.
|
protected void |
inactivate()
Cancels this request if still active.
|
EMessageKey |
key()
Returns the feed message key.
|
java.lang.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.
|
java.lang.String |
toString()
Returns a containing the feed message key and data member
values.
|
addAllKeys, addKey, addListener, checkScopes, clientId, close, createDispatcher, defaultDispatcher, eClient, equals, feedId, feedState, findKeys, findKeys, findKeys, hashCode, inPlace, isActive, isFeedUp, isOverridden, loadKeys, location, register, register, register, removeListener, scope, setExhaust, shutdown, shutdown, shutdownAll, startup, startup, startupAll, storeKeys, storeKeys, storeKeys, subclassDistance
protected final net.sf.eBus.client.ESingleFeed.FeedType mFeedType
protected final net.sf.eBus.client.ESubject mSubject
feed type
.protected int mActivationCount
protected void inactivate()
inactivate
in class EFeed
public java.lang.String toString()
public ERequestMessage request()
public ECondition condition()
public ERequestFeed.RequestState state()
public EReplyFeed replier()
public void reply(EReplyMessage msg)
msg
- the reply message.java.lang.IllegalArgumentException
- if msg
is null
or is not a valid reply
message class for this request.java.lang.IllegalStateException
- if the request state is done
.public final EMessageKey key()
EPublishFeed
, then a
notification
message key is returned.public final java.lang.String messageSubject()
message key subect
.public final int activationCount()
Copyright © 2001 - 2024. Charles W. Rapp. All rights reserved.