Classes | Public Member Functions

alma.acs.nc.AcsEventSubscriber Interface Reference

Inheritance diagram for alma.acs.nc.AcsEventSubscriber:
alma.acs.nc.refactored.NCSubscriber

List of all members.

Classes

interface  Callback< T extends IDLEntity >
interface  GenericCallback

Public Member Functions

void addSubscription (Callback<?extends IDLEntity > receiver) throws CannotAddSubscriptionException
void removeSubscription (Class<?extends IDLEntity > structClass) throws SubscriptionNotFoundException
void addGenericSubscription (GenericCallback receiver) throws CannotAddSubscriptionException
void removeGenericSubscription () throws SubscriptionNotFoundException
void startReceivingEvents () throws CannotStartReceivingEventsException, IllegalStateException
void disconnect () throws IllegalStateException
void suspend () throws IllegalStateException
void resume () throws IllegalStateException

Detailed Description

This interface provides an event subscriber, that can be implemented on top of Corba NC or DDS, in-memory for local testing, or on top of other technologies.

Discussion:

Author:
jslopez

Member Function Documentation

void alma.acs.nc.AcsEventSubscriber.addGenericSubscription ( GenericCallback  receiver  )  throws CannotAddSubscriptionException

Adds a generic handler for all types of events.

It is possible to add a generic handler in addition to event type specific handlers (where the latter will get precedence). Adding another generic handler will replace the previous generic handler.

Parameters:
receiver The callback to use when receiving events
Exceptions:
CannotAddSubscriptionException If there is a problem and the generic receiver cannot be added
void alma.acs.nc.AcsEventSubscriber.addSubscription ( Callback<?extends IDLEntity >  receiver  )  throws CannotAddSubscriptionException

Adds a handler that will receive events of a specific type. The even type is determined by the value returned by calling Callback#getEventType() over the receiver parameter.

Note that the same event type can only be subscribed to with one handler, which means that another handler added for the same type will replace the previous handler.

Parameters:
receiver The callback to use when receiving events for the specified type.
Exceptions:
CannotAddSubscriptionException If there is a problem and the receiver cannot be added

Referenced by alma.demo.EventConsumerImpl.NCReceiverImpl.initialize().

void alma.acs.nc.AcsEventSubscriber.disconnect (  )  throws IllegalStateException

Disconnects this subscriber from the Notification Channel, and releases all the resources associated with it. After this call, all registered handlers will stop receiving events, and this subscriber becomes unusable.

Calling this method over a subscriber object that has been already disconnected will throw an IllegalStateException.

Exceptions:
IllegalStateException If this method is called over an AcsEventSubscriber object that has been already disconnected

Referenced by alma.acs.container.ContainerServicesImpl.cleanUp(), and alma.demo.EventConsumerImpl.NCReceiverImpl.initialize().

void alma.acs.nc.AcsEventSubscriber.removeGenericSubscription (  )  throws SubscriptionNotFoundException

Removes the generic event handler, so that it will no longer receive events. Event specific handlers may still receive events.

Exceptions:
SubscriptionNotFoundException If a generic receiver has not been previously subscribed
CannotRemoveSubscriptionExeption If there is any problem while unsubscribing the generic receiver
void alma.acs.nc.AcsEventSubscriber.removeSubscription ( Class<?extends IDLEntity >  structClass  )  throws SubscriptionNotFoundException

Removes the subscription for a specified event type, so that the handler previously registered for that event type will no longer receive events.

Parameters:
structClass the event type to be unsubscribed. If null, then all subscriptions but the generic subscription are removed.
Exceptions:
SubscriptionNotFoundException if the specified event type has not been previously subscribed.
void alma.acs.nc.AcsEventSubscriber.resume (  )  throws IllegalStateException

Used to reenable the Subscriber after a call to the suspend() method. Queued events will be received after this call, see suspend().

This call has no effect if the Subscriber is not connected, or if it is connected and already processing events.

void alma.acs.nc.AcsEventSubscriber.startReceivingEvents (  )  throws CannotStartReceivingEventsException, IllegalStateException

This method must be called to actually start receiving events. Typically it is called after the subscriptions are set up. User may still add and remove subscriptions at any given time, though. Also, the connection can be suspended and resumed.

No further invocations should be attempted on this method after one has been already successful. Otherwise, an IllegalStateException will be thrown.

If this method is not called, no event will be received

Exceptions:
CannotStartReceivingEventsException If any error happens while trying to start receiving events
IllegalStateException If the user calls this method on an object that is already receiving events

Referenced by alma.demo.EventConsumerImpl.NCReceiverImpl.initialize().

void alma.acs.nc.AcsEventSubscriber.suspend (  )  throws IllegalStateException

Used to temporarily halt receiving events of all types.

If the Subscriber has been connected already (method startReceivingEvents(), then after calling this method, incoming events will be buffered instead of being discarded; unexpired events will be received later, after a call to resume().

This call has no effect if the Subscriber is not connected, or if it is connected but already suspended.

Exceptions:
IllegalStateException if the subscriber is not connected to an NC.

The documentation for this interface was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties