[ 
https://issues.apache.org/jira/browse/DERBY-6945?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16592686#comment-16592686
 ] 

Rick Hillegas commented on DERBY-6945:
--------------------------------------

Attaching derby-6945-48-ac-serverWithSecurityPolicy.diff. This patch makes a 
number of changes to support running the server with a module path and the 
default security policy:

1) Rewrites the module-finding logic. Now every module provides an 
implementation of a vacuous service which identifies modules. The vacuous 
service is called DerbyModuleAPI, the shared module declares that it uses this 
service, and all of the modules declare that they provide an implementation 
called DerbyModule. This lets us find all Derby modules via 
ServiceLoader.load(). The old logic could not find the server module.

2) Grants the shared module permission to read the Derby jar files in order to 
find message localizations when running with a module path under a security 
manager.

3) Exposes more engine packages to reflective access so that more generated 
classes work when running with a module path.

4) Makes further adjustments to the localization logic so that it can find 
server messages.

5) Misc cleanup.

Tests passed cleanly for me with this patch.

Touches the following files:

{noformat}
--------------------------------

M       
java/org.apache.derby.commons/org/apache/derby/shared/common/reference/ModuleUtil.java
M       
java/org.apache.derby.tools/org/apache/derby/impl/tools/sysinfo/Main.java

(1) Adjusts the module finder to use the new, vacuous Derby-identifying service.

--------------------------------

M       java/org.apache.derby.server/org/apache/derby/drda/server.policy
M       java/org.apache.derby.server/org/apache/derby/drda/template.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/derbynet/GetCurrentPropertiesTest.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/derbynet/NetworkServerControlApiTest.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/derbynet/ProtocolTest.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/derbynet/RuntimeInfoTest.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/engine/noDeregisterPermission.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/jdbc4/noAbortPermission.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/jdbcapi/LDAPTests.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/jdbcapi/XATest.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.initial.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.modified.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.unreloadable.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/lang/luceneSupport.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/lang/no_derby_internals.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/lang/resultSetReader.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/management/CacheManagerMBeanTest.withPerm.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/management/CacheManagerMBeanTest.withoutPerm.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/replicationTests/Derby5937SlaveShutdownTest.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/tools/derbyrunjartest.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/unit/fillLog.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/util/derby_tests.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/util/nwsvr.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/util/useprocessfalse.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/unitTests/junit/AssertFailureTest1.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/unitTests/junit/MissingPermissionsTest.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/unitTests/junit/MissingPermissionsTest1.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/unitTests/junit/MissingPermissionsTest2.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/unitTests/junit/SystemPrivilegesPermissionTest.policy
M       
java/org.apache.derby.tests/org/apache/derbyTesting/unitTests/junit/SystemPrivilegesPermissionTest1.policy

(2) Grants the shared module read access to the jars in the installation
directory so that message localizations can be read when running with
a module path and a security manager.

--------------------------------

A       java/locales/DerbyModule.template
M       java/locales/module-info.template
M       java/org.apache.derby.client/module-info.java
A       java/org.apache.derby.client/org/apache/derby/info
A       java/org.apache.derby.client/org/apache/derby/info/client
A       
java/org.apache.derby.client/org/apache/derby/info/client/DerbyModule.java
M       java/org.apache.derby.commons/module-info.java
A       java/org.apache.derby.commons/org/apache/derby/info
A       java/org.apache.derby.commons/org/apache/derby/info/shared
A       
java/org.apache.derby.commons/org/apache/derby/info/shared/DerbyModule.java
A       java/org.apache.derby.commons/org/apache/derby/shared/api
A       
java/org.apache.derby.commons/org/apache/derby/shared/api/DerbyModuleAPI.java
M       java/org.apache.derby.engine/module-info.java
A       java/org.apache.derby.engine/org/apache/derby/info
A       java/org.apache.derby.engine/org/apache/derby/info/engine
A       
java/org.apache.derby.engine/org/apache/derby/info/engine/DerbyModule.java
M       java/org.apache.derby.engine/org/apache/derby/loc/build.xml
M       java/org.apache.derby.optionaltools/module-info.java
A       java/org.apache.derby.optionaltools/org/apache/derby/optional/info
A       
java/org.apache.derby.optionaltools/org/apache/derby/optional/info/DerbyModule.java
M       java/org.apache.derby.runner/build.xml
M       java/org.apache.derby.runner/module-info.java
A       java/org.apache.derby.runner/org/apache/derby/run/info
A       java/org.apache.derby.runner/org/apache/derby/run/info/DerbyModule.java
M       java/org.apache.derby.server/module-info.java
A       java/org.apache.derby.server/org/apache/derby/info
A       java/org.apache.derby.server/org/apache/derby/info/net
A       java/org.apache.derby.server/org/apache/derby/info/net/DerbyModule.java
M       java/org.apache.derby.tests/module-info.java
A       java/org.apache.derby.tests/org/apache/derby/info
A       java/org.apache.derby.tests/org/apache/derby/info/tsting
A       
java/org.apache.derby.tests/org/apache/derby/info/tsting/DerbyModule.java
M       java/org.apache.derby.tools/module-info.java
A       java/org.apache.derby.tools/org/apache/derby/info
A       java/org.apache.derby.tools/org/apache/derby/info/tools
A       java/org.apache.derby.tools/org/apache/derby/info/tools/DerbyModule.java

