verinec.netsim.loggers
Class Logger

java.lang.Object
  extended by org.jdom.Content
      extended by org.jdom.Element
          extended by verinec.netsim.loggers.events.Events
              extended by verinec.netsim.loggers.Logger
All Implemented Interfaces:
Serializable, Cloneable, Parent, IExtendedLogger, ILogger

public class Logger
extends Events
implements IExtendedLogger

Logger creates a single instance of a Logger. There is no Constructor but two static methods that guarantee that there is only a single instance of a logger.

Version:
$Revision: 1032 $
Author:
Dominik Jungo
See Also:
Serialized Form

Field Summary
private static ILogger instance
           
private static long serialVersionUID
           
 
Fields inherited from class org.jdom.Element
additionalNamespaces, name, namespace
 
Fields inherited from class org.jdom.Content
parent
 
Constructor Summary
Logger()
           
 
Method Summary
 Events getEvents()
          gets the logged events
static ILogger getInstance()
          gets the instace of the logger
static ILogger Instance(ILogger logger)
          Sets the logger instance to a given instance of a logger.
static ILogger Instance(String repository, String stoptime)
          Creates a new Logger (@see Logger) if there isn't alreadyone and then it returns the instance of the logger
 
Methods inherited from class verinec.netsim.loggers.events.Events
addEvent, getEventList, getRepository, getRepositoryName, getStopTime, setRepositoryName, setStopTime
 
Methods inherited from class org.jdom.Element
addContent, addContent, addContent, addContent, addContent, addNamespaceDeclaration, clone, cloneContent, getAdditionalNamespaces, getAttribute, getAttribute, getAttributes, getAttributeValue, getAttributeValue, getAttributeValue, getAttributeValue, getChild, getChild, getChildren, getChildren, getChildren, getChildText, getChildText, getChildTextNormalize, getChildTextNormalize, getChildTextTrim, getChildTextTrim, getContent, getContent, getContent, getContentSize, getDescendants, getDescendants, getName, getNamespace, getNamespace, getNamespacePrefix, getNamespaceURI, getQualifiedName, getText, getTextNormalize, getTextTrim, getValue, indexOf, isAncestor, isRootElement, removeAttribute, removeAttribute, removeAttribute, removeChild, removeChild, removeChildren, removeChildren, removeContent, removeContent, removeContent, removeContent, removeNamespaceDeclaration, setAttribute, setAttribute, setAttribute, setAttributes, setContent, setContent, setContent, setContent, setName, setNamespace, setText, toString
 
Methods inherited from class org.jdom.Content
detach, equals, getDocument, getParent, getParentElement, hashCode, setParent
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface verinec.netsim.loggers.IExtendedLogger
getEventList
 
Methods inherited from interface verinec.netsim.loggers.ILogger
addEvent
 
Methods inherited from interface org.jdom.Parent
getDocument, getParent
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

instance

private static ILogger instance
Constructor Detail

Logger

public Logger()
Method Detail

Instance

public static ILogger Instance(ILogger logger)
                        throws NetSimException
Sets the logger instance to a given instance of a logger.

Parameters:
logger - a logger
Returns:
the instance of the logger
Throws:
NetSimException - if there exists already another instance of a logger

Instance

public static ILogger Instance(String repository,
                               String stoptime)
Creates a new Logger (@see Logger) if there isn't alreadyone and then it returns the instance of the logger

Parameters:
repository - repository of this logger
stoptime - stoptime of the simulation
Returns:
the single existing instance of the logger

getInstance

public static ILogger getInstance()
                           throws NetSimException
gets the instace of the logger

Returns:
the instace of the logger
Throws:
NetSimException - if the instance isn't set yet

getEvents

public Events getEvents()
Description copied from interface: IExtendedLogger
gets the logged events

Specified by:
getEvents in interface IExtendedLogger
Returns:
the logged events
See Also:
IExtendedLogger.getEvents()

Copyright © 2005 Verinec, DIUF