00001
00002 #ifndef _MANAGEMENT_BINDING_
00003 #define _MANAGEMENT_BINDING_
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 Binding : 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 exchangeRef;
00044 uint64_t queueRef;
00045 std::string bindingKey;
00046 framing::FieldTable arguments;
00047
00048
00049 uint64_t msgMatched;
00050
00051
00052 static void writeSchema (qpid::framing::Buffer& buf);
00053 void writeConfig (qpid::framing::Buffer& buf);
00054 void writeInstrumentation (qpid::framing::Buffer& buf,
00055 bool skipHeaders = false);
00056 void doMethod (std::string methodName,
00057 qpid::framing::Buffer& inBuf,
00058 qpid::framing::Buffer& outBuf);
00059 writeSchemaCall_t getWriteSchemaCall (void) { return writeSchema; }
00060
00061
00062 public:
00063
00064 friend class PackageQpid;
00065 typedef boost::shared_ptr<Binding> shared_ptr;
00066
00067 Binding (Manageable* coreObject, Manageable* _parent, uint64_t _queueRef, std::string _bindingKey, framing::FieldTable _arguments);
00068 ~Binding (void);
00069
00070 std::string getPackageName (void) { return packageName; }
00071 std::string getClassName (void) { return className; }
00072 uint8_t* getMd5Sum (void) { return md5Sum; }
00073
00074
00075
00076
00077 inline void inc_msgMatched (uint64_t by = 1){
00078 sys::RWlock::ScopedWlock writeLock (accessLock);
00079 msgMatched += by;
00080 instChanged = true;
00081 }
00082 inline void dec_msgMatched (uint64_t by = 1){
00083 sys::RWlock::ScopedWlock writeLock (accessLock);
00084 msgMatched -= by;
00085 instChanged = true;
00086 }
00087 inline void set_msgMatched (uint64_t val){
00088 sys::RWlock::ScopedWlock writeLock (accessLock);
00089 msgMatched = val;
00090 instChanged = true;
00091 }
00092
00093 };
00094
00095 }}
00096
00097
00098 #endif