00001
00002 #ifndef _MANAGEMENT_PRODUCER_
00003 #define _MANAGEMENT_PRODUCER_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "qpid/management/ManagementObject.h"
00028 #include "qpid/framing/FieldTable.h"
00029 #include "qpid/framing/Uuid.h"
00030
00031 namespace qpid {
00032 namespace management {
00033
00034 class Producer : public ManagementObject
00035 {
00036 private:
00037
00038 static std::string packageName;
00039 static std::string className;
00040 static uint8_t md5Sum[16];
00041
00042
00043 uint64_t destinationRef;
00044 uint64_t exchangeRef;
00045
00046
00047 uint64_t msgsProduced;
00048 uint64_t bytesProduced;
00049
00050
00051 static void writeSchema (qpid::framing::Buffer& buf);
00052 void writeConfig (qpid::framing::Buffer& buf);
00053 void writeInstrumentation (qpid::framing::Buffer& buf,
00054 bool skipHeaders = false);
00055 void doMethod (std::string methodName,
00056 qpid::framing::Buffer& inBuf,
00057 qpid::framing::Buffer& outBuf);
00058 writeSchemaCall_t getWriteSchemaCall (void) { return writeSchema; }
00059
00060
00061 public:
00062
00063 friend class PackageQpid;
00064 typedef boost::shared_ptr<Producer> shared_ptr;
00065
00066 Producer (Manageable* coreObject, uint64_t _destinationRef, uint64_t _exchangeRef);
00067 ~Producer (void);
00068
00069 std::string getPackageName (void) { return packageName; }
00070 std::string getClassName (void) { return className; }
00071 uint8_t* getMd5Sum (void) { return md5Sum; }
00072
00073
00074
00075
00076 inline void inc_msgsProduced (uint64_t by = 1){
00077 sys::RWlock::ScopedWlock writeLock (accessLock);
00078 msgsProduced += by;
00079 instChanged = true;
00080 }
00081 inline void dec_msgsProduced (uint64_t by = 1){
00082 sys::RWlock::ScopedWlock writeLock (accessLock);
00083 msgsProduced -= by;
00084 instChanged = true;
00085 }
00086 inline void set_msgsProduced (uint64_t val){
00087 sys::RWlock::ScopedWlock writeLock (accessLock);
00088 msgsProduced = val;
00089 instChanged = true;
00090 }
00091 inline void inc_bytesProduced (uint64_t by = 1){
00092 sys::RWlock::ScopedWlock writeLock (accessLock);
00093 bytesProduced += by;
00094 instChanged = true;
00095 }
00096 inline void dec_bytesProduced (uint64_t by = 1){
00097 sys::RWlock::ScopedWlock writeLock (accessLock);
00098 bytesProduced -= by;
00099 instChanged = true;
00100 }
00101 inline void set_bytesProduced (uint64_t val){
00102 sys::RWlock::ScopedWlock writeLock (accessLock);
00103 bytesProduced = val;
00104 instChanged = true;
00105 }
00106
00107 };
00108
00109 }}
00110
00111
00112 #endif