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.InitializingBean;
07:
08: import com.tc.aspectwerkz.proxy.Uuid;
09:
10: public class SimpleInitializingSingleton implements InitializingBean,
11: ISimpleInitializingSingleton {
12: public static final String ME = "me";
13: private transient long id = System.identityHashCode(this )
14: + Uuid.newUuid();
15:
16: public static ISimpleInitializingSingleton afterPropertiesSetThis;
17: private String name;
18:
19: public void afterPropertiesSet() throws Exception {
20: afterPropertiesSetThis = this ;
21: this .name = ME;
22: }
23:
24: public String getName() {
25: return name;
26: }
27:
28: public long getId() {
29: return id;
30: }
31:
32: public long getInnerId() {
33: return afterPropertiesSetThis.getId();
34: }
35:
36: public boolean isTheSameInstance() {
37: return afterPropertiesSetThis == this;
38: }
39: }
|