public abstract class ReloadStrategySupport extends ServiceSupport implements ReloadStrategy
ReloadStrategy SPI plugins.| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
cache |
protected org.slf4j.Logger |
log |
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending| Constructor and Description |
|---|
ReloadStrategySupport() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
protected void |
doStop()
Implementations override this method to support customized start/stop.
|
CamelContext |
getCamelContext()
Get the
CamelContext |
int |
getFailedCounter()
Number of reloads failed.
|
int |
getReloadCounter()
Number of reloads succeeded.
|
void |
onReloadXml(CamelContext camelContext,
String name,
InputStream resource)
A reload is triggered when a XML resource is changed which contains Camel routes.
|
void |
resetCounters()
Reset the counters.
|
void |
setCamelContext(CamelContext camelContext)
Injects the
CamelContext |
void |
setFailed(int failed) |
void |
setSucceeded(int succeeded) |
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendpublic ReloadStrategySupport()
public CamelContext getCamelContext()
CamelContextAwareCamelContextgetCamelContext in interface CamelContextAwarepublic void setCamelContext(CamelContext camelContext)
CamelContextAwareCamelContextsetCamelContext in interface CamelContextAwarecamelContext - the Camel contextpublic void onReloadXml(CamelContext camelContext, String name, InputStream resource)
ReloadStrategyonReloadXml in interface ReloadStrategycamelContext - the running CamelContextname - name of resource such as a file name (can be null)resource - the changed resource@ManagedAttribute(description="Number of reloads succeeded") public int getReloadCounter()
ReloadStrategygetReloadCounter in interface ReloadStrategy@ManagedAttribute(description="Number of reloads failed") public int getFailedCounter()
ReloadStrategygetFailedCounter in interface ReloadStrategypublic void setSucceeded(int succeeded)
public void setFailed(int failed)
@ManagedOperation(description="Reset counters") public void resetCounters()
ReloadStrategyresetCounters in interface ReloadStrategyprotected void doStart() throws Exception
ServiceSupportServiceSupport.doStop() for more details.doStart in class ServiceSupportExceptionServiceSupport.doStop()protected void doStop() throws Exception
ServiceSupportServiceSupport.doStop() method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext is shutting down.doStop in class ServiceSupportExceptionServiceSupport.doStart()Apache Camel