org.jlog2.util
Class PropertiesParser

java.lang.Object
  extended by org.jlog2.util.PropertiesParser

public class PropertiesParser
extends java.lang.Object

This class acts as a parser of a properties file to configure the logger


Constructor Summary
PropertiesParser()
          Create a new instance of PropertiesParser.
 
Method Summary
 java.util.Properties getProperties()
          Get the properties that configure the loggers.
 void initialiseChannels(java.util.Hashtable logChannels, java.util.Hashtable debugChannels)
          Initialise the log and debug channels.
 void resetChannels(java.util.Hashtable logChannels, java.util.Hashtable debugChannels)
          Reset the log and debug channels.
 void writeToFile(java.util.Properties newProps)
          Write the properties to the properties file at the default location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesParser

public PropertiesParser()
                 throws java.lang.Exception
Create a new instance of PropertiesParser.

Throws:
java.lang.Exception - any error.
Method Detail

getProperties

public java.util.Properties getProperties()
Get the properties that configure the loggers.

Returns:
the properties read from a file.

initialiseChannels

public void initialiseChannels(java.util.Hashtable logChannels,
                               java.util.Hashtable debugChannels)
                        throws java.lang.Exception
Initialise the log and debug channels.

Parameters:
logChannels - the log channels object to initialise. Keys are the logger keys while values are the default channels.
debugChannels - the debug channels object to initialise. Keys are the logger keys while values are the default channels.
Throws:
java.lang.Exception - any error.

resetChannels

public void resetChannels(java.util.Hashtable logChannels,
                          java.util.Hashtable debugChannels)
                   throws java.lang.Exception
Reset the log and debug channels.

Parameters:
logChannels - the log channels object to initialise. Keys are the logger keys while values are the default channels.
debugChannels - the debug channels object to initialise. Keys are the logger keys while values are the default channels.
Throws:
java.lang.Exception - any error.

writeToFile

public void writeToFile(java.util.Properties newProps)
                 throws java.lang.Exception
Write the properties to the properties file at the default location. Then need to load in again to change the currently used property settings.

Parameters:
newProps - the new set of properties.
Throws:
java.lang.Exception - any error.