Go to the documentation of this file.00001 #ifndef archive_event_supplier_H
00002 #define archive_event_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
00029
00030 #ifndef __cplusplus
00031 #error This is a C++ include file and cannot be used from plain C
00032 #endif
00033
00038 #include <lokiSingleton.h>
00039 #include <baciC.h>
00040
00041 #include <basencSupplier.h>
00042 #include <ACSErrTypeCORBA.h>
00043 #include <acsncErrType.h>
00044
00053 class ArchiveSupplier : public BaseSupplier
00054 {
00055 public:
00059 ArchiveSupplier();
00060
00064 virtual ~ArchiveSupplier();
00065
00080 template <class T>
00081 void
00082 sendEvent(CORBA::Short priority,
00083 ACS::Time timeStamp,
00084 const std::string& component,
00085 const std::string& property,
00086 T value,
00087 const std::string& container="")
00088 {
00089 CORBA::Any any;
00090 any <<= value;
00091
00092 try{
00093 this->send_event(priority,
00094 timeStamp,
00095 component,
00096 property,
00097 any,
00098 container);
00099 }
00100 catch(ACSErrTypeCORBA::CORBAReferenceNilExImpl& ex1)
00101 {
00102 acsncErrType::PublishEventFailureExImpl
00103 ex2 (__FILE__, __LINE__, "ArchiveSupplier::send_event");
00104 ex2.setEventName("archiving_event");
00105 ex2.setChannelName(channelName_mp);
00106 throw ex2;
00107 }
00108 catch(ACSErrTypeCORBA::NarrowFailedExImpl& ex1)
00109 {
00110 acsncErrType::PublishEventFailureExImpl
00111 ex2 (__FILE__, __LINE__, "ArchiveSupplier::send_event");
00112 ex2.setEventName("archiving_event");
00113 ex2.setChannelName(channelName_mp);
00114 throw ex2;
00115 }
00116 catch(ACSErrTypeCORBA::FailedToResolveServiceExImpl& ex1)
00117 {
00118 acsncErrType::PublishEventFailureExImpl
00119 ex2 (__FILE__, __LINE__, "ArchiveSupplier::send_event");
00120 ex2.setEventName("archiving_event");
00121 ex2.setChannelName(channelName_mp);
00122 throw ex2;
00123 }
00124 }
00125
00140 void
00141 send_event(CORBA::Short priority,
00142 ACS::Time timeStamp,
00143 const std::string& component,
00144 const std::string& property,
00145 CORBA::Any value,
00146 const std::string& container);
00147
00148 protected:
00149
00153 virtual const char*
00154 getNotificationFactoryName()
00155 {return acscommon::ARCHIVE_NOTIFICATION_FACTORY_NAME;}
00156
00160 virtual const char*
00161 getChannelDomain()
00162 {return acscommon::ARCHIVING_DOMAIN;}
00163
00167 virtual const char*
00168 getChannelKind()
00169 { return acscommon::ARCHIVING_CHANNEL_KIND; }
00170
00174 virtual const char*
00175 getEventType()
00176 { return ""; }
00177
00178 };
00179
00184 typedef Loki::SingletonHolder<ArchiveSupplier,
00185 Loki::CreateUsingNew,
00186 Loki::PhoenixSingleton,
00187 Loki::SingleThreaded> ArchiveSupplierSingleton;
00188
00189 #endif