Author: pcl Date: Wed Jul 12 12:07:34 2006 New Revision: 421375 URL: http://svn.apache.org/viewvc?rev=421375&view=rev Log: removed some extraneous JDO / licensing-related code
Modified: incubator/openjpa/trunk/openjpa-kernel-5/src/main/java/org/apache/openjpa/enhance/PCClassFileTransformer.java incubator/openjpa/trunk/openjpa-kernel-5/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/ant/PCEnhancerTask.java incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfiguration.java incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StoreManager.java incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataTool.java incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java Modified: incubator/openjpa/trunk/openjpa-kernel-5/src/main/java/org/apache/openjpa/enhance/PCClassFileTransformer.java URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel-5/src/main/java/org/apache/openjpa/enhance/PCClassFileTransformer.java?rev=421375&r1=421374&r2=421375&view=diff ============================================================================== --- incubator/openjpa/trunk/openjpa-kernel-5/src/main/java/org/apache/openjpa/enhance/PCClassFileTransformer.java (original) +++ incubator/openjpa/trunk/openjpa-kernel-5/src/main/java/org/apache/openjpa/enhance/PCClassFileTransformer.java Wed Jul 12 12:07:34 2006 @@ -70,8 +70,6 @@ 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 @@ new Project().loadClass(new ByteArrayInputStream(bytes), _loader), _repos); enhancer.setAddDefaultConstructor(_flags.addDefaultConstructor); - enhancer.setJDOEnhance(_flags.jdoEnhance); enhancer.setEnforcePropertyRestrictions (_flags.enforcePropertyRestrictions); Modified: incubator/openjpa/trunk/openjpa-kernel-5/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel-5/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java?rev=421375&r1=421374&r2=421375&view=diff ============================================================================== --- incubator/openjpa/trunk/openjpa-kernel-5/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java (original) +++ incubator/openjpa/trunk/openjpa-kernel-5/src/main/java/org/apache/openjpa/enhance/PCEnhancerAgent.java Wed Jul 12 12:07:34 2006 @@ -30,13 +30,13 @@ * [EMAIL PROTECTED] 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 */ Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/ant/PCEnhancerTask.java URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/ant/PCEnhancerTask.java?rev=421375&r1=421374&r2=421375&view=diff ============================================================================== --- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/ant/PCEnhancerTask.java (original) +++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/ant/PCEnhancerTask.java Wed Jul 12 12:07:34 2006 @@ -35,7 +35,6 @@ * <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> */ @@ -58,13 +57,6 @@ */ public void setAddDefaultConstructor(boolean addDefCons) { flags.addDefaultConstructor = addDefCons; - } - - /** - * Whether to perform JDO enhancement in addition to OpenJPA enhancement. - */ - public void setJdoEnhance(boolean jdoEnhance) { - flags.jdoEnhance = jdoEnhance; } /** Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java?rev=421375&r1=421374&r2=421375&view=diff ============================================================================== --- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java (original) +++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java Wed Jul 12 12:07:34 2006 @@ -1228,12 +1228,11 @@ * <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 [EMAIL PROTECTED] Configuration}; optional.</li> + * properties file containing information as outlined in + * [EMAIL PROTECTED] Configuration}; optional.</li> * <li><i>-<property name> <property value></i>: All bean * properties of the standard OpenJPA [EMAIL PROTECTED] 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 Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java?rev=421375&r1=421374&r2=421375&view=diff ============================================================================== --- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java (original) +++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java Wed Jul 12 12:07:34 2006 @@ -49,6 +49,7 @@ 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 @@ 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; @@ -206,20 +206,6 @@ } /** - * 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 * access restrictions. @@ -460,7 +446,6 @@ if (meth.isStatic()) return null; - boolean nonFieldsFound = false; Code code = meth.getCode(false); if (code == null) return null; @@ -2647,23 +2632,18 @@ * 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 @@ * <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 [EMAIL PROTECTED] Configuration}; optional.</li> + * properties file containing information as outlined in + * [EMAIL PROTECTED] Configuration}; optional.</li> * <li><i>-<property name> <property value></i>: All bean * properties of the standard OpenJPA [EMAIL PROTECTED] 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 @@ ("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 @@ 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 File directory = null; public boolean addDefaultConstructor = true; public boolean tmpClassLoader = true; - public boolean jdoEnhance = false; public boolean enforcePropertyRestrictions = false; } Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfiguration.java URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfiguration.java?rev=421375&r1=421374&r2=421375&view=diff ============================================================================== --- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfiguration.java (original) +++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfiguration.java Wed Jul 12 12:07:34 2006 @@ -48,8 +48,6 @@ /** * 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(); Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java?rev=421375&r1=421374&r2=421375&view=diff ============================================================================== --- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java (original) +++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java Wed Jul 12 12:07:34 2006 @@ -192,9 +192,6 @@ /** * 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. */ Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StoreManager.java URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StoreManager.java?rev=421375&r1=421374&r2=421375&view=diff ============================================================================== --- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StoreManager.java (original) +++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StoreManager.java Wed Jul 12 12:07:34 2006 @@ -353,8 +353,8 @@ * 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 */ Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java?rev=421375&r1=421374&r2=421375&view=diff ============================================================================== --- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java (original) +++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java Wed Jul 12 12:07:34 2006 @@ -152,7 +152,6 @@ 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; @@ -1343,27 +1342,6 @@ } /** - * 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. */ protected void clearAllFieldCache() { @@ -2117,8 +2095,6 @@ _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(); Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataTool.java URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataTool.java?rev=421375&r1=421374&r2=421375&view=diff ============================================================================== --- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataTool.java (original) +++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataTool.java Wed Jul 12 12:07:34 2006 @@ -229,12 +229,10 @@ * <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 - * [EMAIL PROTECTED] OpenJPAConfiguration}. Optional.</li> + * as outlined in [EMAIL PROTECTED] OpenJPAConfiguration}. Optional.</li> * <li><i>-<property name> <property value></i>: All bean * properties of the OpenJPA [EMAIL PROTECTED] 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 Modified: incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java?rev=421375&r1=421374&r2=421375&view=diff ============================================================================== --- incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java (original) +++ incubator/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/ant/AbstractTask.java Wed Jul 12 12:07:34 2006 @@ -31,7 +31,7 @@ * 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