01: /*
02: * JFox - The most lightweight Java EE Application Server!
03: * more details please visit http://www.huihoo.org/jfox or http://www.jfox.org.cn.
04: *
05: * JFox is licenced and re-distributable under GNU LGPL.
06: */
07: package jfox.test;
08:
09: import org.jfox.framework.annotation.Constant;
10: import org.jfox.framework.annotation.Service;
11: import org.jfox.framework.annotation.Inject;
12: import org.jfox.framework.component.ComponentContext;
13: import org.jfox.framework.component.ComponentInitialization;
14:
15: /**
16: * @author <a href="mailto:jfox.young@gmail.com">Yang Yong</a>
17: */
18: @Service(id="User1")
19: public class User1 implements IUser, ComponentInitialization {
20:
21: @Inject(id="UserManager")
22: IUserManager userMgr;
23:
24: @Constant("World")
25: private String name = "User1";
26:
27: public User1() {
28: }
29:
30: /**
31: * Component 实例化之�的回调方法
32: * �以�实例化之�,set Property 之�的准备工作
33: *
34: * @param componentContext Component context
35: */
36: public void postContruct(ComponentContext componentContext) {
37: }
38:
39: /**
40: * Component 属性设置完毕之�的回调方法
41: * 负责�Properties Set 之�的检查工作,以�� init �作
42: */
43: public void postInject() {
44: userMgr.addUser(this );
45: }
46:
47: public String getName() {
48: return name;
49: }
50:
51: public static void main(String[] args) {
52:
53: }
54: }
|