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 org.jfox.framework;
08:
09: /**
10: * ComponentId 由Module和Name共�组�
11: * Component之间相互引用的时候,�是通过 ComponentId 引用
12: * è¿™æ ·çš„å¼±å¼•ç”¨ä½¿å¾— Module 动æ€?部署以å?Šå¼•ç”¨çš„切æ?¢æˆ?为å?¯èƒ½
13: *
14: * @author <a href="mailto:jfox.young@gmail.com">Young Yang</a>
15: */
16: public class ComponentId {
17: /**
18: * 注册Component时使用的å??称,用æ?¥åŒºåˆ†å?Œä¸€ä¸ªComponent类型的ä¸?å?Œæ³¨å†Œ
19: */
20: private String name = "";
21:
22: private String moduleName = "";
23:
24: public ComponentId(String name) {
25: this .name = name;
26: }
27:
28: public String getName() {
29: return name;
30: }
31:
32: public String getModuleName() {
33: return moduleName;
34: }
35:
36: public void setModuleName(String moduleName) {
37: this .moduleName = moduleName;
38: }
39:
40: /*
41: public String getModule() {
42: return module;
43: }
44: */
45:
46: public String toString() {
47: return "ComponentId {" + getName() + "}";
48: }
49:
50: public boolean equals(Object o) {
51: if (this == o)
52: return true;
53: if (o == null || getClass() != o.getClass())
54: return false;
55:
56: ComponentId that = (ComponentId) o;
57:
58: return name.equals(that.name)
59: && moduleName.equals(that.moduleName);
60: }
61:
62: public int hashCode() {
63: return name.hashCode() + moduleName.hashCode();
64: }
65:
66: public static void main(String[] args) {
67:
68: }
69: }
|