00001 /** 00002 * @file CosEventComm.idl 00003 * 00004 * @brief Define the CosEventComm module 00005 * 00006 * CosEventComm.idl,v 1.7 2001/09/17 20:50:34 coryan Exp 00007 * 00008 * Described in CORBAservices: Common Object Services Specification, 00009 * chapter 4. 00010 * 00011 * CosEventComm Module, page 4-8 includes the following interfaces: 00012 * PushConsumer, PushSupplier, PullSupplier, PullConsumer 00013 * 00014 * The Event service IDL can be downloaded from 00015 * ftp://www.omg.org/pub/docs/formal/97-11-02.idl 00016 * 00017 * The complete specification is available from: 00018 * http://www.omg.org/technology/documents/formal/event_service.htm 00019 * 00020 * @author Pradeep Gore <pradeep@cs.wustl.edu> 00021 */ 00022 00023 #ifndef TAO_EVENTCOMM_IDL 00024 #define TAO_EVENTCOMM_IDL 00025 00026 #pragma prefix "omg.org" 00027 00028 /** 00029 * @namespace CosEventComm 00030 * 00031 * @brief Define the interfaces implemented by users of the CORBA 00032 * Event Service. 00033 */ 00034 module CosEventComm 00035 { 00036 /** 00037 * @exception Disconnected 00038 * 00039 * @brief Exception raised when a client tries to communicate with 00040 * the Event Service after it has disconnected. 00041 * 00042 * The exception is raised if: 00043 * 00044 * - If supplier tries to push an event before fully connecting to 00045 * the EC. 00046 * - A consumer tries to pull an event before fully connecting to 00047 * the EC. 00048 */ 00049 exception Disconnected {}; 00050 00051 /** 00052 * @interface PushConsumer 00053 * 00054 * @brief Define the interface implemented by push-style consumers 00055 * 00056 * A push-style consumer passively receives events from the Event 00057 * Service. Applications simply implement this interface, connect 00058 * to the Event Service and receive events. 00059 */ 00060 interface PushConsumer 00061 { 00062 /// Receive one event from the Consumer's peer. 00063 /** 00064 * A supplier communicates event data to the consumer by 00065 * invoking the push operation. 00066 * @param data The event 00067 * @throws CosEventComm::Disconnected if the object considers 00068 * itself no longer connected to its peer. 00069 */ 00070 void push (in any data) raises (Disconnected); 00071 00072 /// The peer has disconnected from the PushConsumer. 00073 /** 00074 * The disconnect_push_consumer operation indicates that the peer 00075 * has disconnected, for example, because it has been destroyed. 00076 * The application can safely release all resources attached to 00077 * this consumer and destroy it, no further push() calls should be 00078 * expected. 00079 */ 00080 void disconnect_push_consumer (); 00081 }; 00082 00083 /** 00084 * @interface PushSupplier 00085 * 00086 * @brief Define the interface implemented by push-style suppliers. 00087 * 00088 * A push-style supplier actively pushes events into the Event 00089 * Service 00090 */ 00091 interface PushSupplier 00092 { 00093 /// The peer has disconnected from the push-style supplier 00094 /** 00095 * The disconnect_push_supplier operation indicates that the peer 00096 * has disconnected, for example, because it has been destroyed. 00097 * The application can safe release all resource attached to this 00098 * supplier and destroy it, further attempts to push events into 00099 * its peer will fail. 00100 */ 00101 void disconnect_push_supplier (); 00102 }; 00103 00104 /** 00105 * @interface PullConsumer 00106 * 00107 * @brief Define the interface implemented by pull-style consumers 00108 * 00109 * A pull-style consumer actively queries the Event Channel for 00110 * events. 00111 */ 00112 interface PullConsumer 00113 { 00114 /// The peer has disconnected from the pull-style consumer. 00115 /** 00116 * The disconnect_pull_consumer operation indicates that the peer 00117 * has disconnected, for example, because it has been destroyed. 00118 * The application can safely release all resources attached to 00119 * this consumer and destroy it, any attemps to pull more data 00120 * should fail. 00121 */ 00122 void disconnect_pull_consumer (); 00123 }; 00124 00125 /** 00126 * @interface PullSupplier 00127 * 00128 * @brief Define the interface implemented by pull-style suppliers. 00129 * 00130 * A pull-style supplier passively generates events for the Event 00131 * Service 00132 */ 00133 interface PullSupplier 00134 { 00135 /// Pull (blocking) one event from the supplier. 00136 /** 00137 * The pull operation should block until the next event becomes 00138 * available. 00139 * @return The next event 00140 * @throws CosEventComm::Disconnected if the object considers 00141 * itself no longer connected to its peer. 00142 */ 00143 any pull () raises (Disconnected); 00144 00145 /// Pull (non-blocking) one event from the supplier. 00146 /** 00147 * The try_pull operation does not block: if the event data is 00148 * available, it returns the event data and sets the has_event 00149 * parameter to true; if the event is not available, it sets the 00150 * has_event parameter to false and the event data is returned 00151 * as long with an undefined value. 00152 * 00153 * @param has_event Set to TRUE if there was another event 00154 * available, FALSE otherwise. 00155 * @return The next event if one was available, an any containing 00156 * a 'long' with an undefined value otherwise. 00157 * @throws CosEventComm::Disconnected if the object considers 00158 * itself no longer connected to its peer. 00159 */ 00160 any try_pull (out boolean has_event) raises (Disconnected); 00161 00162 /// The peer has disconnected from the pull-style supplier. 00163 /** 00164 * The disconnect_pull_supplier operation indicates that the peer 00165 * has disconnected, for example, because it has been destroyed. 00166 * The application can safe release all resource attached to this 00167 * supplier and destroy it, the peer should not make any attempts 00168 * to pull more data after this request. 00169 */ 00170 void disconnect_pull_supplier (); 00171 }; 00172 00173 }; 00174 00175 #pragma prefix "" 00176 00177 #endif /* TAO_EVENTCOMM_IDL */