1 22 package org.jboss.metamodel.descriptor; 23 24 import org.jboss.logging.Logger; 25 26 33 public class ResourceEnvRef extends Ref 34 { 35 private static final Logger log = Logger.getLogger(ResourceEnvRef.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 public String getResourceName() 52 { 53 return resourceName; 54 } 55 56 public void setResourceName(String resourceName) 57 { 58 this.resourceName = resourceName; 59 } 60 61 public String getJndiName() 62 { 63 return jndiName; 64 } 65 66 public void setJndiName(String jndiName) 67 { 68 this.jndiName = jndiName; 69 this.mappedName = jndiName; 70 } 71 72 public String getMappedName() 73 { 74 return mappedName; 75 } 76 77 public void setMappedName(String mappedName) 78 { 79 this.mappedName = mappedName; 80 } 81 82 public String getResRefName() 83 { 84 return resRefName; 85 } 86 87 public void setResRefName(String resRefName) 88 { 89 this.resRefName = resRefName; 90 } 91 92 public String getResType() 93 { 94 return resType; 95 } 96 97 public void setResType(String resType) 98 { 99 this.resType = resType; 100 } 101 102 public String getResAuth() 103 { 104 return resAuth; 105 } 106 107 public void setResAuth(String resAuth) 108 { 109 this.resAuth = resAuth; 110 } 111 112 public String getAuthorizationType() 113 { 114 return resAuth; 115 } 116 117 public String getResSharingScope() 118 { 119 return resSharingScope; 120 } 121 122 public void setResSharingScope(String resSharingScope) 123 { 124 this.resSharingScope = resSharingScope; 125 } 126 127 public boolean isShareable() 128 { 129 if (resSharingScope == null || resSharingScope.equals("Shareable")) 130 return true; 131 else 132 return false; 133 } 134 135 public void merge(ResourceEnvRef ref) 136 { 137 if (ref.getJndiName() != null) 138 { 139 this.setJndiName(ref.getJndiName()); 140 141 setMappedName(ref.getJndiName()); 142 } 143 144 if (ref.getResourceName() != null) 145 { 146 this.setResourceName(ref.getResourceName()); 147 148 String mappedName = ref.getResourceName(); 149 if (mappedName.startsWith("java:")) 150 this.setMappedName(ref.getResourceName()); 151 else 152 this.setMappedName("java:" + ref.getResourceName()); 153 } 154 } 155 156 public String toString() 157 { 158 StringBuffer sb = new StringBuffer (100); 159 sb.append("[ResourceEnvRef:"); 160 sb.append("resRefName=").append(resRefName); 161 sb.append(",resType=").append(resType); 162 sb.append(",jndiName=").append(jndiName); 163 sb.append(",mappedName=").append(mappedName); 164 sb.append("]"); 165 return sb.toString(); 166 } 167 } 168 | Popular Tags |