1 7 package org.jboss.ejb3.dd; 8 9 import javax.annotation.AuthenticationType; 10 import javax.annotation.AuthenticationType; 11 12 19 public class ResourceRef 20 { 21 22 private String resRefName; 23 24 private String resType; 25 26 private String resAuth; 27 28 private String resSharingScope; 29 30 private String injectionTarget; 31 32 private String jndiName; 33 34 private String resourceName; 35 36 public String getJndiName() 37 { 38 return jndiName; 39 } 40 41 public void setJndiName(String jndiName) 42 { 43 this.jndiName = jndiName; 44 } 45 46 public String getResourceName() 47 { 48 return resourceName; 49 } 50 51 public void setResourceName(String resourceName) 52 { 53 this.resourceName = resourceName; 54 } 55 56 public String getInjectionTarget() 57 { 58 return injectionTarget; 59 } 60 61 public void setInjectionTarget(String injectionTarget) 62 { 63 this.injectionTarget = injectionTarget; 64 } 65 66 public String getResRefName() 67 { 68 return resRefName; 69 } 70 71 public void setResRefName(String resRefName) 72 { 73 this.resRefName = resRefName; 74 } 75 76 public String getResType() 77 { 78 return resType; 79 } 80 81 public void setResType(String resType) 82 { 83 this.resType = resType; 84 } 85 86 public String getResAuth() 87 { 88 return resAuth; 89 } 90 91 public void setResAuth(String resAuth) 92 { 93 this.resAuth = resAuth; 94 } 95 96 public AuthenticationType getAuthorizationType() 97 { 98 if (resAuth == null || resAuth.equals("Container")) 99 return AuthenticationType.CONTAINER; 100 else 101 return AuthenticationType.APPLICATION; 102 } 103 104 public String getResSharingScope() 105 { 106 return resSharingScope; 107 } 108 109 public void setResSharingScope(String resSharingScope) 110 { 111 this.resSharingScope = resSharingScope; 112 } 113 114 public boolean isShareable() 115 { 116 if (resSharingScope == null || resSharingScope.equals("Shareable")) 117 return true; 118 else 119 return false; 120 } 121 122 public String toString() 123 { 124 StringBuffer sb = new StringBuffer (100); 125 sb.append("["); 126 sb.append("resRefName=").append(resRefName); 127 sb.append("]"); 128 return sb.toString(); 129 } 130 131 public boolean equals(Object o) 132 { 133 if (this == o) 134 return true; 135 if (!(o instanceof ResourceRef)) 136 return false; 137 138 final ResourceRef ref = (ResourceRef) o; 139 140 if (resRefName != null ? !resRefName.equals(ref.resRefName) 141 : ref.resRefName != null) 142 return false; 143 144 return true; 145 } 146 147 public int hashCode() 148 { 149 int result; 150 result = (resRefName != null ? resRefName.hashCode() : 0); 151 return result; 153 } 154 } 155 | Popular Tags |