Go to the documentation of this file.00001 #ifndef SUPPLIER_H
00002 #define SUPPLIER_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00033 #include "acsncHelper.h"
00034 #include <acscomponentImpl.h>
00035 #include "RepeatGuardLogger.h"
00036 #include "acsncCircularQueue.h"
00037
00038 namespace nc {
00055 class Supplier :
00056 protected Helper,
00057 public POA_CosNotifyComm::StructuredPushSupplier,
00058 protected virtual PortableServer::RefCountServantBase
00059 {
00060 public:
00070 Supplier(const char* channelName,
00071 acscomponent::ACSComponentImpl* component,
00072 const char* acsNCDomainName = 0);
00073
00084 Supplier(const char* channelName,
00085 CORBA::ORB_ptr orb_mp,
00086 acscomponent::ACSComponentImpl* component,
00087 const char* acsNCDomainName = 0);
00088
00112 Supplier(const char* channelName,
00113 int argc,
00114 char *argv[],
00115 acscomponent::ACSComponentImpl* component,
00116 const char* acsNCDomainName = 0);
00117
00125 virtual void
00126 disconnect();
00127
00143 void
00144 publishEvent(const CosNotification::StructuredEvent &event)
00145 ;
00146
00160 virtual void
00161 publishEvent(const CORBA::Any &eventData)
00162 ;
00163
00173 virtual void
00174 disconnect_structured_push_supplier();
00175
00189 virtual void
00190 subscription_change(const CosNotification::EventTypeSeq &eventsAdded,
00191 const CosNotification::EventTypeSeq &eventsRemoved);
00192
00197 void reconnect(::NotifyMonitoringExt::EventChannelFactory *ecf);
00198
00199 void setAntennaName(std::string antennaName);
00200
00208 void setAutoreconnect(bool autoreconnect);
00209
00213 bool increaseEventBufferSize(unsigned int bufferSize);
00214
00218 unsigned int getEventBufferSize() const;
00219
00220 protected:
00224 virtual ~Supplier();
00225
00234 void
00235 populateHeader(CosNotification::StructuredEvent &event)
00236 ;
00237
00248 virtual void
00249 populateHeader(const CORBA::Any &any)
00250 ;
00251
00261 void
00262 setEventType(const char *);
00263
00264
00265
00275 void
00276 createSupplier()
00277 ;
00278
00290 void
00291 destroyNotificationChannel()
00292 ;
00293
00303 void
00304 init(CORBA::ORB_ptr orb)
00305 ;
00306
00307
00308 void
00309 reinit();
00310
00315 CosNotifyChannelAdmin::SupplierAdmin_var SupplierAdmin_m;
00316
00320 CosNotifyChannelAdmin::StructuredProxyPushConsumer_var proxyConsumer_m;
00321
00325 CosNotifyComm::StructuredPushSupplier_var reference_m;
00326
00327
00328
00334 acscomponent::ACSComponentImpl* component_mp;
00335
00339 char* typeName_mp;
00340
00344 unsigned long long count_m;
00345 Logging::RepeatGuardLogger<Logging::BaseLog> guardbl;
00350 CosNotification::StructuredEvent event_m;
00351
00352 std::string antennaName;
00353
00359 bool autoreconnect_m;
00360
00364 ACE_Recursive_Thread_Mutex m_publishMutex;
00365
00366 private:
00367
00368 static const uint32_t SLEEP_TIME_BEFORE_SENDING_BUFFERED_EVENTS;
00369
00373 void operator=(const Supplier&);
00374
00378 Supplier(const Supplier&);
00379
00380 CosNotifyChannelAdmin::AdminID adminid;
00381 CosNotifyChannelAdmin::ProxyID proxyConsumerID;
00382
00383 CircularQueue eventBuff;
00384
00385 };
00386 };
00387 #endif
00388