Shutdown hook for commons-pipeline.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Shutdown hook for commons-pipeline.

rollatwork
I'd like to implement a shutdown hook for commons pipeline so that  
when my service stops it notifies the pipeline to shutdown gracefully.

Something like this, excuse my pseudo :

                Runtime.getRuntime().addShutdownHook(new Thread() {
                  public void run() {
                            getPipelline().finish();
                 }
                });;

Is this a logical way to gracefully stop the pipeline in the event of  
an application shutdown?

Cheers,
Roland

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Shutdown hook for commons-pipeline.

Ken Tanaka
Roland,

I've done work with the pipeline but haven't explored shutting it down
like this. Your pseudocode looks OK to me, and it looks simple enough to
just try on a hello world sort of pipeline. Would you be willing to do
that and post back how it goes?

-Ken

Roland Chan wrote:
> I'd like to implement a shutdown hook for commons pipeline so that
> when my service stops it notifies the pipeline to shutdown gracefully.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]