tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Using reflection to call tcnative methods
Date Sat, 09 Jul 2011 02:14:53 GMT

I've been working in AprLifecycleListener to add FIPS support. I need to
make an additional native method call in initializeSSL and I'm wondering
why all of the native methods are called using reflection instead of
direct method calls.

The SSL class, for instance, and the AprLifecycleListener are both in
the Tomcat source tree and so they should always be in sync.

The only reason I can think of is that native methods can throw any
exception they want even if they are not declared in the Java stub, and
the InvocationTargetException that wraps any exception through a
reflective call will help avoid any problems. Is that it?

Is that the reason for the reflective calls?

If not, is there another reason?

If there's no good reason, then all the reflective-call clutter should
be removed.


View raw message