|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.management.DefaultManagementStrategy
public class DefaultManagementStrategy
A default management strategy that does not manage.
This is default only used if Camel detects that it cannot use the JMX capableManagedManagementStrategy strategy. Then Camel will
fallback to use this instead that is basically a simple and noop strategy.
This class can also be used to extend your custom management implement. In fact the JMX capable
provided by Camel extends this class as well.
ManagedManagementStrategy| Constructor Summary | |
|---|---|
DefaultManagementStrategy()
|
|
DefaultManagementStrategy(CamelContext camelContext)
|
|
| Method Summary | ||
|---|---|---|
void |
addEventNotifier(EventNotifier eventNotifier)
Adds the event notifier to use. |
|
Statistic |
createStatistic(String name,
Object owner,
Statistic.UpdateMode updateMode)
|
|
CamelContext |
getCamelContext()
Get the CamelContext |
|
EventFactory |
getEventFactory()
Gets the event factory |
|
List<EventNotifier> |
getEventNotifiers()
Gets the event notifiers. |
|
|
getManagedObjectName(Object managedObject,
String customName,
Class<T> nameType)
Construct an object name, where either the object to be managed and/or a custom name component are provided |
|
ManagementAgent |
getManagementAgent()
Gets the management agent |
|
ManagementNamingStrategy |
getManagementNamingStrategy()
Gets the naming strategy to use |
|
ManagementObjectStrategy |
getManagementObjectStrategy()
Gets the object strategy to use |
|
ManagementStatisticsLevel |
getStatisticsLevel()
Gets the statistics level |
|
boolean |
isManaged(Object managedObject,
Object name)
Determines if an object or name is managed. |
|
boolean |
isOnlyManageProcessorWithCustomId()
Checks whether only to manage processors if they have been configured with a custom id |
|
void |
manageNamedObject(Object managedObject,
Object preferredName)
Adds a managed object allowing the ManagementStrategy implementation to record or expose the object as it sees fit. |
|
void |
manageObject(Object managedObject)
Adds a managed object allowing the ManagementStrategy implementation to record or expose the object as it sees fit. |
|
boolean |
manageProcessor(ProcessorDefinition<?> definition)
Filter whether the processor should be managed or not. |
|
void |
notify(EventObject event)
Management events provide a single model for capturing information about execution points in the application code. |
|
void |
onlyManageProcessorWithCustomId(boolean flag)
Sets the whether only manage processors if they have been configured with a custom id Default is false. |
|
boolean |
removeEventNotifier(EventNotifier eventNotifier)
Removes the event notifier |
|
void |
setCamelContext(CamelContext camelContext)
Injects the CamelContext |
|
void |
setEventFactory(EventFactory eventFactory)
Sets the event factory to use |
|
void |
setEventNotifiers(List<EventNotifier> eventNotifiers)
Sets the list of event notifier to use. |
|
void |
setManagementAgent(ManagementAgent managementAgent)
Sets the management agent to use |
|
void |
setManagementNamingStrategy(ManagementNamingStrategy managementNamingStrategy)
Sets the naming strategy to use |
|
void |
setManagementObjectStrategy(ManagementObjectStrategy managementObjectStrategy)
Sets the object strategy to use |
|
void |
setStatisticsLevel(ManagementStatisticsLevel level)
Sets the statistics level Default is ManagementStatisticsLevel.All |
|
void |
start()
Starts the service |
|
void |
stop()
Stops the service |
|
void |
unmanageNamedObject(Object name)
Removes a managed object by name. |
|
void |
unmanageObject(Object managedObject)
Removes the managed object. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultManagementStrategy()
public DefaultManagementStrategy(CamelContext camelContext)
| Method Detail |
|---|
public List<EventNotifier> getEventNotifiers()
ManagementStrategy
getEventNotifiers in interface ManagementStrategypublic void addEventNotifier(EventNotifier eventNotifier)
ManagementStrategyService, as otherwise
it would not be used.
addEventNotifier in interface ManagementStrategyeventNotifier - event notifierpublic boolean removeEventNotifier(EventNotifier eventNotifier)
ManagementStrategy
removeEventNotifier in interface ManagementStrategyeventNotifier - event notifier to remove
public void setEventNotifiers(List<EventNotifier> eventNotifiers)
ManagementStrategy
setEventNotifiers in interface ManagementStrategyeventNotifiers - list of event notifierspublic EventFactory getEventFactory()
ManagementStrategy
getEventFactory in interface ManagementStrategypublic void setEventFactory(EventFactory eventFactory)
ManagementStrategy
setEventFactory in interface ManagementStrategyeventFactory - event factorypublic ManagementNamingStrategy getManagementNamingStrategy()
ManagementStrategy
getManagementNamingStrategy in interface ManagementStrategypublic void setManagementNamingStrategy(ManagementNamingStrategy managementNamingStrategy)
ManagementStrategy
setManagementNamingStrategy in interface ManagementStrategymanagementNamingStrategy - naming strategypublic ManagementObjectStrategy getManagementObjectStrategy()
ManagementStrategy
getManagementObjectStrategy in interface ManagementStrategypublic void setManagementObjectStrategy(ManagementObjectStrategy managementObjectStrategy)
ManagementStrategy
setManagementObjectStrategy in interface ManagementStrategymanagementObjectStrategy - object strategypublic ManagementAgent getManagementAgent()
ManagementStrategy
getManagementAgent in interface ManagementStrategypublic void setManagementAgent(ManagementAgent managementAgent)
ManagementStrategy
setManagementAgent in interface ManagementStrategymanagementAgent - management agentpublic void onlyManageProcessorWithCustomId(boolean flag)
ManagementStrategy
onlyManageProcessorWithCustomId in interface ManagementStrategyflag - true will only manage if custom id was set.public boolean isOnlyManageProcessorWithCustomId()
ManagementStrategy
isOnlyManageProcessorWithCustomId in interface ManagementStrategypublic boolean manageProcessor(ProcessorDefinition<?> definition)
ManagementStrategy
manageProcessor in interface ManagementStrategydefinition - definition of the processor
public void manageObject(Object managedObject)
throws Exception
ManagementStrategy
manageObject in interface ManagementStrategymanagedObject - the managed object
Exception - can be thrown if the object could not be added
public void manageNamedObject(Object managedObject,
Object preferredName)
throws Exception
ManagementStrategy
manageNamedObject in interface ManagementStrategymanagedObject - the managed objectpreferredName - representing the preferred name, maybe a String, or a JMX ObjectName
Exception - can be thrown if the object could not be added
public <T> T getManagedObjectName(Object managedObject,
String customName,
Class<T> nameType)
throws Exception
ManagementStrategy
getManagedObjectName in interface ManagementStrategymanagedObject - the object to be managedcustomName - a custom name componentnameType - the name type required
Exception - can be thrown if the object name could not be created
public void unmanageObject(Object managedObject)
throws Exception
ManagementStrategy
unmanageObject in interface ManagementStrategymanagedObject - the managed object
Exception - can be thrown if the object could not be removed
public void unmanageNamedObject(Object name)
throws Exception
ManagementStrategy
unmanageNamedObject in interface ManagementStrategyname - an object name previously created by this strategy.
Exception - can be thrown if the object could not be removed
public boolean isManaged(Object managedObject,
Object name)
ManagementStrategy
isManaged in interface ManagementStrategymanagedObject - the object to considername - the name to consider
public CamelContext getCamelContext()
CamelContextAwareCamelContext
getCamelContext in interface CamelContextAwarepublic void setCamelContext(CamelContext camelContext)
CamelContextAwareCamelContext
setCamelContext in interface CamelContextAwarecamelContext - the Camel context
public void notify(EventObject event)
throws Exception
ManagementStrategy
notify in interface ManagementStrategyevent - the event
Exception - can be thrown if the notification failed
public Statistic createStatistic(String name,
Object owner,
Statistic.UpdateMode updateMode)
public void setStatisticsLevel(ManagementStatisticsLevel level)
ManagementStrategyManagementStatisticsLevel.All
setStatisticsLevel in interface ManagementStrategylevel - the new levelpublic ManagementStatisticsLevel getStatisticsLevel()
ManagementStrategy
getStatisticsLevel in interface ManagementStrategy
public void start()
throws Exception
Service
start in interface ServiceException - is thrown if starting failed
public void stop()
throws Exception
Service
stop in interface ServiceException - is thrown if stopping failed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||