use of org.mule.runtime.api.lifecycle.InitialisationException in project mule by mulesoft.
the class SecurityFilterMessageProcessor method initialise.
@Override
public void initialise() throws InitialisationException {
try {
muleContext.getInjector().inject(filter);
initialiseIfNeeded(filter, muleContext);
} catch (MuleException e) {
throw new InitialisationException(e, this);
}
}
use of org.mule.runtime.api.lifecycle.InitialisationException in project mule by mulesoft.
the class WaitComponent method initialise.
@Override
public void initialise() throws InitialisationException {
try {
componentInitializedLatch.release();
waitLatch.await();
} catch (InterruptedException e) {
throw new InitialisationException(e, this);
}
}
use of org.mule.runtime.api.lifecycle.InitialisationException in project mule by mulesoft.
the class AbstractRegistryBootstrap method initialise.
/**
* TODO Optimize me! MULE-9343
*
* {@inheritDoc}
*/
@Override
public void initialise() throws InitialisationException {
List<BootstrapService> bootstrapServices;
try {
bootstrapServices = muleContext.getRegistryBootstrapServiceDiscoverer().discover();
} catch (Exception e) {
throw new InitialisationException(e, this);
}
// Merge and process properties
int objectCounter = 1;
List<TransformerBootstrapProperty> transformers = new LinkedList<>();
List<ObjectBootstrapProperty> namedObjects = new LinkedList<>();
List<ObjectBootstrapProperty> unnamedObjects = new LinkedList<>();
List<TransactionFactoryBootstrapProperty> singleTransactionFactories = new LinkedList<>();
for (BootstrapService bootstrapService : bootstrapServices) {
Properties bootstrapProperties = bootstrapService.getProperties();
for (Map.Entry entry : bootstrapProperties.entrySet()) {
final String propertyKey = (String) entry.getKey();
final String propertyValue = (String) entry.getValue();
if (propertyKey.contains(OBJECT_KEY)) {
String newKey = propertyKey.substring(0, propertyKey.lastIndexOf(".")) + objectCounter++;
unnamedObjects.add(createObjectBootstrapProperty(bootstrapService, newKey, propertyValue));
} else if (propertyKey.contains(TRANSFORMER_KEY)) {
transformers.add(createTransformerBootstrapProperty(bootstrapService, propertyValue));
} else if (propertyKey.contains(SINGLE_TX)) {
if (!propertyKey.contains(TRANSACTION_RESOURCE_SUFFIX)) {
singleTransactionFactories.add(createTransactionFactoryBootstrapProperty(bootstrapService, bootstrapProperties, propertyKey, propertyValue));
}
} else {
namedObjects.add(createObjectBootstrapProperty(bootstrapService, propertyKey, propertyValue));
}
}
}
try {
registerUnnamedObjects(unnamedObjects);
registerTransformers();
registerTransformers(transformers);
registerObjects(namedObjects);
registerTransactionFactories(singleTransactionFactories, muleContext);
} catch (Exception e1) {
throw new InitialisationException(e1, this);
}
}
use of org.mule.runtime.api.lifecycle.InitialisationException in project mule by mulesoft.
the class TypeBasedTransformerResolver method initialise.
@Override
public void initialise() throws InitialisationException {
try {
objectToString = new ObjectToString();
objectToByteArray = new ObjectToByteArray();
// these are just fallbacks that are not to go
// into the mule registry
initialiseIfNeeded(objectToString, muleContext);
initialiseIfNeeded(objectToByteArray, muleContext);
} catch (MuleException e) {
throw new InitialisationException(e, this);
}
}
use of org.mule.runtime.api.lifecycle.InitialisationException in project mule by mulesoft.
the class AbstractAggregator method initEventGroupsObjectStore.
protected void initEventGroupsObjectStore() throws InitialisationException {
try {
if (eventGroupsObjectStore == null) {
// TODO: Delete ProvidedObjectStoreWrapper if not needed when moving this to compatibility
eventGroupsObjectStore = new ProvidedPartitionableObjectStoreWrapper(null, internalEventsGroupsObjectStoreSupplier());
}
eventGroupsObjectStore.open(storePrefix + ".expiredAndDispatchedGroups");
eventGroupsObjectStore.open(storePrefix + ".eventGroups");
} catch (MuleRuntimeException | ObjectStoreException e) {
throw new InitialisationException(e, this);
}
}
Aggregations