Why have you removed getConsumers() from org.apache.qpid.server.model.Queue?
I was using that!
for (Consumer subscription : queue.getConsumers())
{
childAdded(queue, subscription);
}
So in order to be able to navigate between a Connection and a Queue you
wind up with Connection, Session, Subscription (AKA Consumer) and Queue.
I maintained the references between Session and Queue via Consumer e.g.
in childAdded() in QmfManagementAgent I do:
else if (child instanceof Consumer) // AKA Subscription
{
// Subscriptions are a little more complex because in QMF
Subscriptions contain sessionRef and queueRef
// properties whereas with the Java Broker model Consumer
is a child of Queue and Session. To cope with
// this we first try to create or retrieve the QMF
Subscription Object then add either the Queue or
// Session reference depending on whether Queue or Session
was the parent of this addChild() call.
if (!_objects.containsKey(child))
{
data = new
org.apache.qpid.server.qmf2.agentdata.Subscription((Consumer)child);
_objects.put(child, data);
}
org.apache.qpid.server.qmf2.agentdata.Subscription
subscription =
(org.apache.qpid.server.qmf2.agentdata.Subscription)_objects.get(child);
QmfAgentData ref = _objects.get(object);
if (ref != null)
{
if (object instanceof Queue)
{
subscription.setQueueRef(ref.getObjectId(),
(Queue)object);
// Raise a Subscribe Event - N.B. Need to do it
*after* we've set the queueRef.
_agent.raiseEvent(subscription.createSubscribeEvent());
}
else if (object instanceof Session)
{
subscription.setSessionRef(ref.getObjectId());
}
}
}
getConsumers() still seems to be present in AMQQueue.java and in
AbstractQueue.java so I hope that it was just "over zealous" tidying of
the org.apache.qpid.server.model.Queue interface - I'd quite like to
have it back please.
Frase
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]