Return-Path: Delivered-To: apmail-db-jdo-commits-archive@www.apache.org Received: (qmail 38193 invoked from network); 22 May 2005 17:56:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 May 2005 17:56:19 -0000 Received: (qmail 94895 invoked by uid 500); 22 May 2005 17:56:19 -0000 Mailing-List: contact jdo-commits-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-commits@db.apache.org Received: (qmail 94864 invoked by uid 99); 22 May 2005 17:56:15 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Sun, 22 May 2005 10:56:13 -0700 Received: (qmail 38123 invoked by uid 65534); 22 May 2005 17:56:11 -0000 Message-ID: <20050522175611.38122.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: svn commit: r171351 [1/16] - in /incubator/jdo/trunk/enhancer20: ./ src/ src/conf/ src/java/ src/java/org/ src/java/org/apache/ src/java/org/apache/jdo/ src/java/org/apache/jdo/enhancer/ src/java/org/apache/jdo/impl/ src/java/org/apache/jdo/impl/enhancer/ src/java/org/apache/jdo/impl/enhancer/classfile/ src/java/org/apache/jdo/impl/enhancer/core/ src/java/org/apache/jdo/impl/enhancer/generator/ src/java/org/apache/jdo/impl/enhancer/meta/ src/java/org/apache/jdo/impl/enhancer/meta/model/ src/java/org/apache/jdo/impl/enhancer/meta/prop/ src/java/org/apache/jdo/impl/enhancer/meta/util/ src/java/org/apache/jdo/impl/enhancer/util/ test/ test/sempdept/ test/sempdept/src/ test/sempdept/src/empdept/ Date: Sun, 22 May 2005 17:55:54 -0000 To: jdo-commits@db.apache.org From: mbo@apache.org X-Mailer: svnmailer-1.0.0-dev X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: mbo Date: Sun May 22 10:55:51 2005 New Revision: 171351 URL: http://svn.apache.org/viewcvs?rev=3D171351&view=3Drev Log: First version of JDO2 implementation (Enhancere). It includes the implement= ation of the byte code enhancer. Added: incubator/jdo/trunk/enhancer20/ incubator/jdo/trunk/enhancer20/maven.xml incubator/jdo/trunk/enhancer20/project.properties incubator/jdo/trunk/enhancer20/project.xml incubator/jdo/trunk/enhancer20/src/ incubator/jdo/trunk/enhancer20/src/conf/ incubator/jdo/trunk/enhancer20/src/conf/commons-logging.properties incubator/jdo/trunk/enhancer20/src/conf/logging.properties incubator/jdo/trunk/enhancer20/src/conf/simplelog.properties incubator/jdo/trunk/enhancer20/src/java/ incubator/jdo/trunk/enhancer20/src/java/org/ incubator/jdo/trunk/enhancer20/src/java/org/apache/ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/enhancer/ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/enhancer/Enhance= rMain.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/enhancer/Main.ja= va incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/enhancer/package= .html incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/Bu= ndle.properties incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/Cl= assArgMain.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/Cl= assArgOptions.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/Cl= assFileEnhancer.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/Cl= assFileEnhancerHelper.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/Cl= assFileEnhancerTimer.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/En= hancerClassLoader.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/En= hancerFatalError.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/En= hancerOptions.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/En= hancerUserException.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/Ge= nericMain.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/Ge= nericOptions.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/Jd= oMetaMain.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/Jd= oMetaOptions.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/Lo= gSupport.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/Op= tionSet.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/Ou= tputStreamWrapper.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/Pe= rsistenceLauncher.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/AnnotatedClassAttribute.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/AnnotatedMethodAttribute.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/AttributeVector.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ClassAttribute.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ClassField.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ClassFile.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ClassMember.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ClassMethod.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ClassPrint.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/CodeAttribute.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/CodeEnv.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ConstBasic.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ConstBasicMemberRef.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ConstClass.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ConstDouble.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ConstFieldRef.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ConstFloat.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ConstInteger.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ConstInterfaceMethodRef.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ConstLong.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ConstMethodRef.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ConstNameAndType.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ConstString.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ConstUnicode.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ConstUtf8.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ConstValue.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ConstantPool.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ConstantValueAttribute.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/Descriptor.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ExceptionRange.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ExceptionTable.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/ExceptionsAttribute.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/GenericAttribute.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/Insn.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/InsnConstOp.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/InsnError.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/InsnIInc.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/InsnIntOp.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/InsnInterfaceInvoke.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/InsnLookupSwitch.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/InsnMultiDimArrayNew.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/InsnReadEnv.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/InsnSingle.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/InsnTableSwitch.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/InsnTarget.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/InsnTargetOp.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/InsnUtils.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/LineNumberTableAttribute.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/LocalVariable.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/LocalVariableTableAttribute.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/SourceFileAttribute.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/SyntheticAttribute.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/VMConstants.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/cl= assfile/VMOp.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/co= re/ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/co= re/Analyzer.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/co= re/Annotater.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/co= re/Augmenter.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/co= re/Builder.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/co= re/Controller.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/co= re/EnhancerConstants.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/co= re/EnhancerFilter.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/co= re/Environment.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ge= nerator/ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ge= nerator/CodeWriter.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ge= nerator/ImplHelper.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ge= nerator/Main.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ge= nerator/NameHelper.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/me= ta/ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/me= ta/EnhancerMetaData.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/me= ta/EnhancerMetaDataFatalError.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/me= ta/EnhancerMetaDataUserException.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/me= ta/ExtendedMetaData.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/me= ta/model/ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/me= ta/model/EnhancerJavaModel.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/me= ta/model/EnhancerJavaType.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/me= ta/model/EnhancerMetaDataJDOModelImpl.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/me= ta/prop/ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/me= ta/prop/EnhancerMetaDataPropertyImpl.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/me= ta/prop/JDOClass.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/me= ta/prop/JDOField.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/me= ta/prop/MetaDataProperties.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/me= ta/prop/NameHelper.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/me= ta/util/ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/me= ta/util/EnhancerMetaDataBaseModel.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/me= ta/util/EnhancerMetaDataTimer.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ut= il/ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ut= il/AnnotationTest.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ut= il/Assertion.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ut= il/AugmentationDiffTest.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ut= il/AugmentationTest.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ut= il/CombinedResourceLocator.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ut= il/Disassembler.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ut= il/InternalError.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ut= il/ListResourceLocator.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ut= il/PathResourceLocator.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ut= il/ResourceLocator.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ut= il/ResourceLocatorBase.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ut= il/ResourceLocatorTimer.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ut= il/Support.java incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/ut= il/Timer.java incubator/jdo/trunk/enhancer20/test/ incubator/jdo/trunk/enhancer20/test/common.xml incubator/jdo/trunk/enhancer20/test/sempdept/ incubator/jdo/trunk/enhancer20/test/sempdept/build.xml incubator/jdo/trunk/enhancer20/test/sempdept/src/ incubator/jdo/trunk/enhancer20/test/sempdept/src/empdept/ incubator/jdo/trunk/enhancer20/test/sempdept/src/empdept.jdoproperties incubator/jdo/trunk/enhancer20/test/sempdept/src/empdept/Department.java incubator/jdo/trunk/enhancer20/test/sempdept/src/empdept/Employee.java incubator/jdo/trunk/enhancer20/test/sempdept/src/empdept/FullTimeEmploy= ee.java incubator/jdo/trunk/enhancer20/test/sempdept/src/empdept/PartTimeEmploy= ee.java incubator/jdo/trunk/enhancer20/test/sempdept/src/empdept/package.jdo Added: incubator/jdo/trunk/enhancer20/maven.xml URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/enhancer20/maven.xml= ?rev=3D171351&view=3Dauto =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/enhancer20/maven.xml (added) +++ incubator/jdo/trunk/enhancer20/maven.xml Sun May 22 10:55:51 2005 @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + =20 + + + + + + + + + + + =20 + + =20 + + + + + + + + + + + + + + + + + + + =20 + Added: incubator/jdo/trunk/enhancer20/project.properties URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/enhancer20/project.p= roperties?rev=3D171351&view=3Dauto =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/enhancer20/project.properties (added) +++ incubator/jdo/trunk/enhancer20/project.properties Sun May 22 10:55:51 2= 005 @@ -0,0 +1,37 @@ +# +# Copyright 2005 The Apache Software Foundation. +#=20 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at=20 +#=20 +# http://www.apache.org/licenses/LICENSE-2.0 +#=20 +# Unless required by applicable law or agreed to in writing, software=20 +# distributed under the License is distributed on an "AS IS" BASIS,=20 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.=20 +# See the License for the specific language governing permissions and=20 +# limitations under the License. + +# checkstyle settings +maven.checkstyle.properties =3D ${basedir}/../jdo_checks.xml + +# dependencies +jdo.jdoapi.jarfile =3D ${pom.getDependencyPath('apache-jdo:jdo1-api')} +jdo.jdocore.jarfile =3D ${pom.getDependencyPath('apache-jdo:jdo2-core')} +logging.jarfile =3D ${pom.getDependencyPath('commons-logging')} +xmlparser =3D=20 + +# enhancer=20 +jdo.enhancer.enhanced.dir =3D ${maven.build.dir}/test-classes +jdo.enhancer.main =3D org.apache.jdo.enhancer.Main +jdo.enhancer.options =3D -f -d "${jdo.enhancer.enhanced.dir}" -s "${jdo.en= hancer.sourcepath}" +jdo.enhancer.sourcepath =3D ${maven.build.dir}/test-classes${path.separato= r}${jdo.jdoapi.jarfile} +jdo.enhancer.classpath =3D ${maven.build.dir}/classes${path.separator}${jd= o=2Ejdocore.jarfile}${path.separator}${jdo.jdoapi.jarfile}${path.separator}= ${logging.jarfile} +jdo.annotationtest.main =3D org.apache.jdo.impl.enhancer.util.AnnotationTe= st +jdo.annotationtest.options =3D -s "${jdo.enhancer.enhanced.dir}${path.sepa= rator}${jdo.enhancer.sourcepath}" +jdo.augmentationtest.main =3D org.apache.jdo.impl.enhancer.util.Augmentati= onTest +jdo.augmentationtest.options =3D -s "${jdo.enhancer.enhanced.dir}${path.se= parator}${jdo.enhancer.sourcepath}" +jdo.xmlexists.main =3D org.apache.jdo.impl.model.jdo.xml.XMLExists +jdo.xmlexists.classpath =3D ${maven.build.dir}/test-classes${path.separato= r}${path.separator}${jdo.jdocore.jarfile}${path.separator}${jdo.jdoapi.jarf= ile}${path.separator}${logging.jarfile} + Added: incubator/jdo/trunk/enhancer20/project.xml URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/enhancer20/project.x= ml?rev=3D171351&view=3Dauto =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/enhancer20/project.xml (added) +++ incubator/jdo/trunk/enhancer20/project.xml Sun May 22 10:55:51 2005 @@ -0,0 +1,70 @@ + + + + + 3 + ../project.xml + + + + JDO2 Implementation (Enhancer) + jdo2-enhancer + 2.0 + org.apache.jdo + Java Data Object 2.0 (JDO) Enhancer + The Java Data Objects 2.0 (JDO) API is a standard interfa= ce-based=20 +Java model abstraction of persistence, developed as Java Specification=20 +Request JSR 243 under the auspices of the Java Community Process. + + + + + + + apache-jdo + jdo1-api + SNAPSHOT + + + apache-jdo + jdo2-core + SNAPSHOT + + + commons-logging + 1.0.4 + + + + + + + src/java + + + + + ${basedir}/src/java + + **/*.properties + + + + + + Added: incubator/jdo/trunk/enhancer20/src/conf/commons-logging.properties URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/enhancer20/src/conf/= commons-logging.properties?rev=3D171351&view=3Dauto =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/enhancer20/src/conf/commons-logging.properties (add= ed) +++ incubator/jdo/trunk/enhancer20/src/conf/commons-logging.properties Sun = May 22 10:55:51 2005 @@ -0,0 +1,38 @@ +# +# Copyright 2005 The Apache Software Foundation. +#=20 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at=20 +#=20 +# http://www.apache.org/licenses/LICENSE-2.0 +#=20 +# Unless required by applicable law or agreed to in writing, software=20 +# distributed under the License is distributed on an "AS IS" BASIS,=20 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.=20 +# See the License for the specific language governing permissions and=20 +# limitations under the License. + +# +# This is a sample apache commons logging configuration file defining logg= ing +# properties for the JDO2 Implementation (Enhancer) sources. It defines wh= at +# logging implementation the apache commons logging API should use by spec= ifying +# the property org.apache.commons.logging.Log (see below). Please note, th= at +# there are separate property files for each logging implementation to set= the +# log level of the loggers: +# - SimpleLog: simplelog.properties=20 +# - JDK1.4 logging: logging.properties +# +# The JDO2 Implementation (Enhancer) sources use the following logger inst= ances: +# Dependent projects: +# org.apache.jdo.util Utility classes +# org.apache.jdo.impl.model.jdo JDOModel implementation +# org.apache.jdo.impl.model.jdo.xml XML parser for JDO metadata files +# + +# Uncomment the next line if you want to use the apache simple logger +#org.apache.commons.logging.Log =3D org.apache.commons.logging.impl.Simple= Log + +# Uncomment the next two lines if you want to use JDK 1.4 logging +#org.apache.commons.logging.Log =3D org.apache.jdo.util.JDOJdk14Logger + Added: incubator/jdo/trunk/enhancer20/src/conf/logging.properties URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/enhancer20/src/conf/= logging.properties?rev=3D171351&view=3Dauto =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/enhancer20/src/conf/logging.properties (added) +++ incubator/jdo/trunk/enhancer20/src/conf/logging.properties Sun May 22 1= 0:55:51 2005 @@ -0,0 +1,53 @@ +# +# Copyright 2005 The Apache Software Foundation. +#=20 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at=20 +#=20 +# http://www.apache.org/licenses/LICENSE-2.0 +#=20 +# Unless required by applicable law or agreed to in writing, software=20 +# distributed under the License is distributed on an "AS IS" BASIS,=20 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.=20 +# See the License for the specific language governing permissions and=20 +# limitations under the License. + +# +# This is a sample properties file to configure standard JDK 1.4 logging f= or=20 +# the JDO2 Implementation (Enhancer) sources.=20 +# Below you find an entry for each of the source logger instances.=20 +# Please uncomment the line and adapt the log level to your needs,=20 +# in case to want to enable a particular logger. +# +# The following describes the mapping between the log level of JDK 1.4 log= ging +# and apache commns logging: +# JDK 1.4 Apache=20 +# FINEST trace=20 +# FINE, FINER debug=20 +# INFO, CONFIG info +# WARNING warn +# SEVERE error, fatal +# + +###################### +# Enhancer source logger +###################### + +###################### +# Dependent projects +###################### + +# Utility class logger +#org.apache.jdo.util.level =3D FINE +# JDOModel logger +#org.apache.jdo.impl.model.jdo.level =3D FINE +# XML parser logger +#org.apache.jdo.impl.model.jdo.xml.level =3D FINE + +###################### +# JDK 1.4 logging properties +###################### + +handlers =3D java.util.logging.ConsoleHandler +java.util.logging.ConsoleHandler.level =3D FINEST Added: incubator/jdo/trunk/enhancer20/src/conf/simplelog.properties URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/enhancer20/src/conf/= simplelog.properties?rev=3D171351&view=3Dauto =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/enhancer20/src/conf/simplelog.properties (added) +++ incubator/jdo/trunk/enhancer20/src/conf/simplelog.properties Sun May 22= 10:55:51 2005 @@ -0,0 +1,43 @@ +# +# Copyright 2005 The Apache Software Foundation. +#=20 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at=20 +#=20 +# http://www.apache.org/licenses/LICENSE-2.0 +#=20 +# Unless required by applicable law or agreed to in writing, software=20 +# distributed under the License is distributed on an "AS IS" BASIS,=20 +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.=20 +# See the License for the specific language governing permissions and=20 +# limitations under the License. + +# +# This is a sample properties file to configure apache commons logging Sim= pleLog +# implementation for the JDO2 Implementation (Enhancer) sources.=20 +# Below you find an entry for each of the source logger instances.=20 +# Please uncomment the line and adapt the log level to your needs,=20 +# in case to want to enable a particular logger. +# + +###################### +# Enhancer source logger +###################### + +###################### +# Dependent projects +###################### + +# Utility class logger +#org.apache.commons.logging.simplelog.log.org.apache.jdo.util =3D debug +# JDOModel logger +#org.apache.commons.logging.simplelog.log.org.apache.jdo.impl.model.jdo = =3D debug +# XML parser logger +#org.apache.commons.logging.simplelog.log.org.apache.jdo.impl.model.jdo.xm= l =3D debug + +###################### +# Default logging level +###################### + +org.apache.commons.logging.simplelog.defaultlog =3D error Added: incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/enhancer/Enha= ncerMain.java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/enhancer20/src/java/= org/apache/jdo/enhancer/EnhancerMain.java?rev=3D171351&view=3Dauto =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/enhancer/Enhance= rMain.java (added) +++ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/enhancer/Enhance= rMain.java Sun May 22 10:55:51 2005 @@ -0,0 +1,387 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.enhancer; + +import java.io.IOException; +import java.io.File; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.PrintWriter; + +import java.util.List; +import java.util.Iterator; +import java.util.Properties; + +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; + +import org.apache.jdo.impl.enhancer.ClassFileEnhancer; +import org.apache.jdo.impl.enhancer.ClassFileEnhancerHelper; +import org.apache.jdo.impl.enhancer.ClassFileEnhancerTimer; +import org.apache.jdo.impl.enhancer.EnhancerFatalError; +import org.apache.jdo.impl.enhancer.EnhancerOptions; +import org.apache.jdo.impl.enhancer.EnhancerUserException; +import org.apache.jdo.impl.enhancer.JdoMetaMain; +import org.apache.jdo.impl.enhancer.OutputStreamWrapper; +import org.apache.jdo.impl.enhancer.core.EnhancerFilter; + + + +/** + * JDO command line enhancer. + * + * @author Martin Zaun + */ +public class EnhancerMain + extends JdoMetaMain +{ + /** + * The options and arguments. + */ + protected EnhancerOptions options; + + /** + * The byte code enhancer. + */ + protected ClassFileEnhancer enhancer; + + /** + * Creates an instance. + */ + public EnhancerMain(PrintWriter out, + PrintWriter err) + { + this(out, err, new EnhancerOptions(out, err)); + } + + /** + * Creates an instance. + */ + public EnhancerMain(PrintWriter out, + PrintWriter err, + EnhancerOptions options) + { + super(out, err, options); + this.options =3D options; + } + + // -------------------------------------------------------------------= --- + + /** + * Enhances all files entered in the command line. + * + * @param classNames List of class names. + * @param classFileNames List of class file names. + * @param archiveFileNames List of archive file names. + */ + private int enhanceInputFiles(List classNames, + List classFileNames, + List archiveFileNames) + { + int res =3D 0; + try { + String name =3D null; + for (Iterator i =3D archiveFileNames.iterator(); i.hasNext();)= { + try { + name =3D (String)i.next(); + enhanceArchiveFile(name); + } catch (EnhancerUserException ex) { + printlnErr("Error while enhancing " + name, ex,=20 + options.verbose.value); + res++; + continue; + } + } + for (Iterator i =3D classFileNames.iterator(); i.hasNext();) { + try { + name =3D (String)i.next(); + enhanceClassFile(openFileInputStream(name)); + } catch (EnhancerUserException ex) { + printlnErr("Error while enhancing " + name, ex,=20 + options.verbose.value); + res++; + continue; + } + } + for (Iterator i =3D classNames.iterator(); i.hasNext();) { + try { + name =3D (String)i.next(); + enhanceClassFile(openClassInputStream(name)); + } catch (EnhancerUserException ex) { + printlnErr("Error while enhancing " + name, ex,=20 + options.verbose.value); + res++; + continue; + } + } + } catch (IOException ex) { + printlnErr("IO Error while enhancing", ex, options.verbose.val= ue); + return ++res; + } catch (EnhancerFatalError ex) { + // enhancer is not anymore guaranteed to be consistent + printlnErr("Fatal error while enhancing", ex, options.verbose.= value); + enhancer =3D null; + return ++res; + } + return res; + } + + /** + * Enhances a classfile. + * + * @param in The input stream of the classfile. + */ + private void enhanceClassFile(InputStream in) + throws IOException, EnhancerUserException, EnhancerFatalError + { + OutputStream out =3D null; + try { + final File temp =3D File.createTempFile("enhancer", ".class"); + out =3D new BufferedOutputStream(new FileOutputStream(temp)); + + //enhance + final OutputStreamWrapper wrapper =3D new OutputStreamWrapper(= out); + final boolean enhanced =3D enhancer.enhanceClassFile(in, wrapp= er); + + closeOutputStream(out); + out =3D null; + createOutputFile(enhanced, + getClassFileName(wrapper.getClassName()), tem= p); + } finally { + closeInputStream(in); + closeOutputStream(out); + } + } + + /** + * Enhances a archive file. + * + * @param fileName The filename of the archive file. + */ + private void enhanceArchiveFile(String fileName) + throws IOException, EnhancerUserException, EnhancerFatalError + { + ZipInputStream in =3D null; + ZipOutputStream out =3D null; + try { + final File temp =3D File.createTempFile("enhancer", ".zip"); + in =3D new ZipInputStream(new BufferedInputStream( + new FileInputStream(new File(fileName)))); + out =3D new ZipOutputStream(new BufferedOutputStream( + new FileOutputStream(temp))); + + // enhance the archive file + final boolean enhanced + =3D ClassFileEnhancerHelper.enhanceZipFile(enhancer, in, o= ut); + + // create the output file + closeOutputStream(out); + out =3D null; + createOutputFile(enhanced, new File(fileName).getName(), temp); + } finally { + closeOutputStream(out); + closeInputStream(in); + } + } + + /** + * Creates a file object that represents the output archive file for + * a given archive file to enhance. + * + * @param archiveFileName the input archive file name + * @return the output archive file + */ + private File createArchiveOutputFile(String archiveFileName) + { + return new File(options.destDir.value, + new File(archiveFileName).getName()); + } + + /** + * Creates the output file for an enhanced class- or archive file. If = the + * enhanced file is written back depends on the command line options. + * + * @param enhanced Has the input file been enhanced? + * @param fileName The name of the output file. + * @param temp The temp file, the output is written to. + * @exception IOException If the file could not be created. + */ + private void createOutputFile(boolean enhanced, + String fileName, + File temp) + throws IOException + { + //noWrite or (not enhanced and not forceWrite) + if (options.noWrite.value + || (!enhanced && !options.forceWrite.value)) { + temp.deleteOnExit(); + return; + } + + // create file and its parent directory + final File file =3D new File(options.destDir.value, fileName); + final File dir =3D file.getAbsoluteFile().getParentFile(); + if (!dir.exists() && !dir.mkdirs()) { + throw new IOException("Error creating directory '" + + dir.getAbsolutePath() + "'."); + } + + file.delete(); //delete old file if exists + boolean renamed =3D temp.renameTo(file); + if (!renamed) { + //@dave: empirical evidence shows that renameTo does not allow= for + // crossing filesystem boundaries. If it fails, try "by hand". + InputStream in =3D null; + OutputStream out =3D null; + try { + in =3D new FileInputStream(temp); + out =3D new FileOutputStream(file); + int PAGESIZE =3D 4096; // Suggest a better size? + byte data[] =3D new byte[PAGESIZE]; + while (in.available() > 0) { + int numRead =3D in.read(data, 0, PAGESIZE); + out.write(data, 0, numRead); + } + renamed =3D true; + } catch (IOException ex) { + throw new IOException("Could not rename temp file '" + + temp.getAbsolutePath() + + "' to '" + file.getAbsolutePath() + + "': " + ex); + } finally { + closeInputStream(in); + closeOutputStream(out); + } + if (renamed) { + temp.delete(); //delete temporary file + } + else { + throw new IOException("Could not rename temp file '" + + temp.getAbsolutePath() + + "' to '" + file.getAbsolutePath() + = "'."); + } + } + } + + /** + * Closes an output stream. + * + * @param out the output stream + */ + private void closeOutputStream(OutputStream out) + { + if (out !=3D null) { + try { + out.close(); + } catch (IOException ex) { + printlnErr("", ex, options.verbose.value); + } + } + } + + // -------------------------------------------------------------------= --- + + /** + * Initializes all components. + */ + protected void init() + throws EnhancerFatalError, EnhancerUserException + { + super.init(); + + final Properties props =3D new Properties(); + if (options.verbose.value) { + props.put(EnhancerFilter.VERBOSE_LEVEL, + EnhancerFilter.VERBOSE_LEVEL_VERBOSE); + } + =20 + if (options.doTiming.value) { + props.put(EnhancerFilter.DO_TIMING_STATISTICS, + Boolean.TRUE.toString()); + } + + if (options.dumpClass.value) { + props.put(EnhancerFilter.DUMP_CLASS, + Boolean.TRUE.toString()); + } + + if (options.noAugment.value) { + props.put(EnhancerFilter.NO_AUGMENT, + Boolean.TRUE.toString()); + } + + if (options.noAnnotate.value) { + props.put(EnhancerFilter.NO_ANNOTATE, + Boolean.TRUE.toString()); + } + + try { + enhancer =3D new EnhancerFilter(jdoMeta, props, out, err); + if (options.doTiming.value) { + // wrap with timing byte-code enhancer + enhancer =3D new ClassFileEnhancerTimer(enhancer); + } + } catch (EnhancerUserException ex) { + printlnErr("Error while creating the enhancer", ex,=20 + options.verbose.value); + throw ex; + } catch (EnhancerFatalError ex) { + // enhancer is not anymore guaranteed to be consistent + printlnErr("Fatal error while creating the enhancer", ex,=20 + options.verbose.value); + enhancer =3D null; + throw ex; + } catch (RuntimeException ex) { + // enhancer is not anymore guaranteed to be consistent + printlnErr("Internal error while creating the enhancer", ex,=20 + options.verbose.value); + enhancer =3D null; + throw new EnhancerFatalError(ex); + } + } + + /** + * Run the enhancer. + */ + protected int process() + { + return enhanceInputFiles(options.classNames, + options.classFileNames, + options.archiveFileNames); + } + + // -------------------------------------------------------------------= --- + + /** + * Runs this class + */ + static public void main(String[] args) + { + final PrintWriter out =3D new PrintWriter(System.out, true); + out.println("--> EnhancerMain.main()"); + //out.println("JDO RI Class-File Enhancer"); + final EnhancerMain main =3D new EnhancerMain(out, out); + int res =3D main.run(args); + //out.println("done."); + out.println("<-- EnhancerMain.main(): exit =3D " + res); + System.exit(res); + } +} Added: incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/enhancer/Main= .java URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/enhancer20/src/java/= org/apache/jdo/enhancer/Main.java?rev=3D171351&view=3Dauto =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/enhancer/Main.ja= va (added) +++ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/enhancer/Main.ja= va Sun May 22 10:55:51 2005 @@ -0,0 +1,957 @@ +/* + * Copyright 2005 The Apache Software Foundation. + *=20 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at=20 + *=20 + * http://www.apache.org/licenses/LICENSE-2.0 + *=20 + * Unless required by applicable law or agreed to in writing, software=20 + * distributed under the License is distributed on an "AS IS" BASIS,=20 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied= .=20 + * See the License for the specific language governing permissions and=20 + * limitations under the License. + */ + +package org.apache.jdo.enhancer; + +import java.io.IOException; +import java.io.FileNotFoundException; +import java.io.File; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.PrintWriter; +import java.io.FileReader; +import java.io.BufferedReader; + +import java.util.Map; +import java.util.List; +import java.util.Collection; +import java.util.Enumeration; +import java.util.Iterator; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Properties; +import java.util.StringTokenizer; + +import java.util.zip.ZipFile; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; +import java.util.zip.ZipException; + +import java.net.URL; + +import org.apache.jdo.impl.enhancer.ClassFileEnhancer; +import org.apache.jdo.impl.enhancer.ClassFileEnhancerHelper; +import org.apache.jdo.impl.enhancer.ClassFileEnhancerTimer; +import org.apache.jdo.impl.enhancer.EnhancerFatalError; +import org.apache.jdo.impl.enhancer.EnhancerUserException; +import org.apache.jdo.impl.enhancer.OutputStreamWrapper; +import org.apache.jdo.impl.enhancer.core.EnhancerFilter; +import org.apache.jdo.impl.enhancer.meta.EnhancerMetaData; +import org.apache.jdo.impl.enhancer.meta.EnhancerMetaDataFatalError; +import org.apache.jdo.impl.enhancer.meta.model.EnhancerMetaDataJDOModelImp= l; +import org.apache.jdo.impl.enhancer.meta.prop.EnhancerMetaDataPropertyImpl; +import org.apache.jdo.impl.enhancer.meta.util.EnhancerMetaDataBaseModel; +import org.apache.jdo.impl.enhancer.meta.util.EnhancerMetaDataTimer; +import org.apache.jdo.impl.enhancer.util.CombinedResourceLocator; +import org.apache.jdo.impl.enhancer.util.ListResourceLocator; +import org.apache.jdo.impl.enhancer.util.PathResourceLocator; +import org.apache.jdo.impl.enhancer.util.ResourceLocator; +import org.apache.jdo.impl.enhancer.util.ResourceLocatorTimer; +import org.apache.jdo.impl.enhancer.util.Support; + + + + + +/** + * Main is the starting point for the persistent filter tool. + */ +public class Main + extends Support +{ + // return values of main() + static public final int OK =3D 0; + static public final int USAGE_ERROR =3D -1; + static public final int METADATA_ERROR =3D -2; + static public final int CLASS_LOCATOR_ERROR =3D -3; + static public final int INTERNAL_ERROR =3D -4; + + /** + * The stream to write messages to. + */ + private final PrintWriter out =3D new PrintWriter(System.out, true); + + /** + * The stream to write error messages to. + */ + private final PrintWriter err =3D new PrintWriter(System.err, true); + + /** + * The command line options. + */ + private final CmdLineOptions opts =3D new CmdLineOptions(); + + /** + * The byte code enhancer. + */ + private ClassFileEnhancer enhancer; + + /** + * The locator for classes. + */ + protected ResourceLocator classLocator; + + /** + * The metadata for the enhancer. + */ + private EnhancerMetaData jdoMetaData; + + /** + * Construct a filter tool instance + */ + public Main() + {} + + // -------------------------------------------------------------------= --- + + /** + * This is where it all starts. + */ + public static void main(String[] argv) + { + int res; + final Main main =3D new Main(); + + //@olsen: added support for timing statistics + try { + res =3D main.process(argv); + } catch (RuntimeException ex) { + main.out.flush(); + main.err.println("Internal error while postprocessing: " + + ex.getMessage()); + ex.printStackTrace(main.err); + main.err.flush(); + res =3D INTERNAL_ERROR; + } finally { + //@olsen: added support for timing statistics + if (main.opts.doTiming) { + Support.timer.print(); + } + } + System.exit(res); + } + + /** + * Process command line options and run enhancer. + */ + public int process(String[] argv) + { + int res; + + if ((res =3D opts.processArgs(argv)) !=3D OK) { + printMessage("aborted with errors."); + return res; + } + + //@olsen: added support for timing statistics + try { + if (opts.doTiming) { + timer.push("Main.process(String[])"); + } + + if ((res =3D createEnhancer()) !=3D OK) { + printMessage("aborted with errors."); + return res; + } + + if ((res =3D enhanceInputFiles(opts.classNames, + opts.classFileNames, + opts.zipFileNames, + opts.jdoFileNames)) !=3D OK) { + printMessage("aborted with errors."); + return res; + } + + printMessage("done."); + return 0; + } finally { + if (opts.doTiming) { + timer.pop(); + } + } + } + + // -------------------------------------------------------------------= --- + + /** + * A class for holding the command line options. + */ + private class CmdLineOptions + { + final List classNames =3D new ArrayList(); =20 + final List classFileNames =3D new ArrayList(); =20 + final List zipFileNames =3D new ArrayList(); =20 + final List jdoFileNames =3D new ArrayList(); =20 + String sourcePath =3D null; + String destinationDirectory =3D null; + String propertiesFileName =3D null; + boolean doTiming =3D false; + boolean verbose =3D false; + boolean quiet =3D false; + boolean forceWrite =3D false; + boolean noWrite =3D false; + boolean dumpClass =3D false; + boolean noAugment =3D false; + boolean noAnnotate =3D false; + + /** + * Print a usage message to System.err. + */ + public void usage() { + err.println("Usage: main ..."); + err.println("Options:"); + err.println(" -h, --help print usage message an= d exit gently"); + err.println(" -v, --verbose print verbose messages= "); + err.println(" -q, --quiet supress warnings"); + err.println(" -s, --sourcepath source path for jdo an= d classfiles"); + err.println(" -d, --destdir destination directory = for output files"); + err.println(" -f, --force overwrite output files= "); + err.println(" -n, --nowrite never write output fil= es"); + err.println(" -t, --timing do timing messures"); + err.println(); + err.println("Debugging Options:"); + err.println(" --properties use property file for = meta data"); + err.println(" --dumpclass print out disassembled= code of classes"); + err.println(" --noaugment do not enhance for per= sistence-capability"); + err.println(" --noannotate do not enhance for per= sistence-awareness"); + err.println(); + err.println("Arguments:"); + //err.println(" the fully qualified name of a Ja= va class"); + err.println(" the name of a .jdo file"); + err.println(" the name of a .class file"); + //err.println(" the name of a .zip or .jar file"= ); + err.println(); + err.println("Returns a non-zero value in case of errors."); + } + + /** + * Process command line options. + */ + protected int processArgs(String[] argv) + { + final Collection inputNames =3D new ArrayList(); + for (int i =3D 0; i < argv.length; i++) { + final String arg =3D argv[i]; + if (arg.equals("-h") + || arg.equals("--help")) { + usage(); + return OK; + } + if (arg.equals("-v") + || arg.equals("--verbose")) { + verbose =3D true; + quiet =3D false; + continue; + } + if (arg.equals("-q") + || arg.equals("--quiet")) { + quiet =3D true; + verbose =3D false; + continue; + } + if (arg.equals("-t") || + arg.equals("--timing")) { + doTiming =3D true; + continue; + } + if (arg.equals("-f") + || arg.equals("--force")) { + forceWrite =3D true; + noWrite =3D false; + continue; + } + if (arg.equals("-n") + || arg.equals("--nowrite")) { + noWrite =3D true; + forceWrite =3D false; + continue; + } + if (arg.equals("--dumpclass")) { + dumpClass =3D true; + continue; + } + if (arg.equals("--noaugment")) { + noAugment =3D true; + continue; + } + if (arg.equals("--noannotate")) { + noAnnotate =3D true; + continue; + } + if (arg.equals("-s") + || arg.equals("--sourcepath")) { + if (argv.length - i < 2) { + printError("Missing argument to the -s/--sourcepat= h option", null); + usage(); + return USAGE_ERROR; + } + sourcePath =3D argv[++i]; + continue; + } + if (arg.equals("-d") + || arg.equals("--destdir")) { + if (argv.length - i < 2) { + printError("Missing argument to the -d/-destdir op= tion", null); + usage(); + return USAGE_ERROR; + } + destinationDirectory =3D argv[++i]; + continue; + } + if (arg.equals("--properties")) { + if (argv.length - i < 2) { + printError("Missing argument to the --properties o= ption", null); + usage(); + return USAGE_ERROR; + } + propertiesFileName =3D argv[++i]; + continue; + } + if (arg.length() > 0 && arg.charAt(0) =3D=3D '-') { + printError("Unrecognized option:" + arg, null); + usage(); + return USAGE_ERROR; + } + if (arg.length() =3D=3D 0) { + printMessage("Ignoring empty command line argument."); + continue; + } + + inputNames.add(arg); + } + + // group input file arguments + for (Iterator names =3D inputNames.iterator(); names.hasNext()= ;) { + final String name =3D (String)names.next(); + if (isJdoFileName(name)) { + jdoFileNames.add(name); + } else if (isClassFileName(name)) { + classFileNames.add(name); + } else if (isZipFileName(name)) { + zipFileNames.add(name); + } else { + classNames.add(name); + } + } + + if (verbose) { + printArgs(); + } + return checkArgs(); + } + + /** + * Check command line options. + */ + protected int checkArgs() + { + // at least one class must be specified + if (classNames.isEmpty() + && classFileNames.isEmpty() + && zipFileNames.isEmpty()) { + final String msg + =3D "No classes specified"; + printError(msg, null); + usage(); + return USAGE_ERROR; + } + + // at least one meta-data source must be specified for classfi= les + if (classFileNames.size() > 0 + && (jdoFileNames.isEmpty() + && propertiesFileName =3D=3D null + && sourcePath =3D=3D null)) { + final String msg + =3D "No JDO meta-data source specified for class files= "; + printError(msg, null); + usage(); + return USAGE_ERROR; + } + + // either jdo files or jdo properties specified + if (!jdoFileNames.isEmpty() && propertiesFileName !=3D null) { + final String msg + =3D "Cannot have both jdo files and properties specifi= ed"; + printError(msg, null); + usage(); + return USAGE_ERROR; + } + + return OK; + } + + /** + * Print command line options. + */ + protected void printArgs() + { + out.println("Enhancer: options:"); + out.println(" verbose =3D " + verbose); + out.println(" quiet =3D " + quiet); + out.println(" forceWrite =3D " + forceWrite); + out.println(" noWrite =3D " + noWrite); + out.println(" sourcePath =3D " + sourcePath); + out.println(" destinationDirectory =3D " + destinationDirec= tory); + out.println(" propertiesFileName =3D " + propertiesFileName= ); + out.println(" doTiming =3D " + doTiming); + out.println(" classNames =3D {"); + for (Iterator i =3D classNames.iterator(); i.hasNext();) { + out.println(" " + i.next()); + } + out.println(" }"); + out.println(" jdoFileNames =3D {"); + for (Iterator i =3D jdoFileNames.iterator(); i.hasNext();) { + out.println(" " + i.next()); + } + out.println(" }"); + out.println(" classFileNames =3D {"); + for (Iterator i =3D classFileNames.iterator(); i.hasNext();) { + out.println(" " + i.next()); + } + out.println(" }"); + out.println(" zipFileNames =3D {"); + for (Iterator i =3D zipFileNames.iterator(); i.hasNext();) { + out.println(" " + i.next()); + } + out.println(" }"); + out.println(" dumpClass =3D " + dumpClass); + out.println(" noAugment =3D " + noAugment); + out.println(" noAnnotate =3D " + noAnnotate); + } + } + + private int initClassLocator() + { + final boolean verbose =3D opts.verbose; + final List classFileNames =3D opts.classFileNames; + final List zipFileNames =3D opts.zipFileNames; + final String sourcePath =3D opts.sourcePath; + try { + final List locators =3D new ArrayList(); + + // create resource locator for specified class files + if (classFileNames !=3D null && !classFileNames.isEmpty()) { + final ResourceLocator classes + =3D new ListResourceLocator(out, verbose, classFileNam= es); + if (verbose) { + out.println("Class Locator: using class files: {"); + for (Iterator i =3D classFileNames.iterator(); i.hasNe= xt();) { + out.println(" " + i.next()); + } + out.println("}"); + } + locators.add(classes); + } + + // create resource locator for specified zip files + if (zipFileNames !=3D null && !zipFileNames.isEmpty()) { + final StringBuffer s =3D new StringBuffer(); + final Iterator i =3D zipFileNames.iterator(); + s.append(i.next()); + while (i.hasNext()) { + s.append(File.pathSeparator + i.next()); + } + final ResourceLocator zips + =3D new PathResourceLocator(out, verbose, s.toString()= ); + if (verbose) + out.println("Class Locator: using jar/zip files: " + + s.toString()); + locators.add(zips); + } + + // create resource locator for specified source path + if (sourcePath !=3D null && sourcePath.length() > 0) { + final ResourceLocator path + =3D new PathResourceLocator(out, verbose, sourcePath); + if (verbose) + out.println("Class Locator: using source path: " + + sourcePath); + locators.add(path); + } + + // print warning if no classes specified + affirm(!locators.isEmpty()); + //if (locators.isEmpty()) { + // printWarning(getI18N("enhancer.using_no_classes")); + //} + + // init class locators + classLocator + =3D new CombinedResourceLocator(out, verbose, locators); + + // wrap with timing class locator + if (opts.doTiming) { + classLocator =3D new ResourceLocatorTimer(classLocator); + } + } catch (IOException ex) { + printError("Cannot initialize resource locator for classes", e= x); + return CLASS_LOCATOR_ERROR; + } + return OK; + } + + private int initEnhancerMetaData() + { + final boolean verbose =3D opts.verbose; + final String propertiesFileName =3D opts.propertiesFileName; + final List jdoFileNames =3D opts.jdoFileNames; + final List zipFileNames =3D opts.zipFileNames; + final String sourcePath =3D opts.sourcePath; + try { + if (propertiesFileName !=3D null) { + jdoMetaData + =3D new EnhancerMetaDataPropertyImpl(out, verbose, + propertiesFileName); + } else { + jdoMetaData + =3D new EnhancerMetaDataJDOModelImpl(out, verbose, + jdoFileNames, + zipFileNames, + sourcePath); + } + + // wrap with timing meta data object + if (opts.doTiming) { + jdoMetaData =3D new EnhancerMetaDataTimer(jdoMetaData); + } + } catch (EnhancerMetaDataFatalError ex) { + printError("Cannot initialize JDO meta-data source", ex); + return METADATA_ERROR; + } + return OK; + } + =20 + private int createEnhancer() + { + int res0 =3D initClassLocator(); + if (res0 < 0) { + return res0; + } + affirm(classLocator !=3D null); + + int res =3D initEnhancerMetaData(); + if (res < 0) { + return res; + } + affirm(jdoMetaData !=3D null); + + final Properties props =3D new Properties(); + if (opts.verbose) { + props.put(EnhancerFilter.VERBOSE_LEVEL, + EnhancerFilter.VERBOSE_LEVEL_VERBOSE); + } + =20 + if (opts.doTiming) { + props.put(EnhancerFilter.DO_TIMING_STATISTICS, + Boolean.TRUE.toString()); + } + + if (opts.dumpClass) { + props.put(EnhancerFilter.DUMP_CLASS, + Boolean.TRUE.toString()); + } + + if (opts.noAugment) { + props.put(EnhancerFilter.NO_AUGMENT, + Boolean.TRUE.toString()); + } + + if (opts.noAnnotate) { + props.put(EnhancerFilter.NO_ANNOTATE, + Boolean.TRUE.toString()); + } + + try { =20 + enhancer =3D new EnhancerFilter(jdoMetaData, props, out, err); + if (opts.doTiming) { + // wrap with timing byte-code enhancer + enhancer =3D new ClassFileEnhancerTimer(enhancer); + } + return 0; + } catch (EnhancerUserException ex) { + printError("Error while creating the enhancer", ex); + return -1; + } catch (EnhancerFatalError ex) { + // enhancer is not anymore guaranteed to be consistent + printError("Fatal error while creating the enhancer", ex); + enhancer =3D null; + return -1; + } + } + + // -------------------------------------------------------------------= --- + + /** + * Enhances all files entered in the command line. + * + * @param classNames List of class names. + * @param classFileNames List of class file names. + * @param zipFileNames List of zip file names. + * @param jdoFileNames List of jdo file names. + */ + private int enhanceInputFiles(List classNames, + List classFileNames, + List zipFileNames, + List jdoFileNames) + { + int res =3D 0; + try { + String name =3D null; + for (Iterator i =3D zipFileNames.iterator(); i.hasNext();) { + try { + name =3D (String)i.next(); + enhanceZipFile(name); + } catch (EnhancerUserException ex) { + printError("Error while enhancing " + name, ex); + res++; + continue; + } + } + for (Iterator i =3D classFileNames.iterator(); i.hasNext();) { + try { + name =3D (String)i.next(); + enhanceClassFile(openFileInputStream(name)); + } catch (EnhancerUserException ex) { + printError("Error while enhancing " + name, ex); + res++; + continue; + } + } + for (Iterator i =3D classNames.iterator(); i.hasNext();) { + try { + name =3D (String)i.next(); + enhanceClassFile(openClassInputStream(name)); + } catch (EnhancerUserException ex) { + printError("Error while enhancing " + name, ex); + res++; + continue; + } + } + } catch (IOException ex) { + printError("IO Error while enhancing", ex); + return ++res; + } catch (EnhancerFatalError ex) { + // enhancer is not anymore guaranteed to be consistent + printError("Fatal error while enhancing", ex); + enhancer =3D null; + return ++res; + } + return res; + } + + /** + * Enhances a classfile. + * + * @param in The input stream of the classfile. + */ + private void enhanceClassFile(InputStream in) + throws IOException, EnhancerUserException, EnhancerFatalError + { + OutputStream out =3D null; + try { + final File temp =3D File.createTempFile("enhancer", ".class"); + out =3D new BufferedOutputStream(new FileOutputStream(temp)); + + //enhance + final OutputStreamWrapper wrapper =3D new OutputStreamWrapper(= out); + final boolean enhanced =3D enhancer.enhanceClassFile(in, wrapp= er); + + closeOutputStream(out); + out =3D null; + createOutputFile(enhanced, + createClassFileName(wrapper.getClassName()), + temp); + } finally { + closeInputStream(in); + closeOutputStream(out); + } + } + + /** + * Enhances a zipfile. + * + * @param filename The filename of the zipfile. + */ + private void enhanceZipFile(String filename) + throws IOException, EnhancerUserException, EnhancerFatalError + { + ZipInputStream in =3D null; + ZipOutputStream out =3D null; + try { + final File temp =3D File.createTempFile("enhancer", ".zip"); + in =3D new ZipInputStream(new BufferedInputStream( + new FileInputStream(new File(filename)))); + out =3D new ZipOutputStream(new BufferedOutputStream( + new FileOutputStream(temp))); + + //enhance the zipfile + final boolean enhanced + =3D ClassFileEnhancerHelper.enhanceZipFile(enhancer, in, o= ut); + + //create the output file + closeOutputStream(out); + out =3D null; + createOutputFile(enhanced, new File(filename).getName(), temp); + } finally { + closeOutputStream(out); + closeInputStream(in); + } + } + + /** + * Opens an input stream for the given filename + * + * @param filename The name of the file. + * @return The input stream. + * @exception FileNotFoundException If the file could not be found. + */ + static private InputStream openFileInputStream(String filename) + throws FileNotFoundException + { + return new BufferedInputStream(new FileInputStream(new File(filename= ))); + } + + /** + * Opens an input stream for the given classname. The input stream is + * created via an URL that is obtained by the value of the sourcepath + * option and zip/jar file arguments. + *=20 + * @param classname The name of the class (dot-notation). + * @return The input stream. + * @exception IOException If an I/O error occured. + */ + private InputStream openClassInputStream(String classname) + throws IOException + { + final String resourcename =3D createClassFileName(classname); + return classLocator.getInputStreamForResource(resourcename); + } + + /** + * Creates a file object that represents the output zipfile for a giv= en + * zipfile to enhance. + * + * @param zipfilename The input zipfile name. + * @return The output zipfile name. + */ + private File createZipOutputFile(String zipfilename) + { + return new File(opts.destinationDirectory, + new File(zipfilename).getName()); + } + + /** + * Creates the output file for an enhaced class- or zipfile. If the + * enhanced file is written back depends on the command line options. + * + * @param enhanced Has the input file been enhanced? + * @param filename The name of the output file. + * @param temp The temp file, the output is written to. + * @exception IOException If the file could not be created. + */ + private void createOutputFile(boolean enhanced, + String filename, + File temp) + throws IOException + { + //noWrite or (not enhanced and not forceWrite) + if (opts.noWrite || (!enhanced && !opts.forceWrite)) { + temp.deleteOnExit(); + return; + } + + File file =3D new File(opts.destinationDirectory, filename); + createPathOfFile(file); + file.delete(); //delete old file if exists + boolean renamed =3D temp.renameTo(file); + if (!renamed) { + //@dave: empirical evidence shows that renameTo does not allow= for + // crossing filesystem boundaries. If it fails, try "by hand". + InputStream in =3D null; + OutputStream out =3D null; + try { + in =3D new FileInputStream(temp); + out =3D new FileOutputStream(file); + int PAGESIZE =3D 4096; // Suggest a better size? + byte data[] =3D new byte[PAGESIZE]; + while (in.available() > 0) { + int numRead =3D in.read(data, 0, PAGESIZE); + out.write(data, 0, numRead); + } + renamed =3D true; + } catch (IOException ex) { + throw new IOException("Could not rename temp file '" + + temp.getAbsolutePath() + + "' to '" + file.getAbsolutePath() + + "': " + ex); + } finally { + closeInputStream(in); + closeOutputStream(out); + } + if (renamed) { + temp.delete(); //delete temporary file + } + else { + throw new IOException("Could not rename temp file '" + + temp.getAbsolutePath() + + "' to '" + file.getAbsolutePath() + = "'."); + } + } + } + + /** + * Closes an input stream. + * + * @param in The input stream. + */ + private void closeInputStream(InputStream in) + { + if (in !=3D null) { + try { + in.close(); + } catch (IOException ex) { + printError(null, ex); + } + } + } + + /** + * Closes an output stream. + * + * @param out The output stream. + */ + private void closeOutputStream(OutputStream out) + { + if (out !=3D null) { + try { + out.close(); + } catch (IOException ex) { + printError(null, ex); + } + } + } + + /** + * Tests if a filename is a classfile name (by testing if the filename + * ends with ".class"). + * + * @param filename The name of the file. + * @return Do we have a potential classfile? + */ + static private boolean isClassFileName(String filename) + { + return filename.toLowerCase().endsWith(".class"); + } + + /** + * Tests if a filename is a zipfile (by testing if the filename + * ends with ".zip" or ".jar"). + * + * @param filename The name of the file. + */ + static private boolean isZipFileName(String filename) + { + final int n =3D filename.length(); + if (n < 5) { + return false; + } + final String ext =3D filename.substring(n - 4); + return ext.equalsIgnoreCase(".zip") || ext.equalsIgnoreCase(".jar"= ); + } + + /** + * Tests if a filename is a jdo file name (by testing if the filename + * ends with ".jdo"). + * + * @param filename The name of the file. + * @return Do we have a potential jdo file? + */ + static private boolean isJdoFileName(String filename) + { + return filename.toLowerCase().endsWith(".jdo"); + } + + /** + * Creates a filename from a classname. + * This is done by replacing '.' by '/'. + * + * @param classname The classname. + * @return The filename. + */ + static private String createClassFileName(String classname) + { + return classname.replace('.', '/') + ".class"; + } + + /** + * Creates only the path of the given file. + * + * @param file The file. + * @exception IOException If an error occured. + */ + static private void createPathOfFile(File file) + throws IOException + { + File dir =3D file.getAbsoluteFile().getParentFile(); + if (!dir.exists() && !dir.mkdirs()) { + throw new IOException("Error creating directory '" + + dir.getAbsolutePath() + "'."); + } + } + + // -------------------------------------------------------------------= --- + + /** + * Prints out an error. + * + * @param msg The error message (can be null). + * @param ex An optional exception (can be null). + */ + private void printError(String msg, + Throwable ex) + { + out.flush(); + if (msg !=3D null) { + err.println(msg); + } + if (ex !=3D null) { + if (opts.verbose) { + ex.printStackTrace(err); + } + else { + err.println(ex.toString()); + } + } + } + + /** + * Prints out a message. + * + * @param msg The message. + */ + private void printMessage(String msg) + { + out.println(msg); + } +} Added: incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/enhancer/pack= age.html URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/enhancer20/src/java/= org/apache/jdo/enhancer/package.html?rev=3D171351&view=3Dauto =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/enhancer/package= .html (added) +++ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/enhancer/package= .html Sun May 22 10:55:51 2005 @@ -0,0 +1,26 @@ + + + + +Package org.apache.jdo.enhancer + + + + +

