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

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

I have made good progress in separating out the new shared jar file. In the 
process, I have tripped across the following issue, on which I would like the 
community's advice.

The sysinfo tool turns out to be quite a tangled mess. It has been cloned into 
the engine, tools, net, and client jars so that each standalone jar file can 
describe its classpath environment. In addition to being invoked from the 
command line, sysinfo is also available as one of the command options of the 
Network Server. I suspect that in time, the Java eco-system will invent a 
better, Jigsaw-based tool which introspects the version information of all 
modules on the classpath. Until then, I do not want to deprecate sysinfo. 
However, I find it impossible to accomplish both of the following goals:

1) Partition the Derby packages across the jar files. This has to be done 
because Jigsaw does not allow packages to be split or cloned across jar files.

2) Maintain the current user api for sysinfo.


In my sandbox, I have put all of the sysinfo support classes into 
derbyshared.jar. This is a half-step toward objective (1): At this point, no 
class appears in more than one jar file. This situation enables all of the 
currently supported ways of running sysinfo, provided that derbyshared.jar is 
on the classpath:

  Locally via

i)  java org.apache.derby.tools.sysinfo

  or

ii)  java -jar derbyrun.jar sysinfo

  or across a network via

iii)  java org.apache.derby.drda.NetworkServerControl sysinfo

However, the half step merely partitions Derby's classes. It does not partition 
Derby's packages. Keeping sysinfo in derbyshared.jar will violate package 
partitioning. That is because all of the other tools (ij, dblook, PlanExporter, 
SignatureChecker) live in the same org.apache.derby.tools package as sysinfo.

Here are some possible ways forward:

S1) Move sysinfo into derbytools.jar. Then the org.apache.derby.tools package 
will remain intact and corralled in one jar file. In addition, this reduces the 
footprint of the smallest engine configuration, the one which only contains 
derby.jar and derbyshared.jar. All of the current apis (i-iii) will continue to 
work. However, this solution means that (i) will work only if derbytools.jar 
AND derbyshared.jar are both on the classpath. 

S2) Leave sysinfo in derbyshared.jar. It will then have to move into another 
package peculiar to that jar file. That means that (i) will no longer work. 
That is, the basic command for running sysinfo will have to reference a 
different package.

To summarize:

N1) With my next checkin, I will partition the derby classes across jar files. 
At that time, derbyshared.jar will have to be on the classpath in order to run 
sysinfo.

N2) We can preserve the current sysinfo api if we move sysinfo into 
derbytools.jar. Then derbytools.jar AND derbyshared.jar must be on the 
classpath in order to run sysinfo.

N3) Or we can leave sysinfo in derbyshared.jar and change one way (i) of 
invoking the tool. However, derbyshared.jar will still need to be on the 
classpath in order to invoke sysinfo.

I hope this explanation is not too muddled. Your thoughts and preferences are 
appreciated.

Thanks,
-Rick


> 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
>         Attachments: derby-6945-01-aa-remove_derbyPreBuild_dep.diff, 
> jdeps.out.tar
>
>
> 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
(v6.4.14#64029)

Reply via email to