logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicko Cadell <ni...@Neoworks.com>
Subject RE: Receiver Implementation
Date Tue, 06 Aug 2002 09:59:36 GMT
I like your idea for a Receiver. I have some comments to make about the
suggested implementation.

First of all the Receiver uses the framework, the framework does not need to
know about the Receiver. This is unlike the Appenders etc. etc. which are
used directly by the framework.

The aim of the receiver is to load some arbitrary code specified in the
config file, and bind it to the LoggerRepository. The LoggerRepository and
the rest of log4j does not need to know that it is a receiver.

I have removed the doPost() method form the interface as this should just be
a helper method on the ReceiverSkeleton and should not be exposed through
the interface.

This is the base interface that this all boils down to:

public interface Plugin implements OptionHandler {
  public String getName();
  public void setName(String _name);

  public LoggerRepository getLoggerRepository();
  public void setLoggerRepository(LoggerRepository _repository);

  public void shutdown();
}

Note that this is now the Plugin interface as it has no receiver specific
functionality. Obviously trivial implementations of PluginSkeleton and
ReceiverSkeleton would be needed (ReceiverSkeleton adds back the doPost()
method.

A Plugin is a class that uses the LoggerRepository to do something. The
class is initialised by calling the OptionHandler method and is shutdown()
when the LoggerRepository is shutdown. The advantage of a plugin aproach is
that it is not limited to receivers, I'm sure that we will think of some
other plugins that can be written.

Any thoughts?
Nicko

--
To unsubscribe, e-mail:   <mailto:log4j-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-dev-help@jakarta.apache.org>


Mime
View raw message