KickJava   Java API By Example, From Geeks To Geeks.

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


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.Component;
10 import org.jfox.ioc.ComponentContext;
11 import org.jfox.ioc.annotation.Managable;
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 SampleComponentB implements ManagableComponent {
19
20     private int id = 0;
21     private String JavaDoc name = "Hello,World from SampleComponentB";
22     private Long JavaDoc time = new Long JavaDoc(System.currentTimeMillis());
23
24     private ComponentContext ctx;
25
26     private Component dependComponent = null;
27
28     public void setDependentComponent(Component comp){
29         this.dependComponent = comp;
30     }
31
32     @Managable
33     public Component getDependentComponent() {
34         return dependComponent;
35     }
36
37     @Managable
38     public void setName(String JavaDoc name) {
39         this.name = name;
40     }
41
42     @Managable
43     public String JavaDoc getName() {
44         return name;
45     }
46
47     @Managable
48     public int getId() {
49         return id;
50     }
51
52     @Managable
53     public void setId(int id) {
54         this.id = id;
55     }
56
57     @Managable
58     public void setTime(Long JavaDoc time) {
59         this.time = time;
60     }
61
62     @Managable
63     public Long JavaDoc getTime() {
64         return time;
65     }
66
67     public void setComponentContext(ComponentContext ctx) {
68         this.ctx = ctx;
69     }
70
71     @Managable
72     public String JavaDoc getComponentDir(){
73         return ctx.getModuleDir();
74     }
75
76     public static void main(String JavaDoc[] args) {
77
78     }
79
80 }
81
82
Popular Tags