org.objectweb.howl.log
Class Configuration

java.lang.Object
  extended by org.objectweb.howl.log.Configuration
All Implemented Interfaces:
ConfigurationMBean

public class Configuration
extends java.lang.Object
implements ConfigurationMBean

Provides configuration information for a Logger instance.

Author:
girouxm

Constructor Summary
Configuration()
          Construct a Configuration object with default values.
Configuration(java.io.File propertyFile)
          Construct a Configuration object using a Properties file specified by the caller.
Configuration(java.util.Properties prop)
          Construct a Configuration object using a Properties object supplied by the caller.
 
Method Summary
 java.lang.String getBufferClassName()
           
 int getBufferSize()
          Returns the size of buffers specified as a number of 1K blocks.
 int getFlushSleepTime()
           
 java.lang.String getLogFileDir()
           
 java.lang.String getLogFileExt()
           
 java.lang.String getLogFileMode()
           
 java.lang.String getLogFileName()
           
 int getMaxBlocksPerFile()
           
 int getMaxBuffers()
           
 int getMaxLogFiles()
           
 int getMinBuffers()
           
 int getThreadsWaitingForceThreshold()
           
 boolean isChecksumEnabled()
           
 boolean isFlushPartialBuffers()
           
 void setBufferClassName(java.lang.String bufferClassName)
           
 void setBufferSize(int bufferSize)
           
 void setChecksumEnabled(boolean checksumOption)
           
 void setFlushPartialBuffers(boolean flushPartialBuffers)
           
 void setFlushSleepTime(int flushSleepTime)
           
 void setLogFileDir(java.lang.String logFileDir)
           
 void setLogFileExt(java.lang.String logFileExt)
           
 void setLogFileMode(java.lang.String logFileMode)
           
 void setLogFileName(java.lang.String logFileName)
           
 void setMaxBlocksPerFile(int maxBlocksPerFile)
           
 void setMaxBuffers(int maxBuffers)
           
 void setMaxLogFiles(int maxLogFiles)
           
 void setMinBuffers(int minBuffers)
           
 void setThreadsWaitingForceThreshold(int threadsWaitingForceThreshold)
           
 void store(java.io.OutputStream out)
          Stores configuration properties to OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configuration

public Configuration()
Construct a Configuration object with default values.

Caller will use setter methods to change the defaults.


Configuration

public Configuration(java.util.Properties prop)
              throws LogConfigurationException
Construct a Configuration object using a Properties object supplied by the caller.

Parameters:
prop - Properties object containing default settings
Throws:
LogConfigurationException

Configuration

public Configuration(java.io.File propertyFile)
              throws LogConfigurationException
Construct a Configuration object using a Properties file specified by the caller.

Parameters:
propertyFile - File object describing a properties file
Throws:
LogConfigurationException - if property file cannot be processed.
Method Detail

getLogFileDir

public java.lang.String getLogFileDir()
Specified by:
getLogFileDir in interface ConfigurationMBean
Returns:
Returns the logDir.

setLogFileDir

public void setLogFileDir(java.lang.String logFileDir)
Parameters:
logFileDir - The logFileDir to set.

getLogFileExt

public java.lang.String getLogFileExt()
Specified by:
getLogFileExt in interface ConfigurationMBean
Returns:
Returns the logFileExt.

setLogFileExt

public void setLogFileExt(java.lang.String logFileExt)
Parameters:
logFileExt - The logFileExt to set.

getLogFileName

public java.lang.String getLogFileName()
Specified by:
getLogFileName in interface ConfigurationMBean
Returns:
Returns the logFileName.

setLogFileName

public void setLogFileName(java.lang.String logFileName)
Parameters:
logFileName - The logFileName to set.

isChecksumEnabled

public boolean isChecksumEnabled()
Specified by:
isChecksumEnabled in interface ConfigurationMBean
Returns:
Returns the checksumEnabled option.

setChecksumEnabled

public void setChecksumEnabled(boolean checksumOption)
Parameters:
checksumOption - The checksumOption to set.

getBufferSize

