|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ws4d.java.eventing.DefaultEventSink
public class DefaultEventSink
Class represents an endpoint to receive notifications.
| Constructor Summary | |
|---|---|
DefaultEventSink(EventListener eventListener,
DataStructure bindings)
Constructor. |
|
DefaultEventSink(EventListener eventListener,
int configurationId)
|
|
| Method Summary | |
|---|---|
void |
addBinding(CommunicationBinding binding)
Adds the given binding to this Bindable. |
void |
addSubscription(java.lang.String clientSubId,
ClientSubscription subscription)
Internal method used within the subscription process. |
void |
clearBindings()
Removes all bindings from this Bindable instance. |
void |
close()
Closes event receiving for this event endpoint. |
Iterator |
getBindings()
Returns an iterator over all bindings
assigned to this Bindable instance. |
EventListener |
getEventListener()
Get associated event listener of this event sink. |
ClientSubscription |
getSubscription(java.lang.String clientSubId)
|
boolean |
hasBindings()
Returns true only if this Bindable instance has
at least one binding assigned. |
boolean |
isOpen()
Returns if event sink is open to receive notifications/ solicit responses. |
void |
open()
Opens event receiving for this event endpoint. |
ParameterValue |
receiveLocalEvent(java.lang.String clientSubscriptionId,
URI actionUri,
ParameterValue outputParameter)
Callback method for receiving local notifications/ solicit responses. |
boolean |
removeBinding(CommunicationBinding binding)
Removes the specified binding from this Bindable instance. |
ClientSubscription |
removeSubscription(java.lang.String clientSubId)
|
boolean |
supportsBindingChanges()
Returns true, if it is safe to call one of the mutator
methods ((Bindable.addBinding(CommunicationBinding),
Bindable.removeBinding(CommunicationBinding), (Bindable.clearBindings(),
etc.) at this time without getting an IllegalStateException. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultEventSink(EventListener eventListener,
DataStructure bindings)
eventListener - Client with which this event sink should be
associated. Received events will be transmitted to the
eventListener.bindings - a data structure of CommunicationBinding
instances over which to expose this event sink
public DefaultEventSink(EventListener eventListener,
int configurationId)
eventListener - configurationId - | Method Detail |
|---|
public boolean hasBindings()
Bindabletrue only if this Bindable instance has
at least one binding assigned. Returns
false, if it doesn't have any bindings.
hasBindings in interface Bindablepublic Iterator getBindings()
Bindablebindings
assigned to this Bindable instance. This iterator will have
no next elements (rather than being ), if the
Bindable doesn't have any bindings.
- Specified by:
getBindings in interface Bindable
- Returns:
- an iterator over all available
bindings
public boolean supportsBindingChanges()
Bindabletrue, if it is safe to call one of the mutator
methods ((Bindable.addBinding(CommunicationBinding),
Bindable.removeBinding(CommunicationBinding), (Bindable.clearBindings(),
etc.) at this time without getting an IllegalStateException.
Returns false otherwise.
Some implementations of this interface may not allow for bindings to be
added or removed all the time, but rather only when the actual
implementation is in a certain set of states (note that this set could be
empty or contain solely a single set). By calling this method and
observing its return value it is possible for a client to determine
whether this Bindable supports changes within its current
state.
supportsBindingChanges in interface Bindabletrue if this Bindable instance may be
modified at the moment without throwing
IllegalStateExceptions, false otherwiseBindable.addBinding(CommunicationBinding),
Bindable.removeBinding(CommunicationBinding),
Bindable.clearBindings()
public void addBinding(CommunicationBinding binding)
throws WS4DIllegalStateException
BindableBindable. Does nothing if the
Bindable already contains the binding.
addBinding in interface Bindablebinding - the binding to add
WS4DIllegalStateException - in case this Bindable
doesn't currently support modifications (see
Bindable.supportsBindingChanges())
public boolean removeBinding(CommunicationBinding binding)
throws WS4DIllegalStateException
BindableBindable instance.
Does nothing, if the Bindable doesn't contain the given
binding. Returns true if the binding was removed and
false if it didn't exist.
removeBinding in interface Bindablebinding - the binding to remove
true if this Bindable instance had the
given binding assigned and it was removed successfully,
false otherwise
WS4DIllegalStateException - in case this Bindable
doesn't currently support modifications (see
Bindable.supportsBindingChanges())
public void clearBindings()
throws WS4DIllegalStateException
BindableBindable instance. Does
nothing if there are no bindings assigned.
clearBindings in interface BindableWS4DIllegalStateException - in case this Bindable
doesn't support modifications at the current time (see
Bindable.supportsBindingChanges())
public void open()
throws EventingException
open in interface EventSinkEventingException - in case opening this event sink fails for any
reason (e.g. binding to a specified local address fails)public void close()
close in interface EventSinkpublic EventListener getEventListener()
EventSink
getEventListener in interface EventSinkpublic boolean isOpen()
EventSink
isOpen in interface EventSinktrue - if event sink is open to receive events/
solicit responses, else false.public ClientSubscription getSubscription(java.lang.String clientSubId)
getSubscription in interface EventSinkpublic ClientSubscription removeSubscription(java.lang.String clientSubId)
clientSubId -
public void addSubscription(java.lang.String clientSubId,
ClientSubscription subscription)
EventSinkService.subscribe(EventSink, String, org.ws4d.java.types.URISet, long)
.
addSubscription in interface EventSinkclientSubId - client subscription idsubscription - client subscription
public ParameterValue receiveLocalEvent(java.lang.String clientSubscriptionId,
URI actionUri,
ParameterValue outputParameter)
EventSink
receiveLocalEvent in interface EventSinkclientSubscriptionId - actionUri - outputParameter -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||