Class DefaultManagementNameStrategy

java.lang.Object
org.apache.camel.impl.engine.DefaultManagementNameStrategy
All Implemented Interfaces:
org.apache.camel.spi.ManagementNameStrategy

public class DefaultManagementNameStrategy extends Object implements org.apache.camel.spi.ManagementNameStrategy
Default implementation of ManagementNameStrategy

This implementation will by default use a name pattern as #name# and in case of a clash, then the pattern will fallback to be using the counter as #name#-#counter#.

  • Constructor Details

    • DefaultManagementNameStrategy

      public DefaultManagementNameStrategy(org.apache.camel.CamelContext camelContext)
    • DefaultManagementNameStrategy

      public DefaultManagementNameStrategy(org.apache.camel.CamelContext camelContext, String defaultPattern, String nextPattern)
  • Method Details

    • getNamePattern

      public String getNamePattern()
      Specified by:
      getNamePattern in interface org.apache.camel.spi.ManagementNameStrategy
    • setNamePattern

      public void setNamePattern(String namePattern)
      Specified by:
      setNamePattern in interface org.apache.camel.spi.ManagementNameStrategy
    • getName

      public String getName()
      Specified by:
      getName in interface org.apache.camel.spi.ManagementNameStrategy
    • getNextName

      public String getNextName()
      Specified by:
      getNextName in interface org.apache.camel.spi.ManagementNameStrategy
    • isFixedName

      public boolean isFixedName()
      Specified by:
      isFixedName in interface org.apache.camel.spi.ManagementNameStrategy
    • resolveManagementName

      public String resolveManagementName(String pattern, String name, boolean invalidCheck)
      Creates a new management name with the given pattern
      Specified by:
      resolveManagementName in interface org.apache.camel.spi.ManagementNameStrategy
      Parameters:
      pattern - the pattern
      name - the name
      Returns:
      the management name
      Throws:
      IllegalArgumentException - if the pattern or name is invalid or empty
    • customResolveManagementName

      protected String customResolveManagementName(String pattern, String answer)
      Strategy to do any custom resolution of the name
      Parameters:
      pattern - the pattern
      answer - the current answer, which may have custom patterns still to be resolved
      Returns:
      the resolved name
    • setCounter

      public static void setCounter(int value)
      To reset the counter, should only be used for testing purposes.
      Parameters:
      value - the counter value