public class JmxManagementLifecycleStrategy extends org.apache.camel.support.service.ServiceSupport implements org.apache.camel.spi.LifecycleStrategy, org.apache.camel.CamelContextAware
ManagementStrategy
.ManagementStrategy
Constructor and Description |
---|
JmxManagementLifecycleStrategy() |
JmxManagementLifecycleStrategy(org.apache.camel.CamelContext camelContext) |
Modifier and Type | Method and Description |
---|---|
protected void |
doStart() |
protected void |
doStop() |
org.apache.camel.CamelContext |
getCamelContext() |
protected void |
manageObject(Object me)
Strategy for managing the object
|
void |
onComponentAdd(String name,
org.apache.camel.Component component) |
void |
onComponentRemove(String name,
org.apache.camel.Component component) |
void |
onContextStarting(org.apache.camel.CamelContext context) |
void |
onContextStopped(org.apache.camel.CamelContext context) |
void |
onEndpointAdd(org.apache.camel.Endpoint endpoint)
If the endpoint is an instance of ManagedResource then register it with the mbean server, if it is not then wrap
the endpoint in a
ManagedEndpoint and register that with the mbean server. |
void |
onEndpointRemove(org.apache.camel.Endpoint endpoint) |
void |
onRouteContextCreate(org.apache.camel.Route route) |
void |
onRoutesAdd(Collection<org.apache.camel.Route> routes) |
void |
onRoutesRemove(Collection<org.apache.camel.Route> routes) |
void |
onServiceAdd(org.apache.camel.CamelContext context,
org.apache.camel.Service service,
org.apache.camel.Route route) |
void |
onServiceRemove(org.apache.camel.CamelContext context,
org.apache.camel.Service service,
org.apache.camel.Route route) |
void |
onThreadPoolAdd(org.apache.camel.CamelContext camelContext,
ThreadPoolExecutor threadPool,
String id,
String sourceId,
String routeId,
String threadPoolProfileId) |
void |
onThreadPoolRemove(org.apache.camel.CamelContext camelContext,
ThreadPoolExecutor threadPool) |
protected boolean |
registerProcessor(org.apache.camel.model.ProcessorDefinition<?> processor)
Should the given processor be registered.
|
void |
setCamelContext(org.apache.camel.CamelContext camelContext) |
protected boolean |
shouldRegister(Object service,
org.apache.camel.Route route)
Whether or not to register the mbean.
|
protected void |
unmanageObject(Object me)
Un-manages the object.
|
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onContextInitialized, onContextInitializing, onContextStart, onContextStarted, onContextStop, onContextStopping, onDataFormatCreated, onLanguageCreated
public JmxManagementLifecycleStrategy()
public JmxManagementLifecycleStrategy(org.apache.camel.CamelContext camelContext)
public org.apache.camel.CamelContext getCamelContext()
getCamelContext
in interface org.apache.camel.CamelContextAware
public void setCamelContext(org.apache.camel.CamelContext camelContext)
setCamelContext
in interface org.apache.camel.CamelContextAware
public void onContextStarting(org.apache.camel.CamelContext context) throws org.apache.camel.VetoCamelContextStartException
onContextStarting
in interface org.apache.camel.spi.LifecycleStrategy
org.apache.camel.VetoCamelContextStartException
public void onContextStopped(org.apache.camel.CamelContext context)
onContextStopped
in interface org.apache.camel.spi.LifecycleStrategy
public void onComponentAdd(String name, org.apache.camel.Component component)
onComponentAdd
in interface org.apache.camel.spi.LifecycleStrategy
public void onComponentRemove(String name, org.apache.camel.Component component)
onComponentRemove
in interface org.apache.camel.spi.LifecycleStrategy
public void onEndpointAdd(org.apache.camel.Endpoint endpoint)
ManagedEndpoint
and register that with the mbean server.onEndpointAdd
in interface org.apache.camel.spi.LifecycleStrategy
endpoint
- the Endpoint attempted to be addedpublic void onEndpointRemove(org.apache.camel.Endpoint endpoint)
onEndpointRemove
in interface org.apache.camel.spi.LifecycleStrategy
public void onServiceAdd(org.apache.camel.CamelContext context, org.apache.camel.Service service, org.apache.camel.Route route)
onServiceAdd
in interface org.apache.camel.spi.LifecycleStrategy
public void onServiceRemove(org.apache.camel.CamelContext context, org.apache.camel.Service service, org.apache.camel.Route route)
onServiceRemove
in interface org.apache.camel.spi.LifecycleStrategy
public void onRoutesAdd(Collection<org.apache.camel.Route> routes)
onRoutesAdd
in interface org.apache.camel.spi.LifecycleStrategy
public void onRoutesRemove(Collection<org.apache.camel.Route> routes)
onRoutesRemove
in interface org.apache.camel.spi.LifecycleStrategy
public void onThreadPoolAdd(org.apache.camel.CamelContext camelContext, ThreadPoolExecutor threadPool, String id, String sourceId, String routeId, String threadPoolProfileId)
onThreadPoolAdd
in interface org.apache.camel.spi.LifecycleStrategy
public void onThreadPoolRemove(org.apache.camel.CamelContext camelContext, ThreadPoolExecutor threadPool)
onThreadPoolRemove
in interface org.apache.camel.spi.LifecycleStrategy
public void onRouteContextCreate(org.apache.camel.Route route)
onRouteContextCreate
in interface org.apache.camel.spi.LifecycleStrategy
protected boolean registerProcessor(org.apache.camel.model.ProcessorDefinition<?> processor)
protected void manageObject(Object me) throws Exception
me
- the managed objectException
- is thrown if error registering the object for managementprotected void unmanageObject(Object me) throws Exception
me
- the managed objectException
- is thrown if error unregistering the managed objectprotected boolean shouldRegister(Object service, org.apache.camel.Route route)
ManagementAgent
has options which controls when to register. This allows us to only register mbeans
accordingly. For example by default any dynamic endpoints is not registered. This avoids to register excessive
mbeans, which most often is not desired.service
- the object to registerroute
- an optional route the mbean is associated with, can be nullprotected void doStart() throws Exception
doStart
in class org.apache.camel.support.service.BaseService
Exception
Apache Camel