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 Gary Gregory <ga...@gmail.com> on 2016/07/21 03:21:47 UTC

LOG4J2-1472 Make org.apache.logging.log4j.core.LoggerContext implement Closeable

Hi All:

With:

LOG4J2-1472
Make org.apache.logging.log4j.core.LoggerContext implement Closeable
https://issues.apache.org/jira/browse/LOG4J2-1472

I have questions:

public class LoggerContext extends AbstractLifeCycle
        implements org.apache.logging.log4j.spi.LoggerContext, Closeable,
Terminable, ConfigurationListener {

- Terminable and Closeable seem redundant. Should we eliminate Terminable?

- Should the public LoggerContext be made to also implement Closeable?

- Should AbstractLifeCycle implement Closeable? I mention this one for
completeness because I think the answer is "no".

Gary

-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: LOG4J2-1472 Make org.apache.logging.log4j.core.LoggerContext implement Closeable

Posted by Gary Gregory <ga...@gmail.com>.
On Wed, Jul 20, 2016 at 8:39 PM, Matt Sicker <bo...@gmail.com> wrote:

> I think you should use AutoCloseable.
>

I think I like AutoCloseable too... I'll make the change.

Thank you,
Gary

>
> I don't think the LifeCycle classes should necessarily advertise
> themselves as closeable due to semantic reasons (same goes for Terminable).
>
> On 20 July 2016 at 22:21, Gary Gregory <ga...@gmail.com> wrote:
>
>> Hi All:
>>
>> With:
>>
>> LOG4J2-1472
>> Make org.apache.logging.log4j.core.LoggerContext implement Closeable
>> https://issues.apache.org/jira/browse/LOG4J2-1472
>>
>> I have questions:
>>
>> public class LoggerContext extends AbstractLifeCycle
>>         implements org.apache.logging.log4j.spi.LoggerContext, Closeable,
>> Terminable, ConfigurationListener {
>>
>> - Terminable and Closeable seem redundant. Should we eliminate Terminable?
>>
>> - Should the public LoggerContext be made to also implement Closeable?
>>
>> - Should AbstractLifeCycle implement Closeable? I mention this one for
>> completeness because I think the answer is "no".
>>
>> Gary
>>
>> --
>> E-Mail: garydgregory@gmail.com | ggregory@apache.org
>> Java Persistence with Hibernate, Second Edition
>> <http://www.manning.com/bauer3/>
>> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
>> Spring Batch in Action <http://www.manning.com/templier/>
>> Blog: http://garygregory.wordpress.com
>> Home: http://garygregory.com/
>> Tweet! http://twitter.com/GaryGregory
>>
>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: LOG4J2-1472 Make org.apache.logging.log4j.core.LoggerContext implement Closeable

Posted by Matt Sicker <bo...@gmail.com>.
I think you should use AutoCloseable.

I don't think the LifeCycle classes should necessarily advertise themselves
as closeable due to semantic reasons (same goes for Terminable).

On 20 July 2016 at 22:21, Gary Gregory <ga...@gmail.com> wrote:

> Hi All:
>
> With:
>
> LOG4J2-1472
> Make org.apache.logging.log4j.core.LoggerContext implement Closeable
> https://issues.apache.org/jira/browse/LOG4J2-1472
>
> I have questions:
>
> public class LoggerContext extends AbstractLifeCycle
>         implements org.apache.logging.log4j.spi.LoggerContext, Closeable,
> Terminable, ConfigurationListener {
>
> - Terminable and Closeable seem redundant. Should we eliminate Terminable?
>
> - Should the public LoggerContext be made to also implement Closeable?
>
> - Should AbstractLifeCycle implement Closeable? I mention this one for
> completeness because I think the answer is "no".
>
> Gary
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
Matt Sicker <bo...@gmail.com>