public abstract class AbstractApiEndpoint<E extends ApiName,T> extends DefaultEndpoint implements PropertyNamesInterceptor, PropertiesInterceptor
Modifier and Type | Field and Description |
---|---|
protected E |
apiName |
protected T |
configuration |
protected String |
inBody |
protected org.slf4j.Logger |
log |
protected ApiMethodHelper<? extends ApiMethod> |
methodHelper |
protected String |
methodName |
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
AbstractApiEndpoint(String endpointUri,
Component component,
E apiName,
String methodName,
ApiMethodHelper<? extends ApiMethod> methodHelper,
T endpointConfiguration) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
afterConfigureProperties()
Initialize proxies, create server connections, etc.
|
void |
configureProperties(Map<String,Object> options)
Configure properties on this endpoint.
|
E |
getApiName()
Returns API name.
|
abstract Object |
getApiProxy(ApiMethod method,
Map<String,Object> args)
Returns an instance of an API Proxy based on apiName, method and args.
|
List<ApiMethod> |
getCandidates()
Returns candidate methods for this endpoint.
|
T |
getConfiguration()
Returns endpoint configuration object.
|
Map<String,Object> |
getEndpointProperties() |
Set<String> |
getEndpointPropertyNames() |
ExecutorService |
getExecutorService() |
String |
getInBody()
Returns name of parameter passed in the exchange In Body.
|
ApiMethodHelper<? extends ApiMethod> |
getMethodHelper()
Returns method helper.
|
String |
getMethodName()
Returns method name.
|
protected abstract ApiMethodPropertiesHelper<T> |
getPropertiesHelper()
Returns generated helper that extends
ApiMethodPropertiesHelper to work with API properties. |
protected abstract String |
getThreadProfileName()
Returns Thread profile name.
|
void |
interceptProperties(Map<String,Object> properties)
Intercept method invocation arguments used to find and invoke API method.
|
void |
interceptPropertyNames(Set<String> propertyNames)
Intercept property names used to find API Method.
|
boolean |
isSingleton()
Whether this class supports being singleton or not.
|
void |
setInBody(String inBody)
Sets the name of a parameter to be passed in the exchange In Body.
|
configureConsumer, configurePollingConsumer, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, doStart, doStop, equals, getCamelContext, getComponent, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isBridgeErrorHandler, isLenientProperties, isPollingConsumerBlockWhenFull, isSynchronous, setBridgeErrorHandler, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toString
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
createConsumer, createProducer
protected final org.slf4j.Logger log
protected final String methodName
protected final ApiMethodHelper<? extends ApiMethod> methodHelper
protected final T configuration
public AbstractApiEndpoint(String endpointUri, Component component, E apiName, String methodName, ApiMethodHelper<? extends ApiMethod> methodHelper, T endpointConfiguration)
public boolean isSingleton()
IsSingleton
isSingleton
in interface IsSingleton
protected abstract ApiMethodPropertiesHelper<T> getPropertiesHelper()
ApiMethodPropertiesHelper
to work with API properties.public void configureProperties(Map<String,Object> options)
Endpoint
configureProperties
in interface Endpoint
configureProperties
in class DefaultEndpoint
options
- the options (properties)protected abstract void afterConfigureProperties()
public void interceptPropertyNames(Set<String> propertyNames)
PropertyNamesInterceptor
interceptPropertyNames
in interface PropertyNamesInterceptor
propertyNames
- argument names.public void interceptProperties(Map<String,Object> properties)
PropertiesInterceptor
interceptProperties
in interface PropertiesInterceptor
properties
- method invocation arguments.public final T getConfiguration()
public final E getApiName()
public final String getMethodName()
public final ApiMethodHelper<? extends ApiMethod> getMethodHelper()
public final List<ApiMethod> getCandidates()
public final String getInBody()
public final void setInBody(String inBody) throws IllegalArgumentException
inBody
- parameter nameIllegalArgumentException
- for invalid parameter name.public final Set<String> getEndpointPropertyNames()
public final Map<String,Object> getEndpointProperties()
public abstract Object getApiProxy(ApiMethod method, Map<String,Object> args)
AbstractApiConsumer
or AbstractApiProducer
.method
- method about to be invokedargs
- method argumentsAbstractApiProducer
,
AbstractApiConsumer
public final ExecutorService getExecutorService()
protected abstract String getThreadProfileName()
Apache Camel