Thanks Howard, that works.

Howard Lewis Ship wrote:
> 
> Sorry, that was SVN trunk code (i.e., 5.0.3-SNAPSHOT), for 5.0.2 the
> service id is "tapestry.ioc.ThreadCleanupHub".
> 
> On 3/12/07, Weisu <[EMAIL PROTECTED]> wrote:
>>
>> Thanks Howard, but I got this msg: Error invoking service builder method
>> com.mainco.ellipse.services.AppModule.buildEllipseSession(ThreadCleanupHub)
>> (for service 'app.EllipseSession'): Service 'app.ThreadCleanupHub' does
>> not
>> exist.
>> This is my code:
>> @Lifecycle("perthread")
>> public static EllipseSession
>> buildEllipseSession(@InjectService("ThreadCleanupHub") ThreadCleanupHub
>> threadCleanupHub)
>>         {
>>         EllipseSessionImpl service = new EllipseSessionImpl();
>>
>>         threadCleanupHub.addThreadCleanupListener(service);
>>
>>         return service;
>>
>>         }
>>
>> Howard Lewis Ship wrote:
>> >
>> > 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]
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-T5-Ioc-Perthread-service-lifecycle-tf3393129.html#a9446675
>> 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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-T5-Ioc-Perthread-service-lifecycle-tf3393129.html#a9447486
Sent from the Tapestry - User mailing list archive at Nabble.com.


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

Reply via email to