On Wed, May 6, 2009 at 6:21 AM, Matthew Toseland
<[email protected]> wrote:
> sdiz commit 006d85dbcd31ffce94279667f5e9ab62d054c9cf
>
> diff --git a/src/freenet/client/ArchiveHandlerImpl.java
> b/src/freenet/client/ArchiveHandlerImpl.java
> index 56a9b81..e8046ca 100644
> --- a/src/freenet/client/ArchiveHandlerImpl.java
> +++ b/src/freenet/client/ArchiveHandlerImpl.java
> @@ -24,13 +24,7 @@ class ArchiveHandlerImpl implements ArchiveHandler {
>        private static volatile boolean logMINOR;
>
>        static {
> -               Logger.registerLogThresholdCallback(new LogThresholdCallback()
> {
> -
> -                       @Override
> -                       public void shouldUpdate() {
> -                               logMINOR = Logger.shouldLog(Logger.MINOR,
> this);
> -                       }
> -               });
> +               Logger.registerClass(ArchiveHandlerImpl.class);
>        }
>
>        private final FreenetURI key;
>
> Etc.
>
> Logger.registerClass uses JNI and weak references, it is a great thing. It

That's not JNI, ... JNI is native C code.
This is Reflection (
http://java.sun.com/docs/books/tutorial/reflect/index.html )

> could simplify much code as above, but shouldUpdate() is slow because of JNI.
> Given we very rarely change logging settings, is that a problem? How long
> would it take to run the JNI hooks on every class? If it's less than 100ms or
> so, we should use this everywhere.
_______________________________________________
Devl mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to