Workflowclient java api amp servlet

Hai, does anyone ever implements workflowclient java api with servlet?

When I tried to use workflowclient java api in a simple java application. I found out that some background process still alive hence, it does not exit the main thread. So, let’s say if i wanna to put the WFSession instances inside the HTTPSession object, how to stop that background process if I invalidated the session object or when the session object expired.

I appreciated any help or susgestion or any idea…

thanks alot