public abstract class AbstractApiProducer<E extends Enum<E> & ApiName,T> extends DefaultAsyncProducer implements PropertiesInterceptor, ResultInterceptor
| Modifier and Type | Field and Description |
|---|---|
protected AbstractApiEndpoint<E,T> |
endpoint |
protected ApiMethodHelper<?> |
methodHelper |
protected ApiMethodPropertiesHelper<T> |
propertiesHelper |
| Constructor and Description |
|---|
AbstractApiProducer(AbstractApiEndpoint<E,T> endpoint,
ApiMethodPropertiesHelper<T> propertiesHelper) |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
doInvokeMethod(ApiMethod method,
Map<String,Object> properties)
Invoke the API method.
|
protected ApiMethod |
findMethod(org.apache.camel.Exchange exchange,
Map<String,Object> properties) |
void |
interceptProperties(Map<String,Object> properties)
Intercept method invocation arguments used to find and invoke API method.
|
void |
interceptResult(Object methodResult,
org.apache.camel.Exchange resultExchange)
Do additional result exchange processing, for example, adding custom headers.
|
boolean |
process(org.apache.camel.Exchange exchange,
org.apache.camel.AsyncCallback callback) |
Object |
splitResult(Object result)
Split a complex result into result elements.
|
process, processAsynccreateExchange, doStart, doStop, getEndpoint, isSingleton, toStringbuild, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitprotected final ApiMethodPropertiesHelper<T> propertiesHelper
protected final ApiMethodHelper<?> methodHelper
public AbstractApiProducer(AbstractApiEndpoint<E,T> endpoint, ApiMethodPropertiesHelper<T> propertiesHelper)
public boolean process(org.apache.camel.Exchange exchange,
org.apache.camel.AsyncCallback callback)
process in interface org.apache.camel.AsyncProcessorpublic void interceptProperties(Map<String,Object> properties)
PropertiesInterceptorinterceptProperties in interface PropertiesInterceptorproperties - method invocation arguments.protected Object doInvokeMethod(ApiMethod method, Map<String,Object> properties) throws org.apache.camel.RuntimeCamelException
method - API method to invoke.properties - method arguments from endpoint properties and exchange In headers.org.apache.camel.RuntimeCamelException - on error. Exceptions thrown by API method are wrapped.public final Object splitResult(Object result)
ResultInterceptorsplitResult in interface ResultInterceptorresult - API method invocation resultpublic void interceptResult(Object methodResult, org.apache.camel.Exchange resultExchange)
ResultInterceptorinterceptResult in interface ResultInterceptormethodResult - result of API method invocation.resultExchange - result as a Camel exchange, may be a split result from Arrays or Collections.Apache Camel