Package net.sf.eBus.feed.historic
Class EAbstractHistoricFeed<T extends EObject>
- java.lang.Object
-
- net.sf.eBus.feed.historic.EAbstractHistoricFeed<T>
-
- Type Parameters:
T- historic feed owner type.
- Direct Known Subclasses:
EHistoricPublishFeed,EHistoricSubscribeFeed
public abstract class EAbstractHistoricFeed<T extends EObject> extends Object
Base class forEHistoricPublishFeedandEHistoricSubscribeFeedcontaining the data members common to each. This includes:- feed name (used for logging purposes),
-
EObjectcontaining (or owning) this feed hybrid object, - notification and historic request message keys, and
- feed scope (applies to notification, request, and reply feeds).
This class also contains data members which track whether the feed is open, in place (that is, advertised or subscribed), and the current historic feed state.
- Author:
- Charles W. Rapp
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classEAbstractHistoricFeed.Builder<T extends EObject,F extends EAbstractHistoricFeed<T>,B extends EAbstractHistoricFeed.Builder<T,F,?>>Base class forEHistoricPublishFeed.BuilderandEHistoricSubscribeFeed.Buildersubclasses.
-
Field Summary
Fields Modifier and Type Field Description protected EFeedStatemFeedStateCurrent historic feed state.protected booleanmInPlaceSet totruewhen historic feed is up.protected booleanmIsOpenSet totruewhen this feed is open and started andfalsewhen stopped.protected EMessageKeymKeyNotifications published on this message key.protected StringmNameeBus object name.protected TmOwnerThis historic feed works on behalf of this eBus object.protected EMessageKeymRequestKeyHistoric message request feed key.protected EFeed.FeedScopemScopeNotification and request feed scope.protected EMessageKeymStatusKeyPublishStatusEventpublished on this message key.
-
Constructor Summary
Constructors Modifier Constructor Description protectedEAbstractHistoricFeed(EAbstractHistoricFeed.Builder<T,?,?> builder)Creates a new historic feed instance based on builder settings.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()Permanently closes historic feed.protected voidcloseFeed(EFeed feed)Closes feed if notnull.protected abstract voiddoClose()Performs actual work to close historic feed.EFeedStatefeedState()Returns current historic subscribe feed state.booleaninPlace()Returnstrueif this feed is "in place" (that is, subscribed or advertised) andfalseif not.booleanisOpen()Returnstrueif this feed is open andfalseif closed.EMessageKeykey()Returns notification message key.EMessageKeypublisherStatusKey()Returns notification message key used to publishPublishStatusEventmessages.EMessageKeyrequestKey()Returns historic request message key.EFeed.FeedScopescope()Returns historic notification and request feed scope.
-
-
-
Field Detail
-
mName
protected final String mName
eBus object name.
-
mOwner
protected final T extends EObject mOwner
This historic feed works on behalf of this eBus object.
-
mKey
protected final EMessageKey mKey
Notifications published on this message key.
-
mStatusKey
protected final EMessageKey mStatusKey
PublishStatusEventpublished on this message key.
-
mRequestKey
protected final EMessageKey mRequestKey
Historic message request feed key.
-
mScope
protected final EFeed.FeedScope mScope
Notification and request feed scope.
-
mIsOpen
protected boolean mIsOpen
Set totruewhen this feed is open and started andfalsewhen stopped.
-
mInPlace
protected boolean mInPlace
Set totruewhen historic feed is up.
-
mFeedState
protected EFeedState mFeedState
Current historic feed state.
-
-
Constructor Detail
-
EAbstractHistoricFeed
protected EAbstractHistoricFeed(EAbstractHistoricFeed.Builder<T,?,?> builder)
Creates a new historic feed instance based on builder settings.- Parameters:
builder- contains historic feed settings.
-
-
Method Detail
-
doClose
protected abstract void doClose()
Performs actual work to close historic feed.
-
isOpen
public final boolean isOpen()
Returnstrueif this feed is open andfalseif closed. Once an historic feed is closed, it cannot be opened again.- Returns:
trueif feed is open.- See Also:
inPlace()
-
inPlace
public final boolean inPlace()
Returnstrueif this feed is "in place" (that is, subscribed or advertised) andfalseif not.- Returns:
trueif feed is in place.
-
key
public final EMessageKey key()
Returns notification message key.- Returns:
- notification message key.
-
publisherStatusKey
public final EMessageKey publisherStatusKey()
Returns notification message key used to publishPublishStatusEventmessages.- Returns:
PublishStatusEventmessage key.
-
requestKey
public final EMessageKey requestKey()
Returns historic request message key.- Returns:
- historic request message key.
-
scope
public final EFeed.FeedScope scope()
Returns historic notification and request feed scope.- Returns:
- feed scope.
-
feedState
public final EFeedState feedState()
Returns current historic subscribe feed state.- Returns:
- current feed state.
-
close
public final void close()
Permanently closes historic feed. This historic feed cannot be re-opened or used to publish/retrieve historic notifications after this.
-
closeFeed
protected final void closeFeed(EFeed feed)
Closes feed if notnull.- Parameters:
feed- close this feed.
-
-