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, suspend
public ReloadStrategySupport()
public CamelContext getCamelContext()
CamelContextAware
CamelContext
getCamelContext
in interface CamelContextAware
public void setCamelContext(CamelContext camelContext)
CamelContextAware
CamelContext
setCamelContext
in interface CamelContextAware
camelContext
- the Camel contextpublic void onReloadXml(CamelContext camelContext, String name, InputStream resource)
ReloadStrategy
onReloadXml
in interface ReloadStrategy
camelContext
- 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()
ReloadStrategy
getReloadCounter
in interface ReloadStrategy
@ManagedAttribute(description="Number of reloads failed") public int getFailedCounter()
ReloadStrategy
getFailedCounter
in interface ReloadStrategy
public void setSucceeded(int succeeded)
public void setFailed(int failed)
@ManagedOperation(description="Reset counters") public void resetCounters()
ReloadStrategy
resetCounters
in interface ReloadStrategy
protected void doStart() throws Exception
ServiceSupport
ServiceSupport.doStop()
for more details.doStart
in class ServiceSupport
Exception
ServiceSupport.doStop()
protected void doStop() throws Exception
ServiceSupport
ServiceSupport.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 ServiceSupport
Exception
ServiceSupport.doStart()
Apache Camel