public interface ManagementNameStrategy
ObjectName
for a managed
CamelContext
.
A strategy is needed as you can run multiple CamelContext in the same JVM, and want them to be enlisted in the JVM
wide JMXMBeanServer. And this requires a strategy to be able to calculate unique names, in case of clashes. Or to
enforce an explicit fixed name, to ensure the JMX name is not using dynamic counters etc.
This strategy supports a naming pattern which supports at least the following tokens
CamelContextNameStrategy
,
org.apache.camel.impl.DefaultManagementNameStrategy
Modifier and Type | Method and Description |
---|---|
String |
getName()
Gets the name
The
isFixedName() determines if the name can be re-calculated such as when using a counter, or the name
is always fixed. |
String |
getNamePattern()
Gets the custom name pattern.
|
String |
getNextName()
Gets the next calculated name, if this strategy is not using fixed names.
|
boolean |
isFixedName()
Whether the name will be fixed, or allow re-calculation such as by using an unique counter.
|
String |
resolveManagementName(String pattern,
String name,
boolean invalidCheck)
Creates a new management name with the given pattern.
|
void |
setNamePattern(String pattern)
Sets a custom name pattern, which will be used instead of any default patterns.
|
String getNamePattern()
void setNamePattern(String pattern)
pattern
- a custom name pattern.String getName()
isFixedName()
determines if the name can be re-calculated such as when using a counter, or the name
is always fixed.String getNextName()
isFixedName()
determines if the name can be re-calculated such as when using a counter, or the name
is always fixed.boolean isFixedName()
String resolveManagementName(String pattern, String name, boolean invalidCheck)
pattern
- the patternname
- the nameinvalidCheck
- whether to check for invalid patternIllegalArgumentException
- if the pattern or name is invalid or emptyApache Camel