use of org.mule.runtime.core.api.MuleContext in project mule by mulesoft.
the class ParametersResolver method getParametersAsResolverSet.
/**
* Constructs a {@link ResolverSet} from the parameters groups, using {@link #toValueResolver(Object, Set)} to process the values.
*
* @return a {@link ResolverSet}
*/
public ResolverSet getParametersAsResolverSet(MuleContext muleContext, ParameterizedModel model, List<ParameterGroupModel> groups) throws ConfigurationException {
List<ParameterGroupModel> inlineGroups = getInlineGroups(groups);
List<ParameterModel> allParameters = groups.stream().flatMap(g -> g.getParameterModels().stream()).collect(toList());
ResolverSet resolverSet = getParametersAsResolverSet(model, getFlatParameters(inlineGroups, allParameters), muleContext);
for (ParameterGroupModel group : inlineGroups) {
getInlineGroupResolver(group, resolverSet, muleContext);
}
return resolverSet;
}
use of org.mule.runtime.core.api.MuleContext in project mule by mulesoft.
the class ApplicationContextBuilder method doBuildContext.
protected MuleContext doBuildContext() throws Exception {
MuleContext context;
MuleContextFactory muleContextFactory = new DefaultMuleContextFactory();
List<ConfigurationBuilder> builders = new ArrayList<>();
builders.add(getAppBuilder(this.applicationResources));
addBuilders(builders);
configureMuleContext(muleContextBuilder);
context = muleContextFactory.createMuleContext(builders, muleContextBuilder);
return context;
}
use of org.mule.runtime.core.api.MuleContext in project mule by mulesoft.
the class ApplicationContextBuilder method build.
public MuleContext build() throws Exception {
// Should we set up the manager for every method?
MuleContext context = doBuildContext();
context.start();
return context;
}
use of org.mule.runtime.core.api.MuleContext in project mule by mulesoft.
the class CollectionValueResolverTestCase method before.
@Before
public void before() throws Exception {
muleContext = mock(MuleContext.class);
event = mock(CoreEvent.class);
resolvingContext = mock(ValueResolvingContext.class);
when(resolvingContext.getEvent()).thenReturn(event);
when(resolvingContext.getConfig()).thenReturn(Optional.empty());
collectionType = ArrayList.class;
childResolvers = new ArrayList();
expectedValues = new ArrayList<>();
for (int i = 0; i < getChildResolversCount(); i++) {
ValueResolver childResolver = getResolver(i, resolvingContext, false, MuleContextAware.class, Lifecycle.class);
childResolvers.add(childResolver);
expectedValues.add(i);
}
resolver = createCollectionResolver(childResolvers);
}
use of org.mule.runtime.core.api.MuleContext in project mule by mulesoft.
the class ConfigurationInjectionLifecycleTestCase method addBuilders.
@Override
protected void addBuilders(List<ConfigurationBuilder> builders) {
builders.add(new AbstractConfigurationBuilder() {
@Override
protected void doConfigure(MuleContext muleContext) throws Exception {
muleContext.getCustomizationService().registerCustomServiceClass("lifecycleTracker", LifecycleTracker.class);
}
});
super.addBuilders(builders);
}
Aggregations