You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by William Tam <em...@gmail.com> on 2007/10/05 04:49:00 UTC

VmComponent

We might want to add this to VmComponent as a way to clear out the
static Map of BlockingQueues.   Notice that once the vm component has
been stopped, entriies in the queues are deleted.  Starting it again
will start with a clean slate.

    @Override
    protected void doStop() throws Exception {
        super.doStop();
        synchronized (queues) {
            for (BlockingQueue q : queues.values()) {
                q.clear();
            }
            queues.clear();
        }
    }

Re: VmComponent

Posted by William Tam <em...@gmail.com>.
Good call. Thanks.

On 10/5/07, Hiram Chirino <hi...@hiramchirino.com> wrote:
> commited in rev 582282
>
> On 10/5/07, Hiram Chirino <hi...@hiramchirino.com> wrote:
> > Hi William,
> >
> > Actually that only makes sense if we keep a global reference counter
> > too.  Cause we only want to clear out the queues once the last
> > instance of the Vm component is shutdown.
> >
> > Will work on it in a bit.
> >
> > On 10/4/07, William Tam <em...@gmail.com> wrote:
> > > We might want to add this to VmComponent as a way to clear out the
> > > static Map of BlockingQueues.   Notice that once the vm component has
> > > been stopped, entriies in the queues are deleted.  Starting it again
> > > will start with a clean slate.
> > >
> > >     @Override
> > >     protected void doStop() throws Exception {
> > >         super.doStop();
> > >         synchronized (queues) {
> > >             for (BlockingQueue q : queues.values()) {
> > >                 q.clear();
> > >             }
> > >             queues.clear();
> > >         }
> > >     }
> > >
> >
> >
> > --
> > Regards,
> > Hiram
> >
> > Blog: http://hiramchirino.com
> >
>
>
> --
> Regards,
> Hiram
>
> Blog: http://hiramchirino.com
>

Re: VmComponent

Posted by Hiram Chirino <hi...@hiramchirino.com>.
commited in rev 582282

On 10/5/07, Hiram Chirino <hi...@hiramchirino.com> wrote:
> Hi William,
>
> Actually that only makes sense if we keep a global reference counter
> too.  Cause we only want to clear out the queues once the last
> instance of the Vm component is shutdown.
>
> Will work on it in a bit.
>
> On 10/4/07, William Tam <em...@gmail.com> wrote:
> > We might want to add this to VmComponent as a way to clear out the
> > static Map of BlockingQueues.   Notice that once the vm component has
> > been stopped, entriies in the queues are deleted.  Starting it again
> > will start with a clean slate.
> >
> >     @Override
> >     protected void doStop() throws Exception {
> >         super.doStop();
> >         synchronized (queues) {
> >             for (BlockingQueue q : queues.values()) {
> >                 q.clear();
> >             }
> >             queues.clear();
> >         }
> >     }
> >
>
>
> --
> Regards,
> Hiram
>
> Blog: http://hiramchirino.com
>


-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Re: VmComponent

Posted by Hiram Chirino <hi...@hiramchirino.com>.
Hi William,

Actually that only makes sense if we keep a global reference counter
too.  Cause we only want to clear out the queues once the last
instance of the Vm component is shutdown.

Will work on it in a bit.

On 10/4/07, William Tam <em...@gmail.com> wrote:
> We might want to add this to VmComponent as a way to clear out the
> static Map of BlockingQueues.   Notice that once the vm component has
> been stopped, entriies in the queues are deleted.  Starting it again
> will start with a clean slate.
>
>     @Override
>     protected void doStop() throws Exception {
>         super.doStop();
>         synchronized (queues) {
>             for (BlockingQueue q : queues.values()) {
>                 q.clear();
>             }
>             queues.clear();
>         }
>     }
>


-- 
Regards,
Hiram

Blog: http://hiramchirino.com