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();
}
}
Aggregations