You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by "Soltysik, Seumas" <Se...@iona.com> on 2007/06/21 00:10:22 UTC

Unused parameter in CXFBusImpl.shutdown(boolean wait)

Currently CXFBusImpl.shutdown(boolean wait) takes an unused wait parameter. Is there any intent to make use of this parameter? If not, it should be removed.
Regards,
Seumas

    public void shutdown(boolean wait) {
        lifeCycleManager = this.getExtension(BusLifeCycleManager.class);
        if (null != lifeCycleManager) {
            lifeCycleManager.preShutdown();
        }
        synchronized (this) {
            state = BusState.SHUTDOWN;
            notifyAll();
        }
        if (null != lifeCycleManager) {
            lifeCycleManager.postShutdown();
        }
        if (BusFactory.getDefaultBus(false) == this) { 
            BusFactory.setDefaultBus(null);
        }
    }

Re: Unused parameter in CXFBusImpl.shutdown(boolean wait)

Posted by Polar Humenn <ph...@iona.com>.
Isn't this parameter supposed to mean that when you shut the bus down, 
and wait is true,
this call should not return until all "work" is done, i.e. requests 
serviced, etc.?

I would think that something's a miss here.

Cheers,
-Polar

Soltysik, Seumas wrote:
> Currently CXFBusImpl.shutdown(boolean wait) takes an unused wait parameter. Is there any intent to make use of this parameter? If not, it should be removed.
> Regards,
> Seumas
>
>     public void shutdown(boolean wait) {
>         lifeCycleManager = this.getExtension(BusLifeCycleManager.class);
>         if (null != lifeCycleManager) {
>             lifeCycleManager.preShutdown();
>         }
>         synchronized (this) {
>             state = BusState.SHUTDOWN;
>             notifyAll();
>         }
>         if (null != lifeCycleManager) {
>             lifeCycleManager.postShutdown();
>         }
>         if (BusFactory.getDefaultBus(false) == this) { 
>             BusFactory.setDefaultBus(null);
>         }
>     }
>
>   

Re: Unused parameter in CXFBusImpl.shutdown(boolean wait)

Posted by Polar Humenn <ph...@iona.com>.
Seumas,

The "shudown(boolean wait)" operation is part of the org.apache.cxf.Bus 
interface, which the CXFBusImpl implements. You can't take the "wait" 
parameter out of it.

Cheers,
-Polar

Soltysik, Seumas wrote:
> Hi Willem,
> Potentially this is a valid parameter, but since it is not used, it should not be a parameter. I am surprised there is not a checkstyle rule to check for un-used parameters.
> Regards,
> Seumas
>
> -----Original Message-----
> From: Willem Jiang [mailto:ning.jiang@iona.com]
> Sent: Thursday, June 21, 2007 5:15 AM
> To: cxf-dev@incubator.apache.org
> Subject: Re: Unused parameter in CXFBusImpl.shutdown(boolean wait)
>
>
> Hi Seumas,
>
> I just has a use case for want to call Bus.shutdown(true)  when the 
> WorkQueue still has jobs to do.
>
> Any thoughts?
>
> Willem.
>
> Soltysik, Seumas wrote:
>   
>> Currently CXFBusImpl.shutdown(boolean wait) takes an unused wait parameter. Is there any intent to make use of this parameter? If not, it should be removed.
>> Regards,
>> Seumas
>>
>>     public void shutdown(boolean wait) {
>>         lifeCycleManager = this.getExtension(BusLifeCycleManager.class);
>>         if (null != lifeCycleManager) {
>>             lifeCycleManager.preShutdown();
>>         }
>>         synchronized (this) {
>>             state = BusState.SHUTDOWN;
>>             notifyAll();
>>         }
>>         if (null != lifeCycleManager) {
>>             lifeCycleManager.postShutdown();
>>         }
>>         if (BusFactory.getDefaultBus(false) == this) { 
>>             BusFactory.setDefaultBus(null);
>>         }
>>     }
>>
>>   
>>     

RE: Unused parameter in CXFBusImpl.shutdown(boolean wait)

Posted by "Soltysik, Seumas" <Se...@iona.com>.
Hi Willem,
Potentially this is a valid parameter, but since it is not used, it should not be a parameter. I am surprised there is not a checkstyle rule to check for un-used parameters.
Regards,
Seumas

-----Original Message-----
From: Willem Jiang [mailto:ning.jiang@iona.com]
Sent: Thursday, June 21, 2007 5:15 AM
To: cxf-dev@incubator.apache.org
Subject: Re: Unused parameter in CXFBusImpl.shutdown(boolean wait)


Hi Seumas,

I just has a use case for want to call Bus.shutdown(true)  when the 
WorkQueue still has jobs to do.

Any thoughts?

Willem.

Soltysik, Seumas wrote:
> Currently CXFBusImpl.shutdown(boolean wait) takes an unused wait parameter. Is there any intent to make use of this parameter? If not, it should be removed.
> Regards,
> Seumas
>
>     public void shutdown(boolean wait) {
>         lifeCycleManager = this.getExtension(BusLifeCycleManager.class);
>         if (null != lifeCycleManager) {
>             lifeCycleManager.preShutdown();
>         }
>         synchronized (this) {
>             state = BusState.SHUTDOWN;
>             notifyAll();
>         }
>         if (null != lifeCycleManager) {
>             lifeCycleManager.postShutdown();
>         }
>         if (BusFactory.getDefaultBus(false) == this) { 
>             BusFactory.setDefaultBus(null);
>         }
>     }
>
>   

Re: Unused parameter in CXFBusImpl.shutdown(boolean wait)

Posted by Willem Jiang <ni...@iona.com>.
Hi Seumas,

I just has a use case for want to call Bus.shutdown(true)  when the 
WorkQueue still has jobs to do.

Any thoughts?

Willem.

Soltysik, Seumas wrote:
> Currently CXFBusImpl.shutdown(boolean wait) takes an unused wait parameter. Is there any intent to make use of this parameter? If not, it should be removed.
> Regards,
> Seumas
>
>     public void shutdown(boolean wait) {
>         lifeCycleManager = this.getExtension(BusLifeCycleManager.class);
>         if (null != lifeCycleManager) {
>             lifeCycleManager.preShutdown();
>         }
>         synchronized (this) {
>             state = BusState.SHUTDOWN;
>             notifyAll();
>         }
>         if (null != lifeCycleManager) {
>             lifeCycleManager.postShutdown();
>         }
>         if (BusFactory.getDefaultBus(false) == this) { 
>             BusFactory.setDefaultBus(null);
>         }
>     }
>
>