(1) Creates a vacuous service (DerbyModuleAPI) for identifying Derby modules. 
Every
module provides an implementation of this service (DerbyModule) and its
module descriptor declares the implementation. The shared
module declares that it uses this service.

(3) In addition, the engine module descriptor now exposes more packages to
reflective access in order to support generated classes in more cases.

--------------------------------

M       
java/build/org/apache/derbyBuild/lastgoodjarcontents/insane.derby.jar.lastcontents
M       
java/build/org/apache/derbyBuild/lastgoodjarcontents/insane.derbyTesting.jar.lastcontents
M       
java/build/org/apache/derbyBuild/lastgoodjarcontents/insane.derbyclient.jar.lastcontents
M       
java/build/org/apache/derbyBuild/lastgoodjarcontents/insane.derbynet.jar.lastcontents
M       
java/build/org/apache/derbyBuild/lastgoodjarcontents/insane.derbyoptionaltools.jar.lastcontents
M       
java/build/org/apache/derbyBuild/lastgoodjarcontents/insane.derbyrun.jar.lastcontents
M       
java/build/org/apache/derbyBuild/lastgoodjarcontents/insane.derbytools.jar.lastcontents
M       
java/build/org/apache/derbyBuild/lastgoodjarcontents/sane.derby.jar.lastcontents
M       
java/build/org/apache/derbyBuild/lastgoodjarcontents/sane.derbyTesting.jar.lastcontents
M       
java/build/org/apache/derbyBuild/lastgoodjarcontents/sane.derbyclient.jar.lastcontents
M       
java/build/org/apache/derbyBuild/lastgoodjarcontents/sane.derbynet.jar.lastcontents
M       
java/build/org/apache/derbyBuild/lastgoodjarcontents/sane.derbyoptionaltools.jar.lastcontents
M       
java/build/org/apache/derbyBuild/lastgoodjarcontents/sane.derbyrun.jar.lastcontents
M       
java/build/org/apache/derbyBuild/lastgoodjarcontents/sane.derbytools.jar.lastcontents

(3) Corresponding adjustments to the lists of jar contents.

--------------------------------

M       
java/org.apache.derby.commons/org/apache/derby/shared/common/i18n/MessageService.java

(4) Further adjustments to the localization logic to make it work for
server messages.

--------------------------------

M       
java/org.apache.derby.tools/org/apache/derby/iapi/tools/i18n/LocalizedResource.java

(5) Fixes an indentation error which was bothering me.

--------------------------------

D       java/org.apache.derby.commons/org/apache/derby/loc/client
D       java/org.apache.derby.commons/org/apache/derby/loc/client/spi

(5) Removes some dead directories. These directories should have been
removed by the previous checkin 
(derby-6945-47-aa-runModulesWithLocalizations.diff.).
{noformat}


