Thanks, Jerome,

It's good to know I was not too far off course.

What is the benefit of using the Application's getTaskService method, as
opposed to creating a Thread myself and then starting my component-stopper?
I'm currently just using a Component + some Restlets, and would prefer not
to create an Application if I don't need to.

As a bit of background, I'm planning to use the Restlet framework in
getinline2, an embedded Java DSL for record-oriented processing. I've been
very impressed by what I've seen so far.

Regards,  Romilly


2009/3/16 Jerome Louvel <[email protected]>

> Hi Romilly,
>
> Your first solution doesn't work because when you stop the component, it
> stops the connectors and shuts downs the active socket connections
> including
> the one serving your shutdown request.
>
> Your second solution sounds good to me. Make sure you leverage the
> Application#taskService to get your new thread.
>
> Best regards,
> Jerome Louvel
> --
> Restlet ~ Founder and Lead developer ~ http://www.restlet.org
> Noelios Technologies ~ Co-founder ~ http://www.noelios.com
>
>
> -----Message d'origine-----
> De : Romilly Cocking [mailto:[email protected]]
> Envoyé : dimanche 15 mars 2009 12:24
> À : [email protected]
> Objet : RE: InterruptedException when stopping component
>
> I've found a workaround; I start another thread and send stop() to the
> container after a 100 ms delay.
>
> It works, but it's not pretty. Is there a better solution?
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=13264
> 44
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1333512
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1333625

Reply via email to