1 23 package com.sun.enterprise.deployment; 24 25 import java.util.Set ; 26 import java.util.HashSet ; 27 28 33 34 public abstract class EjbAbstractDescriptor extends Descriptor implements NamedDescriptor { 35 private String homeClassName; 36 private String remoteClassName; 37 private String localHomeClassName; 38 private String localClassName; 39 40 private Set <String > remoteBusinessClassNames = new HashSet <String >(); 41 private Set <String > localBusinessClassNames = new HashSet <String >(); 42 43 private String webServiceEndpointInterfaceName; 46 47 private String jndiName = ""; 48 private String mappedName = ""; 49 50 51 54 public EjbAbstractDescriptor() { 55 } 56 57 60 protected EjbAbstractDescriptor(EjbAbstractDescriptor other) { 61 super(other); 62 this.homeClassName = other.homeClassName; 63 this.remoteClassName = other.remoteClassName; 64 this.remoteBusinessClassNames = 65 new HashSet <String >(other.remoteBusinessClassNames); 66 this.localHomeClassName = other.localHomeClassName; 67 this.localClassName = other.localClassName; 68 this.localBusinessClassNames = 69 new HashSet <String >(other.localBusinessClassNames); 70 this.webServiceEndpointInterfaceName = 71 other.webServiceEndpointInterfaceName; 72 this.jndiName = other.jndiName; 73 } 74 75 76 public abstract String getType(); 77 public abstract void setType(String type); 78 79 82 public String getHomeClassName() { 83 return this.homeClassName; 84 } 85 86 89 public void setHomeClassName(String homeClassName) { 90 this.homeClassName = homeClassName; 91 } 92 93 96 public void setRemoteClassName(String remoteClassName) { 97 this.remoteClassName = remoteClassName; 98 } 99 100 101 104 public String getRemoteClassName() { 105 return this.remoteClassName; 106 } 107 108 113 public void setLocalHomeClassName(String localHomeClassName) { 114 this.localHomeClassName = localHomeClassName; 115 } 116 117 120 public String getLocalHomeClassName() { 121 return localHomeClassName; 122 } 123 124 129 public void setLocalClassName(String localClassName) { 130 this.localClassName = localClassName; 131 } 132 133 136 public String getLocalClassName() { 137 return localClassName; 138 } 139 140 public void addRemoteBusinessClassName(String className) { 141 remoteBusinessClassNames.add(className); 142 } 143 144 public void addLocalBusinessClassName(String className) { 145 localBusinessClassNames.add(className); 146 } 147 148 153 public Set <String > getRemoteBusinessClassNames() { 154 return new HashSet <String >( remoteBusinessClassNames ); 155 } 156 157 162 public Set <String > getLocalBusinessClassNames() { 163 return new HashSet <String >( localBusinessClassNames ); 164 } 165 166 public void setWebServiceEndpointInterfaceName(String name) { 167 this.webServiceEndpointInterfaceName = name; 168 } 169 170 public String getWebServiceEndpointInterfaceName() { 171 return webServiceEndpointInterfaceName; 172 } 173 174 177 public String getJndiName() { 178 if (this.jndiName == null) { 179 this.jndiName = ""; 180 } 181 return (jndiName != null && jndiName.length() > 0)? 182 jndiName : getMappedName(); 183 } 184 185 188 public void setJndiName(String jndiName) { 189 this.jndiName = jndiName; 190 if (this.getName().equals("")) { 191 super.setName(jndiName); 192 } 193 this.changed(); 194 } 195 196 public String getMappedName() { 197 return (mappedName != null)? mappedName : ""; 198 } 199 200 public void setMappedName(String mappedName) { 201 this.mappedName = mappedName; 202 this.changed(); 203 } 204 205 208 public void print(StringBuffer toStringBuffer) { 209 super.print(toStringBuffer); 210 toStringBuffer.append("\n homeClassName ").append(homeClassName); 211 toStringBuffer.append("\n remoteClassName ").append(remoteClassName); 212 toStringBuffer.append("\n remoteBusinessIntfs ").append(remoteBusinessClassNames).append("\n"); 213 toStringBuffer.append("\n localhomeClassName ").append(localHomeClassName); 214 toStringBuffer.append("\n localClassName ").append(localClassName); 215 toStringBuffer.append("\n localBusinessIntfs ").append(localBusinessClassNames).append("\n"); 216 toStringBuffer.append("\n jndiName ").append(jndiName).append("\n"); 217 } 218 219 222 public boolean isLocalInterfacesSupported() { 223 return (getLocalHomeClassName() != null); 224 } 225 226 229 public boolean isLocalBusinessInterfacesSupported() { 230 return (localBusinessClassNames.size() > 0); 231 } 232 233 236 public boolean isRemoteInterfacesSupported() { 237 return (getHomeClassName() != null); 238 } 239 240 243 public boolean isRemoteBusinessInterfacesSupported() { 244 return (remoteBusinessClassNames.size() > 0); 245 } 246 247 248 251 public boolean hasWebServiceEndpointInterface() { 252 return (getWebServiceEndpointInterfaceName() != null); 253 } 254 255 } 256 257 | Popular Tags |