You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Paul Smith <Pa...@lawlex.com.au> on 2004/05/13 00:10:17 UTC

RE: cvs commit: logging-log4j/src/java/org/apache/log4j/selector ContextJNDISelector.java

> Along those lines, it might be nice to add an "isActivated" read only
> property, which is set by the Plugin on activateOptions call. 
>  What do you
> think?

This just shows how long it's been since I've been in this area (or any
area) of the log4j code.  There already IS an isActive method....

Perhaps the PluginRegistry.addPlugin method could either a) call
activateOptions if it's not active yet, OR throw IllegalStateException, as a
sanity check to enforce the contract that Plugins must be activated before
being added.

?

Paul

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


RE: cvs commit: logging-log4j/src/java/org/apache/log4j/selector ContextJNDISelector.java

Posted by Ceki Gülcü <ce...@qos.ch>.
At 12:10 AM 5/13/2004, Paul Smith wrote:
> > Along those lines, it might be nice to add an "isActivated" read only
> > property, which is set by the Plugin on activateOptions call.
> >  What do you
> > think?
>
>This just shows how long it's been since I've been in this area (or any
>area) of the log4j code.  There already IS an isActive method....

Indeed, there is an isActive method in Plugin in the plugin interface and I 
find its meaning quite confusing although that may be due to my ignorance 
of the intended usage.

What does isActive()==true mean? Does it mean that the plugin is free of 
errors, or could it also mean currently running but in a state without 
active connections. What about paused plugins? Are paused plugins active or 
inactive? Do we/should we care?

>Perhaps the PluginRegistry.addPlugin method could either a) call
>activateOptions if it's not active yet, OR throw IllegalStateException, as a
>sanity check to enforce the contract that Plugins must be activated before
>being added.

This may seem a bit naive but why should the configurator care if a plugin 
is active before adding it it to the registry? With a new config file, the 
user tells us that she wants this plugin added to the registry. That's all 
we can really count on for sure. The current behavior for appenders is to 
detach and close existing appenders and replace them with the new ones 
mentioned in the new config file. (At least that is the sprit of the 
current behavior for appenders. I have intentionally simplified the 
description for the sake of this discussion.)

My current preference would be simply to remove the isActive method from 
the Plugin interface. What do you think?

>Paul

-- 
Ceki Gülcü

      For log4j documentation consider "The complete log4j manual"
      ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp  



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org