You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Christopher Schultz <ch...@christopherschultz.net> on 2012/04/25 22:43:14 UTC

Problem back-porting r1298479

All,

I'm trying to back-port r1298479 (and several other clean-up patches) to
tc6.0.x but there seems to be some impedence in RealmBase.

In 7.0.x and trunk, RealmBase implements LifecycleMBeanBase which has an
"initInternal" method while in 6.0.x, RealmBase has no superclass (well,
java.lang.Object) and thus no method.

Where is the best place to put something that "goes into" initInternal?

It looks like RealmBase in 6.0.x implements Lifecycle's interface
manually and there *is* an init() method called from Lifecycle.start().
That seems to be to be the natural place to put this in the absence of
the initInternal method being available.

Any comments?

Thanks,
-chris


Re: Problem back-porting r1298479

Posted by Christopher Schultz <ch...@christopherschultz.net>.
All,

On 4/25/12 4:43 PM, Christopher Schultz wrote:
> It looks like RealmBase in 6.0.x implements Lifecycle's interface
> manually and there *is* an init() method called from Lifecycle.start().
> That seems to be to be the natural place to put this in the absence of
> the initInternal method being available.

One problem with simply moving the call to RealmBase.init is that in
6.0.x, RealmBase.init() doesn't include LifecycleException in its throws
clause (there is no throws clause).

I suspect that adding "throws LifecycleException" would be a potentially
breaking-change since it's a public method. Instead, I'll have to catch
LifecycleException and then ... I'm not sure. The only other problems
handled in RealmBase.init are for MBean registration whick I wouldn't
consider to be fatal (and neither does that code). Not being able to
initialize the "username retriever" (this is an x509 thing) basically
means that the Realm isn't going to work at all, so this should be fatal.

Is there a policy or convention for indicating failure when there are no
checked exceptions available in the method declaration?
IllegalStateException?

Thanks,
-chris