Results 1 to 1 of 1
- 09-28-2007, 12:50 PM #1
How to implement Destruction callbacks in Spring Framework
Org.springframework.beans.factory.DisposableBean interface has a following callback method for Bean in container when the container containing this bean is destroyed.
But for the aforementioned reason it should be avoided so following code is much better optionJava Code:void destroy() throws Exception;
Java Code:<bean id="sampleInitBean" class="sample.ExampleBean" destroy-method="cleanup"/> public class SampleBean { public void cleanup() { // destruction code for bean (closing pooled connections etc) } }
Similar Threads
-
How to implement Destruction callbacks in Spring Framework
By Java Tip in forum Java TipReplies: 0Last Post: 03-31-2008, 10:18 AM -
How to use Initialization callbacks in Spring Framework
By Java Tip in forum Java TipReplies: 0Last Post: 03-31-2008, 10:16 AM -
What is weaving in Spring Framework
By Java Tip in forum Java TipReplies: 0Last Post: 03-29-2008, 12:39 PM -
How to use Initialization callbacks in Spring Framework
By JavaBean in forum Java TipReplies: 0Last Post: 09-28-2007, 12:49 PM -
What is weaving in Spring Framework
By JavaBean in forum Java TipReplies: 0Last Post: 09-26-2007, 08:30 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks