@Override public brooklyn.management.internal.UsageListener apply(String input) {
                // TODO Want to use classLoader = mgmt.getCatalog().getRootClassLoader();
                ClassLoader classLoader = LocalUsageManager.class.getClassLoader();
                Optional<Object> result = Reflections.invokeConstructorWithArgs(classLoader, input);
                if (result.isPresent()) {
                    if (result.get() instanceof brooklyn.management.internal.UsageManager.UsageListener) {
                        return new brooklyn.management.internal.UsageManager.UsageListener.UsageListenerAdapter((brooklyn.management.internal.UsageManager.UsageListener) result.get());
                    } else {
                        return (brooklyn.management.internal.UsageListener) result.get();
                    }
                } else {
                    throw new IllegalStateException("Failed to create UsageListener from class name '"+input+"' using no-arg constructor");
                }
            }
@Override public brooklyn.management.internal.UsageListener apply(String input) {
               
                ClassLoader classLoader = LocalUsageManager.class.getClassLoader();
                Optional<Object> result = Reflections.invokeConstructorWithArgs(classLoader, input);
                if (result.isPresent()) {
                    if (result.get() instanceof brooklyn.management.internal.UsageManager.UsageListener) {
                        return new brooklyn.management.internal.UsageManager.UsageListener.UsageListenerAdapter((brooklyn.management.internal.UsageManager.UsageListener) result.get());
                    } else {
                        return (brooklyn.management.internal.UsageListener) result.get();
                    }
                } else {
                    throw new IllegalStateException("Failed to create UsageListener from class name '"+input+"' using no-arg constructor");
                }
            }
@override public brooklyn.management.internal.usagelistener apply(string input) { classloader classloader = localusagemanager.class.getclassloader(); optional<object> result = reflections.invokeconstructorwithargs(classloader, input); if (result.ispresent()) { if (result.get() instanceof brooklyn.management.internal.usagemanager.usagelistener) { return new brooklyn.management.internal.usagemanager.usagelistener.usagelisteneradapter((brooklyn.management.internal.usagemanager.usagelistener) result.get()); } else { return (brooklyn.management.internal.usagelistener) result.get(); } } else { throw new illegalstateexception("failed to create usagelistener from class name '"+input+"' using no-arg constructor"); } }