Search in sources :

Example 1 with BackPressureAction

use of org.mule.runtime.extension.api.runtime.source.BackPressureAction in project mule by mulesoft.

the class BackPressureContextArgumentResolver method resolve.

@Override
public LazyValue<BackPressureContext> resolve(ExecutionContext executionContext) {
    return new LazyValue<>(() -> {
        ExecutionContextAdapter ctx = (ExecutionContextAdapter) executionContext;
        BackPressureAction action = (BackPressureAction) ctx.getVariable(BACK_PRESSURE_ACTION_CONTEXT_PARAM);
        if (action == null) {
            action = FAIL;
        }
        return new ImmutableBackPressureContext(ctx.getEvent(), action, callbackContextResolver.resolve(ctx).get());
    });
}
Also used : LazyValue(org.mule.runtime.api.util.LazyValue) BackPressureAction(org.mule.runtime.extension.api.runtime.source.BackPressureAction) ImmutableBackPressureContext(org.mule.runtime.module.extension.internal.runtime.source.ImmutableBackPressureContext) ExecutionContextAdapter(org.mule.runtime.module.extension.api.runtime.privileged.ExecutionContextAdapter)

Aggregations

LazyValue (org.mule.runtime.api.util.LazyValue)1 BackPressureAction (org.mule.runtime.extension.api.runtime.source.BackPressureAction)1 ExecutionContextAdapter (org.mule.runtime.module.extension.api.runtime.privileged.ExecutionContextAdapter)1 ImmutableBackPressureContext (org.mule.runtime.module.extension.internal.runtime.source.ImmutableBackPressureContext)1