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/Uuid.h"
00029
00030 namespace qpid {
00031 namespace management {
00032
00033 class Producer : public ManagementObject
00034 {
00035 private:
00036
00037 static std::string packageName;
00038 static std::string className;
00039 static uint8_t md5Sum[16];
00040
00041
00042 uint64_t destinationRef;
00043 uint64_t exchangeRef;
00044
00045
00046 uint64_t msgsProduced;
00047 uint64_t bytesProduced;
00048
00049
00050 static void writeSchema (qpid::framing::Buffer& buf);
00051 void writeConfig (qpid::framing::Buffer& buf);
00052 void writeInstrumentation (qpid::framing::Buffer& buf,
00053 bool skipHeaders = false);
00054 void doMethod (std::string methodName,
00055 qpid::framing::Buffer& inBuf,
00056 qpid::framing::Buffer& outBuf);
00057 writeSchemaCall_t getWriteSchemaCall (void) { return writeSchema; }
00058
00059
00060 public:
00061
00062 friend class PackageQpid;
00063 typedef boost::shared_ptr<Producer> shared_ptr;
00064
00065 Producer (Manageable* coreObject, uint64_t _destinationRef, uint64_t _exchangeRef);
00066 ~Producer (void);
00067
00068 std::string getPackageName (void) { return packageName; }
00069 std::string getClassName (void) { return className; }
00070 uint8_t* getMd5Sum (void) { return md5Sum; }
00071
00072
00073
00074
00075 inline void inc_msgsProduced (uint64_t by = 1){
00076 sys::RWlock::ScopedWlock writeLock (accessLock);
00077 msgsProduced += by;
00078 instChanged = true;
00079 }
00080 inline void dec_msgsProduced (uint64_t by = 1){
00081 sys::RWlock::ScopedWlock writeLock (accessLock);
00082 msgsProduced -= by;
00083 instChanged = true;
00084 }
00085 inline void inc_bytesProduced (uint64_t by = 1){
00086 sys::RWlock::ScopedWlock writeLock (accessLock);
00087 bytesProduced += by;
00088 instChanged = true;
00089 }
00090 inline void dec_bytesProduced (uint64_t by = 1){
00091 sys::RWlock::ScopedWlock writeLock (accessLock);
00092 bytesProduced -= by;
00093 instChanged = true;
00094 }
00095
00096 };
00097
00098 }}
00099
00100
00101 #endif