1 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 17 18 public class SampleComponentB implements ManagableComponent { 19 20 private int id = 0; 21 private String name = "Hello,World from SampleComponentB"; 22 private Long time = new Long (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 name) { 39 this.name = name; 40 } 41 42 @Managable 43 public String 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 time) { 59 this.time = time; 60 } 61 62 @Managable 63 public Long getTime() { 64 return time; 65 } 66 67 public void setComponentContext(ComponentContext ctx) { 68 this.ctx = ctx; 69 } 70 71 @Managable 72 public String getComponentDir(){ 73 return ctx.getModuleDir(); 74 } 75 76 public static void main(String [] args) { 77 78 } 79 80 } 81 82 | Popular Tags |