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:
Patrick Linskey 2006-07-12 19:07:34 +00:00
parent 3feb467900
commit 26ee3648c3
11 changed files with 29 additions and 100 deletions

View File

@ -70,8 +70,6 @@ public class PCClassFileTransformer
flags.addDefaultConstructor = opts.removeBooleanProperty flags.addDefaultConstructor = opts.removeBooleanProperty
("addDefaultConstructor", "AddDefaultConstructor", ("addDefaultConstructor", "AddDefaultConstructor",
flags.addDefaultConstructor); flags.addDefaultConstructor);
flags.jdoEnhance = opts.removeBooleanProperty
("jdoEnhance", "JdoEnhance", flags.jdoEnhance);
flags.enforcePropertyRestrictions = opts.removeBooleanProperty flags.enforcePropertyRestrictions = opts.removeBooleanProperty
("enforcePropertyRestrictions", "EnforcePropertyRestrictions", ("enforcePropertyRestrictions", "EnforcePropertyRestrictions",
flags.enforcePropertyRestrictions); flags.enforcePropertyRestrictions);
@ -118,7 +116,6 @@ public class PCClassFileTransformer
new Project().loadClass(new ByteArrayInputStream(bytes), new Project().loadClass(new ByteArrayInputStream(bytes),
_loader), _repos); _loader), _repos);
enhancer.setAddDefaultConstructor(_flags.addDefaultConstructor); enhancer.setAddDefaultConstructor(_flags.addDefaultConstructor);
enhancer.setJDOEnhance(_flags.jdoEnhance);
enhancer.setEnforcePropertyRestrictions enhancer.setEnforcePropertyRestrictions
(_flags.enforcePropertyRestrictions); (_flags.enforcePropertyRestrictions);

View File

@ -30,13 +30,13 @@ import org.apache.openjpa.util.ClassResolver;
* {@link PersistenceCapable} interface at runtime. The agent is launched * {@link PersistenceCapable} interface at runtime. The agent is launched
* at JVM startup from the command line:</p> * at JVM startup from the command line:</p>
* <p/> * <p/>
* <code>java -javaagent:org.apache.openjpa.jar[=&lt;options&gt;]</code> * <code>java -javaagent:openjpa.jar[=&lt;options&gt;]</code>
* <p/> * <p/>
* <p>The options string should be formatted as a OpenJPA plugin, and may contain * <p>The options string should be formatted as a OpenJPA plugin, and may
* any properties understood by the OpenJPA enhancer or any configuration * contain any properties understood by the OpenJPA enhancer or any
* properties. For example:</p> * configuration properties. For example:</p>
* <p/> * <p/>
* <code>java -javaagent:org.apache.openjpa.jar=JdoEnhance=true,LicenseKey=xxx</code> * <code>java -javaagent:openjpa.jar</code>
* *
* @author Abe White * @author Abe White
*/ */

View File

@ -35,7 +35,6 @@ import org.apache.openjpa.meta.MetaDataRepository;
* <li><code>directory</code></li> * <li><code>directory</code></li>
* <li><code>addDefaultConstructor</code></li> * <li><code>addDefaultConstructor</code></li>
* <li><code>tmpClassLoader</code></li> * <li><code>tmpClassLoader</code></li>
* <li><code>jdoEnhance</code></li>
* <li><code>enforcePropertyRestrictions</code></li> * <li><code>enforcePropertyRestrictions</code></li>
* </ul></p> * </ul></p>
*/ */
@ -60,13 +59,6 @@ public class PCEnhancerTask
flags.addDefaultConstructor = addDefCons; 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 * Set whether to fail if the persistent type uses property access and
* bytecode analysis shows that it may be violating OpenJPA's property * bytecode analysis shows that it may be violating OpenJPA's property

View File

