KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfox > ioc > sample > SampleComponentC


1 /* JFox, the OpenSource J2EE Application Server
2  *
3  * Distributable under GNU LGPL license by gun.org
4  * more details please visit http://www.huihoo.org/jfox
5  */

6
7 package org.jfox.ioc.sample;
8
9 import org.jfox.ioc.ComponentContext;
10 import org.jfox.ioc.annotation.Managable;
11 import org.jfox.ioc.ext.ActiveComponent;
12 import org.jfox.ioc.ext.ManagableComponent;
13
14 /**
15  * @author <a HREF="mailto:young_yy@hotmail.com">Young Yang</a>
16  */

17
18 public class SampleComponentC implements ManagableComponent, ActiveComponent {
19
20     private int id = 0;
21     private String JavaDoc name = "Hello,World from SampleComponentC";
22     private Long JavaDoc time = new Long JavaDoc(System.currentTimeMillis());
23
24     private ComponentContext ctx;
25
26     @Managable
27     public void setName(String JavaDoc name) {
28         this.name = name;
29     }
30
31     @Managable
32     public String JavaDoc getName() {
33         return name;
34     }
35
36     @Managable
37     public int getId() {
38         return id;
39     }
40
41     @Managable
42     public void setId(int id) {
43         this.id = id;
44     }
45
46     @Managable
47     public void setTime(Long JavaDoc time) {
48         this.time = time;
49     }
50
51     @Managable
52     public Long JavaDoc getTime() {
53         return time;
54     }
55
56     public void setComponentContext(ComponentContext ctx) {
57         this.ctx = ctx;
58     }
59
60     @Managable
61     public String JavaDoc getComponentDir(){
62         return ctx.getModuleDir();
63     }
64
65     public static void main(String JavaDoc[] args) {
66
67     }
68
69 }
70
71
Popular Tags