1 25 26 package org.objectweb.easybeans.rpc; 27 28 import javax.naming.NamingException ; 29 import javax.naming.Reference ; 30 import javax.naming.Referenceable ; 31 import javax.naming.StringRefAddr ; 32 33 37 public abstract class AbsCallRef implements Referenceable { 38 39 42 public static final String CONTAINER_ID = "containerID"; 43 44 47 public static final String FACTORY_NAME = "factoryName"; 48 49 52 public static final String INTERFACE_NAME = "interfaceClassName"; 53 54 57 public static final String USE_ID = "useID"; 58 59 62 private String itfClassName = null; 63 64 67 private String containerId = null; 68 69 72 private String factoryName = null; 73 74 77 private boolean useID; 78 79 87 public AbsCallRef(final String itfClassName, final String containerId, final String factoryName, final boolean useID) { 88 this.itfClassName = itfClassName; 89 this.containerId = containerId; 90 this.factoryName = factoryName; 91 this.useID = useID; 92 } 93 94 100 public abstract Reference getReference() throws NamingException ; 101 102 103 108 protected Reference updateRefAddr(final Reference reference) { 109 reference.add(new StringRefAddr (CONTAINER_ID, containerId)); 110 reference.add(new StringRefAddr (FACTORY_NAME, factoryName)); 111 reference.add(new StringRefAddr (INTERFACE_NAME, itfClassName)); 112 reference.add(new StringRefAddr (USE_ID, Boolean.toString(useID))); 113 return reference; 114 } 115 116 120 public String getItfClassName() { 121 return itfClassName; 122 } 123 124 125 } 126 | Popular Tags |