public interface Bindable
communication
bindings.
By implementing the Bindable interface, a class indicates that it is capable of
being "bound" to one or more communication endpoint addresses (as represented by
instances of the CommunicationBinding interface). The methods defined herein allow a
client to observe and manipulate these bindings.
Note that some implementations may not support alterations to their communication bindings, or
support them solely when it is in certain state(s). The method #supportsBindingChanges()
is used in order to indicate this. Clients are advised to inspect its return value prior to
calling mutator methods like addBinding(CommunicationBinding), removeBinding(CommunicationBinding) or clearBindings().
Example:
Bindable bindable = ...;
CommunicationBinding binding = ...;
if (bindable.supportsBindingChanges()) {
bindable.add(binding);
}
CommunicationBinding| Modifier and Type | Method and Description |
|---|---|
void |
addBinding(CommunicationAutoBinding binding)
Adds the given autoBinding to this
Bindable. |
void |
addBinding(CommunicationBinding binding)
Adds the given binding to this
Bindable. |
void |
clearBindings()
Removes all bindings from this
Bindable instance. |
Iterator |
getCommunicationAutoBindings()
Returns an iterator over all
autoBindings assigned to this Bindable instance. |
Iterator |
getCommunicationBindings()
Returns an iterator over all
bindings assigned to this Bindable
instance. |
boolean |
hasCommunicationAutoBindings()
Returns
true only if this instance has at least one binding assigned. |
boolean |
hasCommunicationBindings()
|
boolean |
removeBinding(CommunicationAutoBinding autoBinding) |
boolean |
removeBinding(CommunicationBinding binding)
Removes the specified binding from this
Bindable instance. |
Iterator getCommunicationBindings()
bindings assigned to this Bindable
instance. This iterator will have no next elements (rather than being ), if the
Bindable doesn't have any bindings.bindingsIterator getCommunicationAutoBindings()
autoBindings assigned to this Bindable instance. This
iterator will have no next elements (rather than being
), if the Bindable doesn't have any
bindings.bindingsboolean hasCommunicationBindings()
true only if this Bindable instance has at least one binding assigned. Returns false, if it doesn't have any
bindings.boolean hasCommunicationAutoBindings()
true only if this instance has at least one binding assigned. Returns false, if it doesn't have any
autoBindings.void addBinding(CommunicationAutoBinding binding) throws java.io.IOException
Bindable. Does nothing if the Bindable
already contains the binding.autoBinding - the binding to addWS4DIllegalStateException - in case this Bindable doesn't currently support modifications (see #supportsBindingChanges())java.io.IOExceptionvoid addBinding(CommunicationBinding binding) throws java.io.IOException
Bindable. Does nothing if the Bindable
already contains the binding.binding - the binding to addWS4DIllegalStateException - in case this Bindable doesn't currently support modifications (see #supportsBindingChanges())java.io.IOExceptionboolean removeBinding(CommunicationBinding binding) throws java.io.IOException
Bindable 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.binding - the binding to removetrue if this Bindable instance had the given binding assigned and it was
removed successfully, false otherwiseWS4DIllegalStateException - in case this Bindable doesn't currently support modifications (see #supportsBindingChanges())java.io.IOExceptionboolean removeBinding(CommunicationAutoBinding autoBinding) throws java.io.IOException
java.io.IOExceptionvoid clearBindings()
throws WS4DIllegalStateException
Bindable instance. Does nothing if there are no
bindings assigned.WS4DIllegalStateException - in case this Bindable doesn't support modifications at the current time (see #supportsBindingChanges())