1 23 24 25 package com.sun.enterprise.deployment; 26 27 import java.util.ArrayList ; 28 import java.util.Collections ; 29 import java.util.List ; 30 import java.util.Properties ; 31 32 37 public class PersistenceUnitDescriptor extends Descriptor { 38 39 private PersistenceUnitsDescriptor parent; 40 41 private String name; 42 43 private String transactionType = "JTA"; 45 private String description; 46 47 private String provider; 48 49 private String jtaDataSource; 50 51 private String nonJtaDataSource; 52 53 private List <String > mappingFiles = new ArrayList <String >(); 54 55 private List <String > jarFiles = new ArrayList <String >(); 56 57 private List <String > classes = new ArrayList <String >(); 58 59 private Properties properties = new Properties (); 60 61 private boolean excludeUnlistedClasses = false; 62 63 public PersistenceUnitDescriptor() { 64 } 65 66 public PersistenceUnitsDescriptor getParent() { 67 return parent; 68 } 69 70 protected void setParent(PersistenceUnitsDescriptor parent) { 71 assert(this.parent==null); 72 this.parent = parent; 73 } 74 75 80 public String getName() { 81 return name; 82 } 83 84 public void setName(String value) { 85 this.name = value; 86 this.changed(); 87 } 88 89 public String getTransactionType() { 90 return transactionType; 91 } 92 93 public void setTransactionType(String transactionType) { 94 this.transactionType = transactionType; 95 } 96 97 public String getDescription() { 98 return description; 99 } 100 101 public void setDescription(String description) { 102 this.description = description; 103 } 104 105 public String getProvider() { 106 return provider; 107 } 108 109 public void setProvider(String value) { 110 this.changed(); 111 this.provider = value; 112 } 113 114 public String getJtaDataSource() { 115 return jtaDataSource; 116 } 117 118 public void setJtaDataSource(String value) { 119 this.jtaDataSource = value; 120 this.changed(); 121 } 122 123 public String getNonJtaDataSource() { 124 return nonJtaDataSource; 125 } 126 127 public void setNonJtaDataSource(String value) { 128 this.nonJtaDataSource = value; 129 this.changed(); 130 } 131 132 public List <String > getMappingFiles() { 133 return Collections.unmodifiableList(mappingFiles); 134 } 135 136 public void addMappingFile(String mappingFile) { 137 mappingFiles.add(mappingFile); 138 } 139 140 public List <String > getJarFiles() { 141 return Collections.unmodifiableList(jarFiles); 142 } 143 144 public void addJarFile(String jarFile) { 145 jarFiles.add(jarFile); 146 this.changed(); 147 } 148 149 public List <String > getClasses() { 150 return Collections.unmodifiableList(classes); 151 } 152 153 public void addClass(String className) { 154 classes.add(className); 155 this.changed(); 156 } 157 158 public Properties getProperties() { 159 return (Properties ) properties.clone(); 160 } 161 162 public void addProperty(String name, Object value) { 163 properties.put(name, value); 164 this.changed(); 165 } 166 167 public boolean isExcludeUnlistedClasses() { 168 return excludeUnlistedClasses; 169 } 170 171 public void setExcludeUnlistedClasses(boolean excludeUnlistedClasses) { 172 this.excludeUnlistedClasses = excludeUnlistedClasses; 173 } 174 175 public ClassLoader getClassLoader() { 176 return getParent().getClassLoader(); 177 } 178 179 public String getPuRoot() { 180 return parent.getPuRoot(); 181 } 182 183 188 public String getAbsolutePuRoot() { 189 return getParent().getAbsolutePuRoot(); 190 } 191 } 192 | Popular Tags |