org.apache.jsieve
Class CommandManager

java.lang.Object
  extended byorg.apache.jsieve.CommandManager

public class CommandManager
extends java.lang.Object

Singleton class CommandManager maps Command names to configured Command implementation classes.


Method Summary
protected static CommandManager computeInstance()
          Computes a new instance of the receiver.
protected  java.lang.String getClassName(java.lang.String name)
           Method getClassName answers the name of the class to which a Command name is mapped.
protected  java.util.Map getClassNameMap()
          Method getClassNameMap answers a Map of Command names and their class names.
static CommandManager getInstance()
          Returns the sole instance of the receiver, lazily initialised if required.
 boolean isSupported(java.lang.String name)
          Method isSupported answers a boolean indicating if a Command name is configured.
 java.lang.Class lookup(java.lang.String name)
           Method lookup answers the class to which a Command name is mapped.
 ExecutableCommand newInstance(java.lang.String name)
           Method newInstance answers an instance of the class to which a Command name is mapped.
static void resetInstance()
          Resets the sole instance.
protected static void setInstance(CommandManager instance)
          Sets the sole instance of the receiver.
protected static void updateInstance()
          Updates the sole instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static CommandManager getInstance()
Returns the sole instance of the receiver, lazily initialised if required.

Returns:
CommandManager

computeInstance

protected static CommandManager computeInstance()
Computes a new instance of the receiver.

Returns:
CommandManager

setInstance

protected static void setInstance(CommandManager instance)
Sets the sole instance of the receiver.

Parameters:
instance - The current instance to set

resetInstance

public static void resetInstance()
Resets the sole instance.


updateInstance

protected static void updateInstance()
Updates the sole instance.


lookup

public java.lang.Class lookup(java.lang.String name)
                       throws LookupException

Method lookup answers the class to which a Command name is mapped.

Parameters:
name - - The name of the Command
Returns:
Class - The class of the Command
Throws:
LookupException

newInstance

public ExecutableCommand newInstance(java.lang.String name)
                              throws LookupException

Method newInstance answers an instance of the class to which a Command name is mapped.

Parameters:
name - - The name of the Command
Returns:
Class - The class of the Command
Throws:
LookupException

isSupported

public boolean isSupported(java.lang.String name)
Method isSupported answers a boolean indicating if a Command name is configured.

Parameters:
name - - The Command name
Returns:
boolean - True if the Command name is configured.

getClassName

protected java.lang.String getClassName(java.lang.String name)
                                 throws LookupException

Method getClassName answers the name of the class to which a Command name is mapped.

Parameters:
name - - The name of the Command
Returns:
String - The name of the class
Throws:
LookupException

getClassNameMap

protected java.util.Map getClassNameMap()
                                 throws SieveConfigurationException
Method getClassNameMap answers a Map of Command names and their class names.

Returns:
Map
Throws:
SieveConfigurationException


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.