1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| public class Result implements BeanNameAware, BeanFactoryAware, ApplicationContextAware, InitializingBean, DisposableBean {
private String status; private String message;
public String getStatus() { return status; }
public void setStatus(String status) { this.status = status; }
public String getMessage() { return message; }
public void setMessage(String message) { this.message = message; }
@Override public String toString() { return "Result{" + "status='" + status + '\'' + ", message='" + message + '\'' + '}'; }
public void initMethod() { System.out.println("initMethod........"); }
@PostConstruct public void postConstruct() { System.out.println("postConstruct........"); }
@Override public void setBeanName(String name) { System.out.println("注册我成为bean时定义的id:" + name); }
@Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { System.out.println("管理我的beanFactory为" + beanFactory); }
@Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { System.out.println("高级容器接口ApplicationContext:" + applicationContext); }
@Override public void afterPropertiesSet() throws Exception { System.out.println("afterPropertiesSet........"); }
@PreDestroy public void PreDestroy(){ System.out.println("PreDestroy......"); }
@Override public void destroy() throws Exception { System.out.println("destroy......"); } }
|