Class FlowableWorkerEndpointRegistry
java.lang.Object
org.flowable.external.worker.config.FlowableWorkerEndpointRegistry
- All Implemented Interfaces:
EventListener,org.springframework.beans.factory.Aware,org.springframework.beans.factory.DisposableBean,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
public class FlowableWorkerEndpointRegistry
extends Object
implements org.springframework.beans.factory.DisposableBean, org.springframework.context.SmartLifecycle, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
- Author:
- Filip Hrisafov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextprotected booleanprotected final org.slf4j.Loggerprotected intprotected final Map<String,FlowableWorkerContainer> Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected FlowableWorkerContainercreateWorkerContainer(FlowableWorkerEndpoint endpoint, FlowableWorkerContainerFactory<?> factory) Create and start a new container using the specified factory.voiddestroy()intgetPhase()Return theFlowableWorkerContainerwith the specified id ornullif no such container exists.Return the ids of the managedFlowableWorkerContainerinstance(s).Return the managedFlowableWorkerContainerinstance(s).booleanvoidonApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) voidregisterWorkerContainer(FlowableWorkerEndpoint endpoint, FlowableWorkerContainerFactory<?> factory) Create a worker container for the givenFlowableWorkerEndpoint.voidregisterWorkerContainer(FlowableWorkerEndpoint endpoint, FlowableWorkerContainerFactory<?> factory, boolean startImmediately) Create a worker container for the givenFlowableWorkerEndpoint.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidstart()protected voidstartIfNecessary(FlowableWorkerContainer workerContainer) Start the specifiedFlowableWorkerContainerif it should be started on startup or when start is called explicitly after startup.voidstop()voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.SmartLifecycle
isAutoStartup
-
Field Details
-
logger
protected final org.slf4j.Logger logger -
workerContainers
-
phase
protected int phase -
applicationContext
protected org.springframework.context.ApplicationContext applicationContext -
contextRefreshed
protected boolean contextRefreshed
-
-
Constructor Details
-
FlowableWorkerEndpointRegistry
public FlowableWorkerEndpointRegistry()
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) - Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
-
getWorkerContainer
Return theFlowableWorkerContainerwith the specified id ornullif no such container exists.- Parameters:
id- the id of the container- Returns:
- the container or
nullif no container with that id exists - See Also:
-
getWorkerContainerIds
Return the ids of the managedFlowableWorkerContainerinstance(s).- See Also:
-
getWorkerContainers
Return the managedFlowableWorkerContainerinstance(s). -
registerWorkerContainer
public void registerWorkerContainer(FlowableWorkerEndpoint endpoint, FlowableWorkerContainerFactory<?> factory, boolean startImmediately) Create a worker container for the givenFlowableWorkerEndpoint.This create the necessary infrastructure to honor that endpoint with regard to its configuration.
The
startImmediatelyflag determines if the container should be started immediately.- Parameters:
endpoint- the endpoint to addfactory- the worker factory to usestartImmediately- start the container immediately if necessary- See Also:
-
registerWorkerContainer
public void registerWorkerContainer(FlowableWorkerEndpoint endpoint, FlowableWorkerContainerFactory<?> factory) Create a worker container for the givenFlowableWorkerEndpoint.This create the necessary infrastructure to honor that endpoint with regard to its configuration.
- Parameters:
endpoint- the endpoint to addfactory- the worker factory to use- See Also:
-
createWorkerContainer
protected FlowableWorkerContainer createWorkerContainer(FlowableWorkerEndpoint endpoint, FlowableWorkerContainerFactory<?> factory) Create and start a new container using the specified factory. -
getPhase
public int getPhase()- Specified by:
getPhasein interfaceorg.springframework.context.Phased- Specified by:
getPhasein interfaceorg.springframework.context.SmartLifecycle
-
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle
-
stop
- Specified by:
stopin interfaceorg.springframework.context.SmartLifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
startIfNecessary
Start the specifiedFlowableWorkerContainerif it should be started on startup or when start is called explicitly after startup.- See Also:
-
SmartLifecycle.isAutoStartup()
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-