com.ibm.ftt.resources.core
Interface IResourcePublisher

All Known Implementing Classes:
ResourcePublisher

public interface IResourcePublisher

The IResourcePublisher interface provides for subscribing and publishing resource subscription events.

The remote resource model uses publish/subscribe mechanism to synchronize physical model layer's changes to anything that references physical objects. Each resource object that wants to participate in the publish/subscribe mechanism should return an object implementing this interface through the getResourcePublisher method.

You can subscribe to events for the resource using the resource publisher. The resource publisher can also be used to publish resource subscription events to all the subscribers.

See Also:
IPhysicalResource.getResourcePublisher()

Field Summary
static String COPY_RIGHT
           
 
Method Summary
 List getSubscriptions()
          Returns a list of all subscriptions attached to this resource publisher.
 void publish(IResourceSubscriptionEvent event)
          Notifies all subscribers that an event pertaining to this publisher occurred.
 void subscribe(IResourceSubscription subscription)
          Attaches a new subscription to this resource publisher.
 void unsubscribe(Object subscriber)
          Detaches the subscription associated with the subscriber from this publisher.
 

Field Detail

COPY_RIGHT

static final String COPY_RIGHT
See Also:
Constant Field Values
Method Detail

subscribe

void subscribe(IResourceSubscription subscription)
Attaches a new subscription to this resource publisher. If a subscription already exists for the subscriber, the original subscription will be replaced.

Parameters:
subscription - the subscription to be added for this resource publisher

unsubscribe

void unsubscribe(Object subscriber)
Detaches the subscription associated with the subscriber from this publisher.

Parameters:
subscriber - the subscriber associated with the subscription to be detached from this resource publisher. If no subscription is associated with the specified subscriber, do nothing.

publish

void publish(IResourceSubscriptionEvent event)
Notifies all subscribers that an event pertaining to this publisher occurred. If this resource publisher contains one or more IResourceSubscription, IResourceSubscription.notifySubscriber(IResourceSubscriptionEvent) method is called for each subscription.

Parameters:
event - the event to publish to all the subscribers

getSubscriptions

List getSubscriptions()
Returns a list of all subscriptions attached to this resource publisher.