Package org.apache.camel.support
Class LoadOnDemandReloadStrategy
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.ResourceReloadStrategySupport
org.apache.camel.support.FileWatcherResourceReloadStrategy
org.apache.camel.support.RouteWatcherReloadStrategy
org.apache.camel.support.RouteOnDemandReloadStrategy
org.apache.camel.support.LoadOnDemandReloadStrategy
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.CamelContextAware,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.HasCamelContext,org.apache.camel.spi.ReloadStrategy,org.apache.camel.spi.ResourceReloadStrategy,org.apache.camel.StatefulService,org.apache.camel.StaticService,org.apache.camel.SuspendableService
@ManagedResource(description="Managed LoadOnDemandReloadStrategy")
public class LoadOnDemandReloadStrategy
extends RouteOnDemandReloadStrategy
Strategy for triggering on-demand loading of Camel routes in a running Camel application. The strategy is triggered
on-demand and reload all files provided from external source such as camel-jbang
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.camel.support.FileWatcherResourceReloadStrategy
FileWatcherResourceReloadStrategy.WatchFileChangesTask -
Field Summary
Fields inherited from class org.apache.camel.support.RouteWatcherReloadStrategy
RELOAD_RESOURCESFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoOnReload(Object source, List<String> files, boolean restart) protected List<org.apache.camel.spi.Resource> findReloadedResources(Object source) voidTriggers on-demand loadingvoidTriggers on-demand reloadingMethods inherited from class org.apache.camel.support.RouteOnDemandReloadStrategy
doOnReload, isRemoveEverything, onReload, onRemoveEverythingMethods inherited from class org.apache.camel.support.RouteWatcherReloadStrategy
doStart, getPattern, isRemoveAllRoutes, onGroovyReload, onPropertiesReload, onRouteReload, setPattern, setRemoveAllRoutes, startupMessageMethods inherited from class org.apache.camel.support.FileWatcherResourceReloadStrategy
doStop, getFileFilter, getFolder, isRecursive, isRunning, setFileFilter, setFolder, setPollTimeout, setRecursive, setSchedulerMethods inherited from class org.apache.camel.support.ResourceReloadStrategySupport
getCamelContext, getFailedCounter, getLastError, getReloadCounter, getResourceReload, incFailedCounter, incSucceededCounter, lastErrorMessage, resetCounters, setCamelContext, setFailed, setLastError, setResourceReload, setSucceededMethods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, 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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-
Constructor Details
-
LoadOnDemandReloadStrategy
public LoadOnDemandReloadStrategy()
-
-
Method Details
-
load
Triggers on-demand loading- Parameters:
source- the source calling thisfiles- a list of file namesrestart- whether to force restart all routes after source files are loaded
-
doOnReload
- Throws:
Exception
-
onReload
Description copied from class:RouteOnDemandReloadStrategyTriggers on-demand reloading- Specified by:
onReloadin interfaceorg.apache.camel.spi.ReloadStrategy- Overrides:
onReloadin classRouteOnDemandReloadStrategy
-
findReloadedResources
- Overrides:
findReloadedResourcesin classRouteOnDemandReloadStrategy- Throws:
Exception
-