@ -1228,12 +1228,11 @@ public class ApplicationIdTool {
* <p>Where the following options are recognized. * <p>Where the following options are recognized.
* <ul> * <ul>
* <li><i>-properties/-p &lt;properties file&gt;</i>: The path to a OpenJPA * <li><i>-properties/-p &lt;properties file&gt;</i>: The path to a OpenJPA
* properties file containing information such as the license key, * properties file containing information as outlined in
* as outlined in {@link Configuration}; optional.</li> * {@link Configuration}; optional.</li>
* <li><i>-&lt;property name&gt; &lt;property value&gt;</i>: All bean * <li><i>-&lt;property name&gt; &lt;property value&gt;</i>: All bean
* properties of the standard OpenJPA {@link OpenJPAConfiguration} can be * properties of the standard OpenJPA {@link OpenJPAConfiguration} can be
* set by using their names and supplying a value; for example: * set by using their names and supplying a value.</li>
* <code>-licenseKey adslfja83r3lkadf</code></li>
* <li><i>-directory/-d &lt;output directory&gt;</i>: Path to the base * <li><i>-directory/-d &lt;output directory&gt;</i>: Path to the base
* source directory. The package structure will be created beneath * source directory. The package structure will be created beneath
* this directory if necessary. If not specified, the tool will try * this directory if necessary. If not specified, the tool will try

View File

@ -49,6 +49,7 @@ import org.apache.openjpa.lib.util.BytecodeWriter;
import org.apache.openjpa.lib.util.Files; import org.apache.openjpa.lib.util.Files;
import org.apache.openjpa.lib.util.Localizer; import org.apache.openjpa.lib.util.Localizer;
import org.apache.openjpa.lib.util.Options; 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.lib.util.TemporaryClassLoader;
import org.apache.openjpa.meta.ClassMetaData; import org.apache.openjpa.meta.ClassMetaData;
import org.apache.openjpa.meta.FieldMetaData; import org.apache.openjpa.meta.FieldMetaData;
@ -114,9 +115,8 @@ public class PCEnhancer {
private Collection _oids = null; private Collection _oids = null;
private boolean _defCons = true; private boolean _defCons = true;
private boolean _jdo = false;
private boolean _fail = false; private boolean _fail = false;
private AuxiliaryEnhancer _auxEnhance = null; private AuxiliaryEnhancer[] _auxEnhancers = null;
private File _dir = null; private File _dir = null;
private BytecodeWriter _writer = null; private BytecodeWriter _writer = null;
private Map _backingFields = null; private Map _backingFields = null;
@ -205,20 +205,6 @@ public class PCEnhancer {
_defCons = addDefaultConstructor; _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 * Whether to fail if the persistent type uses property access and
* bytecode analysis shows that it may be violating OpenJPA's property * bytecode analysis shows that it may be violating OpenJPA's property
@ -460,7 +446,6 @@ public class PCEnhancer {
if (meth.isStatic()) if (meth.isStatic())
return null; return null;
boolean nonFieldsFound = false;
Code code = meth.getCode(false); Code code = meth.getCode(false);
if (code == null) if (code == null)
return null; return null;
@ -2647,23 +2632,18 @@ public class PCEnhancer {
* Allow any registered auxiliary code generators to run. * Allow any registered auxiliary code generators to run.
*/ */
private void runAuxiliaryEnhancers() { private void runAuxiliaryEnhancers() {
if (!_jdo) if (_auxEnhancers == null) {
return; try {
Class[] classes = Services
if (_auxEnhance == null) { .getImplementorClasses(AuxiliaryEnhancer.class);
try { _auxEnhancers = new AuxiliaryEnhancer[classes.length];
// make sure JDO libs are available before creating a JDO for (int i = 0; i < _auxEnhancers.length; i++)
// enhancer _auxEnhancers[i] = (AuxiliaryEnhancer) classes[i]
Class c = Class.forName("javax.jdo.spi.PersistenceCapable"); .newInstance();
c = Class.forName("org.apache.openjpa.jdo.JDOEnhancer", true, } catch (Throwable t) {
AuxiliaryEnhancer.class.getClassLoader()); throw new GeneralException(t);
_auxEnhance = (AuxiliaryEnhancer) c.newInstance(); }
} }
catch (Throwable t) {
throw new GeneralException(t);
}
}
_auxEnhance.run(_pc, _meta);
} }
/** /**
@ -3364,21 +3344,17 @@ public class PCEnhancer {
* <p>Where the following options are recognized. * <p>Where the following options are recognized.
* <ul> * <ul>
* <li><i>-properties/-p &lt;properties file&gt;</i>: The path to a OpenJPA * <li><i>-properties/-p &lt;properties file&gt;</i>: The path to a OpenJPA
* properties file containing information such as the license key, * properties file containing information as outlined in
* as outlined in {@link Configuration}; optional.</li> * {@link Configuration}; optional.</li>
* <li><i>-&lt;property name&gt; &lt;property value&gt;</i>: All bean * <li><i>-&lt;property name&gt; &lt;property value&gt;</i>: All bean
* properties of the standard OpenJPA {@link OpenJPAConfiguration} can be * properties of the standard OpenJPA {@link OpenJPAConfiguration} can be
* set by using their names and supplying a value; for example: * set by using their names and supplying a value; for example:
* <code>-licenseKey adslfja83r3lkadf</code></li>
* <li><i>-directory/-d &lt;build directory&gt;</i>: The path to the base * <li><i>-directory/-d &lt;build directory&gt;</i>: The path to the base
* directory where enhanced classes are stored. By default, the * directory where enhanced classes are stored. By default, the
* enhancer overwrites the original .class file with the enhanced * enhancer overwrites the original .class file with the enhanced
* version. Use this option to store the generated .class file in * version. Use this option to store the generated .class file in
* another directory. The package structure will be created beneath * another directory. The package structure will be created beneath
* the given directory.</li> * 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 * <li><i>-addDefaultConstructor/-adc [true/t | false/f]</i>: Whether to
* add a default constructor to persistent classes missing one, as * add a default constructor to persistent classes missing one, as
* opposed to throwing an exception. Defaults to true.</li> * opposed to throwing an exception. Defaults to true.</li>
@ -3434,8 +3410,6 @@ public class PCEnhancer {
("addDefaultConstructor", "adc", flags.addDefaultConstructor); ("addDefaultConstructor", "adc", flags.addDefaultConstructor);
flags.tmpClassLoader = opts.removeBooleanProperty flags.tmpClassLoader = opts.removeBooleanProperty
("tmpClassLoader", "tcl", flags.tmpClassLoader); ("tmpClassLoader", "tcl", flags.tmpClassLoader);
flags.jdoEnhance = opts.removeBooleanProperty("jdoEnhance", "jdo",
flags.jdoEnhance);
flags.enforcePropertyRestrictions = opts.removeBooleanProperty flags.enforcePropertyRestrictions = opts.removeBooleanProperty
("enforcePropertyRestrictions", "epr", ("enforcePropertyRestrictions", "epr",
flags.enforcePropertyRestrictions); flags.enforcePropertyRestrictions);
@ -3491,7 +3465,6 @@ public class PCEnhancer {
enhancer.setBytecodeWriter(writer); enhancer.setBytecodeWriter(writer);
enhancer.setDirectory(flags.directory); enhancer.setDirectory(flags.directory);
enhancer.setAddDefaultConstructor(flags.addDefaultConstructor); enhancer.setAddDefaultConstructor(flags.addDefaultConstructor);
enhancer.setJDOEnhance(flags.jdoEnhance);
status = enhancer.run(); status = enhancer.run();
if (status == ENHANCE_NONE) if (status == ENHANCE_NONE)
log.info(_loc.get("enhance-norun")); log.info(_loc.get("enhance-norun"));
@ -3527,7 +3500,6 @@ public class PCEnhancer {
public File directory = null; public File directory = null;
public boolean addDefaultConstructor = true; public boolean addDefaultConstructor = true;
public boolean tmpClassLoader = true; public boolean tmpClassLoader = true;
public boolean jdoEnhance = false;
public boolean enforcePropertyRestrictions = false; public boolean enforcePropertyRestrictions = false;
} }

View File

@ -48,8 +48,6 @@ public interface FetchConfiguration
/** /**
* Return the context assiciated with this configuration; * Return the context assiciated with this configuration;
* may be null if it has not been set or this object has been serialized. * 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(); public StoreContext getContext();

View File

@ -192,9 +192,6 @@ public class FetchConfigurationImpl
/** /**
* Adds a fetch group of the given name to this receiver. * 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. * @param name must not be null or empty.
*/ */

View File

@ -353,8 +353,8 @@ public interface StoreManager
* Return a query implementation suitable for this store. If the query * Return a query implementation suitable for this store. If the query
* is iterated within a data store transaction, returned instances should * is iterated within a data store transaction, returned instances should
* be locked. Return null if this store does not support native execution * be locked. Return null if this store does not support native execution
* of the given language. OpenJPA can execute JDOQL and JPQL in memory * of the given language. OpenJPA can execute JPQL in memory even without
* even without back end support. * back end support.
* *
* @param language the query language * @param language the query language
*/ */

View File

@ -152,7 +152,6 @@ public class ClassMetaData
private int _cacheTimeout = Integer.MIN_VALUE; private int _cacheTimeout = Integer.MIN_VALUE;
private Boolean _detachable = null; private Boolean _detachable = null;
private String _detachState = DEFAULT_STRING; private String _detachState = DEFAULT_STRING;
private Boolean _auditable = null;
private String _alias = null; private String _alias = null;
private int _versionIdx = Integer.MIN_VALUE; private int _versionIdx = Integer.MIN_VALUE;
@ -1342,27 +1341,6 @@ public class ClassMetaData
return null; 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. * Clear cached field data.
*/ */
@ -2117,8 +2095,6 @@ public class ClassMetaData
_detachable = meta._detachable; _detachable = meta._detachable;
if (_detachState == DEFAULT_STRING) if (_detachState == DEFAULT_STRING)
_detachState = meta.getDetachedState(); _detachState = meta.getDetachedState();
if (_auditable == null)
_auditable = (meta.isAuditable()) ? Boolean.TRUE : Boolean.FALSE;
// synch field information; first remove extra fields // synch field information; first remove extra fields
clearFieldCache(); clearFieldCache();

View File

@ -229,12 +229,10 @@ public class MetaDataTool
* <ul> * <ul>
* <li><i>-properties/-p &lt;properties file or resource&gt;</i>: The path * <li><i>-properties/-p &lt;properties file or resource&gt;</i>: The path
* or resource name of a OpenJPA properties file containing information * or resource name of a OpenJPA properties file containing information
* such as the license key data as outlined in * as outlined in {@link OpenJPAConfiguration}. Optional.</li>
* {@link OpenJPAConfiguration}. Optional.</li>
* <li><i>-&lt;property name&gt; &lt;property value&gt;</i>: All bean * <li><i>-&lt;property name&gt; &lt;property value&gt;</i>: All bean
* properties of the OpenJPA {@link OpenJPAConfiguration} can be set by * properties of the OpenJPA {@link OpenJPAConfiguration} can be set by
* using their names and supplying a value. For example: * using their names and supplying a value.</li>
* <code>-licenseKey adslfja83r3lkadf</code></li>
* <li><i>-file/-f &lt;stdout | output file or resource&gt;</i>: The path * <li><i>-file/-f &lt;stdout | output file or resource&gt;</i>: The path
* or resource name of a file the metadata should be generated to. * or resource name of a file the metadata should be generated to.
* If the given file already contains metadata, the generated * If the given file already contains metadata, the generated

View File

@ -31,7 +31,7 @@ import org.apache.openjpa.lib.util.Localizer;
* the configuration as a bean-like task. E.g., you can do: * the configuration as a bean-like task. E.g., you can do:
* <p/> * <p/>
* <code> &lt;mytask&rt;<br /> * <code> &lt;mytask&rt;<br />
* &nbsp;&nbsp;&lt;config licenseKey="key" connectionUserName="foo"/&rt;<br /> * &nbsp;&nbsp;&lt;config connectionUserName="foo"/&rt;<br />
* &lt;/mytask&rt; * &lt;/mytask&rt;
* </code> * </code>
* The defailt configuration for the system will be used if the * The defailt configuration for the system will be used if the