00001 #ifndef logging_acsstructuredpushsupplier_H 00002 #define logging_acsstructuredpushsupplier_H 00003 /******************************************************************************* 00004 * ALMA - Atacama Large Millimiter Array 00005 * (c) European Southern Observatory, 2002 00006 * Copyright by ESO (in the framework of the ALMA collaboration) 00007 * and Cosylab 2002, All rights reserved 00008 * 00009 * This library is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU Lesser General Public 00011 * License as published by the Free Software Foundation; either 00012 * version 2.1 of the License, or (at your option) any later version. 00013 * 00014 * This library is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 * Lesser General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU Lesser General Public 00020 * License along with this library; if not, write to the Free Software 00021 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 * 00023 * "@(#) $Id: loggingACSStructuredPushSupplier.h,v 1.6 2008/09/29 08:36:42 cparedes Exp $" 00024 * 00025 * who when what 00026 * -------- ---------- ---------------------------------------------- 00027 * msekoran 2001-06-17 created 00028 */ 00029 00030 #ifndef __cplusplus 00031 #error This is a C++ include file and cannot be used from plain C 00032 #endif 00033 00034 #include <acsutil.h> 00035 00036 #include <orbsvcs/CosNotifyChannelAdminS.h> 00037 #include <orbsvcs/CosNotifyCommC.h> 00038 00039 class LoggingService; 00040 00045 class ACSStructuredPushSupplier : public POA_CosNotifyComm::StructuredPushSupplier, 00046 public PortableServer::RefCountServantBase 00047 { 00048 // = TITLE 00049 // StructuredPushSupplier 00050 // 00051 // = DESCRIPTION 00052 // Supplier 00053 // 00054 public: 00055 // = Initialization and Termination code 00056 ACSStructuredPushSupplier (void); 00057 // Constructor. 00058 00059 void connect (CosNotifyChannelAdmin::SupplierAdmin_ptr supplier_admin); 00060 // Connect the Supplier to the EventChannel. 00061 // Creates a new proxy supplier and connects to it. 00062 00063 void disconnect (); 00064 // Disconnect from the supplier. 00065 00066 virtual void send_event (const CosNotification::StructuredEvent& event); 00067 // Send one event. 00068 00069 00070 // = NotifySubscribe 00071 /* 00072 * = NotifySubscribe 00073 * \throw CosNotifyComm::InvalidEventType 00074 */ 00075 virtual void subscription_change (const CosNotification::EventTypeSeq & added, 00076 const CosNotification::EventTypeSeq & removed); 00077 00078 // = StructuredPushSupplier method 00079 virtual void disconnect_structured_push_supplier (); 00080 00081 void set_logging_service(LoggingService *service); 00082 00083 protected: 00084 00085 void update_num_lost_logs(const CosNotification::StructuredEvent& event); 00086 00087 // = Data members 00088 CosNotifyChannelAdmin::StructuredProxyPushConsumer_var proxy_consumer_; 00089 // The proxy that we are connected to. 00090 00091 CosNotifyChannelAdmin::ProxyID proxy_consumer_id_; 00092 // This supplier's id. 00093 00094 // = Protected Methods 00095 virtual ~ACSStructuredPushSupplier (); 00096 // Destructor 00097 00098 // Logging service used to reinitialize the connection to the Notify Channel when 00099 // publishing an event throws an exception [OBJECT_NOT_EXIST, BAD_OPERATION] 00100 LoggingService *m_service; 00101 00102 // Number of lost logs 00103 int32_t m_numLostLogs; 00104 }; 00105 00106 #endif
1.7.0