Understood. I can change to an IllegalArgumentException perhaps. I'll have
to check the circumstances where Optional.absent() is actually returned.
On 8 Apr 2014 14:04, "Sam Corbett" <notifications@github.com> wrote:

> In
> locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java:
>
> >              }
> >          }
> >          if (Strings.isNonBlank(customizersSupplierType)) {
> > -            try {
> > -                Class<Supplier<Collection<JcloudsLocationCustomizer>>> customizerClazz =
> > -                        (Class<Supplier<Collection<JcloudsLocationCustomizer>>>) getClass().getClassLoader().loadClass(customizersSupplierType);
> > -                Supplier<Collection<JcloudsLocationCustomizer>> supplier = getClassInvokedWithConfigBag(customizerClazz, setup);
> > -                result.addAll(supplier.get());
> > -            } catch (Exception e) {
> > -                throw new IllegalStateException("Failed to load customizer supplier "+customizersSupplierType+" for location "+this);
> > +            Optional<Supplier<Collection<JcloudsLocationCustomizer>>> supplier = Reflections.invokeConstructorWithArgs(getManagementContext().getCatalog().getRootClassLoader(), customizersSupplierType, setup);
> > +            if (supplier.isPresent()) {
> > +                result.addAll(supplier.get().get());
> > +            } else {
> > +                LOG.warn("Cannot load JcloudsLocationCustomizer supplier: " + customizersSupplierType);
>
> A LOG.warn isn't good enough for me - I need this to fail and abort the
> creation of machines if my security group customiser isn't loaded.
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/brooklyncentral/brooklyn/pull/1310/files#r11388360>
> .
>