org.oddjob.logging
Class AbstractPollingArchiver

java.lang.Object
  extended byorg.oddjob.logging.AbstractPollingArchiver

public abstract class AbstractPollingArchiver
extends java.lang.Object

A LogArchiver which maintains it's log archives by polling.

This archiver will remove a component from it's list of components to poll when no more listeners are listening to it.

This archiver will only poll the first component where many components share the same archive.

Author:
Rob Gordon

Constructor Summary
AbstractPollingArchiver(AbstractArchiverCache cache)
          Constructor.
 
Method Summary
 void addArchiveListener(LogListener l, java.lang.Object component, LogLevel level, long last, int max)
          Add a LogListener for the given component.
abstract  java.lang.String archiveFor(java.lang.Object component)
           
 void destroy()
           
 void poll()
          Poll for Log Messages.
 void removeArchiveListener(LogListener l, java.lang.Object component)
          Remove the LogListener for the given component.
abstract  LogEvent[] retrieveEvents(java.lang.Object component, long last, int max)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPollingArchiver

public AbstractPollingArchiver(AbstractArchiverCache cache)
Constructor.

Method Detail

addArchiveListener

public void addArchiveListener(LogListener l,
                               java.lang.Object component,
                               LogLevel level,
                               long last,
                               int max)
Add a LogListener for the given component.

Parameters:
l - The LogListener.
component - The component.
level - The level.
last - The last message number required.
max - The maximum history.

removeArchiveListener

public void removeArchiveListener(LogListener l,
                                  java.lang.Object component)
Remove the LogListener for the given component.

Parameters:
l - The LogListener.
component - The component.

archiveFor

public abstract java.lang.String archiveFor(java.lang.Object component)

poll

public void poll()
Poll for Log Messages.


retrieveEvents

public abstract LogEvent[] retrieveEvents(java.lang.Object component,
                                          long last,
                                          int max)

destroy

public void destroy()