Search in sources :

Example 1 with SourceResultAdapter

use of org.mule.runtime.core.internal.execution.SourceResultAdapter in project mule by mulesoft.

the class DefaultSourceCallback method handle.

/**
 * {@inheritDoc}
 */
@Override
public void handle(Result<T, A> result, SourceCallbackContext context) {
    checkArgument(context instanceof SourceCallbackContextAdapter, "The supplied context was not created through this callback, " + "you naughty developer");
    SourceCallbackContextAdapter contextAdapter = (SourceCallbackContextAdapter) context;
    validateNotifications(contextAdapter);
    MessageProcessContext messageProcessContext = processContextSupplier.get();
    SourceResultAdapter resultAdapter = new SourceResultAdapter(result, cursorProviderFactory, defaultMediaType, returnsListOfMessages, context.getCorrelationId());
    Message message = of(resultAdapter);
    executeFlow(context, messageProcessContext, message);
    contextAdapter.dispatched();
}
Also used : Message(org.mule.runtime.api.message.Message) MessageProcessContext(org.mule.runtime.core.privileged.execution.MessageProcessContext) SourceResultAdapter(org.mule.runtime.core.internal.execution.SourceResultAdapter)

Aggregations

Message (org.mule.runtime.api.message.Message)1 SourceResultAdapter (org.mule.runtime.core.internal.execution.SourceResultAdapter)1 MessageProcessContext (org.mule.runtime.core.privileged.execution.MessageProcessContext)1