Search in sources :

Example 1 with ProducerView

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

the class ActiveMQServerControlImpl method listProducers.

@Override
public String listProducers(@Parameter(name = "Options") String options, @Parameter(name = "Page Number") int page, @Parameter(name = "Page Size") int pageSize) throws Exception {
    checkStarted();
    clearIO();
    try {
        Set<ServerProducer> producers = new HashSet<>();
        for (ServerSession session : server.getSessions()) {
            producers.addAll(session.getServerProducers().values());
        }
        ProducerView view = new ProducerView(server);
        view.setCollection(producers);
        view.setOptions(options);
        return view.getResultsAsJson(page, pageSize);
    } finally {
        blockOnIO();
    }
}
Also used : ServerSession(org.apache.activemq.artemis.core.server.ServerSession) ServerProducer(org.apache.activemq.artemis.core.server.ServerProducer) ProducerView(org.apache.activemq.artemis.core.management.impl.view.ProducerView) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 ProducerView (org.apache.activemq.artemis.core.management.impl.view.ProducerView)1 ServerProducer (org.apache.activemq.artemis.core.server.ServerProducer)1 ServerSession (org.apache.activemq.artemis.core.server.ServerSession)1