It tends to look like this:

 @Lifecycle("perthread")
   public static HibernateSessionManager
build(@InjectService("HibernateSessionSource")
   HibernateSessionSource sessionSource,

   @InjectService("ThreadCleanupHub")
   ThreadCleanupHub threadCleanupHub)
   {
       HibernateSessionManagerImpl service = new
HibernateSessionManagerImpl(sessionSource);

       threadCleanupHub.addThreadCleanupListener(service);

       return service;
   }

In this example, HibernateSessionManagerImpl implements
ThreadCleanupListener, in addition to HibernateSessionManager.

ThreadCleanupHub is responsible for notifying its listeners at the end
of the request.

With the "perthread" lifecycle, your service builder method is invoked
at most once per request.

On 3/12/07, Weisu <[EMAIL PROTECTED]> wrote:

Hi, I am try to create a perthread service, the following lines are in the
module builder class, how and where can I define cleanupThread() method?

@Lifecycle("perthread")
public static EllipseSession buildEllipseSession()
{
return new EllipseSessionImpl();
}
Thanks.
--
View this message in context: 
http://www.nabble.com/-T5-Ioc-Perthread-service-lifecycle-tf3393129.html#a9446131
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to