|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.inspirel.yami.ValuePublisher
public class ValuePublisher
Simple subscription publisher. The subscription publisher that notifies remote listeners with published value updates. Remote listeners can subscribe and unsubscribe at any time.
Nested Class Summary | |
---|---|
static class |
ValuePublisher.SubscriberInfo
Helper class for holding destination target and object for any given subscriber. |
Constructor Summary | |
---|---|
ValuePublisher()
Constructor. |
|
ValuePublisher(IncomingMessageCallback callback)
Constructor. |
|
ValuePublisher(IncomingMessageCallback callback,
int maxQueueLength,
ValuePublisherOverflowCallback overflowCallback)
Constructor. |
Method Summary | |
---|---|
void |
close()
Unregisters from the controlling agent and cleans up resources. |
int |
getNumberOfSubscribers()
Returns the number of current subscribes. |
java.util.List<ValuePublisher.SubscriberInfo> |
getSubscribers()
Returns the list of current subscribers. |
void |
publish(Parameters value)
Publishe the new value with default priority. |
void |
publish(YAMISerializable value,
int priority)
Publishe the new value. |
void |
subscribe(java.lang.String destinationTarget,
java.lang.String destinationObject)
Subscribe new listener. |
void |
unsubscribe(java.lang.String destinationTarget)
Unsubscribe the given listener. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ValuePublisher()
public ValuePublisher(IncomingMessageCallback callback)
Creates the subscription publisher that is not registered at any agent and that delegates arbitrary remote commands to the given callback. The new publisher will use queues of length 1 for each subscriber.
Note: The "subscribe" and "unsubscribe" messages are also forwarded to the user-provided callback, but these two messages are already processed by the published value's implementation.
callback
- the callback implementation for unknown commandspublic ValuePublisher(IncomingMessageCallback callback, int maxQueueLength, ValuePublisherOverflowCallback overflowCallback)
Creates the subscription publisher that is not registered at any agent and that delegates arbitrary remote commands to the given callback as well as reports queue overflow conditions.
Note: The "subscribe" and "unsubscribe" messages are also forwarded to the user-provided callback, but these two messages are already "replied-to" by the published value's implementation.
callback
- the callback implementation for unknown commandsmaxQueueLength
- length of message queue for each subscriberoverflowCallback
- the callback implementation
for overflow conditionMethod Detail |
---|
public void subscribe(java.lang.String destinationTarget, java.lang.String destinationObject) throws YAMIIOException
destinationTarget
- target of the remote listenerdestinationObject
- name of the remote listener's object
YAMIIOException
- if the connection to the destination
cannot be establishedpublic void unsubscribe(java.lang.String destinationTarget)
destinationTarget
- target of the remote listenerpublic void publish(Parameters value)
value
- new value that is to be sent as update to all listenerspublic void publish(YAMISerializable value, int priority)
value
- new value that is to be sent as update to all listenerspriority
- priority of the update messagepublic int getNumberOfSubscribers()
public java.util.List<ValuePublisher.SubscriberInfo> getSubscribers()
public void close()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |