• Classes
  • Modules
  • Namespaces
  • Files
  • Related Pages
  • File List
  • File Members

acsncSupplier.h

Go to the documentation of this file.
00001 #ifndef SUPPLIER_H
00002 #define SUPPLIER_H
00003 
00004 /* @(#) $Id: acsncSupplier.h,v 1.67 2011/11/17 23:31:54 javarias 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 #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 

Generated on Mon Jul 4 2016 08:50:20 for ACS-2016.6 C++ API by  doxygen 1.7.0