This package contains th eenhancer interface.

+ + Added: incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer= /Bundle.properties URL: http://svn.apache.org/viewcvs/incubator/jdo/trunk/enhancer20/src/java/= org/apache/jdo/impl/enhancer/Bundle.properties?rev=3D171351&view=3Dauto =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/Bu= ndle.properties (added) +++ incubator/jdo/trunk/enhancer20/src/java/org/apache/jdo/impl/enhancer/Bu= ndle.properties Sun May 22 10:55:51 2005 @@ -0,0 +1,220 @@ + + Copyright 2005 The Apache Software Foundation. +=20 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at=20 +=20 + http://www.apache.org/licenses/LICENSE-2.0 +=20 + Unless required by applicable law or agreed to in writing, software=20 + distributed under the License is distributed on an "AS IS" BASIS,=20 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.=20 + See the License for the specific language governing permissions and=20 + limitations under the License. + + +# ResourceBundle properties file for model messages +# key consists of: enhancer.. +# - is optional, package under model +# - short description (use _ to represent space) +# all keys should be in lowercase + +# +# Global Enhancer Metadata messages +# + +# {0}=3Ddetail message +enhancer.metadata.message=3DJDO ENHANCER: Metadata: {0} + +# {0}=3Derror message +enhancer.metadata.error=3DJDO ENHANCER: Metadata Error: {0} + +# {0}=3Dwarning message +enhancer.metadata.warning=3DJDO ENHANCER: Metadata Warning: {0} + +# {0}=3Dmissing resource file +enhancer.metadata.cannot_read_resource=3DCannot read directory or jar file= : {0} + +# +# Detail Enhancer Metadata messages +# + +# {0}=3Dexception message +enhancer.metadata.jdomodel_error=3DA JDO model exception has occurred: {0} + +# {0}=3Dexception message +enhancer.metadata.io_error=3DAn I/O exception has occurred: {0} + +# {0}=3Dfilename +enhancer.metadata.using_properties=3Dusing properties file: {0} + +# {0}=3Dfilenames +enhancer.metadata.using_jdo_files=3Dusing jdo files: {0} + +# {0}=3Dpath +enhancer.metadata.using_jar_files=3Dusing jar/zip files: {0} + +# {0}=3Dpath +enhancer.metadata.using_source_path=3Dusing source path: {0} + +# {0}=3D +enhancer.metadata.using_no_metadata=3Dno JDO metadata source was specified + + +# +# Global enhancer messages +# + +# {0}=3Ddetailed message +enhancer.message=3DJDO ENHANCER: {0} + +# {0}=3Ddetailed message +enhancer.error=3DJDO ENHANCER: At least one error occurred while enhancing= input class for Transparent Persistence; detailed message(s): {0} + +# {0}=3Derror number, {1}=3Ddetailed message +enhancer.enumerated_error=3DJDO ENHANCER: Error ({0}): {1} + +# {0}=3Ddetailed message +enhancer.internal_error=3DJDO ENHANCER: An internal error occurred while e= nhancing input class; detailed message: {0} + +# {0}=3Ddetailed message +enhancer.warning=3DJDO ENHANCER: Warning: {0} + +# +# Enhancer core messages +# + +# +enhancer.class_format_error=3DI/O error while reading input stream or inpu= t stream does not denote a valid Java class. + +# +enhancer.io_error_while_writing_stream=3DI/O error while writing output st= ream. + +# {0}=3Ddir name +enhancer.unable_to_create_dir=3DUnable to create the directory named {0}. + +# {0}=3Dclass name +enhancer.class_previously_annotated=3DThe class {0} was previously annotat= ed. + +# {0}=3Dboolean +enhancer.class_implements_jdo_pc=3Dimplements the JDO PersistenceCapable i= nterface: {0}. + +# +enhancer.class_has_default_constructor=3Dhas default constructor. +enhancer.class_has_not_default_constructor=3Dhas not default constructor. + +# +enhancer.class_has_static_initializer=3Dhas static initializer. +enhancer.class_has_not_static_initializer=3Dhas not static initializer. + +# +enhancer.class_has_clone_method=3Dhas clone method. +enhancer.class_has_not_clone_method=3Dhas not clone method. + +# +enhancer.class_has_writeObject_method=3Dhas writeObject method. +enhancer.class_has_not_writeObject_method=3Dhas not writeObject method. + +# +enhancer.class_has_writeReplace_method=3Dhas writeReplace method. +enhancer.class_has_not_writeReplace_method=3Dhas not writeReplace method. + +# +enhancer.class_has_readObject_method=3Dhas readObject method. +enhancer.class_has_not_readObject_method=3Dhas not readObject method. + +# {0}=3Dclass name +enhancer.class_missing_default_constructor=3DThe persistence-capable class= {0} does not provide a default (no-argument) constructor. + +# {0}=3Dboolean +enhancer.class_has_generic_jdo_fields=3Dhas the generic JDO fields: {0}. + +# {0}=3Dboolean +enhancer.class_has_generic_jdo_methods=3Dhas the generic JDO methods: {0}. + +# {0}=3Dboolean +enhancer.class_has_generic_jdo_members=3Dhas the generic JDO fields and me= thods: {0}. + +# {0}=3Dboolean +enhancer.class_has_specific_jdo_fields=3Dhas the specific JDO fields: {0}. + +# {0}=3Dboolean +enhancer.class_has_specific_jdo_methods=3Dhas the specific JDO methods: {0= }=2E + +# {0}=3Dboolean +enhancer.class_has_specific_jdo_members=3Dhas the specific JDO fields and = methods: {0}. + +# {0}=3Dboolean +enhancer.class_has_oid_handling_jdo_methods=3Dhas the ObjectId-handling JD= O methods: {0}. + +# {0}=3Dboolean +enhancer.class_has_callback_jdo_methods=3Dhas the instance-callback JDO me= thods: {0}. + +# {0}=3Dclass name, {1}=3Dmethod name +enhancer.class_defines_jdo_method=3DThe persistence-capable class {0} defi= nes a JDO method called {1}. + +# {0}=3Dclass name, {1}=3Dfield name +enhancer.class_defines_jdo_field=3DThe persistence-capable class {0} defin= es a JDO field called {1}. + +# {0}=3Dclass name, {1}=3Dmember name +enhancer.class_has_jdo_like_member=3DThe persistence-capable class {0} def= ines a member {1} whose name starts with the reserved jdo prefix. + +# {0}=3Dclass name, {1}=3Dmethod name, +# {2}=3Dexpected signature, {3}=3Dfound signature +# {4}=3Dexpected modifiers, {5}=3Dfound modifiers +enhancer.class_has_illegally_declared_jdo_member=3DThe persistence-capable= class {0} has an illegally declared JDO member: {1}; expected signature: '= '{2}''; found signature: ''{3}''; expected access modifier flags: {4}; foun= d access modifier flags: {5}. + +# {0}=3Dclass name, {1}=3Dfound method names, {2}=3Dmissing method names +enhancer.class_has_inconsistently_declared_jdo_members=3DThe persistence-c= apable class {0} has an incosistent set of declared JDO members; found: {1}= ; missing: {2}. + +# +# Other Enhancer messages +# + +# {0}=3Dfilenames +enhancer.using_jdo_files=3Dusing jdo files: {0} + +# {0}=3Dpath +enhancer.using_archive_files=3Dusing jar/zip files: {0} + +# {0}=3Dpath +enhancer.using_source_path=3Dusing source path: {0} + +# {0}=3Dresource file name +enhancer.using_file=3Dusing file: {0} + +# {0}=3Dresource path element +enhancer.using_path_element=3Dusing path element: {0} + +# {0}=3Dclass name, {1}=3Dfile name, {2}=3Dfile name +enhancer.class_already_entered=3DThe class {0} from {1} is already entered= from {2}. + +# {0}=3Ddir name, {1}=3Ddir name +enhancer.destination_directory_already_set=3DAttempt to set the destinatio= n directory to {0}, but it has already been set to {1}. + +# {0}=3Ddir name +enhancer.destination_directory_not_exist=3DThe destination directory {0} d= oes not exist. + +# {0}=3Dresource name +enhancer.found_resource=3Dfound resource: {0} +enhancer.not_found_resource=3Dnot found resource: {0} + +# {0}=3Dresource name +enhancer.cannot_read_resource=3Dresource does not exist or cannot be read:= {0} + +# {0}=3Dresource name {1}=3Dexception message +enhancer.io_error_while_reading_resource=3DAn I/O exception has occurred w= hile reading resource: {0}, exception: {1} + +# {0}=3Dresource name +enhancer.io_error_while_reading_resource=3DAn I/O exception has occurred: = {0} + +# {0}=3Dresource name +enhancer.illegal_path_element=3Dillegal element source path: {0} + +# +# Enhancer exception messages +# + +MSG_CauseThrowable=3DCauseThrowable: +MSG_CauseThrowableStackTrace=3DCauseThrowableStackTrace: