|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IDistributionManager
Manages subscriptions for distribution of events within the local context and
from remote contexts. Application code uses the subscribe method to receive
distribution of events from both local and remote IContainer
instances.
IFrameworkContext
Method Summary | |
---|---|
boolean |
addSubscriptionListener(ISubscriptionListener listener)
Add a container subscription listener. |
IChannel[] |
getConnectedChannels()
Get all the currently connected channels |
IFrameReader |
getFrameReader()
Get the frame reader for this context |
IFrameWriter |
getFrameWriter()
Get the frame writer for this context |
boolean |
removeSubscriptionListener(ISubscriptionListener listener)
Remove a container subscription listener. |
boolean |
subscribe(String contextIdentity,
String identityRegularExpression,
IType type,
IDomain domain,
IEventListener listener)
Subscribe the listener for the events generated by the IContainer
instance(s) in the identified context that match the type, domain and
identity regular expression. |
boolean |
unsubscribe(String contextIdentity,
String identityRegularExpression,
IType type,
IDomain domain,
IEventListener listener)
Unsubscribe the listener from the IContainer instance(s)
identified by the type, domain and identity regular expression in the
specified context. |
String |
updateRemoteContainer(String remoteContextIdentity,
String identity,
IType type,
IDomain domain,
String fieldName,
String fieldValueAsString)
Update a named field with a new value in a container in a remote context. |
Methods inherited from interface fulmine.ILifeCycle |
---|
isActive, start |
Methods inherited from interface fulmine.IDestroyable |
---|
destroy |
Methods inherited from interface fulmine.distribution.IRetransmissionManager |
---|
requestRetransmit, requestRetransmitAll, retransmit, retransmitAll, retransmitAllToAll, retransmitToAll |
Methods inherited from interface fulmine.rpc.IRpcTransmissionManager |
---|
invokeRpc |
Method Detail |
---|
boolean subscribe(String contextIdentity, String identityRegularExpression, IType type, IDomain domain, IEventListener listener)
IContainer
instance(s) in the identified context that match the type, domain and
identity regular expression. The supplied listener will be registered
against the matching container instance(s). Events (changes to the
container instance(s)) will be received by the listener.
The container type and domain is matched exactly. However, a 'wildcard'
match for the type or domain can be specified using
ISubscription.WILDCARD_TYPE
and
ISubscription.WILDCARD_DOMAIN
. The identity regular expression
can identify an exact container identity or it can identify multiple
container identities (it is a regular expression matched against
container identities).
All subscription operations occur indefinitely; the operation examines
all current containers and then future created containers for an identity
match. The listener is registered against any matching container. The
subscription exists until either the context terminates or the
unsubscribe(String, String, IType, IDomain, IEventListener)
method is invoked with the same arguments. Using a regular expression
matching subscription allows a listener to receive updates for containers
whose identities are currently unknown or do not yet exist.
When the subscription is for a remote context (the contextIdentity does not match the local context identity), the subscription request is transmitted to the named remote context. The remote context handles the subscription using the same contract as for a local subscription. If the remote context has not yet come online, the subscription is saved until the identified remote context becomes available, at which point the subscription is transmitted.
Calling this method multiple times with the same arguments has no effect; it is idempotent.
contextIdentity
- the identity of context where the container(s) existidentityRegularExpression
- the identity regular expression that will be matched against a
container's identitytype
- the type of the containerdomain
- the domain of the containerlistener
- the listener that will be registered for receiving events from
the matching container(s)
true
if the subscription was created,
false
if it already existedunsubscribe(String, String, IType, IDomain, IEventListener)
boolean unsubscribe(String contextIdentity, String identityRegularExpression, IType type, IDomain domain, IEventListener listener)
IContainer
instance(s)
identified by the type, domain and identity regular expression in the
specified context.
The subscribe(String, String, IType, IDomain, IEventListener)
method is idempotent so if it is called multiple times with the
same arguments, one call to
unsubscribe(String, String, IType, IDomain, IEventListener)
will
remove it.
Two subscriptions with equal type and domain but identity "foo.*" and "foo" are separate subscriptions and require two unsubscribe operations; the unsubscribe for "foo.*" does not unsubscribe the "foo" subscription.
contextIdentity
- the identity of the remote contextidentityRegularExpression
- the identity regular expression that will be matched against a
container's identitytype
- the type of the containerdomain
- the domain of the containerlistener
- the listener that will be unregistered from receiving events
from matching container(s)
true
if the subscription was found and removed,
false
otherwisesubscribe(String, String, IType, IDomain, IEventListener)
boolean addSubscriptionListener(ISubscriptionListener listener)
The listener will be added to a list only if it does not already exist in the list. Subscription events will be notified to all listeners in the list in the order they are added.
listener
- a listener to add to an internal list.
true
if the listener was added, false
otherwiseboolean removeSubscriptionListener(ISubscriptionListener listener)
listener
- the listener to remove
true
if the listener was found and removed,
false
otherwiseIFrameWriter getFrameWriter()
IFrameWriter
for this contextIFrameReader getFrameReader()
IFrameReader
for this contextIChannel[] getConnectedChannels()
IChannel
instancesString updateRemoteContainer(String remoteContextIdentity, String identity, IType type, IDomain domain, String fieldName, String fieldValueAsString)
Note: This operation may be synchronous and may therefore block on I/O.
remoteContextIdentity
- the identity of the remote context where the container is
hostedidentity
- the identity of the container with the field to changetype
- the type of the containerdomain
- the domain of the containerfieldName
- the field name in the container to updatefieldValueAsString
- the field value (as a string) to set as the new value for the
named field
#setRemoteUpdateHandler(IRemoteUpdateHandler)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |