org.mule.rx.RxMessageSourceProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rx-mule Show documentation
Show all versions of rx-mule Show documentation
Reactive Extensions for Mule ESB
package org.mule.rx;
import org.apache.commons.lang.Validate;
import org.mule.api.MuleException;
import org.mule.api.source.MessageSource;
import org.mule.construct.Flow;
import rx.functions.Func1;
public abstract class RxMessageSourceProvider implements Func1
{
@Override
public final MessageSource call(final Flow flow)
{
Validate.notNull(flow, "flow can't be null");
try
{
return doCall(flow);
}
catch (final MuleException me)
{
throw new RuntimeException("Failed to create message source for flow: " + flow, me);
}
}
public abstract MessageSource doCall(Flow flow) throws MuleException;
}