Class AbstractEndpoint
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
- All Implemented Interfaces:
- Aware,- BeanFactoryAware,- BeanNameAware,- DisposableBean,- InitializingBean,- ApplicationContextAware,- Lifecycle,- Phased,- SmartLifecycle,- ComponentSourceAware,- ExpressionCapable,- NamedComponent,- ManageableLifecycle,- ManageableSmartLifecycle
- Direct Known Subclasses:
- AbstractPollingEndpoint,- EventDrivenConsumer,- GatewayProxyFactoryBean,- MessageProducerSupport,- MessagingGatewaySupport,- ReactiveStreamsConsumer
@IntegrationManagedResource
public abstract class AbstractEndpoint
extends IntegrationObjectSupport
implements ManageableSmartLifecycle, DisposableBean
The base class for Message Endpoint implementations.
 
This class implements Lifecycle and provides an autoStartup
 property. If true, the endpoint will start automatically upon
 initialization. Otherwise, it will require an explicit invocation of its
 start() method. The default value is true.
 To require explicit startup, provide a value of false
 to the setAutoStartup(boolean) method.
- Author:
- Mark Fisher, Kris Jacyna, Gary Russell, Artem Bilan, Trung Pham
- 
Field SummaryFieldsFields inherited from class org.springframework.integration.context.IntegrationObjectSupportEXPRESSION_PARSER, loggerFields inherited from interface org.springframework.context.SmartLifecycleDEFAULT_PHASE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoiddestroy()protected abstract voiddoStart()Subclasses must implement this method with the start behavior.protected abstract voiddoStop()Subclasses must implement this method with the stop behavior.protected voidStop the component and invoke callback.final intgetPhase()getRole()booleanisActive()final booleanfinal booleanprotected voidonInit()Subclasses may implement this for initialization logic.voidsetAutoStartup(boolean autoStartup) voidsetPhase(int phase) voidSpecify the role for the endpoint.final voidstart()final voidstop()final voidMethods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getComponentType, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
- 
Field Details- 
lifecycleLock
 
- 
- 
Constructor Details- 
AbstractEndpointpublic AbstractEndpoint()
 
- 
- 
Method Details- 
setAutoStartuppublic void setAutoStartup(boolean autoStartup) 
- 
setPhasepublic void setPhase(int phase) 
- 
setRoleSpecify the role for the endpoint. Such endpoints can be started/stopped as a group.- Parameters:
- role- the role for this endpoint.
- Since:
- 5.0
- See Also:
 
- 
getRole
- 
onInitprotected void onInit()Description copied from class:IntegrationObjectSupportSubclasses may implement this for initialization logic.- Overrides:
- onInitin class- IntegrationObjectSupport
 
- 
destroypublic void destroy()- Specified by:
- destroyin interface- DisposableBean
 
- 
isAutoStartuppublic final boolean isAutoStartup()- Specified by:
- isAutoStartupin interface- SmartLifecycle
 
- 
getPhasepublic final int getPhase()- Specified by:
- getPhasein interface- Phased
- Specified by:
- getPhasein interface- SmartLifecycle
 
- 
isRunningpublic final boolean isRunning()- Specified by:
- isRunningin interface- Lifecycle
- Specified by:
- isRunningin interface- ManageableLifecycle
 
- 
startpublic final void start()- Specified by:
- startin interface- Lifecycle
- Specified by:
- startin interface- ManageableLifecycle
 
- 
stoppublic final void stop()- Specified by:
- stopin interface- Lifecycle
- Specified by:
- stopin interface- ManageableLifecycle
 
- 
stop- Specified by:
- stopin interface- SmartLifecycle
 
- 
doStopStop the component and invoke callback.- Parameters:
- callback- the Runnable to invoke.
 
- 
isActivepublic boolean isActive()
- 
doStartprotected abstract void doStart()Subclasses must implement this method with the start behavior. This method will be invoked while holding thelifecycleLock.
- 
doStopprotected abstract void doStop()Subclasses must implement this method with the stop behavior. This method will be invoked while holding thelifecycleLock.
 
-