001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.ejb3.entity;
023:
024: import java.net.URL;
025: import java.util.List;
026: import java.util.Properties;
027: import javax.persistence.spi.PersistenceUnitInfo;
028: import javax.persistence.spi.PersistenceUnitTransactionType;
029: import javax.persistence.spi.ClassTransformer;
030: import javax.sql.DataSource;
031:
032: import org.jboss.mx.loading.UnifiedClassLoader;
033: import org.jboss.mx.loading.UnifiedClassLoader3;
034:
035: /**
036: * Comment
037: *
038: * @author <a href="mailto:bill@jboss.org">Bill Burke</a>
039: * @version $Revision: 63376 $
040: */
041: public class PersistenceUnitInfoImpl implements PersistenceUnitInfo {
042: private String entityManagerName;
043: private DataSource jtaDataSource;
044: private DataSource nonJtaDataSource;
045: private List<String> mappingFileNames;
046: private List<URL> jarFiles;
047: private List<String> entityclassNames;
048: private Properties properties;
049: private ClassLoader classLoader;
050: private String persistenceProviderClassName;
051: private PersistenceUnitTransactionType transactionType;
052: private URL persistenceUnitRootUrl;
053: private boolean excludeClasses;
054:
055: public PersistenceUnitInfoImpl() {
056: }
057:
058: public void addTransformer(ClassTransformer transformer) {
059: //throw new RuntimeException("NOT IMPLEMENTED");
060: }
061:
062: public ClassLoader getNewTempClassLoader() {
063:
064: return new UnifiedClassLoader3(
065: ((UnifiedClassLoader) classLoader).getURL());
066: }
067:
068: public String getPersistenceProviderClassName() {
069: return persistenceProviderClassName;
070: }
071:
072: public void setPersistenceProviderClassName(
073: String persistenceProviderClassName) {
074: this .persistenceProviderClassName = persistenceProviderClassName;
075: }
076:
077: public String getPersistenceUnitName() {
078: return entityManagerName;
079: }
080:
081: public void setPersistenceUnitName(String entityManagerName) {
082: this .entityManagerName = entityManagerName;
083: }
084:
085: public DataSource getJtaDataSource() {
086: return jtaDataSource;
087: }
088:
089: public void setJtaDataSource(DataSource jtaDataSource) {
090: this .jtaDataSource = jtaDataSource;
091: }
092:
093: public DataSource getNonJtaDataSource() {
094: return nonJtaDataSource;
095: }
096:
097: public void setNonJtaDataSource(DataSource nonJtaDataSource) {
098: this .nonJtaDataSource = nonJtaDataSource;
099: }
100:
101: public List<String> getMappingFileNames() {
102: return mappingFileNames;
103: }
104:
105: public void setMappingFileNames(List<String> mappingFileNames) {
106: this .mappingFileNames = mappingFileNames;
107: }
108:
109: public List<URL> getJarFileUrls() {
110: return jarFiles;
111: }
112:
113: public void setJarFiles(List<URL> jarFiles) {
114: this .jarFiles = jarFiles;
115: }
116:
117: public List<String> getManagedClassNames() {
118: return entityclassNames;
119: }
120:
121: public void setManagedClassnames(List<String> entityclassNames) {
122: this .entityclassNames = entityclassNames;
123: }
124:
125: public Properties getProperties() {
126: return properties;
127: }
128:
129: public void setProperties(Properties properties) {
130: this .properties = properties;
131: }
132:
133: public ClassLoader getClassLoader() {
134: return classLoader;
135: }
136:
137: public void setClassLoader(ClassLoader classLoader) {
138: this .classLoader = classLoader;
139: }
140:
141: public PersistenceUnitTransactionType getTransactionType() {
142: return transactionType;
143: }
144:
145: public void setTransactionType(
146: PersistenceUnitTransactionType transactionType) {
147: this .transactionType = transactionType;
148: }
149:
150: public URL getPersistenceUnitRootUrl() {
151: return persistenceUnitRootUrl;
152: }
153:
154: public void setPersistenceUnitRootUrl(URL persistenceUnitRootUrl) {
155: this .persistenceUnitRootUrl = persistenceUnitRootUrl;
156: }
157:
158: public boolean excludeUnlistedClasses() {
159: return excludeClasses;
160: }
161:
162: public void setExcludeUnlistedClasses(boolean excludeClasses) {
163: this.excludeClasses = excludeClasses;
164: }
165:
166: }
|