tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <>
Subject Re: How to remove stateful sessions programmatically ?
Date Tue, 21 Oct 2008 01:04:52 GMT

On Oct 20, 2008, at 2:21 AM, Jean-Sébastien Scrève wrote:

> Well, I don't see any simple way of doing it.
> I'm gonna do like in Seam : lookup for a method annotated @Remove  
> with no
> parameters and call it if present.

If you don't mind being bound to OpenEJB internals, you could grab the  
CoreDeploymentInfo object for the bean and call this method:

     public List<Method> getRemoveMethods() {
         return removeMethods;

Then invoke one of those methods on the stateful bean proxy.  This of  
course won't work if the bean didn't declare any remove methods via  
annotation in it or it's parent class or via the xml deployment  

But as I stated before, if you had some sort of need to be able to  
flush instances without the consent of the bean developer we might be  
able to think of something if you wanted to describe the motivation of  
the use case (tooling issue, runtime thing, memory management issue,  
etc. etc.)


View raw message