KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tctest > spring > bean > DisposableService


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tctest.spring.bean;
5
6 import org.springframework.beans.factory.DisposableBean;
7 import org.springframework.beans.factory.InitializingBean;
8
9 public class DisposableService implements InitializingBean, DisposableBean {
10
11   private transient String JavaDoc name = "disposable";
12
13   private transient String JavaDoc foo;
14
15   public transient static DisposableService afterPropertiesSetThis;
16   public transient static DisposableService destroyThis;
17
18   public String JavaDoc getName() {
19     return name;
20   }
21
22   public String JavaDoc getFoo() {
23     return foo;
24   }
25   
26   public void afterPropertiesSet() throws Exception JavaDoc {
27     this.foo = "bar";
28     afterPropertiesSetThis = this;
29     
30   }
31
32   public void destroy() throws Exception JavaDoc {
33     this.name = null;
34     destroyThis = this;
35     if (foo == null) throw new RuntimeException JavaDoc("foo is null");
36   }
37
38 }
39
Popular Tags