mirror of
https://github.com/apache/openjpa.git
synced 2025-02-20 17:05:15 +00:00
removed some extraneous JDO / licensing-related code
git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@421375 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3feb467900
commit
26ee3648c3
@ -70,8 +70,6 @@ public class PCClassFileTransformer
|
||||
flags.addDefaultConstructor = opts.removeBooleanProperty
|
||||
("addDefaultConstructor", "AddDefaultConstructor",
|
||||
flags.addDefaultConstructor);
|
||||
flags.jdoEnhance = opts.removeBooleanProperty
|
||||
("jdoEnhance", "JdoEnhance", flags.jdoEnhance);
|
||||
flags.enforcePropertyRestrictions = opts.removeBooleanProperty
|
||||
("enforcePropertyRestrictions", "EnforcePropertyRestrictions",
|
||||
flags.enforcePropertyRestrictions);
|
||||
@ -118,7 +116,6 @@ public class PCClassFileTransformer
|
||||
new Project().loadClass(new ByteArrayInputStream(bytes),
|
||||
_loader), _repos);
|
||||
enhancer.setAddDefaultConstructor(_flags.addDefaultConstructor);
|
||||
enhancer.setJDOEnhance(_flags.jdoEnhance);
|
||||
enhancer.setEnforcePropertyRestrictions
|
||||
(_flags.enforcePropertyRestrictions);
|
||||
|
||||
|
@ -30,13 +30,13 @@ import org.apache.openjpa.util.ClassResolver;
|
||||
* {@link PersistenceCapable} interface at runtime. The agent is launched
|
||||
* at JVM startup from the command line:</p>
|
||||
* <p/>
|
||||
* <code>java -javaagent:org.apache.openjpa.jar[=<options>]</code>
|
||||
* <code>java -javaagent:openjpa.jar[=<options>]</code>
|
||||
* <p/>
|
||||
* <p>The options string should be formatted as a OpenJPA plugin, and may contain
|
||||
* any properties understood by the OpenJPA enhancer or any configuration
|
||||
* properties. For example:</p>
|
||||
* <p>The options string should be formatted as a OpenJPA plugin, and may
|
||||
* contain any properties understood by the OpenJPA enhancer or any
|
||||
* configuration properties. For example:</p>
|
||||
* <p/>
|
||||
* <code>java -javaagent:org.apache.openjpa.jar=JdoEnhance=true,LicenseKey=xxx</code>
|
||||
* <code>java -javaagent:openjpa.jar</code>
|
||||
*
|
||||
* @author Abe White
|
||||
*/
|
||||
|
@ -35,7 +35,6 @@ import org.apache.openjpa.meta.MetaDataRepository;
|
||||
* <li><code>directory</code></li>
|
||||
* <li><code>addDefaultConstructor</code></li>
|
||||
* <li><code>tmpClassLoader</code></li>
|
||||
* <li><code>jdoEnhance</code></li>
|
||||
* <li><code>enforcePropertyRestrictions</code></li>
|
||||
* </ul></p>
|
||||
*/
|
||||
@ -60,13 +59,6 @@ public class PCEnhancerTask
|
||||
flags.addDefaultConstructor = addDefCons;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to perform JDO enhancement in addition to OpenJPA enhancement.
|
||||
*/
|
||||
public void setJdoEnhance(boolean jdoEnhance) {
|
||||
flags.jdoEnhance = jdoEnhance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether to fail if the persistent type uses property access and
|
||||
* bytecode analysis shows that it may be violating OpenJPA's property
|
||||
|
@ -1228,12 +1228,11 @@ public class ApplicationIdTool {
|
||||
* <p>Where the following options are recognized.
|
||||
* <ul>
|
||||
* <li><i>-properties/-p <properties file></i>: The path to a OpenJPA
|
||||
* properties file containing information such as the license key,
|
||||
* as outlined in {@link Configuration}; optional.</li>
|
||||
* properties file containing information as outlined in
|
||||
* {@link Configuration}; optional.</li>
|
||||
* <li><i>-<property name> <property value></i>: All bean
|
||||
* properties of the standard OpenJPA {@link OpenJPAConfiguration} can be
|
||||
* set by using their names and supplying a value; for example:
|
||||
* <code>-licenseKey adslfja83r3lkadf</code></li>
|
||||
* set by using their names and supplying a value.</li>
|
||||
* <li><i>-directory/-d <output directory></i>: Path to the base
|
||||
* source directory. The package structure will be created beneath
|
||||
* this directory if necessary. If not specified, the tool will try
|
||||
|
@ -49,6 +49,7 @@ import org.apache.openjpa.lib.util.BytecodeWriter;
|
||||
import org.apache.openjpa.lib.util.Files;
|
||||
import org.apache.openjpa.lib.util.Localizer;
|
||||
import org.apache.openjpa.lib.util.Options;
|
||||
import org.apache.openjpa.lib.util.Services;
|
||||
import org.apache.openjpa.lib.util.TemporaryClassLoader;
|
||||
import org.apache.openjpa.meta.ClassMetaData;
|
||||
import org.apache.openjpa.meta.FieldMetaData;
|
||||
@ -114,9 +115,8 @@ public class PCEnhancer {
|
||||
private Collection _oids = null;
|
||||
|
||||
private boolean _defCons = true;
|
||||
private boolean _jdo = false;
|
||||
private boolean _fail = false;
|
||||
private AuxiliaryEnhancer _auxEnhance = null;
|
||||
private AuxiliaryEnhancer[] _auxEnhancers = null;
|
||||
private File _dir = null;
|
||||
private BytecodeWriter _writer = null;
|
||||
private Map _backingFields = null;
|
||||
@ -205,20 +205,6 @@ public class PCEnhancer {
|
||||
_defCons = addDefaultConstructor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to perform JDO enhancement in addition to OpenJPA enhancement.
|
||||
*/
|
||||
public boolean getJDOEnhance() {
|
||||
return _jdo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to perform JDO enhancement in addition to OpenJPA enhancement.
|
||||
*/
|
||||
public void setJDOEnhance(boolean jdoEnhance) {
|
||||
_jdo = jdoEnhance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to fail if the persistent type uses property access and
|
||||
* bytecode analysis shows that it may be violating OpenJPA's property
|
||||
@ -460,7 +446,6 @@ public class PCEnhancer {
|
||||
if (meth.isStatic())
|
||||
return null;
|
||||
|
||||
boolean nonFieldsFound = false;
|
||||
Code code = meth.getCode(false);
|
||||
if (code == null)
|
||||
return null;
|
||||
@ -2647,23 +2632,18 @@ public class PCEnhancer {
|
||||
* Allow any registered auxiliary code generators to run.
|
||||
*/
|
||||
private void runAuxiliaryEnhancers() {
|
||||
if (!_jdo)
|
||||
return;
|
||||
|
||||
if (_auxEnhance == null) {
|
||||
try {
|
||||
// make sure JDO libs are available before creating a JDO
|
||||
// enhancer
|
||||
Class c = Class.forName("javax.jdo.spi.PersistenceCapable");
|
||||
c = Class.forName("org.apache.openjpa.jdo.JDOEnhancer", true,
|
||||
AuxiliaryEnhancer.class.getClassLoader());
|
||||
_auxEnhance = (AuxiliaryEnhancer) c.newInstance();
|
||||
}
|
||||
catch (Throwable t) {
|
||||
throw new GeneralException(t);
|
||||
}
|
||||
}
|
||||
_auxEnhance.run(_pc, _meta);
|
||||
if (_auxEnhancers == null) {
|
||||
try {
|
||||
Class[] classes = Services
|
||||
.getImplementorClasses(AuxiliaryEnhancer.class);
|
||||
_auxEnhancers = new AuxiliaryEnhancer[classes.length];
|
||||
for (int i = 0; i < _auxEnhancers.length; i++)
|
||||
_auxEnhancers[i] = (AuxiliaryEnhancer) classes[i]
|
||||
.newInstance();
|
||||
} catch (Throwable t) {
|
||||
throw new GeneralException(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3364,21 +3344,17 @@ public class PCEnhancer {
|
||||
* <p>Where the following options are recognized.
|
||||
* <ul>
|
||||
* <li><i>-properties/-p <properties file></i>: The path to a OpenJPA
|
||||
* properties file containing information such as the license key,
|
||||
* as outlined in {@link Configuration}; optional.</li>
|
||||
* properties file containing information as outlined in
|
||||
* {@link Configuration}; optional.</li>
|
||||
* <li><i>-<property name> <property value></i>: All bean
|
||||
* properties of the standard OpenJPA {@link OpenJPAConfiguration} can be
|
||||
* set by using their names and supplying a value; for example:
|
||||
* <code>-licenseKey adslfja83r3lkadf</code></li>
|
||||
* <li><i>-directory/-d <build directory></i>: The path to the base
|
||||
* directory where enhanced classes are stored. By default, the
|
||||
* enhancer overwrites the original .class file with the enhanced
|
||||
* version. Use this option to store the generated .class file in
|
||||
* another directory. The package structure will be created beneath
|
||||
* the given directory.</li>
|
||||
* <li><i>-jdoEnhance/-jdo [true/t | false/f]</i>: Whether to
|
||||
* enhance to implement JDO <code>PersistenceCapable</code> interface
|
||||
* in addition to OpenJPA enhancement. Defaults to false.</li>
|
||||
* <li><i>-addDefaultConstructor/-adc [true/t | false/f]</i>: Whether to
|
||||
* add a default constructor to persistent classes missing one, as
|
||||
* opposed to throwing an exception. Defaults to true.</li>
|
||||
@ -3434,8 +3410,6 @@ public class PCEnhancer {
|
||||
("addDefaultConstructor", "adc", flags.addDefaultConstructor);
|
||||
flags.tmpClassLoader = opts.removeBooleanProperty
|
||||
("tmpClassLoader", "tcl", flags.tmpClassLoader);
|
||||
flags.jdoEnhance = opts.removeBooleanProperty("jdoEnhance", "jdo",
|
||||
flags.jdoEnhance);
|
||||
flags.enforcePropertyRestrictions = opts.removeBooleanProperty
|
||||
("enforcePropertyRestrictions", "epr",
|
||||
flags.enforcePropertyRestrictions);
|
||||
@ -3491,7 +3465,6 @@ public class PCEnhancer {
|
||||
enhancer.setBytecodeWriter(writer);
|
||||
enhancer.setDirectory(flags.directory);
|
||||
enhancer.setAddDefaultConstructor(flags.addDefaultConstructor);
|
||||
enhancer.setJDOEnhance(flags.jdoEnhance);
|
||||
status = enhancer.run();
|
||||
if (status == ENHANCE_NONE)
|
||||
log.info(_loc.get("enhance-norun"));
|
||||
@ -3527,7 +3500,6 @@ public class PCEnhancer {
|
||||
public File directory = null;
|
||||
public boolean addDefaultConstructor = true;
|
||||
public boolean tmpClassLoader = true;
|
||||
public boolean jdoEnhance = false;
|
||||
public boolean enforcePropertyRestrictions = false;
|
||||
}
|
||||
|
||||
|
@ -48,8 +48,6 @@ public interface FetchConfiguration
|
||||
/**
|
||||
* Return the context assiciated with this configuration;
|
||||
* may be null if it has not been set or this object has been serialized.
|
||||
* In this case, the fetch configuration may not allow the setting of
|
||||
* certain properties that require non-standard license capabilities.
|
||||
*/
|
||||
public StoreContext getContext();
|
||||
|
||||
|
@ -192,9 +192,6 @@ public class FetchConfigurationImpl
|
||||
|
||||
/**
|
||||
* Adds a fetch group of the given name to this receiver.
|
||||
* Checks if license allows for adding custom fetch groups. Makes
|
||||
* an exception if the given name matches with the default fetch group
|
||||
* name.
|
||||
*
|
||||
* @param name must not be null or empty.
|
||||
*/
|
||||
|
@ -353,8 +353,8 @@ public interface StoreManager
|
||||
* Return a query implementation suitable for this store. If the query
|
||||
* is iterated within a data store transaction, returned instances should
|
||||
* be locked. Return null if this store does not support native execution
|
||||
* of the given language. OpenJPA can execute JDOQL and JPQL in memory
|
||||
* even without back end support.
|
||||
* of the given language. OpenJPA can execute JPQL in memory even without
|
||||
* back end support.
|
||||
*
|
||||
* @param language the query language
|
||||
*/
|
||||
|
@ -152,7 +152,6 @@ public class ClassMetaData
|
||||
private int _cacheTimeout = Integer.MIN_VALUE;
|
||||
private Boolean _detachable = null;
|
||||
private String _detachState = DEFAULT_STRING;
|
||||
private Boolean _auditable = null;
|
||||
private String _alias = null;
|
||||
private int _versionIdx = Integer.MIN_VALUE;
|
||||
|
||||
@ -1342,27 +1341,6 @@ public class ClassMetaData
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this class is auditable.
|
||||
*/
|
||||
public boolean isAuditable() {
|
||||
if (_auditable == null) {
|
||||
if (_super != null)
|
||||
_auditable = (getPCSuperclassMetaData().isAuditable())
|
||||
? Boolean.TRUE : Boolean.FALSE;
|
||||
else
|
||||
_auditable = Boolean.FALSE;
|
||||
}
|
||||
return _auditable.booleanValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this class is auditable.
|
||||
*/
|
||||
public void setAuditable(boolean auditable) {
|
||||
_auditable = (auditable) ? Boolean.TRUE : Boolean.FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear cached field data.
|
||||
*/
|
||||
@ -2117,8 +2095,6 @@ public class ClassMetaData
|
||||
_detachable = meta._detachable;
|
||||
if (_detachState == DEFAULT_STRING)
|
||||
_detachState = meta.getDetachedState();
|
||||
if (_auditable == null)
|
||||
_auditable = (meta.isAuditable()) ? Boolean.TRUE : Boolean.FALSE;
|
||||
|
||||
// synch field information; first remove extra fields
|
||||
clearFieldCache();
|
||||
|
@ -229,12 +229,10 @@ public class MetaDataTool
|
||||
* <ul>
|
||||
* <li><i>-properties/-p <properties file or resource></i>: The path
|
||||
* or resource name of a OpenJPA properties file containing information
|
||||
* such as the license key data as outlined in
|
||||
* {@link OpenJPAConfiguration}. Optional.</li>
|
||||
* as outlined in {@link OpenJPAConfiguration}. Optional.</li>
|
||||
* <li><i>-<property name> <property value></i>: All bean
|
||||
* properties of the OpenJPA {@link OpenJPAConfiguration} can be set by
|
||||
* using their names and supplying a value. For example:
|
||||
* <code>-licenseKey adslfja83r3lkadf</code></li>
|
||||
* using their names and supplying a value.</li>
|
||||
* <li><i>-file/-f <stdout | output file or resource></i>: The path
|
||||
* or resource name of a file the metadata should be generated to.
|
||||
* If the given file already contains metadata, the generated
|
||||
|
@ -31,7 +31,7 @@ import org.apache.openjpa.lib.util.Localizer;
|
||||
* the configuration as a bean-like task. E.g., you can do:
|
||||
* <p/>
|
||||
* <code> <mytask&rt;<br />
|
||||
* <config licenseKey="key" connectionUserName="foo"/&rt;<br />
|
||||
* <config connectionUserName="foo"/&rt;<br />
|
||||
* </mytask&rt;
|
||||
* </code>
|
||||
* The defailt configuration for the system will be used if the
|
||||
|
Loading…
x
Reference in New Issue
Block a user