|
|
ce820ff |
Index: cpp/src/qmf/engine/ObjectImpl.h
|
|
|
ce820ff |
===================================================================
|
|
|
ce820ff |
--- cpp/src/qmf/engine/ObjectImpl.h (revision 831913)
|
|
|
ce820ff |
+++ cpp/src/qmf/engine/ObjectImpl.h (working copy)
|
|
|
ce820ff |
@@ -56,7 +56,7 @@
|
|
|
ce820ff |
|
|
|
ce820ff |
void destroy();
|
|
|
ce820ff |
const ObjectId* getObjectId() const { return objectId.get(); }
|
|
|
ce820ff |
- void setObjectId(ObjectId* oid) { objectId.reset(oid); }
|
|
|
ce820ff |
+ void setObjectId(ObjectId* oid) { objectId.reset(new ObjectId(*oid)); }
|
|
|
ce820ff |
const SchemaObjectClass* getClass() const { return objectClass; }
|
|
|
ce820ff |
Value* getValue(const std::string& key) const;
|
|
|
ce820ff |
void invokeMethod(const std::string& methodName, const Value* inArgs, void* context) const;
|
|
|
ce820ff |
Index: cpp/src/qpid/management/ManagementAgent.h
|
|
|
ce820ff |
===================================================================
|
|
|
ce820ff |
--- cpp/src/qpid/management/ManagementAgent.h (revision 831913)
|
|
|
ce820ff |
+++ cpp/src/qpid/management/ManagementAgent.h (working copy)
|
|
|
ce820ff |
@@ -113,11 +113,13 @@
|
|
|
ce820ff |
//
|
|
|
ce820ff |
struct RemoteAgent : public Manageable
|
|
|
ce820ff |
{
|
|
|
ce820ff |
+ ManagementAgent& agent;
|
|
|
ce820ff |
uint32_t brokerBank;
|
|
|
ce820ff |
uint32_t agentBank;
|
|
|
ce820ff |
std::string routingKey;
|
|
|
ce820ff |
ObjectId connectionRef;
|
|
|
ce820ff |
qmf::org::apache::qpid::broker::Agent* mgmtObject;
|
|
|
ce820ff |
+ RemoteAgent(ManagementAgent& _agent) : agent(_agent) {}
|
|
|
ce820ff |
ManagementObject* GetManagementObject (void) const { return mgmtObject; }
|
|
|
ce820ff |
virtual ~RemoteAgent ();
|
|
|
ce820ff |
};
|
|
|
ce820ff |
@@ -212,6 +214,7 @@
|
|
|
ce820ff |
|
|
|
ce820ff |
void writeData ();
|
|
|
ce820ff |
void periodicProcessing (void);
|
|
|
ce820ff |
+ void deleteObjectNowLH(const ObjectId& oid);
|
|
|
ce820ff |
void encodeHeader (framing::Buffer& buf, uint8_t opcode, uint32_t seq = 0);
|
|
|
ce820ff |
bool checkHeader (framing::Buffer& buf, uint8_t *opcode, uint32_t *seq);
|
|
|
ce820ff |
void sendBuffer (framing::Buffer& buf,
|
|
|
ce820ff |
Index: cpp/src/qpid/management/ManagementAgent.cpp
|
|
|
ce820ff |
===================================================================
|
|
|
ce820ff |
--- cpp/src/qpid/management/ManagementAgent.cpp (revision 831913)
|
|
|
ce820ff |
+++ cpp/src/qpid/management/ManagementAgent.cpp (working copy)
|
|
|
ce820ff |
@@ -44,9 +44,11 @@
|
|
|
ce820ff |
|
|
|
ce820ff |
ManagementAgent::RemoteAgent::~RemoteAgent ()
|
|
|
ce820ff |
{
|
|
|
ce820ff |
- if (mgmtObject != 0)
|
|
|
ce820ff |
+ QPID_LOG(trace, "Remote Agent removed bank=[" << brokerBank << "." << agentBank << "]");
|
|
|
ce820ff |
+ if (mgmtObject != 0) {
|
|
|
ce820ff |
mgmtObject->resourceDestroy();
|
|
|
ce820ff |
- QPID_LOG(trace, "Remote Agent removed bank=[" << brokerBank << "." << agentBank << "]");
|
|
|
ce820ff |
+ agent.deleteObjectNowLH(mgmtObject->getObjectId());
|
|
|
ce820ff |
+ }
|
|
|
ce820ff |
}
|
|
|
ce820ff |
|
|
|
ce820ff |
ManagementAgent::ManagementAgent () :
|
|
|
ce820ff |
@@ -443,6 +445,32 @@
|
|
|
ce820ff |
}
|
|
|
ce820ff |
}
|
|
|
ce820ff |
|
|
|
ce820ff |
+void ManagementAgent::deleteObjectNowLH(const ObjectId& oid)
|
|
|
ce820ff |
+{
|
|
|
ce820ff |
+ ManagementObjectMap::iterator iter = managementObjects.find(oid);
|
|
|
ce820ff |
+ if (iter == managementObjects.end())
|
|
|
ce820ff |
+ return;
|
|
|
ce820ff |
+ ManagementObject* object = iter->second;
|
|
|
ce820ff |
+ if (!object->isDeleted())
|
|
|
ce820ff |
+ return;
|
|
|
ce820ff |
+
|
|
|
ce820ff |
+#define DNOW_BUFSIZE 2048
|
|
|
ce820ff |
+ char msgChars[DNOW_BUFSIZE];
|
|
|
ce820ff |
+ uint32_t contentSize;
|
|
|
ce820ff |
+ Buffer msgBuffer(msgChars, DNOW_BUFSIZE);
|
|
|
ce820ff |
+
|
|
|
ce820ff |
+ encodeHeader(msgBuffer, 'c');
|
|
|
ce820ff |
+ object->writeProperties(msgBuffer);
|
|
|
ce820ff |
+ contentSize = msgBuffer.getPosition();
|
|
|
ce820ff |
+ msgBuffer.reset();
|
|
|
ce820ff |
+ stringstream key;
|
|
|
ce820ff |
+ key << "console.obj.1.0." << object->getPackageName() << "." << object->getClassName();
|
|
|
ce820ff |
+ sendBuffer(msgBuffer, contentSize, mExchange, key.str());
|
|
|
ce820ff |
+ QPID_LOG(trace, "SEND Immediate(delete) ContentInd to=" << key.str());
|
|
|
ce820ff |
+
|
|
|
ce820ff |
+ managementObjects.erase(oid);
|
|
|
ce820ff |
+}
|
|
|
ce820ff |
+
|
|
|
ce820ff |
void ManagementAgent::sendCommandComplete (string replyToKey, uint32_t sequence,
|
|
|
ce820ff |
uint32_t code, string text)
|
|
|
ce820ff |
{
|
|
|
ce820ff |
@@ -871,7 +899,7 @@
|
|
|
ce820ff |
|
|
|
ce820ff |
assignedBank = assignBankLH(requestedAgentBank);
|
|
|
ce820ff |
|
|
|
ce820ff |
- RemoteAgent* agent = new RemoteAgent;
|
|
|
ce820ff |
+ RemoteAgent* agent = new RemoteAgent(*this);
|
|
|
ce820ff |
agent->brokerBank = brokerBank;
|
|
|
ce820ff |
agent->agentBank = assignedBank;
|
|
|
ce820ff |
agent->routingKey = replyToKey;
|
|
|
ce820ff |
Index: cpp/bindings/qmf/ruby/qmf.rb
|
|
|
ce820ff |
===================================================================
|
|
|
ce820ff |
--- cpp/bindings/qmf/ruby/qmf.rb (revision 831913)
|
|
|
ce820ff |
+++ cpp/bindings/qmf/ruby/qmf.rb (working copy)
|
|
|
ce820ff |
@@ -456,7 +456,7 @@
|
|
|
ce820ff |
attr_reader :impl, :agent_key
|
|
|
ce820ff |
def initialize(impl=nil)
|
|
|
ce820ff |
if impl
|
|
|
ce820ff |
- @impl = impl
|
|
|
ce820ff |
+ @impl = Qmfengine::ObjectId.new(impl)
|
|
|
ce820ff |
else
|
|
|
ce820ff |
@impl = Qmfengine::ObjectId.new
|
|
|
ce820ff |
end
|
|
|
ce820ff |
@@ -594,7 +594,7 @@
|
|
|
ce820ff |
attr_reader :impl
|
|
|
ce820ff |
def initialize(kwargs = {})
|
|
|
ce820ff |
if kwargs.include?(:impl)
|
|
|
ce820ff |
- @impl = kwargs[:impl]
|
|
|
ce820ff |
+ @impl = Qmfengine::Query.new(kwargs[:impl])
|
|
|
ce820ff |
else
|
|
|
ce820ff |
package = ''
|
|
|
ce820ff |
if kwargs.include?(:key)
|