use of org.mule.runtime.module.extension.internal.runtime.operation.ReflectiveMethodOperationExecutor in project mule by mulesoft.
the class ReflectiveOperationExecutorFactory method createExecutor.
@Override
public ComponentExecutor<M> createExecutor(M operationModel, Map<String, Object> parameters) {
DefaultObjectBuilder objectBuilder = new DefaultObjectBuilder(implementationClass);
parameters.forEach((k, v) -> objectBuilder.addPropertyResolver(k, new StaticValueResolver<>(v)));
Object delegate;
CoreEvent initialiserEvent = null;
try {
initialiserEvent = getInitialiserEvent();
delegate = objectBuilder.build(from(initialiserEvent));
} catch (Exception e) {
throw new MuleRuntimeException(createStaticMessage("Could not create instance of operation class " + implementationClass.getName()), e);
} finally {
if (initialiserEvent != null) {
((BaseEventContext) initialiserEvent.getContext()).success();
}
}
return new ReflectiveMethodOperationExecutor(operationModel, operationMethod, delegate);
}
Aggregations