00001 #ifndef SUPPLIER_H 00002 #define SUPPLIER_H 00003 00004 /* @(#) $Id: acsncSupplier.h,v 1.63 2008/10/09 07:57:41 cparedes Exp $ 00005 * 00006 * Supplier Abstract base class for notification channel push structured event 00007 * supplier. 00008 * ALMA - Atacama Large Millimiter Array 00009 * (c) Associated Universities Inc., 2002 00010 * (c) European Southern Observatory, 2002 00011 * Copyright by ESO (in the framework of the ALMA collaboration) 00012 * and Cosylab 2002, All rights reserved 00013 * 00014 * This library is free software; you can redistribute it and/or 00015 * modify it under the terms of the GNU Lesser General Public 00016 * License as published by the Free Software Foundation; either 00017 * version 2.1 of the License, or (at your option) any later version. 00018 * 00019 * This library is distributed in the hope that it will be useful, 00020 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00022 * Lesser General Public License for more details. 00023 * 00024 * You should have received a copy of the GNU Lesser General Public 00025 * License along with this library; if not, write to the Free Software 00026 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00027 */ 00028 00033 #include "acsncHelper.h" 00034 #include <acscomponentImpl.h> 00035 #include "RepeatGuardLogger.h" 00036 namespace nc { 00053 class Supplier : 00054 protected Helper, 00055 public POA_CosNotifyComm::StructuredPushSupplier, 00056 protected virtual PortableServer::RefCountServantBase 00057 { 00058 public: 00066 Supplier(const char* channelName, 00067 acscomponent::ACSComponentImpl* component); 00068 00077 Supplier(const char* channelName, 00078 CORBA::ORB_ptr orb_mp, 00079 acscomponent::ACSComponentImpl* component); 00080 00102 Supplier(const char* channelName, 00103 int argc, 00104 char *argv[], 00105 acscomponent::ACSComponentImpl* component); 00106 00114 virtual void 00115 disconnect(); 00116 00128 void 00129 publishEvent(const CosNotification::StructuredEvent &event) 00130 ; 00131 00141 virtual void 00142 publishEvent(const CORBA::Any &eventData) 00143 ; 00144 00154 virtual void 00155 disconnect_structured_push_supplier(); 00156 00170 virtual void 00171 subscription_change(const CosNotification::EventTypeSeq &eventsAdded, 00172 const CosNotification::EventTypeSeq &eventsRemoved); 00173 00174 protected: 00178 virtual ~Supplier(); 00179 00188 void 00189 populateHeader(CosNotification::StructuredEvent &event) 00190 ; 00191 00202 virtual void 00203 populateHeader(const CORBA::Any &any) 00204 ; 00205 00215 void 00216 setEventType(const char *); 00217 00218 00219 00229 void 00230 createSupplier() 00231 ; 00232 00244 void 00245 destroyNotificationChannel() 00246 ; 00247 00257 void 00258 init(CORBA::ORB_ptr orb) 00259 ; 00260 00261 00262 00267 CosNotifyChannelAdmin::SupplierAdmin_var SupplierAdmin_m; 00268 00272 CosNotifyChannelAdmin::StructuredProxyPushConsumer_var proxyConsumer_m; 00273 00277 CosNotifyComm::StructuredPushSupplier_var reference_m; 00278 00279 00280 00286 acscomponent::ACSComponentImpl* component_mp; 00287 00291 char* typeName_mp; 00292 00296 unsigned long long count_m; 00297 Logging::RepeatGuardLogger<Logging::BaseLog> guardbl; 00302 CosNotification::StructuredEvent event_m; 00303 00304 private: 00305 00306 00310 void operator=(const Supplier&); 00311 00315 Supplier(const Supplier&); 00316 }; 00317 }; 00318 #endif 00319