[ http://issues.apache.org/jira/browse/DERBY-289?page=all ]
David Van Couvering updated DERBY-289:
--------------------------------------
Attachment: DERBY-289.diff
Hi, all. Here is the proposed patch that provides the framework for code
sharing. I was thinking folks could look at it and discuss, and then once
issues have (hopefully) been worked out, we can have a vote.
When you apply these changes, you need to manually create an empty master file
master/FeatureManagement.out
Summary of changes:
- Created new top-level source directory trunk/java/common
- common/org/apache/derby/common/package.html has a full description of the
framework and the guidelines around it. This is an updated version of the
policy as we worked out on the Wiki. The intention is that this becomes the
official guidelines (and gets updated as needed) once we vote on this and it
gets checked in
- Created some utilities for i18n and error handling that both the engine and
network client make use of
- Created a new SQLException class for the client, SQLException2, which makes
use of the common framework. I did this rather than modify the existing class
because I wanted a well-structured way to migrate exception code over
incrementally.
- Relocated iapi.services.sanity from the engine to the common area, since it's
shared by all (there are more opportunities like this, but this seemed like the
simplest example)
- Moved a few messages from the engine's messages_en.properties under the
engine directory to common-messages_en.properties under the common directory.
Note that I did not at this time move all the translations over. This is a
tedious manual job and I am going to write a tool to do this automatically once
all the messages are relocated (or we are ready for a release, whichever comes
first).
- Note that I did NOT move SQLState from iapi.reference at this time. What do
you all think -- should this be relocated at some point, since it is shared
code? It's irrelevant at runtime since it's a class that is simply constants,
so it doesn't even get included at runtime. Also
- Created some unit tests for the feature management aspects of the common
framework under tests/common. These are written as JUnit tests. They can be
relocated at some point if we identify a single area for new JUnit tests
- Modified the build to build the common code. I noticed that the build
infrastructure automatically picked up common code that the various jar files
depended on for derby.jar, derbytools.jar and derbynet.jar. This did not
appear to be the case for the client jar, so I modified the derbyclientjar
build target to add the common classes
This passes derbyall. The new unit tests for the common framework are not
included in derbyall as they can only be run against the classes directory, not
against jar files. This is because the unit tests depend on two "shared
component" jar files, and my classloader can't seem to find the classes inside
them when they are embedded inside another jar file (e.g. derbyTesting.jar).
They need to be jar files because they are two different versions of the same
component and they need to be sealed. An alternative approach is to keep them
outside of derbyTesting but I was loathe to add the requirement for two more
jar files in the classpath to run derbyall.
svn status output:
M tools\ant\properties\dirs.properties
M java\tools\org\apache\derby\impl\tools\sysinfo\Main.java
M java\engine\org\apache\derby\impl\services\monitor\BaseMonitor.java
M java\engine\org\apache\derby\iapi\services\i18n\BundleFinder.java
M java\engine\org\apache\derby\iapi\services\i18n\MessageService.java
M java\engine\org\apache\derby\iapi\services\sanity\SanityManager.java
D java\engine\org\apache\derby\iapi\services\sanity\SanityState.tmpl
M java\engine\org\apache\derby\iapi\services\sanity\AssertFailure.java
M java\engine\org\apache\derby\iapi\error\StandardException.java
M java\engine\org\apache\derby\iapi\error\ExceptionSeverity.java
M java\engine\org\apache\derby\iapi\reference\SQLState.java
M java\engine\org\apache\derby\loc\messages_de_DE.properties
M java\engine\org\apache\derby\loc\messages_zh_CN.properties
M java\engine\org\apache\derby\loc\messages_en.properties
M java\engine\org\apache\derby\loc\messages_ja_JP.properties
M java\engine\org\apache\derby\loc\messages_ko_KR.properties
M java\engine\org\apache\derby\loc\messages_pt_BR.properties
M java\engine\org\apache\derby\loc\messages_es.properties
M java\engine\org\apache\derby\loc\messages_fr.properties
M java\engine\org\apache\derby\loc\messages_zh_TW.properties
M java\engine\org\apache\derby\loc\messages_it.properties
A java\common
A java\common\org
A java\common\org\apache
A java\common\org\apache\derby
A java\common\org\apache\derby\common
A java\common\org\apache\derby\common\i18n
A java\common\org\apache\derby\common\i18n\MessageUtil.java
A java\common\org\apache\derby\common\CommonInfo.java
A java\common\org\apache\derby\common\SharedComponentInfo.java
A java\common\org\apache\derby\common\sanity
A java\common\org\apache\derby\common\sanity\SanityManager.java
A java\common\org\apache\derby\common\sanity\SanityState.tmpl
A java\common\org\apache\derby\common\sanity\SanityState.java
A java\common\org\apache\derby\common\sanity\AssertFailure.java
A java\common\org\apache\derby\common\CommonFeatures.java
A java\common\org\apache\derby\common\error
A java\common\org\apache\derby\common\error\ExceptionSeverity.java
A java\common\org\apache\derby\common\error\ExceptionUtil.java
A java\common\org\apache\derby\common\package.html
A java\common\org\apache\derby\loc
A java\common\org\apache\derby\loc\common-messages_es.properties
A java\common\org\apache\derby\loc\common-messages_fr.properties
A java\common\org\apache\derby\loc\common-messages_zh_TW.properties
A java\common\org\apache\derby\loc\common-messages_it.properties
A java\common\org\apache\derby\loc\common-messages.properties
A java\common\org\apache\derby\loc\common-messages_de_DE.properties
A java\common\org\apache\derby\loc\common-messages_zh_CN.properties
A java\common\org\apache\derby\loc\common-messages_en.properties
A java\common\org\apache\derby\loc\common-messages_ja_JP.properties
A java\common\org\apache\derby\loc\common-messages_ko_KR.properties
A java\common\org\apache\derby\loc\common-messages_pt_BR.properties
A java\common\org\apache\derby\loc\build.xml
A java\common\build.xml
M java\testing\org\apache\derbyTesting\functionTests\tests\tools\build.xml
A java\testing\org\apache\derbyTesting\functionTests\tests\common
A
java\testing\org\apache\derbyTesting\functionTests\tests\common\FeatureManagement_app.properties
A java\testing\org\apache\derbyTesting\functionTests\tests\common\sc1
A
java\testing\org\apache\derbyTesting\functionTests\tests\common\sc1\TestSCInfo.java
A
java\testing\org\apache\derbyTesting\functionTests\tests\common\sc1\TestSCFeatures.java
A
java\testing\org\apache\derbyTesting\functionTests\tests\common\sc1\TestSharedClass.java
A java\testing\org\apache\derbyTesting\functionTests\tests\common\sc2
A
java\testing\org\apache\derbyTesting\functionTests\tests\common\sc2\NewClass.java
A
java\testing\org\apache\derbyTesting\functionTests\tests\common\sc2\TestSCInfo.java
A
java\testing\org\apache\derbyTesting\functionTests\tests\common\sc2\TestSCFeatures.java
A
java\testing\org\apache\derbyTesting\functionTests\tests\common\sc2\newPackage
A
java\testing\org\apache\derbyTesting\functionTests\tests\common\sc2\newPackage\NewPackageClass.java
A
java\testing\org\apache\derbyTesting\functionTests\tests\common\sc2\TestSharedClass.java
A
java\testing\org\apache\derbyTesting\functionTests\tests\common\FeatureManagement.java
A java\testing\org\apache\derbyTesting\functionTests\tests\common\build.xml
A
java\testing\org\apache\derbyTesting\functionTests\tests\common\copyfiles.ant
M
java\testing\org\apache\derbyTesting\functionTests\tests\jdbcapi\build.xml
A
java\testing\org\apache\derbyTesting\functionTests\master\FeatureManagement.out
M java\testing\build.xml
M java\client\org\apache\derby\jdbc\ClientBaseDataSource.java
A java\client\org\apache\derby\loc
A java\client\org\apache\derby\loc\client-messages_en.properties
A java\client\org\apache\derby\loc\build.xml
A java\client\org\apache\derby\loc\client-messages.properties
A java\client\org\apache\derby\client\i18n
A java\client\org\apache\derby\client\i18n\ClientMessageUtil.java
M java\client\org\apache\derby\client\ClientPooledConnection.java
M java\client\org\apache\derby\client\am\Connection.java
A java\client\org\apache\derby\client\am\SqlException2.java
M java\client\org\apache\derby\client\am\SqlException.java
M java\client\build.xml
M build.xml
> Enable code sharing between Derby client and engine
> ---------------------------------------------------
>
> Key: DERBY-289
> URL: http://issues.apache.org/jira/browse/DERBY-289
> Project: Derby
> Type: Improvement
> Components: Network Client
> Versions: 10.0.2.1, 10.0.2.0, 10.0.2.2, 10.1.1.0
> Environment: N/A
> Reporter: David Van Couvering
> Assignee: David Van Couvering
> Priority: Minor
> Fix For: 10.2.0.0
> Attachments: DERBY-289.diff
>
> Right now, there is no way for the Derby network client to share code with
> the Derby engine. We should have a separate jar file, e.g. derby_common.jar,
> that contains shared code and is used by both the client and the engine.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira