1 26 27 package com.bull.eclipse.jonas.utils.xml; 28 29 30 31 36 public class ResourceRefDesc { 37 38 41 public static final int APPLICATION_AUTH = 0; 42 43 46 public static final int CONTAINER_AUTH = 1; 47 48 51 private static final String [] AUTH = {"APPLICATION_AUTH", "CONTAINER_AUTH"}; 52 53 56 private String name; 57 58 61 private Class type; 62 63 66 private int authentication; 67 68 71 private String jndiName; 72 73 81 102 106 public String getName() { 107 return name; 108 } 109 110 114 public Class getType() { 115 return type; 116 } 117 118 122 public int getAuthentication() { 123 return authentication; 124 } 125 126 130 public boolean isJdbc() { 131 Class jdbcClass = javax.sql.DataSource .class; 132 return jdbcClass.isAssignableFrom(type); 133 } 134 135 139 public String getJndiName() { 140 return jndiName; 141 } 142 143 147 public String toString() { 148 StringBuffer ret = new StringBuffer (); 149 ret.append("\ngetName()=" + getName()); 150 ret.append("\ngetType()=" + getType()); 151 ret.append("\ngetAuthentication()=" + AUTH[getAuthentication()]); 152 ret.append("\nisJdbc()=" + new Boolean (isJdbc()).toString()); 153 ret.append("\ngetJndiName()=" + getJndiName()); 154 return ret.toString(); 155 } 156 } 157 | Popular Tags |