Search in sources :

Example 1 with Pluggable

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

the class PluginClassProviderAction method perform.

@Override
public Object perform(Map<String, Object> request, Broker broker) {
    try {
        String className = (String) request.get("plugin");
        QpidServiceLoader serviceLoader = new QpidServiceLoader();
        final Class<Pluggable> clazz = (Class<Pluggable>) Class.forName("org.apache.qpid.server.plugin." + className);
        List<String> values = new ArrayList<String>();
        for (Pluggable instance : serviceLoader.instancesOf(clazz)) {
            values.add(instance.getType());
        }
        return values;
    } catch (ClassNotFoundException e) {
        return Collections.emptyList();
    }
}
Also used : QpidServiceLoader(org.apache.qpid.server.plugin.QpidServiceLoader) Pluggable(org.apache.qpid.server.plugin.Pluggable) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 Pluggable (org.apache.qpid.server.plugin.Pluggable)1 QpidServiceLoader (org.apache.qpid.server.plugin.QpidServiceLoader)1