Bill Barker wrote:
>> Index: CoyoteConnector.java
>> ===================================================================
>> @@ -1062,11 +1062,12 @@
>> * Initialize this connector (create ServerSocket here!)
>> */
>> public void initialize()
>> - throws LifecycleException {
>> -
>> - if (initialized)
>> - throw new LifecycleException
>> - (sm.getString("coyoteConnector.alreadyInitialized"));
>> + throws LifecycleException
>> + {
>> + if (initialized) {
>> +
> log.info(sm.getString("coyoteConnector.alreadyInitialized"));
>> + return;
>> + }
>
> I'm not sure that I'm happy with this. Throwing an exception seems much
> cleaner than logging at a low level and pretending to be happy with
> everything.
>
> This isn't a veto, since I haven't looked into the callers enough (yet) to
> know what changes. But it is a very big red-flag.
The problem is that right now init/start are called twice in JMX mode -
and I couldn't find any simple way to avoid this ( that wouldn't break too
much ).
If you load a connector as a MBean, the JMX container will take care of its
lifecycle - this way the connector could be unloaded/reloaded under JMX
control just like any other jmx component. But tomcat requires the
connector to be registered in Service, and Service will also call
init/stat/stop on it.
I think supporting both operating modes is quite important, so please
let's not throw exceptions for a while. Having init() called twice
is really not that bad - it may be a sign that the container is confused (
which is very true :-), but the component doesn't have to throw errors.
The best would be to find a better solution to deal with the lifecycle -
if the JMX container manages a component, Service shouldn't be used.
Costin
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]