KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfox > test > User1


1 /*
2  * JFox - The most lightweight Java EE Application Server!
3  * more details please visit http://www.huihoo.org/jfox or http://www.jfox.org.cn.
4  *
5  * JFox is licenced and re-distributable under GNU LGPL.
6  */

7 package jfox.test;
8
9 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(
19         id = "User1")
20 public class User1 implements IUser, ComponentInitialization {
21
22     @Inject(id = "UserManager")
23     IUserManager userMgr;
24
25     @Constant("World")
26     private String JavaDoc name = "User1";
27
28     public User1() {
29     }
30
31
32     /**
33      * Component 实例化之?的回调方法
34      * ?以?实例化之?,set Property 之?的准备工作
35      *
36      * @param componentContext Component context
37      */

38     public void postContruct(ComponentContext componentContext) {
39     }
40
41     /**
42      * Component 属性设置完毕之?的回调方法
43      * 负责?Properties Set 之?的检查工作,以?? init ?作
44      */

45     public void postInject() {
46         userMgr.addUser(this);
47     }
48
49     public String JavaDoc getName() {
50         return name;
51     }
52
53     public static void main(String JavaDoc[] args) {
54
55     }
56 }
57
Popular Tags