> Re-package Derby as a collection of jigsaw modules
> --------------------------------------------------
>
>                 Key: DERBY-6945
>                 URL: https://issues.apache.org/jira/browse/DERBY-6945
>             Project: Derby
>          Issue Type: Improvement
>    Affects Versions: 10.13.1.2
>            Reporter: Rick Hillegas
>            Priority: Major
>         Attachments: derby-6945-01-aa-remove_derbyPreBuild_dep.diff, 
> derby-6945-02-ab-newDerbySharedJar.diff, 
> derby-6945-02-ac-newDerbySharedJar.diff, derby-6945-03-aa-partitionTest.diff, 
> derby-6945-04-aa-moveRunClass.diff, 
> derby-6945-05-aa-removeRedundant_Attribute_SQLState.diff, 
> derby-6945-06-aa-removeOtherSharedDuplicates.diff, 
> derby-6945-07-aa-net_client_overlap.diff, 
> derby-6945-08-aa-move_shared_iapi_under_shared.diff, 
> derby-6945-08-ab-move_shared_iapi_under_shared.diff, 
> derby-6945-08-ad-move_shared_iapi_under_shared.diff, 
> derby-6945-09-ab-moveInternalDriver.diff, derby-6945-10-aa-moveDriver42.diff, 
> derby-6945-11-ab-moveAutoloadedDriver.diff, 
> derby-6945-12-ab-moveClientDataSourceInterface.diff, 
> derby-6945-13-aa-create-ClientAutoloadedDriver.diff, 
> derby-6945-14-aa-moveMoreEmbeddedClassesOutOfPublicAPI.diff, 
> derby-6945-15-aa-moveMoreClientClassesOutOfPublicAPI.diff, 
> derby-6945-16-aa-consolidatePublicAPI.diff, 
> derby-6945-17-aa-resealPackagesIn-derbyshared.diff, 
> derby-6945-18-aa-resealLocalizationPackage.diff, 
> derby-6945-19-ad-movePublicAPIintoToolsJar.diff, 
> derby-6945-20-aa-removeClasslister.diff, 
> derby-6945-21-aa-simplifyBuildScripts.diff, 
> derby-6945-21-ab-simplifyBuildScripts.diff, 
> derby-6945-22-ad-isolateClassesByArtifact.diff, 
> derby-6945-22-ae-isolateClassesByArtifact.diff, 
> derby-6945-22-af-isolateClassesByArtifact.diff, 
> derby-6945-23-aa-upgradeToAnt_1.10.2.diff, 
> derby-6945-24-aa-fixNativeAuthenticationServiceTest.diff, 
> derby-6945-25-ab-moduleDescriptors.diff, 
> derby-6945-26-aa-packagePrivateTests.diff, 
> derby-6945-27-aa-adjustModulesForTests.diff, 
> derby-6945-28-aa-testingModuleDescriptor.diff, 
> derby-6945-29-aa-disable-SimpleApp-test.diff, 
> derby-6945-30-ab-move-clientmessages-toolsmessages.diff, 
> derby-6945-31-aa-clientmessages-ResourceBundleProvider.diff, 
> derby-6945-32-aa-messageLookupCleanup.diff, 
> derby-6945-33-ab-moveLocalizations.diff, 
> derby-6945-34-aa-licenseHeaders.diff, 
> derby-6945-35-aa-removeSpuriousCharacter.diff, 
> derby-6945-36-aa-moduleDescriptorsForLocaleJars.diff, 
> derby-6945-38-aa-javadocCleanup.diff, derby-6945-39-aa-javadocCleanup.diff, 
> derby-6945-40-aa-generatedSource-dirNames.diff, 
> derby-6945-41-ac-cleanupProductJavadoc.diff, 
> derby-6945-42-aa-cleanupTestJavadoc.diff, 
> derby-6945-43-aa-cleanupPublicAPIforJavadoc.diff, 
> derby-6945-44-aa-moduleAwareJavadoc.diff, derby-6945-45-aa-fixWarnings.diff, 
> derby-6945-46-aa-jacocoSourceRoots.diff, 
> derby-6945-47-aa-runModulesWithLocalizations.diff, 
> derby-6945-48-ac-serverWithSecurityPolicy.diff, 
> derby-6945-XX-moveDataSourceFactories, jdeps.out.tar, weirdAnt.out
>
>
> Once we commit to building with Java 9 (see DERBY-6856), we should consider 
> re-packaging Derby as a set of jigsaw modules. This would result in a 
> different set of release artifacts. This might be a good opportunity to 
> address the Tomcat artifactory issues raised by issue DERBY-6944.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to