org.apache.camel.util.component
Class ApiConsumerHelper

java.lang.Object
  extended by org.apache.camel.util.component.ApiConsumerHelper

public final class ApiConsumerHelper
extends Object

Utility class for API Consumers.


Method Summary
static
<E extends Enum<E> & ApiName,T>
ApiMethod
findMethod(AbstractApiEndpoint<E,T> endpoint, PropertyNamesInterceptor propertyNamesInterceptor)
          Utility method to find matching API Method for supplied endpoint's configuration properties.
static
<T extends DefaultConsumer & ResultInterceptor>
int
getResultsProcessed(T consumer, Object result, boolean splitResult)
          Utility method for Consumers to process API method invocation result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findMethod

public static <E extends Enum<E> & ApiName,T> ApiMethod findMethod(AbstractApiEndpoint<E,T> endpoint,
                                                                  PropertyNamesInterceptor propertyNamesInterceptor)
Utility method to find matching API Method for supplied endpoint's configuration properties.

Type Parameters:
E - ApiName enumeration.
T - Component configuration class.
Parameters:
endpoint - endpoint for configuration properties.
propertyNamesInterceptor - names interceptor for adapting property names, usually the consumer class itself.
Returns:
matching ApiMethod.

getResultsProcessed

public static <T extends DefaultConsumer & ResultInterceptor> int getResultsProcessed(T consumer,
                                                                                     Object result,
                                                                                     boolean splitResult)
                               throws Exception
Utility method for Consumers to process API method invocation result.

Type Parameters:
T - Consumer class that extends DefaultConsumer and implements ResultInterceptor.
Parameters:
consumer - Consumer that wants to process results.
result - result of API method invocation.
splitResult - true if the Consumer wants to split result using ResultInterceptor.splitResult(Object) method.
Returns:
number of result exchanges processed.
Throws:
Exception - on error.


Apache Camel