use of org.mule.runtime.module.extension.internal.runtime.resolver.ObjectBuilderValueResolver in project mule by mulesoft.
the class TopLevelParameterObjectFactory method doGetObject.
@Override
public Object doGetObject() throws Exception {
return withContextClassLoader(classLoader, () -> {
// TODO MULE-10919 - This logic is similar to that of the resolverset object builder and should
// be generalized
DefaultObjectBuilder builder = this.builder.get();
resolveParameters(objectType, builder);
resolveParameterGroups(objectType, builder);
injectFields();
ValueResolver<Object> resolver = new ObjectBuilderValueResolver<>(builder, muleContext);
if (resolver.isDynamic()) {
return resolver;
}
CoreEvent initialiserEvent = null;
try {
initialiserEvent = getInitialiserEvent(muleContext);
staticProduct = resolver.resolve(from(initialiserEvent));
muleContext.getInjector().inject(staticProduct);
return staticProduct;
} finally {
if (initialiserEvent != null) {
((BaseEventContext) initialiserEvent.getContext()).success();
}
}
}, Exception.class, exception -> {
throw exception;
});
}
Aggregations