Search in sources :

Example 1 with QueueView

use of org.apache.activemq.artemis.core.management.impl.view.QueueView in project activemq-artemis by apache.

the class ActiveMQServerControlImpl method listQueues.

@Override
public String listQueues(String options, int page, int pageSize) throws Exception {
    checkStarted();
    clearIO();
    try {
        List<QueueControl> queues = new ArrayList<>();
        Object[] qs = server.getManagementService().getResources(QueueControl.class);
        for (int i = 0; i < qs.length; i++) {
            queues.add((QueueControl) qs[i]);
        }
        QueueView view = new QueueView(server);
        view.setCollection(queues);
        view.setOptions(options);
        return view.getResultsAsJson(page, pageSize);
    } finally {
        blockOnIO();
    }
}
Also used : QueueView(org.apache.activemq.artemis.core.management.impl.view.QueueView) ArrayList(java.util.ArrayList) JsonObject(javax.json.JsonObject) QueueControl(org.apache.activemq.artemis.api.core.management.QueueControl)

Aggregations

ArrayList (java.util.ArrayList)1 JsonObject (javax.json.JsonObject)1 QueueControl (org.apache.activemq.artemis.api.core.management.QueueControl)1 QueueView (org.apache.activemq.artemis.core.management.impl.view.QueueView)1