public int getBufferSize()
Returns the size of buffers specified as a number of 1K blocks.

As an example, if buffers are 4096 bytes large, getBufferSize() returns 4.

Specified by:
getBufferSize in interface ConfigurationMBean
Returns:
Returns the bufferSize as a number of 1K blocks.

setBufferSize

public void setBufferSize(int bufferSize)
                   throws LogConfigurationException
Parameters:
bufferSize - The size of a log buffer specified as a number of 1024 byte blocks.

The value specified by bufferSize is multiplied by 1024 to establish the actual buffer size used by the logger.

Throws:
LogConfigurationException

getBufferClassName

public java.lang.String getBufferClassName()
Specified by:
getBufferClassName in interface ConfigurationMBean
Returns:
Returns the bufferClassName.

setBufferClassName

public void setBufferClassName(java.lang.String bufferClassName)
Parameters:
bufferClassName - The bufferClassName to set.

getMaxBuffers

public int getMaxBuffers()
Specified by:
getMaxBuffers in interface ConfigurationMBean
Returns:
Returns the maxBuffers.

setMaxBuffers

public void setMaxBuffers(int maxBuffers)
                   throws LogConfigurationException
Parameters:
maxBuffers - The maxBuffers to set.
Throws:
LogConfigurationException

getMinBuffers

public int getMinBuffers()
Specified by:
getMinBuffers in interface ConfigurationMBean
Returns:
Returns the minBuffers.

setMinBuffers

public void setMinBuffers(int minBuffers)
                   throws LogConfigurationException
Parameters:
minBuffers - The minBuffers to set.
Throws:
LogConfigurationException

getFlushSleepTime

public int getFlushSleepTime()
Specified by:
getFlushSleepTime in interface ConfigurationMBean
Returns:
Returns the flushSleepTime.

setFlushSleepTime

public void setFlushSleepTime(int flushSleepTime)
Parameters:
flushSleepTime - The amount of time (specified in milli-seconds) the FlushManager should sleep.

getThreadsWaitingForceThreshold

public int getThreadsWaitingForceThreshold()
Specified by:
getThreadsWaitingForceThreshold in interface ConfigurationMBean
Returns:
Returns the threadsWaitingForceThreshold.

setThreadsWaitingForceThreshold

public void setThreadsWaitingForceThreshold(int threadsWaitingForceThreshold)
Parameters:
threadsWaitingForceThreshold - The threadsWaitingForceThreshold to set.

getMaxBlocksPerFile

public int getMaxBlocksPerFile()
Specified by:
getMaxBlocksPerFile in interface ConfigurationMBean
Returns:
Returns the maxBlocksPerFile.

setMaxBlocksPerFile

public void setMaxBlocksPerFile(int maxBlocksPerFile)
Parameters:
maxBlocksPerFile - The maxBlocksPerFile to set.

getMaxLogFiles

public int getMaxLogFiles()
Specified by:
getMaxLogFiles in interface ConfigurationMBean
Returns:
Returns the maxLogFiles.

setMaxLogFiles

public void setMaxLogFiles(int maxLogFiles)
Parameters:
maxLogFiles - The maxLogFiles to set.

getLogFileMode

public java.lang.String getLogFileMode()
Specified by:
getLogFileMode in interface ConfigurationMBean
Returns:
Returns the logFileMode.

setLogFileMode

public void setLogFileMode(java.lang.String logFileMode)
                    throws LogConfigurationException
Parameters:
logFileMode - The logFileMode to set.
Throws:
LogConfigurationException

store

public void store(java.io.OutputStream out)
           throws java.io.IOException
Stores configuration properties to OutputStream.

Throws:
java.io.IOException
See Also:
Properties.store(java.io.OutputStream, java.lang.String)

isFlushPartialBuffers

public boolean isFlushPartialBuffers()
Returns:
Returns the flushPartialBuffers.

setFlushPartialBuffers

public void setFlushPartialBuffers(boolean flushPartialBuffers)
Parameters:
flushPartialBuffers - The flushPartialBuffers to set.


Copyright © 2003-2010 HOWL Development Team. All Rights Reserved.