org.apache.jsieve
Class ConfigurationManager

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

public class ConfigurationManager
extends java.lang.Object

Singleton class ConfigurationManager parses the XML statements in the Sieve configuration file and translates them to Java objects.

The Sieve configuration is read from 3 properties file. They are located by searching the classpath of the current ClassLoader. org/apache/jsieve/commandsmap.properties org/apache/jsieve/testsmap.properties org/apache/jsieve/comparatorsmap.properties


Method Summary
protected static ConfigurationManager computeInstance()
          Returns a new instance of the receiver.
 java.util.Map getCommandMap()
          Method getCommandMap answers a Map of Command names and their associated class names, lazily initialized if required.
 java.util.Map getComparatorMap()
          Method getComparatorMap answers a Map of Comparator names and their associated class names, lazily initialized if required.
protected static java.io.InputStream getConfigStream(java.lang.String configName)
           Method getConfigStream answers an InputStream over the Sieve configuration file.
static ConfigurationManager getInstance()
          Returns the sole instance of the receiver, lazily initialised if required.
 java.util.Map getTestMap()
          Method getTestMap answers a Map of Test names and their associated class names, lazily initialized if required.
protected  void parse()
          Method parse uses the Digester to parse the XML statements in the Sieve configuration file into Java objects.
protected  void setCommandMap(java.util.Map commandMap)
          Sets the commandMap.
protected  void setComparatorMap(java.util.Map comparatorMap)
          Sets the comparatorMap.
protected static void setInstance(ConfigurationManager instance)
          Sets the instance.
protected  void setTestMap(java.util.Map testMap)
          Sets the testMap.
protected static void updateInstance()
          Updates the instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

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

Returns:
ConfigurationManager
Throws:
SieveConfigurationException

computeInstance

protected static ConfigurationManager computeInstance()
                                               throws SieveConfigurationException
Returns a new instance of the receiver.

Returns:
ConfigurationManager
Throws:
SieveConfigurationException

setInstance

protected static void setInstance(ConfigurationManager instance)
Sets the instance.

Parameters:
instance - The instance to set

updateInstance

protected static void updateInstance()
                              throws SieveConfigurationException
Updates the instance.

Throws:
SieveConfigurationException

getConfigStream

protected static java.io.InputStream getConfigStream(java.lang.String configName)
                                              throws java.io.IOException

Method getConfigStream answers an InputStream over the Sieve configuration file. It is located by searching the classpath of the current ClassLoader.

The context classloader is searched first. If a suitably named resource is found then this is returned. Otherwise, the classloader used to load this class is searched for the resource.

Returns:
InputStream
Throws:
java.io.IOException

getCommandMap

public java.util.Map getCommandMap()
Method getCommandMap answers a Map of Command names and their associated class names, lazily initialized if required.

Returns:
Map

getTestMap

public java.util.Map getTestMap()
Method getTestMap answers a Map of Test names and their associated class names, lazily initialized if required.

Returns:
Map

getComparatorMap

public java.util.Map getComparatorMap()
Method getComparatorMap answers a Map of Comparator names and their associated class names, lazily initialized if required.

Returns:
Map

parse

protected void parse()
              throws org.xml.sax.SAXException,
                     java.io.IOException
Method parse uses the Digester to parse the XML statements in the Sieve configuration file into Java objects.

Throws:
org.xml.sax.SAXException
java.io.IOException

setCommandMap

protected void setCommandMap(java.util.Map commandMap)
Sets the commandMap.

Parameters:
commandMap - The commandMap to set

setTestMap

protected void setTestMap(java.util.Map testMap)
Sets the testMap.

Parameters:
testMap - The testMap to set

setComparatorMap

protected void setComparatorMap(java.util.Map comparatorMap)
Sets the comparatorMap.

Parameters:
comparatorMap - The comparatorMap to set


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