1 22 package org.jboss.metamodel.descriptor; 23 24 import org.jboss.logging.Logger; 25 26 33 public class ResourceRef extends Ref 34 { 35 private static final Logger log = Logger.getLogger(ResourceRef.class); 36 37 private String resRefName; 38 39 private String resType; 40 41 private String resAuth; 42 43 private String resSharingScope; 44 45 private String mappedName; 46 47 private String jndiName; 48 49 private String resourceName; 50 51 private String resUrl; 52 53 public String getResUrl() 54 { 55 return resUrl; 56 } 57 58 public void setResUrl(String resUrl) 59 { 60 this.resUrl = resUrl; 61 } 62 63 public String getResourceName() 64 { 65 return resourceName; 66 } 67 68 public void setResourceName(String resourceName) 69 { 70 this.resourceName = resourceName; 71 } 72 73 public String getJndiName() 74 { 75 return jndiName; 76 } 77 78 public void setJndiName(String jndiName) 79 { 80 this.jndiName = jndiName; 81 } 82 83 public String getMappedName() 84 { 85 return mappedName; 86 } 87 88 public void setMappedName(String mappedName) 89 { 90 this.mappedName = mappedName; 91 } 92 93 public String getResRefName() 94 { 95 return resRefName; 96 } 97 98 public void setResRefName(String resRefName) 99 { 100 this.resRefName = resRefName; 101 } 102 103 public String getResType() 104 { 105 return resType; 106 } 107 108 public void setResType(String resType) 109 { 110 this.resType = resType; 111 } 112 113 public String getResAuth() 114 { 115 return resAuth; 116 } 117 118 public void setResAuth(String resAuth) 119 { 120 this.resAuth = resAuth; 121 } 122 123 public String getAuthorizationType() 124 { 125 return resAuth; 126 130 } 131 132 public String getResSharingScope() 133 { 134 return resSharingScope; 135 } 136 137 public void setResSharingScope(String resSharingScope) 138 { 139 this.resSharingScope = resSharingScope; 140 } 141 142 public boolean isShareable() 143 { 144 if (resSharingScope == null || resSharingScope.equals("Shareable")) 145 return true; 146 else 147 return false; 148 } 149 150 public void merge(ResourceRef ref) 151 { 152 if (ref.getJndiName() != null) 153 { 154 this.setJndiName(ref.getJndiName()); 155 156 String mappedName = ref.getJndiName(); 157 if (mappedName.startsWith("java:")) 158 this.setMappedName(ref.getJndiName()); 159 else 160 this.setMappedName("java:" + ref.getJndiName()); 161 } 162 163 if (ref.getResourceName() != null) 164 { 165 this.setResourceName(ref.getResourceName()); 166 167 String mappedName = ref.getResourceName(); 168 if (mappedName.startsWith("java:")) 169 this.setMappedName(ref.getResourceName()); 170 else 171 this.setMappedName("java:" + ref.getResourceName()); 172 } 173 } 174 175 public String toString() 176 { 177 StringBuffer sb = new StringBuffer (100); 178 sb.append("[" + this.getClass().getName() + ": "); 179 sb.append("resRefName=").append(resRefName); 180 sb.append(", jndiName=").append(jndiName); 181 sb.append(", resourceName=").append(resourceName); 182 sb.append(", resType=").append(resType); 183 sb.append(", mappedName=").append(mappedName); 184 sb.append(", injectionTarget=").append(injectionTarget); 185 sb.append("]"); 186 return sb.toString(); 187 } 188 } 189 | Popular Tags |