You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Gilbert Kwan <gi...@gmail.com> on 2008/04/09 21:26:13 UTC
When is @Destroy called for @Scope("REQUEST")?
I am curious why the destroy method was not called for @Scope("REQUEST").
Service Definition:
=============
@Scope("REQUEST")
public class AServiceImpl implements AService {
@Init
public void init() {
System.out.println("init()");
}
@Destroy
public void destroy() {
System.out.println("destroy()");
}
public void xxx() {
System.out.println("xxx()"); }
}
Client called:
=========
System.out.println("Setting up");
domain = SCADomain.newInstance(compositeName);
aService = domain.getService(AService.class, "AService");
aService.xxx();
System.out.println("Cleaning up");
if (domain != null)
domain.close();
Output:
======
Setting up
init()
xxx()
Cleaning up
Is it the proper behaviour?
When I changed to other scope type, I could see the destroy method be called.
Gilbert
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org
Re: When is @Destroy called for @Scope("REQUEST")?
Posted by Vamsavardhana Reddy <c1...@gmail.com>.
On Thu, Apr 10, 2008 at 8:36 AM, Raymond Feng <en...@gmail.com> wrote:
> Hi,
>
> It seems to be a bug. The @Init method
You mean the @Destroy method!
> should be called upon the end of the scope. For request, it's the thread.
> Can you open a JIRA to track it?
>
> Thanks,
> Raymond
>
> --------------------------------------------------
> From: "Gilbert Kwan" <gi...@gmail.com>
> Sent: Wednesday, April 09, 2008 12:26 PM
> To: <tu...@ws.apache.org>
> Subject: When is @Destroy called for @Scope("REQUEST")?
>
>
> I am curious why the destroy method was not called for @Scope("REQUEST").
> >
> > Service Definition:
> > =============
> > @Scope("REQUEST")
> > public class AServiceImpl implements AService {
> >
> > @Init
> > public void init() {
> > System.out.println("init()");
> > }
> >
> > @Destroy
> > public void destroy() {
> > System.out.println("destroy()");
> > }
> >
> > public void xxx() {
> > System.out.println("xxx()"); }
> > }
> >
> >
> > Client called:
> > =========
> > System.out.println("Setting up");
> > domain = SCADomain.newInstance(compositeName);
> > aService = domain.getService(AService.class, "AService");
> > aService.xxx();
> > System.out.println("Cleaning up");
> > if (domain != null)
> > domain.close();
> >
> > Output:
> > ======
> > Setting up
> > init()
> > xxx()
> > Cleaning up
> >
> >
> > Is it the proper behaviour?
> > When I changed to other scope type, I could see the destroy method be
> > called.
> >
> > Gilbert
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-user-help@ws.apache.org
> >
> >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>
Re: When is @Destroy called for @Scope("REQUEST")?
Posted by Raymond Feng <en...@gmail.com>.
Hi,
It seems to be a bug. The @Init method should be called upon the end of the
scope. For request, it's the thread. Can you open a JIRA to track it?
Thanks,
Raymond
--------------------------------------------------
From: "Gilbert Kwan" <gi...@gmail.com>
Sent: Wednesday, April 09, 2008 12:26 PM
To: <tu...@ws.apache.org>
Subject: When is @Destroy called for @Scope("REQUEST")?
> I am curious why the destroy method was not called for @Scope("REQUEST").
>
> Service Definition:
> =============
> @Scope("REQUEST")
> public class AServiceImpl implements AService {
>
> @Init
> public void init() {
> System.out.println("init()");
> }
>
> @Destroy
> public void destroy() {
> System.out.println("destroy()");
> }
>
> public void xxx() {
> System.out.println("xxx()"); }
> }
>
>
> Client called:
> =========
> System.out.println("Setting up");
> domain = SCADomain.newInstance(compositeName);
> aService = domain.getService(AService.class, "AService");
> aService.xxx();
> System.out.println("Cleaning up");
> if (domain != null)
> domain.close();
>
> Output:
> ======
> Setting up
> init()
> xxx()
> Cleaning up
>
>
> Is it the proper behaviour?
> When I changed to other scope type, I could see the destroy method be
> called.
>
> Gilbert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org