}.trigger ();
}
private final IConnectorsFactory provideConnectorsFactory ()
{
final IConnectorsFactoryBuilder builder = this.provideConnectorsFactoryBuilder ();
final List<?> initializers = this.provideConnectorsFactoryInitializers ();
for (final Object initializer : initializers) {
if (initializer instanceof eu.mosaic_cloud.cloudlets.connectors.core.IConnectorsFactoryInitializer) {
try {
builder.initialize ((eu.mosaic_cloud.cloudlets.connectors.core.IConnectorsFactoryInitializer) initializer);
} catch (final Throwable exception) {
this.exceptions.traceHandledException (exception);
throw (new IllegalArgumentException ("error encountered while initializing cloudlet connectors factory", exception));
}
} else if (initializer instanceof eu.mosaic_cloud.connectors.core.IConnectorsFactoryInitializer) {
try {
builder.initialize ((eu.mosaic_cloud.connectors.core.IConnectorsFactoryInitializer) initializer);
} catch (final Throwable exception) {
this.exceptions.traceHandledException (exception);
throw (new IllegalArgumentException ("error encountered while initializing cloudlet connectors factory", exception));
}
} else {
throw (new IllegalArgumentException (ExtendedFormatter.defaultInstance.format ("error encountered while initializing cloudlet connectors factory, unexpected initializer class `%{object:class}`", initializer)));
}
}
final IConnectorsFactory factory;
try {
factory = builder.build ();
} catch (final Throwable exception) {
this.exceptions.traceHandledException (exception);
throw (new IllegalArgumentException ("error encountered while building cloudlet connectors factory", exception));
}
return factory;