1 23 package com.sun.enterprise.deployment; 24 25 import com.sun.enterprise.deployment.JmsDestinationReference; 26 27 32 33 public class JmsDestinationReferenceDescriptor extends EnvironmentProperty implements NamedDescriptor, JmsDestinationReference { 34 35 private String refType; 36 37 private static final String SESSION_CTX_TYPE = "javax.ejb.SessionContext"; 38 private static final String MDB_CTX_TYPE ="javax.ejb.MessageDrivenContext"; 39 private static final String EJB_CTX_TYPE ="javax.ejb.EJBContext"; 40 private static final String EJB_TIMER_SERVICE_TYPE 41 = "javax.ejb.TimerService"; 42 43 public JmsDestinationReferenceDescriptor() { 44 } 45 46 public JmsDestinationReferenceDescriptor(String name, String description, String refType) { 47 super(name, "", description); 48 this.refType = refType; 49 } 50 51 public void setRefType(String refType) { 52 this.refType = refType; 53 this.changed(); 54 } 55 56 public String getRefType() { 57 return this.refType; 58 } 59 60 public String getInjectResourceType() { 61 return getRefType(); 62 } 63 64 public void setInjectResourceType(String refType) { 65 setRefType(refType); 66 } 67 68 71 public String getJndiName() { 72 String jndiName = this.getValue(); 73 return (jndiName != null && ! jndiName.equals("")) ? 74 jndiName : getMappedName(); 75 } 76 77 80 public void setJndiName(String jndiName) { 81 this.setValue(jndiName); 82 } 83 84 public boolean isEJBContext() { 85 return (getRefType().equals(SESSION_CTX_TYPE) || 86 getRefType().equals(MDB_CTX_TYPE) || 87 getRefType().equals(EJB_CTX_TYPE) || 88 getRefType().equals(EJB_TIMER_SERVICE_TYPE)); 89 } 90 91 92 public boolean equals(Object object) { 93 if (object instanceof JmsDestinationReference) { 94 JmsDestinationReference destReference = (JmsDestinationReference) object; 95 return destReference.getName().equals(this.getName()); 96 } 97 return false; 98 } 99 } 100 | Popular Tags |