org.apache.camel.impl
Class DefaultCamelContextNameStrategy

java.lang.Object
  extended by org.apache.camel.impl.DefaultCamelContextNameStrategy
All Implemented Interfaces:
CamelContextNameStrategy

public class DefaultCamelContextNameStrategy
extends Object
implements CamelContextNameStrategy

A default name strategy which auto assigns a name using a prefix-counter pattern.

Version:

Constructor Summary
DefaultCamelContextNameStrategy()
           
DefaultCamelContextNameStrategy(String prefix)
           
 
Method Summary
 String getName()
          Gets the name

The CamelContextNameStrategy.isFixedName() determines if the name can be re-calculated such as when using a counter, or the name is always fixed.

static int getNextCounter()
           
 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.
static void setCounter(int value)
          To reset the counter, should only be used for testing purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCamelContextNameStrategy

public DefaultCamelContextNameStrategy()

DefaultCamelContextNameStrategy

public DefaultCamelContextNameStrategy(String prefix)
Method Detail

getName

public String getName()
Description copied from interface: CamelContextNameStrategy
Gets the name

The CamelContextNameStrategy.isFixedName() determines if the name can be re-calculated such as when using a counter, or the name is always fixed.

Specified by:
getName in interface CamelContextNameStrategy
Returns:
the name.

getNextName

public String getNextName()
Description copied from interface: CamelContextNameStrategy
Gets the next calculated name, if this strategy is not using fixed names.

The CamelContextNameStrategy.isFixedName() determines if the name can be re-calculated such as when using a counter, or the name is always fixed.

Specified by:
getNextName in interface CamelContextNameStrategy
Returns:
the next name

isFixedName

public boolean isFixedName()
Description copied from interface: CamelContextNameStrategy
Whether the name will be fixed, or allow re-calculation such as by using an unique counter.

Specified by:
isFixedName in interface CamelContextNameStrategy
Returns:
true for fixed names, false for names which can re-calculated

getNextCounter

public static int getNextCounter()

setCounter

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

Parameters:
value - the counter value


Apache CAMEL