01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tctest.spring.bean;
05:
06: import org.springframework.beans.factory.DisposableBean;
07: import org.springframework.beans.factory.InitializingBean;
08:
09: public class DisposableService implements InitializingBean,
10: DisposableBean {
11:
12: private transient String name = "disposable";
13:
14: private transient String foo;
15:
16: public transient static DisposableService afterPropertiesSetThis;
17: public transient static DisposableService destroyThis;
18:
19: public String getName() {
20: return name;
21: }
22:
23: public String getFoo() {
24: return foo;
25: }
26:
27: public void afterPropertiesSet() throws Exception {
28: this .foo = "bar";
29: afterPropertiesSetThis = this ;
30:
31: }
32:
33: public void destroy() throws Exception {
34: this .name = null;
35: destroyThis = this ;
36: if (foo == null)
37: throw new RuntimeException("foo is null");
38: }
39:
40: }
|