Search in sources :

Example 1 with ProtocolEngineCreator

use of org.apache.qpid.server.plugin.ProtocolEngineCreator in project qpid-broker-j by apache.

the class Main method printVersion.

private void printVersion() {
    final StringBuilder protocol = new StringBuilder("AMQP version(s) [major.minor]: ");
    boolean first = true;
    Set<Protocol> protocols = new TreeSet<>();
    for (ProtocolEngineCreator installedEngine : (new QpidServiceLoader()).instancesOf(ProtocolEngineCreator.class)) {
        protocols.add(installedEngine.getVersion());
    }
    for (Protocol supportedProtocol : protocols) {
        if (first) {
            first = false;
        } else {
            protocol.append(", ");
        }
        protocol.append(supportedProtocol.getProtocolVersion());
    }
    System.out.println(CommonProperties.getVersionString() + " (" + protocol + ")");
}
Also used : QpidServiceLoader(org.apache.qpid.server.plugin.QpidServiceLoader) TreeSet(java.util.TreeSet) ProtocolEngineCreator(org.apache.qpid.server.plugin.ProtocolEngineCreator) Protocol(org.apache.qpid.server.model.Protocol)

Aggregations

TreeSet (java.util.TreeSet)1 Protocol (org.apache.qpid.server.model.Protocol)1 ProtocolEngineCreator (org.apache.qpid.server.plugin.ProtocolEngineCreator)1 QpidServiceLoader (org.apache.qpid.server.plugin.QpidServiceLoader)1