1 6 package org.jfox.ejb; 7 8 import org.jfox.ioc.connector.ObjectId; 9 import org.jfox.ioc.util.ObjectUUID; 10 11 16 17 public class EJBObjectId extends ObjectId { 18 19 private String ejbName; 20 private String remoteInterf; 21 private String homeInterf; 22 23 private boolean isHome; 24 25 public EJBObjectId(String ejbName, String homeInterf, String remoteInterf, ObjectUUID hash, boolean isHome) { 26 super(hash); 27 this.ejbName = ejbName; 28 this.homeInterf = homeInterf; 29 this.remoteInterf = remoteInterf; 30 this.isHome = isHome; 31 } 32 33 public String toString() { 34 StringBuffer sb = new StringBuffer (); 35 if(isHome) { 36 sb.append(homeInterf); 37 } 38 else { 39 sb.append(remoteInterf); 40 } 41 sb.append("@").append(uuid); 42 return sb.toString(); 43 } 44 45 48 public String getRemoteInterfaceName() { 49 return remoteInterf; 50 } 51 52 public String getHomeInterfName() { 53 return homeInterf; 54 } 55 56 public boolean isHome() { 57 return isHome; 58 } 59 60 public String getEjbName() { 61 return ejbName; 62 } 63 64 public int hashCode() { 65 return uuid.hashCode(); 66 } 67 68 71 public String getStringObjectId() { 72 return this.toString(); 73 } 74 75 public ObjectUUID getObjectUUID() { 76 return uuid; 77 } 78 79 public byte[] getAddress() { 80 return uuid.getVMID().getAddress(); 81 } 82 83 88 public boolean isCurrentVM() { 89 return uuid.getVMID().isCurrentVM(); 90 } 91 92 public boolean equals(Object obj) { 93 if(!(obj instanceof EJBObjectId)) return false; 94 return ((EJBObjectId) obj).getStringObjectId().equals(this.getStringObjectId()); 95 } 96 97 102 103 } 104 | Popular Tags |