com.ibm.etools.logging.util
Class AbstractMessageLoggerFactory

java.lang.Object
  |
  +--com.ibm.etools.logging.util.AbstractMessageLoggerFactory
Direct Known Subclasses:
MsgLoggerFactory

public abstract class AbstractMessageLoggerFactory
extends java.lang.Object


Constructor Summary
AbstractMessageLoggerFactory()
           
 
Method Summary
 void closeAllFileHandles()
          Closes the open file handles owned by loggers in the Factory.
 AbstractMessageLogger createLogger(java.lang.String name)
          Deprecated. This method is not the correct way to get or create a new logger. The correct way to get or create a new logger is by calling getLogger(String loggerName).
protected abstract  AbstractMessageLogger createProperLogger()
          This method must be overridden by the subclass to provide the proper instance of logger to be created by this factory.
 void destroyLogger(java.lang.String name)
          Destroys the logger instance with the specified name.
 void destroyLogger(java.lang.String name, java.lang.String version)
          Destroys the logger instance with the specified name and version.
 AbstractMessageLogger getLogger(java.lang.String name)
          Returns the logger instance with the specified name.
 AbstractMessageLogger getLogger(java.lang.String name, Plugin plugin)
          Returns the logger instance with the specified name and if a parameter Plugin is passed, sets the Plugin for the logger.
 AbstractMessageLogger getLogger(java.lang.String name, java.lang.String version, Plugin plugin)
          Returns the logger instance with the specified name and version and if a parameter Plugin is passed, sets the Plugin for the logger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMessageLoggerFactory

public AbstractMessageLoggerFactory()
Method Detail

createProperLogger

protected abstract AbstractMessageLogger createProperLogger()
This method must be overridden by the subclass to provide the proper instance of logger to be created by this factory.

Returns:
com.ibm.etools.logging.util.AbstractMessageLogger newly created logger

closeAllFileHandles

public final void closeAllFileHandles()
Closes the open file handles owned by loggers in the Factory.


destroyLogger

public final void destroyLogger(java.lang.String name)
                         throws java.lang.IllegalArgumentException
Destroys the logger instance with the specified name. Since the logger's version is not specified, the logger with the specified name and no version is destroyed.

Parameters:
name - the name of the logger to be destroyed
Throws:
java.lang.IllegalArgumentException - Attempting to destroy a logger with an illegal name

destroyLogger

public final void destroyLogger(java.lang.String name,
                                java.lang.String version)
                         throws java.lang.IllegalArgumentException
Destroys the logger instance with the specified name and version.

Parameters:
name - the name of the logger to be destroyed
version - the version of the logger to be destroyed
Throws:
java.lang.IllegalArgumentException - Attempting to destroy a logger with an illegal name

getLogger

public final AbstractMessageLogger getLogger(java.lang.String name,
                                             Plugin plugin)
                                      throws java.lang.IllegalArgumentException
Returns the logger instance with the specified name and if a parameter Plugin is passed, sets the Plugin for the logger. Since the logger's version is not specified, the logger with the specified name and no version is returned and if a parameter Plugin is passed, sets the Plugin for the logger. If a logger instance with the specified name and no version does not exist, one is created and if a parameter Plugin is passed, sets the Plugin for the logger. Since the logger's version is not specified, the newly created logger instance will have no version. The newly created logger is returned.

Parameters:
name - the name of the logger to be retrieved or created
plugin - the Plugin that this logger belongs, if running within a plugin environment
Returns:
the existing or new logger instance with the specified name
Throws:
java.lang.IllegalArgumentException - Attempting to get a logger with an illegal name

getLogger

public final AbstractMessageLogger getLogger(java.lang.String name,
                                             java.lang.String version,
                                             Plugin plugin)
                                      throws java.lang.IllegalArgumentException
Returns the logger instance with the specified name and version and if a parameter Plugin is passed, sets the Plugin for the logger. If a logger by the specified name and version does not exist, one is created and if a parameter Plugin is passed, sets the Plugin for the logger. The newly created logger is returned.

Parameters:
name - the name of the logger to be retrieved or created
version - the version of the logger to be retrieved or created
plugin - the Plugin that this logger belongs, if running within a plugin environment
Returns:
the existing or new logger instance with the specified name and version
Throws:
java.lang.IllegalArgumentException - Attempting to get a logger with an illegal name

getLogger

public final AbstractMessageLogger getLogger(java.lang.String name)
                                      throws java.lang.IllegalArgumentException
Returns the logger instance with the specified name. Since the logger's version is not specified, the logger with the specified name and no version is returned. If a logger instance with the specified name and no version does not exist, one is created and returned. Since the logger's version is not specified, the newly created logger instance will have no version.

Parameters:
name - the name of the logger to be retrieved or created
Returns:
the existing or new logger instance with the specified name
Throws:
java.lang.IllegalArgumentException - Attempting to retrieve/create a logger with an illegal name

createLogger

public final AbstractMessageLogger createLogger(java.lang.String name)
                                         throws java.lang.IllegalArgumentException
Deprecated. This method is not the correct way to get or create a new logger. The correct way to get or create a new logger is by calling getLogger(String loggerName).

java.lang.IllegalArgumentException