mirror of https://github.com/apache/openjpa.git
revert OPENJPA-401 in 1.0.x - shouldn't add a new flag in a service stream.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/1.0.x@618762 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
304117261f
commit
78e258706d
|
@ -49,7 +49,6 @@ import org.apache.openjpa.util.MultiLoaderClassResolver;
|
|||
* <li><code>file</code></li>
|
||||
* <li><code>schemaFile</code></li>
|
||||
* <li><code>sqlFile</code></li>
|
||||
* <li><code>tmpClassLoader</code></li>
|
||||
* </ul> Of these arguments, only <code>action</code> is required.
|
||||
*/
|
||||
public class MappingToolTask
|
||||
|
@ -62,7 +61,6 @@ public class MappingToolTask
|
|||
protected String file = null;
|
||||
protected String schemaFile = null;
|
||||
protected String sqlFile = null;
|
||||
protected boolean tmpClassLoader = true;
|
||||
|
||||
/**
|
||||
* Set the enumerated MappingTool action type.
|
||||
|
@ -177,28 +175,22 @@ public class MappingToolTask
|
|||
throws Exception {
|
||||
if (MappingTool.ACTION_IMPORT.equals(flags.action))
|
||||
assertFiles(files);
|
||||
ClassLoader toolLoader = (ClassLoader) AccessController
|
||||
.doPrivileged(J2DoPrivHelper
|
||||
.getClassLoaderAction(MappingTool.class));
|
||||
ClassLoader loader = toolLoader;
|
||||
MultiLoaderClassResolver resolver = new MultiLoaderClassResolver();
|
||||
|
||||
if (tmpClassLoader) {
|
||||
loader = (ClassLoader) AccessController.doPrivileged(J2DoPrivHelper
|
||||
|
||||
ClassLoader loader =
|
||||
(ClassLoader) AccessController.doPrivileged(J2DoPrivHelper
|
||||
.newTemporaryClassLoaderAction(getClassLoader()));
|
||||
resolver.addClassLoader(loader);
|
||||
}
|
||||
resolver.addClassLoader(toolLoader);
|
||||
|
||||
if (flags.meta && MappingTool.ACTION_ADD.equals(flags.action))
|
||||
flags.metaDataFile = Files.getFile(file, loader);
|
||||
else
|
||||
flags.mappingWriter = Files.getWriter(file, loader);
|
||||
|
||||
flags.schemaWriter = Files.getWriter(schemaFile, loader);
|
||||
flags.sqlWriter = Files.getWriter(sqlFile, loader);
|
||||
|
||||
MultiLoaderClassResolver resolver = new MultiLoaderClassResolver();
|
||||
resolver.addClassLoader((ClassLoader) AccessController.doPrivileged(
|
||||
J2DoPrivHelper.getClassLoaderAction(MappingTool.class)));
|
||||
resolver.addClassLoader(loader);
|
||||
JDBCConfiguration conf = (JDBCConfiguration) getConfiguration();
|
||||
conf.setClassResolver(resolver);
|
||||
|
||||
|
@ -226,18 +218,5 @@ public class MappingToolTask
|
|||
return actions;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <P>
|
||||
* Set whether a temporary ClassLoader should be used by the MappingTool.
|
||||
* The default value is true
|
||||
* </P>
|
||||
*
|
||||
* @param tmpClassLoader
|
||||
* Whether the temporary ClassLoader should be used.
|
||||
*/
|
||||
public void setTmpClassLoader(boolean tmpClassLoader) {
|
||||
this.tmpClassLoader = tmpClassLoader;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue