See: Description
Interface | Description |
---|---|
CancelRequestCallback |
A class implementing
EReplier is not required to
override EReplier.cancelRequest(EReplyFeed.ERequest, boolean) . |
ECondition |
This interface allows
ESubscribeFeed and
EReplyFeed to automatically test a message in order
to determine if it should be passed on to a client. |
EObject |
This interface solves the problem of start up and shutting
down from a non-eBus thread.
|
EPublisher |
Classes wanting to send eBus notifications need to implement
this interface.
|
EReplier |
Classes able to reply to eBus requests must implement this
interface.
|
ERequestor |
Classes wanting to send eBus requests must implement this
interface.
|
ESubscriber |
Classes wanting to receive eBus notification messages need to
implement this interface.
|
FeedStatusCallback<T extends IEFeed> |
An eBus client implementing either
ESubscriber ,
EPublisher , or ERequestor is not required
to override the matching feed status method (
ESubscriber.feedStatus(EFeedState, IESubscribeFeed) ,
EPublisher.publishStatus(EFeedState, IEPublishFeed) , or
ERequestor.feedStatus(EFeedState, IERequestFeed) ). |
IEFeed |
Common base interface for single- and multi-subject feeds.
|
IEPublishFeed |
Provides a common view for
EPublishFeed and
EMultiPublishFeed feeds. |
IEReplyFeed |
Provides a common view of single- and multi-subject reply
feeds, allowing such feeds to be referenced in a common way.
|
IERequestFeed |
Provides a common view of single- and multi-subject request
feeds, allowing such feeds to be referenced in a common way.
|
IESubscribeFeed |
Provides a common view of single- and multi-subject
subscription feeds, allowing such feeds to be referenced in a
common way.
|
IMessageExhaust |
This interface provides an ability to exhaust messages passing
through the local eBus to a persistent store.
|
ISubjectListener |
eBus clients wishing to be informed about new subjects should
implement this interface and register with
ESubject.addListener(ISubjectListener) . |
NotifyCallback<T extends ENotificationMessage> |
This functional interface may be used to handle notification
message delivery instead of
ESubscriber.notify(ENotificationMessage, IESubscribeFeed)
by passing a NotifyCallback instance to
ESubscribeFeed.Builder.notifyCallback(NotifyCallback) . |
ReplyCallback |
This functional interface may be used to handle reply message
delivery instead of
ERequestor.reply(int, EReplyMessage, ERequestFeed.ERequest)
by passing a ReplyCallback instance to
ERequestFeed.replyCallback(ReplyCallback) . |
RequestCallback |
This functional interface may be used to handle request
delivery instead of
EReplier.request(EReplyFeed.ERequest)
by passing a RequestCallback instance to
EReplyFeed.Builder.requestCallback(RequestCallback)
This allows a tighter coupling between a feed and the code for
processing the feed's requests. |
Class | Description |
---|---|
AbstractEBusMessage |
Base class for eBus
ConnectionMessage and
ServerMessage classes. |
AbstractEBusMessage.Builder<M extends AbstractEBusMessage,B extends AbstractEBusMessage.Builder<M,?>> |
Base class builder for
AbstractEBusMessage
builders. |
ConnectionMessage |
This message reports when a
remote connection has either
logged on or logged off . |
ConnectionMessage.Builder |
Use this builder to create
ConnectionMessage
instances. |
EClient |
EClient ties together eBus message routing and message
processing. |
EClient.RQStats |
Contains the
EClient.RQThread current condition. |
EClient.RQThread |
A Dispatcher run queue thread watches a given
run queue
for EClient instances ready to run, attempting to
acquire the next ready client. |
EFeed |
Applications interface with eBus through feed instances.
|
EFeed.AbstractClientTask |
Base class for eBus client callback tasks created by
feeds.
|
EFeed.Builder<F extends EFeed,T extends EObject,B extends EFeed.Builder<F,T,?>> |
Base class for all
EFeed builders. |
EMulticastConnection |
EMulticastConnection is the API gateway to eBus
multicast communication. |
EMulticastConnection.KeyInfo |
Contains a message keys's unique integer identifier,
source address and its current feed state.
|
EMulticastConnection.MessageReader |
This class is responsible for decoding the eBus header and
message from an
AsyncMulticastSocket 's underlying
inbound buffer. |
EMulticastConnection.MulticastKey |
Contains multi-feed notification key.
|
EMulticastPublisher |
This class is responsible for publishing notification messages
to its multicast connection.
|
EMulticastSubscriber |
This class is responsible for subscribing to notification
messages from its multicast connection.
|
EMultiFeed<C extends EMessage,F extends net.sf.eBus.client.ESingleFeed> |
Multiple subject feeds act as a proxy between application
objects and multiple subordinate simple feeds
(
EPublishFeed , ESubscribeFeed ,
EReplyFeed , and ERequestFeed ), all for a
single message class. |
EMultiFeed.Builder<C extends EMessage,F extends net.sf.eBus.client.ESingleFeed,T extends EObject,M extends EMultiFeed<C,F>,B extends EMultiFeed.Builder<C,F,T,M,?>> |
Base class for multiple subject feeds.
|
EMultiPublishFeed |
This feed allows an
EPublisher to open one feed for a
given notification message class and multiple message subjects. |
EMultiPublishFeed.Builder |
EMultiPublishFeed.Builder is the mechanism for
creating an EMultiPublishFeed instance. |
EMultiReplyFeed |
This feed allows an
EReplier to open one feed for a
given request message class and multiple message subjects. |
EMultiReplyFeed.Builder |
EMultiReplyFeed.Builder is the mechanism for
creating an EMultiReplyFeed instance. |
EMultiRequestFeed |
This feed acts as a proxy for handling multiple
ERequestFeed s on behalf of a ERequestor
client. |
EMultiRequestFeed.Builder |
EMultiRequestFeed.Builder is the mechanism for
creating an EMultiRequestFeed instance. |
EMultiSubscribeFeed |
This feeds acts as a proxy for handling multiple
ESubscribeFeed s on behalf of a ESubscriber
client. |
EMultiSubscribeFeed.Builder |
EMultiSubscribeFeed.Builder is the mechanism for
creating an EMultiSubscribeFeed instance. |
ENotifyFeed |
Abstract base class for
EPublishFeed and
ESubscribeFeed classes. |
ENotifyFeed.Builder<F extends ENotifyFeed,T extends EObject,B extends ENotifyFeed.Builder<F,T,?>> |
Base class for notification publish and subscribe feeds.
|
EPublishFeed |
EPublishFeed is the application entry point for
publishing notification messages
to subscribers. |
EPublishFeed.Builder |
EPublishFeed.Builder is now the preferred
mechanism for creating a EPublishFeed instance. |
EReliableUDPServer |
Extends
EUDPServer to handle reliable UDP message
header. |
ERemoteApp |
This class provides communication between eBus applications.
|
ERemoteAppContext | |
EReplyFeed |
EReplyFeed is the application entry point for posting
replies to request messages to
requestors. |
EReplyFeed.Builder |
EReplyFeed.Builder is now the preferred
mechanism for creating a EReplyFeed instance. |
EReplyFeed.ERequest | |
ERequestFeed |
ERequestFeed is the application entry point for
posting request messages to repliers. |
ERequestFeed.Builder |
EREquestFeed.Builder is now the preferred
mechanism for creating a ERequestFeed instance. |
ERequestFeed.ERequest |
This class represents an individual request, tracking the
current request state and the remaining repliers.
|
EServer |
Accepts new connections to this eBus application.
|
ESubscribeFeed |
ESubscribeFeed is the application entry point for
receiving notification messages . |
ESubscribeFeed.Builder |
ESubscribeFeed.Builder is now the preferred
mechanism for creating a ESubscribeFeed instance. |
ETCPServer |
Accepts new TCP (both secure and plain text) connections.
|
EUDPServer |
This UDP datagram socket "accepts" a new UDP datagram socket
from a remote eBus application.
|
EUDPServer.UDPMessageWriter |
Used to encode a
UDPConnectReply message directly
to a datagram output buffer. |
MulticastMessage |
Reports multicast connection current state.
|
MulticastMessage.Builder |
Use this builder to create
MulticastMessage
instances. |
ServerMessage |
This message reports the
remote Internet address and TCP port
of a connection newly accepted by EServer but not yet
logged in. |
ServerMessage.Builder |
Use this builder to create
ServerMessage
instances. |
Enum | Description |
---|---|
ConnectionMessage.ConnectionState |
A remote eBus is either logged on or logged off.
|
EClient.ClientLocation |
An eBus client is either local to this JVM or in a remote
JVM.
|
EClient.ObjectState |
An eBus object is either on a run queue thread or off.
|
EClient.RQThread.RQThreadState |
A run queue thread is either idle (waiting for an
available eBus object) or busy (running an eBus
object).
|
EClient.RunState |
Defines the eBus client run states.
|
EFeed.FeedScope |
Feed scope is either restricted to this JVM, to both this
JVM and remote JVMs, and to remote JVMs only.
|
EFeedState |
Enumerates an eBus notification message feed state: either up
or down.
|
EMultiFeed.MultiFeedType |
A multi-feed either supports subject list or a subject
pattern.
|
ERequestFeed.RequestState |
A request is either not placed, active, done, or canceled.
|
MulticastMessage.MulticastState |
A multicast connection is either joined to its group or
disconnected.
|
SubjectType |
ISubjectListener updates are for two message key
types: notification and request. |
ThreadType |
Lists the thread types available to eBus users when
configuring eBus.
|
EFeed
objects. All
feed objects are associated with a unique type+topic
message key
.
eBus v. 4.5.0 added the ability to directly add messages keys
to the eBus message key dictionary and retrieve keys from said
dictionary. Prior to this version, message keys were
indirectly added to the dictionary when opening feeds. This
feature added to support the new
multi-subject feeds.
Multi-subject feeds may use a
¯query
to
match a variable number of keys. This is why
EFeed.addKey(net.sf.eBus.messages.EMessageKey)
,
EFeed.addAllKeys(java.util.Collection)
and
EFeed.loadKeys(java.io.ObjectInputStream)
methods are
provided: unless the message key dictionary is populated with
keys prior to creating a multi-subject query feed, the query would
find no matching keys.
A simple feed is associated with a single message key and messages are sent to or received from the feed only after the feed is opened and advertised/subscribed. Simple feeds provide no value added capabilities beyond this.
EPublishFeed
: Publishers
advertise and publish
notification messages
via a publish feed instance.
ESubscribeFeed
:
Subscribers hook into this feed to receive notification
messages.
EReplyFeed
: Repliers
advertise their ability to send
reply messages
in response to a
request messages
.
EReplyFeed.ERequest
and not the
EReplyFeed
.
ERequestFeed
: Requestors
place request messages and receive replies using the
request feed.
EFeed
subclass but acts as a
proxy between an application object and multiple subordinate
feeds for the same message class. The multi-subject
feed is responsible for keeping the subordinate feeds in the
same state (opened, advertised/subscribed,
un-advertised/un-subscribed, closed), configuring the
subordinate feeds with the same callbacks.
A multi-subject feed is configured to work with a single notification/request message class and multiple message subjects. An application object needing a multi-subject feed for multiple message classes must open a different multi-subject feed for each message class.
The supported multi-subject feeds are:EMultiPublishFeed
:
uses EPublishFeed
subordinate feeds.
EMultiSubscribeFeed
:
uses ESubscribeFeed
subordinate feeds.
EMultiRequestFeed
:
uses ERequestFeed
subordinate feeds.
EMultiReplyFeed
:
uses EReplyFeed
subordinate feeds.
EMultiFeed
for a
detailed explanation on how to create and use multi-feeds.
EPublisher
: Required
interface for
publishing
notification messages.
ESubscriber
: Required
interface for
subscribing
to notification messages.
EReplier
: Required
interface for
replying
to requests.
ERequestor
: Required
interface for
posting requests
.
eBus v. 4.2.0 added support for using Java lambda expressions
as a callback target. An application still must implement the
matching role interface for a given feed but is not required
to override interface methods. Instead, an application uses
Java lambda expressions to define the callback target. See
FeedStatusCallback
,
NotifyCallback
,
ReplyCallback
, and
RequestCallback
for more
information.
ERemoteApp
instance. This instance
is either created by the application direction to initiate
a connection to another eBus application or is created by an
EServer
instance upon accepting a
remotely initiated connection. ERemoteApp
and
EServer
instances are created configuring an instance
using the appropriate builder. For ERemoteApp
the
EConfigure.ConnectionBuilder
is used (this
builder instance is acquired using
EConfigure.connectionBuilder()
).
EServer
configuration is created using
EConfigure.ServerBuilder
(acquired using
EConfigure.serverBuilder()
).
Once the configuration is successfully built then open the
remote application or server instance using
ERemoteApp.openConnection(net.sf.eBus.config.EConfigure.RemoteConnection)
or
EServer.openServer(net.sf.eBus.config.EConfigure.Service)
,
respectively.
These instance may be created directly in application code or indirectly at application start using the command line option:
-Dnet.sf.eBus.net.config.jsonFile=<conf file path>
This will automatically open the remote client connections and servers on start up.
As of eBus release 6.0.0 Java properties are no longer supported with respect to eBus configuration. Only typesfafe JSON configuration files may be used.
Aside: it may appear strange the eBus has a
EUDPServer
since UDP is a
session-less protocol. But eBus communication is
session-based. So eBus adds a session layer on top of the UDP
connection. The UDP connection initiator sends a
UDP connect request
message to the EUDPServer
. A
UDP connect reply
is sent and, if the UDP connection is accepted, the random UDP
port assigned to the connection which the initiating client
should use for all further communication.
eBus also supports both secure TCP (using SSL/TLS) and secure
UDP (using DTLS) for remote connections. But this option is
not supported in configuration file since that would require
placing sensitive information into the JSON .conf
file in the clear.
notification
messages to be transmitted between applications. Since
Multicast is session-less and cannot easily be turned into a
session-based protocol eBus handles multicasting differently.
There are two types of multicast connections:
multicast publisher and multicast subscriber. The multicast
publisher uses an eBus multi-feed subscription to
receive the desired notification messages. These notifications
must be locally published with either
EFeed.FeedScope.LOCAL_AND_REMOTE
or
EFeed.FeedScope.REMOTE_ONLY
feed scope.
The multicast publisher multicasts via
McastKeyMessage
the
message key (message class and subject), unique integer
message key identifier, and the message feed state (up or
down). Locally published notifications are mulicast
immediately upon receipt. Note that the multicast publisher
does not track whether there are any remote eBus
applications joined to the multicast group and subscribed to
the message key. Local notifications are sent no matter what.
Multicast subscriber is the opposite: it takes notifications
from the multicast group and uses a publisher multi-feed to
inject the message into eBus. Upon successfully joining the
configured multicast group the multicast subscriber posts a
McastSubscribeMessage
which causes all the joined multicast publishers to transmit
their current feed status messages. Multicast subscriber
publish feeds have a
EFeed.FeedScope.REMOTE_ONLY
scope.
Multicast publishers and subscribers are configured at start
to support a defined set of message keys. This set cannot be
altered once the multicast instance is created. That said,
there is one way to dynamically add new subjects to a
multicast instance: by have that instance use a
query
-based multi-feed.
As new subject feeds come on line the multicast instance will
either publish or receive the subject feed via the multicast
group.
ConnectionMessage
,
ServerMessage
, and
MulticastMessage
messages,
respectively. To track connection status create an
ESubscriber
which subscribes to
the appropriate message key for the desired connection type.
Status messages will be sent to the subscribe feed callback
method. The status message keys for the supported eBus
connection types are:
ConnectionMessage.MESSAGE_KEY
ServerMessage.MESSAGE_KEY
MulticastMessage.MESSAGE_KEY
IMessageExhaust
interface.
An application needing to persist all local messages
accomplishes this by implementing this interface and
registering an IMessageExhaust
instance with
ESubject.setExhaust(net.sf.eBus.client.IMessageExhaust)
.
This application exhaust is called via an eBus dispatcher
thread so as not to interfere with message delivery.
Note that only one exhaust may be registered at a
time. If an application needs to persist a message in
multiple stores, then that must be done by the single
application exhaust. If an application does not want to
exhaust all messages, that filtering must be done by the
application exhaust. If
IMessageExhaust.exhaust(net.sf.eBus.messages.EMessage)
should throw an exception (whether deliberate or not), that
exception will be caught and logged as a warning.
Note: an application using this exhaust API is responsible for opening and closing the persistent store when appropriate.
The default message exhaust does nothing with the message.
Copyright © 2001 - 2024. Charles W. Rapp. All rights reserved.