CosNotifyComm.idl

Go to the documentation of this file.
00001 /**
00002  * @file CosNotifyComm.idl
00003  *
00004  * @brief Define the CosNotifyComm module
00005  *
00006  * CosNotifyComm.idl,v 1.7 2005/07/01 20:12:39 michel_j Exp
00007  *
00008  * This module is taken from the standard CORBA Notification Service
00009  * 1.0, as described in:
00010  *
00011  * http://www.omg.org/technology/documents/formal/notification_service.htm
00012  *
00013  * In particular the following two documents were used:
00014  * formal/2000-06-20
00015  * formal/01-03-03
00016  *
00017  * @author Pradeep Gore <pradeep@cs.wustl.edu>
00018  */
00019 
00020 #ifndef _COS_NOTIFY_COMM_IDL_
00021 #define _COS_NOTIFY_COMM_IDL_
00022 
00023 #include "CosNotification.idl"
00024 #include "CosEventComm.idl"
00025 
00026 #pragma prefix "omg.org"
00027 
00028 /**
00029  * @namespace CosNotifyComm
00030  *
00031  * @brief Define the interfaces implemented by users of the CORBA
00032  *        Notification Service.
00033  */
00034 module CosNotifyComm
00035 {
00036   /**
00037    * @exception InvalidEventType
00038    *
00039    * @brief Exception raised to indicate that an EventType is
00040    * syntactically or semantically invalid.
00041    */
00042   exception InvalidEventType {
00043     /// Type of invalid event
00044     CosNotification::_EventType type;
00045   };
00046 
00047   /**
00048    * @interface NotifyPublish
00049    *
00050    * @brief Defines interface to report changes in the events
00051    *        published to a consumer.
00052    *
00053    * Interfaces that represent consumers (or the consumer aspects of
00054    * an Notification Service) provide this interface to receive
00055    * notifications in the list of events they support.
00056    */
00057   interface NotifyPublish {
00058     /// Report a change in the list of publications.
00059     /**
00060      * @param added The list of new event types that the consumer can
00061      *   expect.
00062      * @param removed The list of event types that the consumer should
00063      *   no longer expect.
00064      * @throws InvalidEventType if the one or more event types
00065      *   provided is invalid
00066      */
00067     void offer_change (in CosNotification::EventTypeSeq added,
00068                        in CosNotification::EventTypeSeq removed )
00069       raises ( InvalidEventType );
00070   };
00071 
00072   /**
00073    * @interface NotifySubscribe
00074    *
00075    * @brief Defines interface to report changes in the events required
00076    *        from a supplier.
00077    *
00078    * Interfaces that represent suppliers (or the supplier aspects of
00079    * the Notification Service) provide this interface to receive
00080    * changes
00081    */
00082   interface NotifySubscribe {
00083     /// Report a change in the list of subscriptions
00084     /**
00085      * @param added The list of new event types that are interesting
00086      *   for the supplier's peer.
00087      * @param removed The list of event types that are no longer
00088      *   interesting for the supplier's peer.
00089      * @throws InvalidEventType if the one or more event types
00090      *   provided is invalid
00091      */
00092     void subscription_change(in CosNotification::EventTypeSeq added,
00093                              in CosNotification::EventTypeSeq removed )
00094       raises ( InvalidEventType );
00095   };
00096 
00097   /**
00098    * @interface PushConsumer
00099    *
00100    * @brief Defines the interface used by push-style consumers
00101    *
00102    * Push-style consumers passively accept events as anys.
00103    */
00104   interface PushConsumer :
00105     NotifyPublish,
00106     CosEventComm::PushConsumer {
00107   };
00108 
00109 #ifdef TAO_HAS_NOTIFY_PULL_INTERFACES
00110   /**
00111    * @interface PullConsumer
00112    *
00113    * @brief Defines the interface used by pull-style consumers
00114    *
00115    * Pull-style consumer actively query the Notification Service to
00116    * receive events.
00117    */
00118   interface PullConsumer :
00119     NotifyPublish,
00120     CosEventComm::PullConsumer {
00121   };
00122 
00123   /**
00124    * @interface PullSupplier
00125    *
00126    * @brief Defines the interface used by pull-style suppliers
00127    *
00128    * Pull-style suppliers passively provide events to the Notification
00129    * Service.
00130    */
00131   interface PullSupplier :
00132     NotifySubscribe,
00133     CosEventComm::PullSupplier {
00134   };
00135 #endif /* TAO_HAS_NOTIFY_PULL_INTERFACES */
00136   /**
00137    * @interface PushSupplier
00138    *
00139    * @brief Defines the interface used by push-style suppliers
00140    *
00141    * Push-style suppliers actively provide events to the Notifcation
00142    * Service.
00143    */
00144   interface PushSupplier :
00145     NotifySubscribe,
00146     CosEventComm::PushSupplier {
00147   };
00148 
00149   /**
00150    * @interface StructuredPushConsumer
00151    *
00152    * @brief Defines the interface used by push-style consumers of
00153    * structured events
00154    *
00155    * Push-style consumers passively receive events from the
00156    * Notification Service.  The events are provided using the
00157    * CosNotification::StructuredEvent structure.
00158    */
00159   interface StructuredPushConsumer : NotifyPublish {
00160     /// Receive one structured event
00161     /**
00162      * This operation is invoked to provide one event to the
00163      * consumer.
00164      * @throws CosEventComm::Disconnected if the object considers
00165      *   itself no longer connected to its peer.
00166      */
00167     void push_structured_event(
00168               in CosNotification::StructuredEvent notification)
00169       raises(CosEventComm::Disconnected);
00170 
00171     /// The peer has disconnected
00172     /**
00173      * This operation is invoked by the consumer peer when it wishes
00174      * to disconnect.  The consumer can safely assume that no more
00175      * events will follow this request.
00176      */
00177     void disconnect_structured_push_consumer();
00178   };
00179 
00180 #ifdef TAO_HAS_NOTIFY_PULL_INTERFACES
00181   /**
00182    * @interface StructuredPullConsumer
00183    *
00184    * @brief Defines the interface used by pull-style consumers of
00185    * structured events
00186    *
00187    * Pull-style consumers actively retrieve events from the
00188    * Notification Service.  The events use the
00189    * CosNotification::StructuredEvent format.
00190    */
00191   interface StructuredPullConsumer : NotifyPublish {
00192     /// The peer has disconnected
00193     /**
00194      * This operation is invoked by the consumer peer when it wishes
00195      * to disconnect.  The consumer can safely assume that no more
00196      * events will follow this request.
00197      */
00198     void disconnect_structured_pull_consumer();
00199   };
00200 
00201   /**
00202    * @interface StructuredPullSupplier
00203    *
00204    * @brief Defines the interface used by pull-style suppliers of
00205    * structured events
00206    *
00207    * Pull-style suppliers passively generate events for the
00208    * Notification Service.  The events use the
00209    * CosNotification::StructuredEvent format.
00210    */
00211   interface StructuredPullSupplier : NotifySubscribe {
00212     /// Pull (blocking) one event from the supplier.
00213     /**
00214      * This operation should block until the next event becomes
00215      * available.
00216      * @throws CosEventComm::Disconnected if the object considers
00217      *   itself no longer connected to its peer.
00218      */
00219     CosNotification::StructuredEvent pull_structured_event()
00220       raises(CosEventComm::Disconnected);
00221 
00222     /// Pull (non-blocking) one event from the supplier.
00223     /**
00224      * The try_pull operation does not block: if the event data is
00225      * available, it returns the event data and sets the has_event
00226      * parameter to true; if the event is not available, it sets the
00227      * has_event parameter to false and the event data is returned
00228      * as long with an undefined value.
00229      * @throws CosEventComm::Disconnected if the object considers
00230      *   itself no longer connected to its peer.
00231      */
00232     CosNotification::StructuredEvent try_pull_structured_event(
00233                                 out boolean has_event)
00234       raises(CosEventComm::Disconnected);
00235 
00236     /// The peer has disconnected
00237     /**
00238      * This operation is invoked by the consumer peer when it wishes
00239      * to disconnect.  The consumer can safely assume that no more
00240      * events will follow this request.
00241      */
00242     void disconnect_structured_pull_supplier();
00243   };
00244 #endif /* TAO_HAS_NOTIFY_PULL_INTERFACES */
00245 
00246   /**
00247    * @interface StructuredPushSupplier
00248    *
00249    * @brief Defines the interface used by push-style suppliers that
00250    *   provide structure events.
00251    *
00252    * Push-style suppliers actively provide events, in this case using
00253    * the CosEventComm::StructuredEvent format.
00254    */
00255   interface StructuredPushSupplier : NotifySubscribe {
00256     /// The peer has disconnected
00257     /**
00258      * This operation is invoked by the consumer peer when it wishes
00259      * to disconnect.  The consumer can safely assume that no more
00260      * events will follow this request.
00261      */
00262     void disconnect_structured_push_supplier();
00263   };
00264 
00265   /**
00266    * @interface SequencePushConsumer
00267    *
00268    * @brief Defines the interface used by push-style consumers that
00269    *   interested in event batches.
00270    *
00271    * Push-style consumer passively accept events, in this case
00272    * multiple events can be delivered simulatneously.
00273    */
00274   interface SequencePushConsumer : NotifyPublish {
00275     /// Receive an event batch
00276     /**
00277      * This operation is invoked to provide an event batch to the
00278      * consumer.
00279      * @throws CosEventComm::Disconnected if the object considers
00280      *   itself no longer connected to its peer.
00281      */
00282     void push_structured_events(
00283               in CosNotification::EventBatch notifications)
00284       raises(CosEventComm::Disconnected);
00285 
00286     /// The peer has disconnected
00287     /**
00288      * This operation is invoked by the consumer peer when it wishes
00289      * to disconnect.  The consumer can safely assume that no more
00290      * events will follow this request.
00291      */
00292     void disconnect_sequence_push_consumer();
00293   };
00294 
00295 #ifdef TAO_HAS_NOTIFY_PULL_INTERFACES
00296 
00297 /**
00298    * @interface SequencePullConsumer
00299    *
00300    * @brief Defines the interface used by pull-style consumers that
00301    * deal with event batches.
00302    *
00303    * Pull-style consumer actively query the Notification Service for
00304    * events, this particular interface can obtain multiple events
00305    * simultaneously.
00306    */
00307   interface SequencePullConsumer : NotifyPublish {
00308     /// The peer has disconnected
00309     /**
00310      * This operation is invoked by the consumer peer when it wishes
00311      * to disconnect.  The consumer can safely assume that no more
00312      * events will follow this request.
00313      */
00314     void disconnect_sequence_pull_consumer();
00315   };
00316 
00317   /**
00318    * @interface SequencePullSupplier
00319    *
00320    * @brief Defines the interface used by pull-style suppliers that
00321    * provide event batches.
00322    *
00323    * Pull-style suppliers passively provide events to the Notification
00324    * Service. This particular interface can provide multiple events
00325    * simultaneously.
00326    */
00327   interface SequencePullSupplier : NotifySubscribe {
00328     /// Pull (blocking) an event batch from the supplier
00329     /**
00330      * @param max_number Maximum number of events expected by the
00331      *        caller.
00332      * @throws CosEventComm::Disconnected if the object considers
00333      *   itself no longer connected to its peer.
00334      */
00335     CosNotification::EventBatch pull_structured_events(
00336                                 in long max_number )
00337       raises(CosEventComm::Disconnected);
00338 
00339     /// Pull (non-blocking) an event batch from the supplier
00340     /**
00341      * @param max_number Maximum number of events expected by the
00342      *        caller.
00343      * @param has_event Return FALSE if there are no events available,
00344      *        TRUE otherwise.
00345      * @throws CosEventComm::Disconnected if the object considers
00346      *   itself no longer connected to its peer.
00347      */
00348     CosNotification::EventBatch try_pull_structured_events(
00349                                 in long max_number,
00350                                 out boolean has_event)
00351       raises(CosEventComm::Disconnected);
00352 
00353     /// The peer has disconnected
00354     /**
00355      * This operation is invoked by the consumer peer when it wishes
00356      * to disconnect.  The consumer can safely assume that no more
00357      * events will follow this request.
00358      */
00359     void disconnect_sequence_pull_supplier();
00360   };
00361 
00362 #endif /* TAO_HAS_NOTIFY_PULL_INTERFACES */
00363 
00364   /**
00365    * @interface SequencePushSupplier
00366    *
00367    * @brief Defines the interface used by push-style suppliers that
00368    * provide event batches.
00369    *
00370    * Push-style suppliers actively generate events for the
00371    * Notification Service. This particular interface can provide
00372    * multiple events simultaneously.
00373    */
00374   interface SequencePushSupplier : NotifySubscribe {
00375     /// The peer has disconnected
00376     /**
00377      * This operation is invoked by the consumer peer when it wishes
00378      * to disconnect.  The consumer can safely assume that no more
00379      * events will follow this request.
00380      */
00381     void disconnect_sequence_push_supplier();
00382   };
00383 };
00384 
00385 #pragma prefix ""
00386 
00387 #endif /* _COS_NOTIFY_COMM_IDL_ */

Generated on Thu Nov 9 13:24:09 2006 for TAO_CosNotification by doxygen 1.3.6