Class AbstractLogHandler

    • Field Detail

      • m_LogUsed

        protected boolean m_LogUsed
        whether the log has been used.
    • Constructor Detail

      • AbstractLogHandler

        protected AbstractLogHandler()
        Initializes the log handler.
    • Method Detail

      • reset

        protected void reset()
        Resets the handler.
      • initialize

        protected void initialize()
        Initializes the members.
      • setUp

        protected void setUp()
        Hook method for performing setup before processing first log record.
      • doPublish

        protected abstract void doPublish​(LogRecord record)
        Publish a LogRecord.

        The logging request was made initially to a Logger object, which initialized the LogRecord and forwarded it here.

        The Handler is responsible for formatting the message, when and if necessary. The formatting should include localization.

        Parameters:
        record - description of the log event. A null record is silently ignored and is not published
      • postPublish

        protected void postPublish​(LogRecord record)
        Hook method after logging occurred.
        Parameters:
        record - description of the log event. A null record is silently ignored and is not published
      • publish

        public void publish​(LogRecord record)
        Publish a LogRecord.

        The logging request was made initially to a Logger object, which initialized the LogRecord and forwarded it here.

        The Handler is responsible for formatting the message, when and if necessary. The formatting should include localization.

        Specified by:
        publish in class Handler
        Parameters:
        record - description of the log event. A null record is silently ignored and is not published
      • flush

        public void flush()
        Flush any buffered output.
        Specified by:
        flush in class Handler
      • close

        public void close()
                   throws SecurityException
        Close the Handler and free all associated resources.

        The close method will perform a flush and then close the Handler. After close has been called this Handler should no longer be used. Method calls may either be silently ignored or may throw runtime exceptions.

        Specified by:
        close in class Handler
        Throws:
        SecurityException - if a security manager exists and if the caller does not have LoggingPermission("control").
      • addLoggingListener

        public void addLoggingListener​(LoggingListener l)
        Adds the specified logging listener.
        Parameters:
        l - the listener to add
      • removeLoggingListener

        public void removeLoggingListener​(LoggingListener l)
        Removes the specified logging listener.
        Parameters:
        l - the listener to remove
      • removeLoggingListeners

        public void removeLoggingListeners()
        Removes all logging listener.
      • iterator

        public Iterator<LoggingListener> iterator()
        Returns an iterator over all current logging listeners.
        Returns:
        the iterator
      • loggingListeners

        public Set<LoggingListener> loggingListeners()
        Returns an iterator over all current logging listeners.
        Returns:
        the iterator
      • notifyLoggingListeners

        protected void notifyLoggingListeners​(LogRecord record)
        Sends out the log record to its listeners.
        Parameters:
        record - the record to broadcast
      • compareTo

        public int compareTo​(Handler o)
        Compares the handler with itself.
        Specified by:
        compareTo in interface Comparable<Handler>
        Parameters:
        o - the other handler
        Returns:
        less than 0, equal to 0, or greater than 0 if the handler is less, equal to, or greater than this one
      • equals

        public boolean equals​(Object obj)
        Checks whether the provided object is the same as this handler.
        Overrides:
        equals in class Object
        Parameters:
        obj - the object to check
        Returns:
        true if the same
        See Also:
        compareTo(Handler)