Class AbstractApiEndpoint<E extends ApiName,T>
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultEndpoint
org.apache.camel.support.ScheduledPollEndpoint
org.apache.camel.support.component.AbstractApiEndpoint<E,T>
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.ApiEndpoint,org.apache.camel.CamelContextAware,org.apache.camel.ComponentAware,org.apache.camel.Endpoint,org.apache.camel.IsSingleton,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.HasCamelContext,org.apache.camel.spi.HasId,org.apache.camel.StatefulService,PropertiesInterceptor,PropertyNamesInterceptor,org.apache.camel.SuspendableService
public abstract class AbstractApiEndpoint<E extends ApiName,T>
extends ScheduledPollEndpoint
implements org.apache.camel.ApiEndpoint, PropertyNamesInterceptor, PropertiesInterceptor
Abstract base class for API Component Endpoints.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Eprotected final Tprotected Stringprotected final org.slf4j.Loggerprotected final ApiMethodHelper<? extends ApiMethod> protected final StringFields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING -
Constructor Summary
ConstructorsConstructorDescriptionAbstractApiEndpoint(String endpointUri, org.apache.camel.Component component, E apiName, String methodName, ApiMethodHelper<? extends ApiMethod> methodHelper, T endpointConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidInitialize proxies, create server connections, etc. after endpoint properties have been configured.protected voidconfigureConsumer(org.apache.camel.Consumer consumer) voidconfigureProperties(Map<String, Object> options) final EReturns API name.abstract ObjectgetApiProxy(ApiMethod method, Map<String, Object> args) Returns an instance of an API Proxy based on apiName, method and args.Returns candidate methods for this endpoint.final TReturns endpoint configuration object.final ExecutorServicefinal StringReturns name of parameter passed in the exchange In Body.final ApiMethodHelper<? extends ApiMethod> Returns method helper.final StringReturns method name.protected abstract ApiMethodPropertiesHelper<T> Returns generated helper that extendsApiMethodPropertiesHelperto work with API properties.protected abstract StringReturns Thread profile name.voidinterceptProperties(Map<String, Object> properties) Intercept method invocation arguments used to find and invoke API method.voidinterceptPropertyNames(Set<String> propertyNames) Intercept property names used to find API Method.final voidSets the name of a parameter to be passed in the exchange In Body.Methods inherited from class org.apache.camel.support.ScheduledPollEndpoint
configureScheduledPollConsumerProperties, doConfigureConsumer, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDefaultDelay, getDelay, getInitialDelay, getPollStrategy, getRepeatCount, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, isGreedy, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRepeatCount, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelayMethods inherited from class org.apache.camel.support.DefaultEndpoint
configureExchange, configurePollingConsumer, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toStringMethods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doStart, doStop, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.camel.ComponentAware
getComponent, getComponent, setComponentMethods inherited from interface org.apache.camel.Endpoint
configureExchange, createAsyncProducer, createConsumer, createExchange, createExchange, createPollingConsumer, createProducer, getCamelContext, getEndpointBaseUri, getEndpointKey, getEndpointUri, getExchangePattern, isLenientProperties, isRemote, isSingletonProducer, setCamelContextMethods inherited from interface org.apache.camel.IsSingleton
isSingletonMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Field Details
-
log
protected final org.slf4j.Logger log -
apiName
-
methodName
-
methodHelper
-
configuration
-
inBody
@UriParam(description="Sets the name of a parameter to be passed in the exchange In Body") protected String inBody
-
-
Constructor Details
-
AbstractApiEndpoint
-
-
Method Details
-
getPropertiesHelper
Returns generated helper that extendsApiMethodPropertiesHelperto work with API properties.- Returns:
- properties helper.
-
configureProperties
- Specified by:
configurePropertiesin interfaceorg.apache.camel.Endpoint- Overrides:
configurePropertiesin classScheduledPollEndpoint
-
afterConfigureProperties
protected abstract void afterConfigureProperties()Initialize proxies, create server connections, etc. after endpoint properties have been configured. -
configureConsumer
- Overrides:
configureConsumerin classScheduledPollEndpoint- Throws:
Exception
-
interceptPropertyNames
Description copied from interface:PropertyNamesInterceptorIntercept property names used to find API Method. Used to add any custom/hidden method arguments, which MUST be provided in interceptProperties() override.- Specified by:
interceptPropertyNamesin interfacePropertyNamesInterceptor- Parameters:
propertyNames- argument names.
-
interceptProperties
Description copied from interface:PropertiesInterceptorIntercept method invocation arguments used to find and invoke API method. Can be overridden to add custom/hidden method arguments.- Specified by:
interceptPropertiesin interfacePropertiesInterceptor- Parameters:
properties- method invocation arguments.
-
getConfiguration
Returns endpoint configuration object. One of the generated EndpointConfiguration classes that extends component configuration class.- Returns:
- endpoint configuration object
-
getApiName
Returns API name.- Returns:
- apiName property.
-
getMethodName
Returns method name.- Returns:
- methodName property.
-
getMethodHelper
Returns method helper.- Returns:
- methodHelper property.
-
getCandidates
Returns candidate methods for this endpoint.- Returns:
- list of candidate methods.
-
getInBody
Returns name of parameter passed in the exchange In Body.- Returns:
- inBody property.
-
setInBody
Sets the name of a parameter to be passed in the exchange In Body.- Parameters:
inBody- parameter name- Throws:
IllegalArgumentException- for invalid parameter name.
-
getEndpointPropertyNames
-
getEndpointProperties
-
getConfigurationPropertyNames
-
getConfigurationProperties
-
getApiProxy
Returns an instance of an API Proxy based on apiName, method and args. Called byAbstractApiConsumerorAbstractApiProducer.- Parameters:
method- method about to be invokedargs- method arguments- Returns:
- a Java object that implements the method to be invoked.
- See Also:
-
getExecutorService
-
getThreadProfileName
Returns Thread profile name. Generated as a constant THREAD_PROFILE_NAME in *Constants.- Returns:
- thread profile name to use.
-