| 1 4 package com.tctest.spring.aj; 5 6 import org.springframework.beans.factory.InitializingBean; 7 8 9 public class InstrumentedBean implements InitializingBean, IInstrumentedBean { 10 11 private ConfigurableBean configurableBean; 12 13 private String value; 14 15 private transient String transientValue = "aaa"; 16 17 18 public void afterPropertiesSet() throws Exception { 19 this.configurableBean = new ConfigurableBean(); 20 } 21 22 public String getProperty1() { 23 synchronized(this) { 24 return this.configurableBean.getProperty1(); 25 } 26 } 27 28 public String getProperty2() { 29 synchronized(this) { 30 return this.configurableBean.getProperty2(); 31 } 32 } 33 34 public void setValue(String value) { 35 synchronized(this) { 36 this.value = value; 37 } 38 } 39 40 public Object getValue() { 41 synchronized(this) { 42 return value; 43 } 44 } 45 46 public Object getTransientValue() { 47 return transientValue; 48 } 49 50 public void setTransientValue(String transientValue) { 51 this.transientValue = transientValue; 52 } 53 54 } 55 56 | Popular Tags |