1 7 package org.jboss.ejb3.dd; 8 9 import java.util.ArrayList ; 10 import java.util.List ; 11 12 import javax.ejb.TransactionManagementType ; 13 14 import org.jboss.logging.Logger; 15 16 23 public abstract class EnterpriseBean 24 { 25 26 private static final Logger log = Logger.getLogger(EnterpriseBean.class); 27 28 private String ejbName = null; 30 31 private String home = null; 32 33 private String remote = null; 34 35 private String localHome = null; 36 37 private String local = null; 38 39 private String ejbClass = null; 40 41 private List <EjbLocalRef> ejbLocalRefs = new ArrayList (); 42 43 private List <EjbRef> ejbRefs = new ArrayList (); 44 45 private List <EnvEntry> envEntries = new ArrayList (); 46 47 private List <ResourceRef> resourceRefs = new ArrayList (); 48 49 private SecurityIdentity securityIdentity; 50 51 protected TransactionManagementType tmType = null; 52 53 private List callbackListeners = new ArrayList (); 54 55 private List interceptors = new ArrayList (); 56 57 private List messageDestinationRefs = new ArrayList (); 58 59 private String jndiName; 61 62 private String localJndiName; 63 64 private String securityDomain; 65 66 private boolean callByValue = false; 67 68 private ClusterConfig clusterConfig = null; 69 70 private String aopDomainName = null; 71 72 public void updateEjbRef(EjbRef updatedRef) 73 { 74 for(EjbRef ref: ejbRefs) 75 { 76 if (ref.getEjbRefName().equals(updatedRef.getEjbRefName())) 77 ref.setJndiName(updatedRef.getJndiName()); 78 } 79 } 80 81 public void updateEjbLocalRef(EjbLocalRef updatedRef) 82 { 83 for(EjbLocalRef ref: ejbLocalRefs) 84 { 85 if (ref.getEjbRefName().equals(updatedRef.getEjbRefName())) 86 ref.setJndiName(updatedRef.getJndiName()); 87 } 88 } 89 90 public void updateResourceRef(ResourceRef updatedRef) 91 { 92 for(ResourceRef ref: resourceRefs) 93 { 94 if (ref.getResRefName().equals(updatedRef.getResRefName())) 95 { 96 ref.setJndiName(updatedRef.getJndiName()); 97 ref.setResourceName(updatedRef.getResourceName()); 98 } 99 } 100 } 101 102 public void setAopDomainName(String aopDomainName) 103 { 104 this.aopDomainName = aopDomainName; 105 } 106 107 public String getAopDomainName() 108 { 109 return aopDomainName; 110 } 111 112 public void setClusterConfig(ClusterConfig clusterConfig) 113 { 114 this.clusterConfig = clusterConfig; 115 } 116 117 public boolean isClustered() 118 { 119 return clusterConfig != null; 120 } 121 122 public ClusterConfig getClusterConfig() 123 { 124 return clusterConfig; 125 } 126 127 public void setRunAsPrincipal(String principal) 128 { 129 if (securityIdentity != null) 130 securityIdentity.setRunAsPrincipal(principal); 131 } 132 133 public void setCallByValue(boolean callByValue) 134 { 135 this.callByValue = callByValue; 136 } 137 138 public boolean isCallByValue() 139 { 140 return callByValue; 141 } 142 143 public String getSecurityDomain() 144 { 145 return securityDomain; 146 } 147 148 public void setSecurityDomain(String securityDomain) 149 { 150 this.securityDomain = securityDomain; 151 } 152 153 public List getMessageDestinationRefs() 154 { 155 return messageDestinationRefs; 156 } 157 158 public void addMessageDestinationRef(MessageDestinationRef messageDestinationRef) 159 { 160 messageDestinationRefs.add(messageDestinationRef); 161 } 162 163 public List getInterceptors() 164 { 165 return interceptors; 166 } 167 168 public void addInterceptor(String interceptor) 169 { 170 interceptors.add(interceptor); 171 } 172 173 public List getCallbackListeners() 174 { 175 return callbackListeners; 176 } 177 178 public void addCallbackListener(String callbackListener) 179 { 180 callbackListeners.add(callbackListener); 181 } 182 183 public String getJndiName() 184 { 185 return jndiName; 186 } 187 188 public void setJndiName(String jndiName) 189 { 190 this.jndiName = jndiName; 191 } 192 193 public String getLocalJndiName() 194 { 195 return localJndiName; 196 } 197 198 public void setLocalJndiName(String localJndiName) 199 { 200 this.localJndiName = localJndiName; 201 } 202 203 public TransactionManagementType getTransactionManagementType() 204 { 205 return tmType; 206 } 207 208 public boolean isSessionBean() 209 { 210 return this instanceof SessionEnterpriseBean; 211 } 212 213 public boolean isEntityBean() 214 { 215 return this instanceof EntityEnterpriseBean; 216 } 217 218 public boolean isMessageDrivenBean() 219 { 220 return this instanceof MessageDrivenBean; 221 } 222 223 public String getEjbName() 224 { 225 return ejbName; 226 } 227 228 public void setEjbName(String ejbName) 229 { 230 this.ejbName = ejbName; 231 } 232 233 public String getHome() 234 { 235 return home; 236 } 237 238 public void setHome(String home) 239 { 240 this.home = home; 241 } 242 243 public String getRemote() 244 { 245 return remote; 246 } 247 248 public void setRemote(String remote) 249 { 250 this.remote = remote; 251 } 252 253 public String getLocalHome() 254 { 255 return localHome; 256 } 257 258 public void setLocalHome(String localHome) 259 { 260 this.localHome = localHome; 261 } 262 263 public String getLocal() 264 { 265 return local; 266 } 267 268 public void setLocal(String local) 269 { 270 this.local = local; 271 } 272 273 public String getEjbClass() 274 { 275 return ejbClass; 276 } 277 278 public void setEjbClass(String ejbClass) 279 { 280 this.ejbClass = ejbClass; 281 } 282 283 public List getEjbLocalRefs() 284 { 285 return ejbLocalRefs; 286 } 287 288 public void setEjbLocalRefs(List ejbLocalRefs) 289 { 290 this.ejbLocalRefs = ejbLocalRefs; 291 } 292 293 public void addEjbLocalRef(EjbLocalRef ref) 294 { 295 ejbLocalRefs.add(ref); 296 } 297 298 public List getEjbRefs() 299 { 300 return ejbRefs; 301 } 302 303 public void setEjbRefs(List ejbRefs) 304 { 305 this.ejbRefs = ejbRefs; 306 } 307 308 public void addEjbRef(EjbRef ref) 309 { 310 ejbRefs.add(ref); 311 } 312 313 public List getEnvEntries() 314 { 315 return envEntries; 316 } 317 318 public void addEnvEntry(EnvEntry entry) 319 { 320 envEntries.add(entry); 321 } 322 323 public List getResourceRefs() 324 { 325 return resourceRefs; 326 } 327 328 public void setResourceRefs(List ejbLocalRefs) 329 { 330 this.resourceRefs = ejbLocalRefs; 331 } 332 333 public void addResourceRef(ResourceRef ref) 334 { 335 resourceRefs.add(ref); 336 } 337 338 public SecurityIdentity getSecurityIdentity() 339 { 340 return securityIdentity; 341 } 342 343 public void setSecurityIdentity(SecurityIdentity securityIdentity) 344 { 345 this.securityIdentity = securityIdentity; 346 } 347 348 public String toString() 349 { 350 StringBuffer sb = new StringBuffer (100); 351 sb.append("ejbName=").append(ejbName); 352 sb.append(",jndiName=").append(jndiName); 353 sb.append(",local=").append(local); 354 sb.append(",remote=").append(remote); 355 sb.append(",home=").append(home); 356 sb.append(",localHome=").append(localHome); 357 sb.append(",ejbClass=").append(ejbClass); 358 return sb.toString(); 359 } 360 } 361 | Popular Tags |