On Thu, Apr 10, 2008 at 8:36 AM, Raymond Feng <[EMAIL PROTECTED]> 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" <[EMAIL PROTECTED]> > Sent: Wednesday, April 09, 2008 12:26 PM > To: <tuscany-user@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: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >