<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-27708</id>
	<title>Nabble - OpenJDK Expert Group Observer List</title>
	<updated>2008-10-10T15:33:45Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/OpenJDK-Expert-Group-Observer-List-f27708.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/OpenJDK-Expert-Group-Observer-List-f27708.html" />
	<subtitle type="html">The specification (&lt;a href=&quot;http://jcp.org/en/jsr/detail?id=277&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;JSR277&lt;/a&gt;) defines a distribution format and a repository for collections of Java code and related resources. It also defines the discovery, loading, and integrity mechanisms at runtime.</subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-19927191</id>
	<title>JSR 277 spec lead changes</title>
	<published>2008-10-10T15:33:45Z</published>
	<updated>2008-10-10T15:33:45Z</updated>
	<author>
		<name>Stanley M. Ho</name>
	</author>
	<content type="html">Hi JSR 277 experts,
&lt;br&gt;&lt;br&gt;This is to let you know that today is my last day at Sun. It has been a 
&lt;br&gt;great pleasure to work with all of you, and I really appreciate the 
&lt;br&gt;contributions all of you have made in this JSR.
&lt;br&gt;&lt;br&gt;Alex Buckley will take over the responsibility for JSR 277, and serve as 
&lt;br&gt;the sole spec lead. I have been working with Alex to make sure the 
&lt;br&gt;transition is smooth. If you have any questions or concerns about the 
&lt;br&gt;JSR, please contact &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=19927191&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;alex.buckley@...&lt;/a&gt; directly.
&lt;br&gt;&lt;br&gt;Going forwards, I'm moving to Research In Motion. I'm reachable on 
&lt;br&gt;Linkedin. Hopefully, many of you will stay in touch and our paths will 
&lt;br&gt;cross again.
&lt;br&gt;&lt;br&gt;- Stanley
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/JSR-277-spec-lead-changes-tp19927191p19927191.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-18954410</id>
	<title>Module change detection...</title>
	<published>2008-08-12T16:22:56Z</published>
	<updated>2008-08-12T16:22:56Z</updated>
	<author>
		<name>Bryan Atsatt</name>
	</author>
	<content type="html">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;
&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body bgcolor=&quot;#ffffff&quot; text=&quot;#000000&quot;&gt;
There are a number of class loading optimizations (including HotSpot's
Class Data Sharing) that are hard to make generic due to the lack of a
standard way to validate cached class state. We have a unique
opportunity to fix this in 277...&lt;br&gt;
&lt;br&gt;
I propose that we add: &lt;br&gt;
&lt;br&gt;
1. An annotation to record a digest over the module's contents, which
would then be visible from ModuleInfo.&lt;br&gt;
2. A convenience api to return the digest, e.g.:&lt;br&gt;
&lt;blockquote&gt;public interface ModuleContent {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public byte[] getDigest();&lt;br&gt;
}&lt;br&gt;
&lt;/blockquote&gt;
&lt;br&gt;
The jam tool would compute and add the annotation, and the default
implementation(s) of ModuleContent would then just return the value
from the annotation.&lt;br&gt;
&lt;br&gt;
Other implementations would be free to compute the value at install
time (or even runtime); development environments could &quot;generate&quot; a
value using a simple counter. &lt;br&gt;
&lt;br&gt;
Unlike the version number, this value can be used to ensure that any
change to the module's contents can be detected. Both HotSpot and other
JVMs can then introduce optimizations like Class Data Sharing that
depend on being able to validate the cache file.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
It may similarly be useful to have ModuleInfo be able to (lazily)
compute a digest for itself, and/or have a digest on ModuleDefinition
that encompasses both the metadata (ModuleInfo) and the contents.&lt;br&gt;
&lt;br&gt;
// Bryan&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/body&gt;
&lt;/html&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Module-change-detection...-tp18954410p18954410.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-18581726</id>
	<title>Re: Deployment module export...</title>
	<published>2008-07-21T20:28:28Z</published>
	<updated>2008-07-21T20:28:28Z</updated>
	<author>
		<name>Stanley M. Ho</name>
	</author>
	<content type="html">Hi Bryan,
&lt;br&gt;&lt;br&gt;Bryan Atsatt wrote:
&lt;br&gt;&amp;gt; I believe that ModuleArchiveInfo.getFileName() would only get you a 
&lt;br&gt;&amp;gt; reference to the metadata file, not the content, and it is allowed to be 
&lt;br&gt;&amp;gt; null as currently defined.
&lt;br&gt;&lt;br&gt;This method will give you a reference to the actual content. For 
&lt;br&gt;example, in the local repository case, this will return a filename of 
&lt;br&gt;the actual file in the repository interchange directory. That said, this 
&lt;br&gt;method is allowed to return null because the repository implementations 
&lt;br&gt;may not always make the content available as a physical file.
&lt;br&gt;&lt;br&gt;&amp;gt; Since Repository implementations should be free to store in whatever 
&lt;br&gt;&amp;gt; format they choose, assuming that a deployment module can be 
&lt;br&gt;&amp;gt; re-constructed from the various apis seems like a very weak alternative 
&lt;br&gt;&amp;gt; to an explicit, well specified &amp;quot;export&amp;quot; method.
&lt;br&gt;&lt;br&gt;Fair enough. I will look into adding an API to do this in the next 
&lt;br&gt;revision of the API specification draft.
&lt;br&gt;&lt;br&gt;- Stanley
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Deployment-module-export...-tp18344483p18581726.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-18449057</id>
	<title>Re: Deployment module export...</title>
	<published>2008-07-14T10:34:39Z</published>
	<updated>2008-07-14T10:34:39Z</updated>
	<author>
		<name>Bryan Atsatt</name>
	</author>
	<content type="html">I believe that ModuleArchiveInfo.getFileName() would only get you a 
&lt;br&gt;reference to the metadata file, not the content, and it is allowed to be 
&lt;br&gt;null as currently defined.
&lt;br&gt;&lt;br&gt;Since Repository implementations should be free to store in whatever 
&lt;br&gt;format they choose, assuming that a deployment module can be 
&lt;br&gt;re-constructed from the various apis seems like a very weak alternative 
&lt;br&gt;to an explicit, well specified &amp;quot;export&amp;quot; method.
&lt;br&gt;&lt;br&gt;// Bryan
&lt;br&gt;&lt;br&gt;Adrian Brock wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Couldn't somebody already do this with
&lt;br&gt;&amp;gt; something like:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; public void export(Repository repository)
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;URL repoURL = repository.getSourceLocation();
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;for (ModuleArchiveInfo archive : repository.list())
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;{
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL url = createRemotableURL(repoURL, archive.getFileName());
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; process(url);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Or is the archive's &amp;quot;fileName&amp;quot; only meant to be a logical
&lt;br&gt;&amp;gt; identifier?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Tue, 2008-07-08 at 10:14 -0700, Bryan Atsatt wrote:
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; I believe we need a mechanism to extract a deployment module from a 
&lt;br&gt;&amp;gt;&amp;gt; Repository. This would enable:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; 1. Provisioning systems to copy from a remote repository to a local 
&lt;br&gt;&amp;gt;&amp;gt; instance.
&lt;br&gt;&amp;gt;&amp;gt; 2. Migration of all content from one repository to another.
&lt;br&gt;&amp;gt;&amp;gt; 3. Backup of repository content regardless of implementation.
&lt;br&gt;&amp;gt;&amp;gt; 4. Tooling to gather dependent deployment modules into a larger 
&lt;br&gt;&amp;gt;&amp;gt; deployment unit.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Given that Repository.install() currently takes a URL parameter, it 
&lt;br&gt;&amp;gt;&amp;gt; would be nicely symmetrical if Repository could produce a URL (for a 
&lt;br&gt;&amp;gt;&amp;gt; given ModuleDefinition) that could be passed directly to install(). For 
&lt;br&gt;&amp;gt;&amp;gt; Repositories that act as a front end for a remote store, returning such 
&lt;br&gt;&amp;gt;&amp;gt; a URL may be a little extra work, but the underlying mechanisms are 
&lt;br&gt;&amp;gt;&amp;gt; already required. For local Repositories, if we recommend that 
&lt;br&gt;&amp;gt;&amp;gt; implementations keep the original deployment module as a separate file, 
&lt;br&gt;&amp;gt;&amp;gt; then a simple &amp;quot;file:&amp;quot; url can be returned. (Modulo the usual unspecified 
&lt;br&gt;&amp;gt;&amp;gt; valid lifetime issue inherent in most URLs.)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Thoughts?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; // Bryan
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Deployment-module-export...-tp18344483p18449057.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-18377898</id>
	<title>Re: Deployment module export...</title>
	<published>2008-07-10T00:47:57Z</published>
	<updated>2008-07-10T00:47:57Z</updated>
	<author>
		<name>Adrian Brock-4</name>
	</author>
	<content type="html">Couldn't somebody already do this with
&lt;br&gt;something like:
&lt;br&gt;&lt;br&gt;public void export(Repository repository)
&lt;br&gt;{
&lt;br&gt;&amp;nbsp; &amp;nbsp;URL repoURL = repository.getSourceLocation();
&lt;br&gt;&amp;nbsp; &amp;nbsp;for (ModuleArchiveInfo archive : repository.list())
&lt;br&gt;&amp;nbsp; &amp;nbsp;{
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; URL url = createRemotableURL(repoURL, archive.getFileName());
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; process(url);
&lt;br&gt;&amp;nbsp; &amp;nbsp;}
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;Or is the archive's &amp;quot;fileName&amp;quot; only meant to be a logical
&lt;br&gt;identifier?
&lt;br&gt;&lt;br&gt;On Tue, 2008-07-08 at 10:14 -0700, Bryan Atsatt wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I believe we need a mechanism to extract a deployment module from a 
&lt;br&gt;&amp;gt; Repository. This would enable:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 1. Provisioning systems to copy from a remote repository to a local 
&lt;br&gt;&amp;gt; instance.
&lt;br&gt;&amp;gt; 2. Migration of all content from one repository to another.
&lt;br&gt;&amp;gt; 3. Backup of repository content regardless of implementation.
&lt;br&gt;&amp;gt; 4. Tooling to gather dependent deployment modules into a larger 
&lt;br&gt;&amp;gt; deployment unit.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Given that Repository.install() currently takes a URL parameter, it 
&lt;br&gt;&amp;gt; would be nicely symmetrical if Repository could produce a URL (for a 
&lt;br&gt;&amp;gt; given ModuleDefinition) that could be passed directly to install(). For 
&lt;br&gt;&amp;gt; Repositories that act as a front end for a remote store, returning such 
&lt;br&gt;&amp;gt; a URL may be a little extra work, but the underlying mechanisms are 
&lt;br&gt;&amp;gt; already required. For local Repositories, if we recommend that 
&lt;br&gt;&amp;gt; implementations keep the original deployment module as a separate file, 
&lt;br&gt;&amp;gt; then a simple &amp;quot;file:&amp;quot; url can be returned. (Modulo the usual unspecified 
&lt;br&gt;&amp;gt; valid lifetime issue inherent in most URLs.)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thoughts?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; // Bryan
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;/div&gt;-- 
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;Adrian Brock
&lt;br&gt;Chief Scientist
&lt;br&gt;JBoss, a division of Red Hat
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Deployment-module-export...-tp18344483p18377898.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-18344483</id>
	<title>Deployment module export...</title>
	<published>2008-07-08T10:14:10Z</published>
	<updated>2008-07-08T10:14:10Z</updated>
	<author>
		<name>Bryan Atsatt</name>
	</author>
	<content type="html">I believe we need a mechanism to extract a deployment module from a 
&lt;br&gt;Repository. This would enable:
&lt;br&gt;&lt;br&gt;1. Provisioning systems to copy from a remote repository to a local 
&lt;br&gt;instance.
&lt;br&gt;2. Migration of all content from one repository to another.
&lt;br&gt;3. Backup of repository content regardless of implementation.
&lt;br&gt;4. Tooling to gather dependent deployment modules into a larger 
&lt;br&gt;deployment unit.
&lt;br&gt;&lt;br&gt;Given that Repository.install() currently takes a URL parameter, it 
&lt;br&gt;would be nicely symmetrical if Repository could produce a URL (for a 
&lt;br&gt;given ModuleDefinition) that could be passed directly to install(). For 
&lt;br&gt;Repositories that act as a front end for a remote store, returning such 
&lt;br&gt;a URL may be a little extra work, but the underlying mechanisms are 
&lt;br&gt;already required. For local Repositories, if we recommend that 
&lt;br&gt;implementations keep the original deployment module as a separate file, 
&lt;br&gt;then a simple &amp;quot;file:&amp;quot; url can be returned. (Modulo the usual unspecified 
&lt;br&gt;valid lifetime issue inherent in most URLs.)
&lt;br&gt;&lt;br&gt;Thoughts?
&lt;br&gt;&lt;br&gt;// Bryan
&lt;br&gt;&amp;nbsp;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Deployment-module-export...-tp18344483p18344483.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-18144761</id>
	<title>Re: ImportDependency</title>
	<published>2008-06-26T15:24:05Z</published>
	<updated>2008-06-26T15:24:05Z</updated>
	<author>
		<name>Stanley M. Ho</name>
	</author>
	<content type="html">These are reasonable suggestions. According to the code conventions, 
&lt;br&gt;class names should be nouns:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;As Adrian and Bryan suggested, I will remove the getType() method from 
&lt;br&gt;ImportDependency. A module system may need to recognize dependencies in 
&lt;br&gt;a module definition from other module system for interoperability (e.g. 
&lt;br&gt;recognizes module re-export), so I think we will need to define common 
&lt;br&gt;dependency types like ModuleDependency and PackageDependency in the API.
&lt;br&gt;&lt;br&gt;Regarding whether we should use interfaces vs abstract classes, Joe 
&lt;br&gt;Darcy has a very good write-up on this topic recently:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://blogs.sun.com/darcy/entry/api_design_interfaces_versus_abstract&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://blogs.sun.com/darcy/entry/api_design_interfaces_versus_abstract&lt;/a&gt;&lt;br&gt;&lt;br&gt;Since these import dependency types are created and used mostly by the 
&lt;br&gt;module systems and each module system may have its own set of 
&lt;br&gt;implementation for these types, defining them as interfaces is probably 
&lt;br&gt;a more sensible thing to do. I will also move the factory methods from 
&lt;br&gt;ImportDependency into Modules for now.
&lt;br&gt;&lt;br&gt;I will make these changes in the next revision of the draft API 
&lt;br&gt;specification. Let me know if there are other feedbacks on this.
&lt;br&gt;&lt;br&gt;- Stanley
&lt;br&gt;&lt;br&gt;&lt;br&gt;Adrian Brock wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I agree, getType() looks wrong to me
&lt;br&gt;&amp;gt; (not very object orientated ;-)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; But I'm not sure that the spec should define import module and package
&lt;br&gt;&amp;gt; as explicit subclasses or that Import[Dependency] should be a 
&lt;br&gt;&amp;gt; concrete class?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I'd prefer to see interfaces. The factory methods would
&lt;br&gt;&amp;gt; just construct implementations of those interfaces.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Somebody else would be free to implement them in a different way,
&lt;br&gt;&amp;gt; e.g. as a wrapper/adapter to the equivalent manifest information of a
&lt;br&gt;&amp;gt; 291 implementation.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; On Wed, 2008-06-11 at 13:11 -0700, Bryan Atsatt wrote:
&lt;br&gt;&amp;gt;&amp;gt; The design of this class seems broken to me with the addition of two 
&lt;br&gt;&amp;gt;&amp;gt; &amp;quot;types&amp;quot;. Why not:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; 1. Make ImportDependency abstract, removing the getType() and newX methods.
&lt;br&gt;&amp;gt;&amp;gt; 2. Make ImportPackage and ImportModule subclasses, each with their own 
&lt;br&gt;&amp;gt;&amp;gt; newX method.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; (I also strongly suggest that we rename ImportDependency to simply 
&lt;br&gt;&amp;gt;&amp;gt; &amp;quot;Import&amp;quot; :^)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; This model also obviously enables new subtypes, an extensibility point 
&lt;br&gt;&amp;gt;&amp;gt; that may come in handy in the future.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; // Bryan
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ImportDependency-tp17786336p18144761.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17957105</id>
	<title>Re: Repository WAS Re: Goals was: Re: Supporting OSGi Bundles in the Java Module System</title>
	<published>2008-06-17T16:51:36Z</published>
	<updated>2008-06-17T16:51:36Z</updated>
	<author>
		<name>Stanley M. Ho</name>
	</author>
	<content type="html">Adrian Brock wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; The question is how easy is it to do all this overriding of
&lt;br&gt;&amp;gt; repository implementations to change behaviour and 
&lt;br&gt;&amp;gt; not loose some aspect of the behaviour.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; e.g. To programmatically create a module like on the other thread.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The tools of a repository are not defined by the spec,
&lt;br&gt;&amp;gt; and there is no repository.install(ModuleContent)
&lt;br&gt;&amp;gt; instead I would create a (possibly dummy) URL backed 
&lt;br&gt;&amp;gt; by a jam file stream (or whatever format the repository understands).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; But does that really do what I want? If I'm mapping a legacy
&lt;br&gt;&amp;gt; file to a module definition at runtime, I probably don't 
&lt;br&gt;&amp;gt; want to install it in the JDK &amp;nbsp;repository implementation 
&lt;br&gt;&amp;gt; since it will copy it to some disk location.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The next time I reboot my runtime, I would have to delete it
&lt;br&gt;&amp;gt; and recreate it otherwise it might be stale.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This is all so I can enable use the tools that come with the 
&lt;br&gt;&amp;gt; JDK repository implementation and possibly other behaviour
&lt;br&gt;&amp;gt; like Bryan's resolving Module imports to Package imports.
&lt;/div&gt;&lt;br&gt;As you mentioned in another thread, &amp;quot;all we really want to do is to PUSH 
&lt;br&gt;a ModuleDefinition/Content to the jsr 277 module system such that we can 
&lt;br&gt;get back a Module/Classloader with the imports resolved.&amp;quot; I don't think 
&lt;br&gt;you really meant to change the behavior of the existing repositories 
&lt;br&gt;(e.g. bootstrap, etc.), but to make it easy to create a new repository 
&lt;br&gt;by extending from a stock implementation and override some of its 
&lt;br&gt;behavior. If I misunderstand you, please let me know.
&lt;br&gt;&lt;br&gt;The repository API in the current draft requires many methods to be 
&lt;br&gt;overridden in order to build a fully functional repository 
&lt;br&gt;implementation. The use case you mentioned is to build a simple 
&lt;br&gt;repository at runtime that all it does is to return ModuleDefinitions; 
&lt;br&gt;it doesn't has a real physical repository under the cover, and it 
&lt;br&gt;probably doesn't support install/uninstall and all the other methods. In 
&lt;br&gt;this case, I agreed that the API probably requires too much work for the 
&lt;br&gt;implementors, and I will look into this issue to see if some 
&lt;br&gt;simplifications can be made in the API.
&lt;br&gt;&lt;br&gt;- Stanley
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Goals-was%3A-Re%3A-Supporting-OSGi-Bundles-in-the-Java-Module-System-tp17753303p17957105.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17834152</id>
	<title>Re: ModuleDefinition construction WAS Re: Goals was: Re: Supporting OSGi Bundles in the Java Module System</title>
	<published>2008-06-13T17:12:36Z</published>
	<updated>2008-06-13T17:12:36Z</updated>
	<author>
		<name>Stanley M. Ho</name>
	</author>
	<content type="html">Adrian Brock wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; I see a number of possible use cases here 
&lt;br&gt;&amp;gt; (I'll continue with appserver example):
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 1) Fully JSR 277
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The appserver and JavaEE specs are updated to fully understand
&lt;br&gt;&amp;gt; JSR277/294. In this case, the JavaEE deployment process would 
&lt;br&gt;&amp;gt; probably make use of a JSR 277 repository.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 2) Partial JSR 277
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The appserver knows about JSR277/294 but the JavaEE specs
&lt;br&gt;&amp;gt; haven't been updated (or they are legacy deployments).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; In this case the appserver could try to adapt the deployments
&lt;br&gt;&amp;gt; to conform to the ModuleDefinition/Content.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; In this case, there probably wouldn't be a real repository
&lt;br&gt;&amp;gt; implementation, instead the &amp;quot;repository&amp;quot; would be dummy.
&lt;br&gt;&amp;gt; It would just be serving as an adapter from the old deployment packaging
&lt;br&gt;&amp;gt; and metadata to the new one at runtime.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 3) Mixed
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Similar to 2, but the opposite. 
&lt;br&gt;&amp;gt; The appserver knows about JSR277/294 and wants to support
&lt;br&gt;&amp;gt; .jam files as well as .jar files in JavaEE deployments.
&lt;br&gt;&amp;gt; i.e. .jam files would be unpacked from a .jar EAR deployment
&lt;br&gt;&amp;gt; and then added to the module system runtime.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Conclusion:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I expect there are other possible uses.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The question is whether Repository is the best api
&lt;br&gt;&amp;gt; for cases (2) and (3). i.e. we implement a dummy
&lt;br&gt;&amp;gt; repository with a dummy &amp;quot;URL&amp;quot; for the source
&lt;br&gt;&amp;gt; or whether there should be a more abstract parent
&lt;br&gt;&amp;gt; class (I called it ModuleSource) that doesn't
&lt;br&gt;&amp;gt; assume a physical repository behind the scenes.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; At least for cases (2) and (3) all we really want
&lt;br&gt;&amp;gt; to do is to PUSH a ModuleDefinition/Content to the
&lt;br&gt;&amp;gt; jsr 277 module system such that we can get back
&lt;br&gt;&amp;gt; a Module/Classloader with the imports resolved.
&lt;/div&gt;&lt;br&gt;In your example, if you want to create ModuleDefinitions from the .jar 
&lt;br&gt;files, there are two ways to achieve it:
&lt;br&gt;&lt;br&gt;1. a. Create a ModuleContent based on the content of the .jar file.
&lt;br&gt;&amp;nbsp; &amp;nbsp; b. Generate the JAM's metadata based on information in the .jar file.
&lt;br&gt;&amp;nbsp; &amp;nbsp; c. Construct a JAM's ModuleDefinition with the ModuleContent using
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Modules.newJamModuleDefinition(). The ModuleDefinition would be
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;associated with the JAM module system.
&lt;br&gt;&lt;br&gt;2. a. Create a ModuleContent based on the content of the .jar file.
&lt;br&gt;&amp;nbsp; &amp;nbsp; b. Create your own ModuleDefinition with the ModuleContent and use
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;the JAM module system as the associated module system. As long as
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;your ModuleDefinition exposes the appropriate metadata information
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;reflectively, the JAM module system would treat it like other
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;JAM's ModuleDefinitions.
&lt;br&gt;&lt;br&gt;In either case, the JAM module system could be used to instantiate and 
&lt;br&gt;initialize Module/ClassLoader from the ModuleDefinition.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Creating a repository implementation is a different story. In the 
&lt;br&gt;current draft API, you do need to override a number of methods in 
&lt;br&gt;Repository in order to have a functional repository implementation. I 
&lt;br&gt;still think Repository is the api for module systems to find 
&lt;br&gt;ModuleDefinitions. The question is how we could change the API to make 
&lt;br&gt;it much easier for developers to create custom repository implementation.
&lt;br&gt;&lt;br&gt;Perhaps we should provide more useful default implementation in the 
&lt;br&gt;Repository's methods so developers only need to override very small 
&lt;br&gt;number of methods. Or perhaps what we really need is a repository 
&lt;br&gt;builder which allows developers to provide a set of ModuleDefinitions 
&lt;br&gt;and get back a basic repository implementation to use.
&lt;br&gt;&lt;br&gt;I'll look into the draft API to see if further simplifications can be made.
&lt;br&gt;&lt;br&gt;- Stanley
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Goals-was%3A-Re%3A-Supporting-OSGi-Bundles-in-the-Java-Module-System-tp17753303p17834152.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17831219</id>
	<title>Re: Refactorability proposal...</title>
	<published>2008-06-13T13:10:43Z</published>
	<updated>2008-06-13T13:10:43Z</updated>
	<author>
		<name>Bryan Atsatt</name>
	</author>
	<content type="html">Yes, this could be an issue. If JavaEE:4.0.0 merely imports and 
&lt;br&gt;re-exports the specific packages, the imports can just be copied out. If 
&lt;br&gt;it actually contains them, and they themselves declare their own 
&lt;br&gt;versions, the jam tool could emit imports for those specific versions, 
&lt;br&gt;but it cannot generate ranges.
&lt;br&gt;&lt;br&gt;This brings us back to the &amp;quot;contract&amp;quot; idea: a named/versioned collection 
&lt;br&gt;of import constraints. The indirection afforded by this could certainly 
&lt;br&gt;solve this problem.
&lt;br&gt;&lt;br&gt;And we do have it, sort of: a module that contains no classes or 
&lt;br&gt;resources itself, only imports and re-exports. In the current model, 
&lt;br&gt;this is a bit of a hack because the module will actually be instantiated 
&lt;br&gt;with its own loader, which is a waste of cycles/resources.
&lt;br&gt;&lt;br&gt;If, OTOH, we special case such &amp;quot;contract&amp;quot; (&amp;quot;indirect&amp;quot;?) modules such 
&lt;br&gt;that they are not instantiated (or at least don't have a loader) but act 
&lt;br&gt;only as a bag of import constraints that can be &amp;quot;borrowed&amp;quot; by an 
&lt;br&gt;importer, that seems like a reasonable solution.
&lt;br&gt;&lt;br&gt;This could be simplified by doing the borrowing at build time, as in my 
&lt;br&gt;proposal, at the cost of some loss of flexibility.
&lt;br&gt;&lt;br&gt;// Bryan
&lt;br&gt;&lt;br&gt;&lt;br&gt;Adrian Brock wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Another issue would be how you handle the generated package
&lt;br&gt;&amp;gt; constraints.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; e.g. Suppose you a module JavaEE:4.0.0 that
&lt;br&gt;&amp;gt; contains packages javax.jms:1.1.0, javax.resource:1.5.0, etc.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I then declare a module constraint
&lt;br&gt;&amp;gt; JavaEE:[4.0.0, 5.0.0)
&lt;br&gt;&amp;gt; i.e. I work with JavaEE4 but not JavaEE5
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; What do the package constraints resolve to for jms and jca
&lt;br&gt;&amp;gt; if we don't have a JavaEE5 module in the repository? :-)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; JavaEE is not a very a good example since package versions
&lt;br&gt;&amp;gt; wouldn't change across a major release, but they could
&lt;br&gt;&amp;gt; in other cases or more general module version constraints.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Tue, 2008-06-10 at 18:27 -0700, Bryan Atsatt wrote:
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; (FYI: I've discussed this with Stanley but wanted to ensure it was 
&lt;br&gt;&amp;gt;&amp;gt; visible to everyone.)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Proposal
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; 1. Eliminate runtime use of import-by-module in the JAM system:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; a. Support the (very convenient) import-by-module at the source level.
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; b. jam tool transforms import-by-module to a list of 
&lt;br&gt;&amp;gt;&amp;gt; import-by-package statements.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; 2. Add APIs to fully support import-by-package in the JAM system:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;a. Support Version annotation in package-info.java (or in 
&lt;br&gt;&amp;gt;&amp;gt; module-info.java). If a
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;package does not declare a version, it &amp;quot;inherits&amp;quot; that of the 
&lt;br&gt;&amp;gt;&amp;gt; enclosing module.
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;b. Add ImportPackage annotation with version constraints.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; 3. Add APIs to fully support import-by-package in the abstract framework:
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; a. Add methods to Query to produce import-by-package nodes.
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; b. Replace Query.getIndexableNames() with fully generic variants (I 
&lt;br&gt;&amp;gt;&amp;gt; proposed
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a solution here previously which I will re-post).
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Rationale
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Module refactoring is inevitable, particularly during the transition 
&lt;br&gt;&amp;gt;&amp;gt; from the current, effectively flat class space to a fine-grained space 
&lt;br&gt;&amp;gt;&amp;gt; provided by module systems. We have significant experience with this 
&lt;br&gt;&amp;gt;&amp;gt; issue at Oracle (with the transition to our own module system), and OSGi 
&lt;br&gt;&amp;gt;&amp;gt; best-practices for conversion include starting with everything in one 
&lt;br&gt;&amp;gt;&amp;gt; bundle and then separating out pieces as experience is gained.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; A very common pattern, in our experience, is for developers to start 
&lt;br&gt;&amp;gt;&amp;gt; with many extra jars in their initial module (a mini version of 
&lt;br&gt;&amp;gt;&amp;gt; class-path hell). As that module is put into wider use, someone 
&lt;br&gt;&amp;gt;&amp;gt; discovers that package X is also contained in their module, and that 
&lt;br&gt;&amp;gt;&amp;gt; duplication either leads to runtime conflicts (very bad), or just plain 
&lt;br&gt;&amp;gt;&amp;gt; footprint bloat. The obvious answer is to put package X in a separate 
&lt;br&gt;&amp;gt;&amp;gt; module, and have everyone share it via imports.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; But... not so fast. If there are consumers of that module who import it 
&lt;br&gt;&amp;gt;&amp;gt; by module name alone, then pulling X out of it will cause those 
&lt;br&gt;&amp;gt;&amp;gt; importers to break. And if it is possible for your module to have been 
&lt;br&gt;&amp;gt;&amp;gt; imported by *anyone* by name alone, then you are stuck: either you break 
&lt;br&gt;&amp;gt;&amp;gt; them or you live with the incorrect granularity (which just isn't an 
&lt;br&gt;&amp;gt;&amp;gt; option in the conflict scenarios). Not a happy choice.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Originally, I had proposed to do away with import-by-module altogether, 
&lt;br&gt;&amp;gt;&amp;gt; both to avoid this problem and to eliminate the conceptual disconnect. 
&lt;br&gt;&amp;gt;&amp;gt; Your code does not today contain import statements that name *jars*, it 
&lt;br&gt;&amp;gt;&amp;gt; names packages and/or specific classes in those packages. Why invent a 
&lt;br&gt;&amp;gt;&amp;gt; new system that takes such a large step backwards?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; The answer is simply convenience. Imagine a module that contains 100 
&lt;br&gt;&amp;gt;&amp;gt; packages and it is obvious that writing a single import statement is far 
&lt;br&gt;&amp;gt;&amp;gt; easier than discovering and explicitly writing all the package imports. 
&lt;br&gt;&amp;gt;&amp;gt; Yes, IDEs will likely mostly eliminate this issue, but it still makes 
&lt;br&gt;&amp;gt;&amp;gt; sense to be able to do this by hand.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; This proposal is an attempt to maintain the convenience while adding the 
&lt;br&gt;&amp;gt;&amp;gt; crucial ability to safely refactor: step 1b is the central idea.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; // Bryan
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Refactorability-proposal...-tp17768285p17831219.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17830439</id>
	<title>Re: Refactorability proposal...</title>
	<published>2008-06-13T12:22:52Z</published>
	<updated>2008-06-13T12:22:52Z</updated>
	<author>
		<name>Bryan Atsatt</name>
	</author>
	<content type="html">Yeah, that was my original proposal (seems like years ago now :^), but 
&lt;br&gt;it means that you can never escape from your mistakes.
&lt;br&gt;&lt;br&gt;As a newbie, you create module X containing your code in package X. But 
&lt;br&gt;you have a dependency on package Y, so, following the traditional 
&lt;br&gt;keep-adding-to-the-classpath-till-it-works model, you throw in package 
&lt;br&gt;Y. But, argh, Y depends on Z, so you throw that in as well. Being a 
&lt;br&gt;newbie, you export everything to keep it simple.
&lt;br&gt;&lt;br&gt;Sometime later you realize it was a mistake to export Y and Z: your code 
&lt;br&gt;didn't actually depend on Z, nor did it expose Y. And the version of Y 
&lt;br&gt;that you want to use now is available in a shiny new module.
&lt;br&gt;&lt;br&gt;So you refactor to remove packages Y and Z and import Y instead.
&lt;br&gt;&lt;br&gt;But for compatibility, you are forced to also:
&lt;br&gt;&lt;br&gt;1. Import Z.
&lt;br&gt;2. Re-export both Y and Z.
&lt;br&gt;&lt;br&gt;Ugly. Far worse though: it binds your importers both to the version of Y 
&lt;br&gt;that you depend on (but don't expose in your code), and the version of Z 
&lt;br&gt;that you don't depend on at all!
&lt;br&gt;&lt;br&gt;And all of this is a direct consequence of import-by-module. With 
&lt;br&gt;import-by-package, this issue just... vanishes.
&lt;br&gt;&lt;br&gt;// Bryan
&lt;br&gt;&lt;br&gt;Adrian Brock wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Thu, 2008-06-12 at 17:13 -0700, Bryan Atsatt wrote:
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; Really, I just want to make it possible for a module developer to be in 
&lt;br&gt;&amp;gt;&amp;gt; a position to &amp;quot;know&amp;quot; that splitting one module into multiple modules 
&lt;br&gt;&amp;gt;&amp;gt; will not break existing importers. I'm quite open to other solutions, as 
&lt;br&gt;&amp;gt;&amp;gt; long as they are reasonable.
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; But can't that also be achieved with the old module re-exporting the
&lt;br&gt;&amp;gt; split out module for backwards compatibility purposes?
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Refactorability-proposal...-tp17768285p17830439.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17820448</id>
	<title>Re: Refactorability proposal...</title>
	<published>2008-06-13T03:10:06Z</published>
	<updated>2008-06-13T03:10:06Z</updated>
	<author>
		<name>Adrian Brock-4</name>
	</author>
	<content type="html">On Thu, 2008-06-12 at 10:53 -0700, Bryan Atsatt wrote:
&lt;br&gt;&amp;gt; The proposal is to resolve module--&amp;gt;packages at *build* time, not 
&lt;br&gt;&amp;gt; deploy. This way, the mapping is guaranteed to be valid.
&lt;br&gt;&lt;br&gt;Whether it is done at build time or deploy time,
&lt;br&gt;my criticisms still apply. 
&lt;br&gt;&lt;br&gt;Its still based upon what was in the repository at that time 
&lt;br&gt;and may not reflect what is in the repository at runtime.
&lt;br&gt;&lt;br&gt;Generating the package version constraints from a module constraint
&lt;br&gt;is non-trivial in general.
&lt;br&gt;&lt;br&gt;&amp;gt; And yes, this does make the sysadmin job a bit more difficult, but 
&lt;br&gt;&amp;gt; that should be relatively easy to address with tooling.
&lt;br&gt;&lt;br&gt;The old, &amp;quot;A tool will solve the complexity problem&amp;quot; opt out. ;-)
&lt;br&gt;-- 
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;Adrian Brock
&lt;br&gt;Chief Scientist
&lt;br&gt;JBoss, a division of Red Hat
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Refactorability-proposal...-tp17768285p17820448.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17820373</id>
	<title>Re: Refactorability proposal...</title>
	<published>2008-06-13T03:05:02Z</published>
	<updated>2008-06-13T03:05:02Z</updated>
	<author>
		<name>Adrian Brock-4</name>
	</author>
	<content type="html">On Thu, 2008-06-12 at 17:13 -0700, Bryan Atsatt wrote:
&lt;br&gt;&amp;gt; Really, I just want to make it possible for a module developer to be in 
&lt;br&gt;&amp;gt; a position to &amp;quot;know&amp;quot; that splitting one module into multiple modules 
&lt;br&gt;&amp;gt; will not break existing importers. I'm quite open to other solutions, as 
&lt;br&gt;&amp;gt; long as they are reasonable.
&lt;br&gt;&lt;br&gt;But can't that also be achieved with the old module re-exporting the
&lt;br&gt;split out module for backwards compatibility purposes?
&lt;br&gt;-- 
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;Adrian Brock
&lt;br&gt;Chief Scientist
&lt;br&gt;JBoss, a division of Red Hat
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Refactorability-proposal...-tp17768285p17820373.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17812489</id>
	<title>Re: Refactorability proposal...</title>
	<published>2008-06-12T17:13:39Z</published>
	<updated>2008-06-12T17:13:39Z</updated>
	<author>
		<name>Bryan Atsatt</name>
	</author>
	<content type="html">Stanley M. Ho wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi Bryan,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I agreed that refactorability is indeed an important issue we need to 
&lt;br&gt;&amp;gt; address. That said, there are couple concerns I have related to step 
&lt;br&gt;&amp;gt; 1b. I'm not arguing against import-by-package at runtime; only against 
&lt;br&gt;&amp;gt; the transformation of import-by-module to import-by-package at 
&lt;br&gt;&amp;gt; compile-time.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; A compile/build-time transformation from import-by-module to 
&lt;br&gt;&amp;gt; import-by-package could fundamentally be done in one of two ways.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; First, it could involve analysis of the module's method signatures. 
&lt;br&gt;&amp;gt; The issue is that the analysis may not be accurate all the time (e.g. 
&lt;br&gt;&amp;gt; code that uses reflection, Class.forName(), etc.). The programmer will 
&lt;br&gt;&amp;gt; then be required do extra trial-and-error steps to fix up the 
&lt;br&gt;&amp;gt; dependencies in the metadata, and this is not acceptable.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Second, it could simply expand import-by-module as the set of exported 
&lt;br&gt;&amp;gt; packages in the imported module, then there is a problem when 
&lt;br&gt;&amp;gt; migrating from one version of an imported module to a newer one and 
&lt;br&gt;&amp;gt; the set of packages have changed. Suppose a core module in JDK 7 
&lt;br&gt;&amp;gt; exports package P and the one in JDK 8 exports packages P and Q. If a 
&lt;br&gt;&amp;gt; module imports JDK 7+ and is compiled against JDK 7, step 1b will 
&lt;br&gt;&amp;gt; transform the module to import only the packages that are known in the 
&lt;br&gt;&amp;gt; core module in JDK 7. When this module runs in JDK 8 or later, it will 
&lt;br&gt;&amp;gt; not see the new packages. This is problematic because many modules 
&lt;br&gt;&amp;gt; will compile against an older version of the JDK and want to call new 
&lt;br&gt;&amp;gt; API in newer JDK through reflection; in general, this situation 
&lt;br&gt;&amp;gt; applies to using other libraries as well. This will also cause problem 
&lt;br&gt;&amp;gt; in applications that involve weaving at runtime and the exact required 
&lt;br&gt;&amp;gt; packages are not known at compile-time.
&lt;/div&gt;This is why OSGi has dynamic-import. And we need it as well. The fact 
&lt;br&gt;that a forName/loadClass() happens to work *without* an explicit import 
&lt;br&gt;is nothing but a ticking time-bomb.
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; There are some general problems with expanding modules to packages at 
&lt;br&gt;&amp;gt; compile/build-time, regardless of how the expansion is achieved.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; First, there are modules (e.g. classpath module) that cannot logically 
&lt;br&gt;&amp;gt; have exported packages which are known at compile-time and at runtime, 
&lt;br&gt;&amp;gt; thus it would be impossible to perform the transformation in this 
&lt;br&gt;&amp;gt; case. (Technically, we can go through every JAR in the classpath in 
&lt;br&gt;&amp;gt; every launch to find out the exports of the classpath module at 
&lt;br&gt;&amp;gt; runtime, but this has huge startup performance impact.)
&lt;/div&gt;This seems like a very special case to me. First, a &amp;quot;classpath&amp;quot; module 
&lt;br&gt;is, by definition, a very strange beast in that it is fully dynamic: any 
&lt;br&gt;importer can be broken at any time by a simple command-line change. I 
&lt;br&gt;can certainly understand a classpath module existing to support legacy 
&lt;br&gt;code, but I have a hard time imagining creating a new module that would 
&lt;br&gt;express a dependency on such a thing.
&lt;br&gt;&lt;br&gt;Even so, I concede that there are likely special cases where import by 
&lt;br&gt;&amp;quot;something other than package name&amp;quot; at runtime is useful.
&lt;br&gt;&lt;br&gt;Really, I just want to make it possible for a module developer to be in 
&lt;br&gt;a position to &amp;quot;know&amp;quot; that splitting one module into multiple modules 
&lt;br&gt;will not break existing importers. I'm quite open to other solutions, as 
&lt;br&gt;long as they are reasonable.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Second, it implies that people export packages but import modules. 
&lt;br&gt;&amp;gt; This will be hard to explain to beginners.
&lt;br&gt;So explain that you both export and import packages, but we provide 
&lt;br&gt;syntactic sugar for both for convenience. (I'd even by happy to 
&lt;br&gt;eliminate that convenience on the import, to simplify things further, as 
&lt;br&gt;you know.)
&lt;br&gt;&lt;br&gt;This is a silly argument IMO (sorry). In modern IDEs, when you type in 
&lt;br&gt;an unqualified class name, the system pops up and asks you which one you 
&lt;br&gt;mean. Without it, you have to (gasp) type a bunch of import statements 
&lt;br&gt;at the top of your file. Why didn't James make this easier by allowing 
&lt;br&gt;us to import a jar?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Last, but perhaps the most important, it means that unresolveable 
&lt;br&gt;&amp;gt; packages at runtime will generate error messages which the programmer 
&lt;br&gt;&amp;gt; must manually map back to imported modules and the transformation 
&lt;br&gt;&amp;gt; process implemented by a tool. The fundamental aim of a programming 
&lt;br&gt;&amp;gt; system should be to reduce the semantic gap between what a programmer 
&lt;br&gt;&amp;gt; sees in code and what a programmer sees at execution; the mapping from 
&lt;br&gt;&amp;gt; packages back to modules increases the semantic gap.
&lt;br&gt;I agree there is a semantic gap, but not the one you cite.
&lt;br&gt;&lt;br&gt;Either refactoring is supported, or it isn't. If it isn't, this 
&lt;br&gt;particular error should not occur. If it is supported, but an 
&lt;br&gt;import-by-module exists, it will be even worse than you suggest: there 
&lt;br&gt;won't be *any* failure at resolution time.
&lt;br&gt;&lt;br&gt;Say I import &amp;quot;module X&amp;quot;, which contains package X and also happens to 
&lt;br&gt;contain packages Y and Z which I &amp;quot;silently&amp;quot; depend on. I compile and run 
&lt;br&gt;fine, but in some future X is split into X, Y and Z modules, and, for 
&lt;br&gt;some reason module Z is not installed. With my proposal, resolution for 
&lt;br&gt;my module will fail (&amp;quot;package Z not found&amp;quot;) iff there is no installed 
&lt;br&gt;module containing Z.
&lt;br&gt;&lt;br&gt;Without my proposal (or some other similar solution), resolution will 
&lt;br&gt;succeed when it shouldn't, and a NoClassDefFoundError will occur at some 
&lt;br&gt;random point in execution naming a class in a package that was never 
&lt;br&gt;explicitly imported. How is that better?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I accept that pushing module imports through to runtime makes it hard 
&lt;br&gt;&amp;gt; to &amp;quot;rewrite&amp;quot; a program (i.e. to refactor module members) but it makes 
&lt;br&gt;&amp;gt; it easy to &amp;quot;read&amp;quot; the program (in the sense of a small semantic gap 
&lt;br&gt;&amp;gt; between what imports are read/written and what imports are executed). 
&lt;br&gt;&amp;gt; A core Java principle has always been that reading is more important 
&lt;br&gt;&amp;gt; than writing, so we do not believe increased ease of refactoring on 
&lt;br&gt;&amp;gt; relatively rare occasions is worth complicating every single reading 
&lt;br&gt;&amp;gt; of a dependency.
&lt;br&gt;Well there's a distinct difference between our perceptions: &amp;quot;relatively 
&lt;br&gt;rare occasions&amp;quot; strikes me as extremely misleading. Though I have 
&lt;br&gt;significant, direct, and exactly analogous experience that tells me the 
&lt;br&gt;frequency will be higher than you seem to expect, I'm perfectly happy to 
&lt;br&gt;concede that it may be lower. But unless you believe that it will be 
&lt;br&gt;zero, we need a tenable solution.
&lt;br&gt;&amp;gt; I still think the refactorability problem you brought up is very 
&lt;br&gt;&amp;gt; important to address. 
&lt;br&gt;Well at least we can agree on that :^). Any ideas that are less ugly 
&lt;br&gt;than mine?
&lt;br&gt;&lt;br&gt;// Bryan
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Refactorability-proposal...-tp17768285p17812489.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17806205</id>
	<title>Re: Refactorability proposal...</title>
	<published>2008-06-12T11:02:08Z</published>
	<updated>2008-06-12T11:02:08Z</updated>
	<author>
		<name>Stanley M. Ho</name>
	</author>
	<content type="html">Hi Bryan,
&lt;br&gt;&lt;br&gt;I agreed that refactorability is indeed an important issue we need to 
&lt;br&gt;address. That said, there are couple concerns I have related to step 1b. 
&lt;br&gt;I'm not arguing against import-by-package at runtime; only against the 
&lt;br&gt;transformation of import-by-module to import-by-package at compile-time.
&lt;br&gt;&lt;br&gt;A compile/build-time transformation from import-by-module to 
&lt;br&gt;import-by-package could fundamentally be done in one of two ways.
&lt;br&gt;&lt;br&gt;First, it could involve analysis of the module's method signatures. The 
&lt;br&gt;issue is that the analysis may not be accurate all the time (e.g. code 
&lt;br&gt;that uses reflection, Class.forName(), etc.). The programmer will then 
&lt;br&gt;be required do extra trial-and-error steps to fix up the dependencies in 
&lt;br&gt;the metadata, and this is not acceptable.
&lt;br&gt;&lt;br&gt;Second, it could simply expand import-by-module as the set of exported 
&lt;br&gt;packages in the imported module, then there is a problem when migrating 
&lt;br&gt;from one version of an imported module to a newer one and the set of 
&lt;br&gt;packages have changed. Suppose a core module in JDK 7 exports package P 
&lt;br&gt;and the one in JDK 8 exports packages P and Q. If a module imports JDK 
&lt;br&gt;7+ and is compiled against JDK 7, step 1b will transform the module to 
&lt;br&gt;import only the packages that are known in the core module in JDK 7. 
&lt;br&gt;When this module runs in JDK 8 or later, it will not see the new 
&lt;br&gt;packages. This is problematic because many modules will compile against 
&lt;br&gt;an older version of the JDK and want to call new API in newer JDK 
&lt;br&gt;through reflection; in general, this situation applies to using other 
&lt;br&gt;libraries as well. This will also cause problem in applications that 
&lt;br&gt;involve weaving at runtime and the exact required packages are not known 
&lt;br&gt;at compile-time.
&lt;br&gt;&lt;br&gt;There are some general problems with expanding modules to packages at 
&lt;br&gt;compile/build-time, regardless of how the expansion is achieved.
&lt;br&gt;&lt;br&gt;First, there are modules (e.g. classpath module) that cannot logically 
&lt;br&gt;have exported packages which are known at compile-time and at runtime, 
&lt;br&gt;thus it would be impossible to perform the transformation in this case. 
&lt;br&gt;(Technically, we can go through every JAR in the classpath in every 
&lt;br&gt;launch to find out the exports of the classpath module at runtime, but 
&lt;br&gt;this has huge startup performance impact.)
&lt;br&gt;&lt;br&gt;Second, it implies that people export packages but import modules. This 
&lt;br&gt;will be hard to explain to beginners.
&lt;br&gt;&lt;br&gt;Last, but perhaps the most important, it means that unresolveable 
&lt;br&gt;packages at runtime will generate error messages which the programmer 
&lt;br&gt;must manually map back to imported modules and the transformation 
&lt;br&gt;process implemented by a tool. The fundamental aim of a programming 
&lt;br&gt;system should be to reduce the semantic gap between what a programmer 
&lt;br&gt;sees in code and what a programmer sees at execution; the mapping from 
&lt;br&gt;packages back to modules increases the semantic gap.
&lt;br&gt;&lt;br&gt;I accept that pushing module imports through to runtime makes it hard to 
&lt;br&gt;&amp;quot;rewrite&amp;quot; a program (i.e. to refactor module members) but it makes it 
&lt;br&gt;easy to &amp;quot;read&amp;quot; the program (in the sense of a small semantic gap between 
&lt;br&gt;what imports are read/written and what imports are executed). A core 
&lt;br&gt;Java principle has always been that reading is more important than 
&lt;br&gt;writing, so we do not believe increased ease of refactoring on 
&lt;br&gt;relatively rare occasions is worth complicating every single reading of 
&lt;br&gt;a dependency.
&lt;br&gt;&lt;br&gt;I still think the refactorability problem you brought up is very 
&lt;br&gt;important to address. That said, the proposed transformation seems to 
&lt;br&gt;have many issues as an acceptable general solution.
&lt;br&gt;&lt;br&gt;- Stanley
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Refactorability-proposal...-tp17768285p17806205.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17805993</id>
	<title>Re: Refactorability proposal...</title>
	<published>2008-06-12T10:53:11Z</published>
	<updated>2008-06-12T10:53:11Z</updated>
	<author>
		<name>Bryan Atsatt</name>
	</author>
	<content type="html">The proposal is to resolve module--&amp;gt;packages at *build* time, not 
&lt;br&gt;deploy. This way, the mapping is guaranteed to be valid.
&lt;br&gt;&lt;br&gt;And yes, this does make the sysadmin job a bit more difficult, but that 
&lt;br&gt;should be relatively easy to address with tooling.
&lt;br&gt;&lt;br&gt;The main point is that relying on import-by-module at runtime guarantees 
&lt;br&gt;that refactoring is problematic. My proposal seems like a reasonable way 
&lt;br&gt;to deal with this, but I wanted to start this discussion to explore 
&lt;br&gt;others as well.
&lt;br&gt;&lt;br&gt;Any thoughts on how to solve this problem?
&lt;br&gt;&lt;br&gt;// Bryan
&lt;br&gt;&lt;br&gt;Adrian Brock wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Refactoring:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Aren't there cases where resolving a module import 
&lt;br&gt;&amp;gt; into its packages during deployment into the repository
&lt;br&gt;&amp;gt; will break with some refactorings?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'm not talking about the more stable module refactorings
&lt;br&gt;&amp;gt; where modules are broken into other modules (which
&lt;br&gt;&amp;gt; you seem to be addressing).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; This is more development time practices where somebody 
&lt;br&gt;&amp;gt; is refactoring module contents. i.e. the importing
&lt;br&gt;&amp;gt; module could end up with a &amp;quot;stale&amp;quot; view of what it
&lt;br&gt;&amp;gt; should be importing.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; A not very good example would be my module B imports a module A
&lt;br&gt;&amp;gt; where A exports com.acme.a.interfaces and 
&lt;br&gt;&amp;gt; com.acme.a.implementation
&lt;br&gt;&amp;gt; I don't use com.acme.a.implementation explicitly so it
&lt;br&gt;&amp;gt; shouldn't really be one of my constraints.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Somebody then refactors module B such that the
&lt;br&gt;&amp;gt; implementation is now in com.acme.a.impl
&lt;br&gt;&amp;gt; but my module wants to import the now non-existant
&lt;br&gt;&amp;gt; (or at least stale) com.acme.a.implementation.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Overrides in the repository:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I know we avoid these discussions on the list since it
&lt;br&gt;&amp;gt; is really a tooling issue. 
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; But it is a lot easier for a sysadmin to change 
&lt;br&gt;&amp;gt; a single version constraint for a module import 
&lt;br&gt;&amp;gt; than it is to have to figure out
&lt;br&gt;&amp;gt; what package versions they need to change on the
&lt;br&gt;&amp;gt; package imports and change each one individually.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Basically, the convenience of import-by-module
&lt;br&gt;&amp;gt; extends beyond the development/source code phase.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; OSGi/291
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; There's still going to be a kind of module import
&lt;br&gt;&amp;gt; somewhere to handle OSGi's bundle import constraint.
&lt;br&gt;&amp;gt; i.e. OSGi bundle B issues a request to import bundle A
&lt;br&gt;&amp;gt; which is really a 277 module.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; On Tue, 2008-06-10 at 18:27 -0700, Bryan Atsatt wrote:
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; (FYI: I've discussed this with Stanley but wanted to ensure it was 
&lt;br&gt;&amp;gt;&amp;gt; visible to everyone.)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Proposal
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; 1. Eliminate runtime use of import-by-module in the JAM system:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; a. Support the (very convenient) import-by-module at the source level.
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; b. jam tool transforms import-by-module to a list of 
&lt;br&gt;&amp;gt;&amp;gt; import-by-package statements.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; 2. Add APIs to fully support import-by-package in the JAM system:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;a. Support Version annotation in package-info.java (or in 
&lt;br&gt;&amp;gt;&amp;gt; module-info.java). If a
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;package does not declare a version, it &amp;quot;inherits&amp;quot; that of the 
&lt;br&gt;&amp;gt;&amp;gt; enclosing module.
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp;b. Add ImportPackage annotation with version constraints.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; 3. Add APIs to fully support import-by-package in the abstract framework:
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; a. Add methods to Query to produce import-by-package nodes.
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; b. Replace Query.getIndexableNames() with fully generic variants (I 
&lt;br&gt;&amp;gt;&amp;gt; proposed
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a solution here previously which I will re-post).
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Rationale
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Module refactoring is inevitable, particularly during the transition 
&lt;br&gt;&amp;gt;&amp;gt; from the current, effectively flat class space to a fine-grained space 
&lt;br&gt;&amp;gt;&amp;gt; provided by module systems. We have significant experience with this 
&lt;br&gt;&amp;gt;&amp;gt; issue at Oracle (with the transition to our own module system), and OSGi 
&lt;br&gt;&amp;gt;&amp;gt; best-practices for conversion include starting with everything in one 
&lt;br&gt;&amp;gt;&amp;gt; bundle and then separating out pieces as experience is gained.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; A very common pattern, in our experience, is for developers to start 
&lt;br&gt;&amp;gt;&amp;gt; with many extra jars in their initial module (a mini version of 
&lt;br&gt;&amp;gt;&amp;gt; class-path hell). As that module is put into wider use, someone 
&lt;br&gt;&amp;gt;&amp;gt; discovers that package X is also contained in their module, and that 
&lt;br&gt;&amp;gt;&amp;gt; duplication either leads to runtime conflicts (very bad), or just plain 
&lt;br&gt;&amp;gt;&amp;gt; footprint bloat. The obvious answer is to put package X in a separate 
&lt;br&gt;&amp;gt;&amp;gt; module, and have everyone share it via imports.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; But... not so fast. If there are consumers of that module who import it 
&lt;br&gt;&amp;gt;&amp;gt; by module name alone, then pulling X out of it will cause those 
&lt;br&gt;&amp;gt;&amp;gt; importers to break. And if it is possible for your module to have been 
&lt;br&gt;&amp;gt;&amp;gt; imported by *anyone* by name alone, then you are stuck: either you break 
&lt;br&gt;&amp;gt;&amp;gt; them or you live with the incorrect granularity (which just isn't an 
&lt;br&gt;&amp;gt;&amp;gt; option in the conflict scenarios). Not a happy choice.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Originally, I had proposed to do away with import-by-module altogether, 
&lt;br&gt;&amp;gt;&amp;gt; both to avoid this problem and to eliminate the conceptual disconnect. 
&lt;br&gt;&amp;gt;&amp;gt; Your code does not today contain import statements that name *jars*, it 
&lt;br&gt;&amp;gt;&amp;gt; names packages and/or specific classes in those packages. Why invent a 
&lt;br&gt;&amp;gt;&amp;gt; new system that takes such a large step backwards?
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; The answer is simply convenience. Imagine a module that contains 100 
&lt;br&gt;&amp;gt;&amp;gt; packages and it is obvious that writing a single import statement is far 
&lt;br&gt;&amp;gt;&amp;gt; easier than discovering and explicitly writing all the package imports. 
&lt;br&gt;&amp;gt;&amp;gt; Yes, IDEs will likely mostly eliminate this issue, but it still makes 
&lt;br&gt;&amp;gt;&amp;gt; sense to be able to do this by hand.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; This proposal is an attempt to maintain the convenience while adding the 
&lt;br&gt;&amp;gt;&amp;gt; crucial ability to safely refactor: step 1b is the central idea.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; // Bryan
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Refactorability-proposal...-tp17768285p17805993.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17800867</id>
	<title>Repository WAS Re: Goals was: Re: Supporting OSGi Bundles in the Java Module System</title>
	<published>2008-06-12T06:55:47Z</published>
	<updated>2008-06-12T06:55:47Z</updated>
	<author>
		<name>Adrian Brock-4</name>
	</author>
	<content type="html">On Wed, 2008-06-11 at 22:31 -0700, Stanley M. Ho wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; 3) QoS - what tools are available for the repository
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The Java Module System implementation will come with a standard tool to 
&lt;br&gt;&amp;gt; manage module archives in the repository, e.g. install/uninstall, etc. 
&lt;br&gt;&amp;gt; Is there any particular aspect of the tools support that you are 
&lt;br&gt;&amp;gt; concerned with but currently not possible in the draft API?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; 4) Location - file system/url based, etc.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This is handled by the ModuleContent abstraction described above.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; * Developing a full repository just to define a different archive
&lt;br&gt;&amp;gt; &amp;gt; format is too much (e.g. legacy javaee deployments)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I would like to know what you think about the draft API to see if it is 
&lt;br&gt;&amp;gt; still too much to develop a repository.
&lt;/div&gt;&lt;br&gt;The question is how easy is it to do all this overriding of
&lt;br&gt;repository implementations to change behaviour and 
&lt;br&gt;not loose some aspect of the behaviour.
&lt;br&gt;&lt;br&gt;e.g. To programmatically create a module like on the other thread.
&lt;br&gt;&lt;br&gt;The tools of a repository are not defined by the spec,
&lt;br&gt;and there is no repository.install(ModuleContent)
&lt;br&gt;instead I would create a (possibly dummy) URL backed 
&lt;br&gt;by a jam file stream (or whatever format the repository understands).
&lt;br&gt;&lt;br&gt;But does that really do what I want? If I'm mapping a legacy
&lt;br&gt;file to a module definition at runtime, I probably don't 
&lt;br&gt;want to install it in the JDK &amp;nbsp;repository implementation 
&lt;br&gt;since it will copy it to some disk location.
&lt;br&gt;&lt;br&gt;The next time I reboot my runtime, I would have to delete it
&lt;br&gt;and recreate it otherwise it might be stale.
&lt;br&gt;&lt;br&gt;This is all so I can enable use the tools that come with the 
&lt;br&gt;JDK repository implementation and possibly other behaviour
&lt;br&gt;like Bryan's resolving Module imports to Package imports.
&lt;br&gt;-- 
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;Adrian Brock
&lt;br&gt;Chief Scientist
&lt;br&gt;JBoss, a division of Red Hat
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Goals-was%3A-Re%3A-Supporting-OSGi-Bundles-in-the-Java-Module-System-tp17753303p17800867.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17800503</id>
	<title>Delegation model WAS  Re: Goals was: Re: Supporting OSGi Bundles in the Java Module System</title>
	<published>2008-06-12T06:28:37Z</published>
	<updated>2008-06-12T06:28:37Z</updated>
	<author>
		<name>Adrian Brock-4</name>
	</author>
	<content type="html">On Wed, 2008-06-11 at 22:31 -0700, Stanley M. Ho wrote:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; 2) Model - parent/child or peer
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I think you meant the module system inteorp model, not the repository 
&lt;br&gt;&amp;gt; delegation model. Right?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&lt;br&gt;I don't see the difference? Hierarchical or Peer delegation
&lt;br&gt;policies between repositories are orthogonal choices to which
&lt;br&gt;module system backs that repository.
&lt;br&gt;&lt;br&gt;It's precisely this orthogonality that causes me to think
&lt;br&gt;that we can't just say &amp;quot;create a new repository implementation&amp;quot;
&lt;br&gt;to change a particular rule/policy.
&lt;br&gt;&lt;br&gt;There are ~ N^2 choices of overrides to what the default
&lt;br&gt;repositories do.
&lt;br&gt;&lt;br&gt;e.g. (probably not a good example since the osgi
&lt;br&gt;module system would use OBR?)
&lt;br&gt;&lt;br&gt;1) A simple file repository containing jam files
&lt;br&gt;2) The same containing osgi bundles
&lt;br&gt;3) A remote repository containing jam files
&lt;br&gt;4) A remote repository contains osgi bundles
&lt;br&gt;&lt;br&gt;And those are just two of the many
&lt;br&gt;orthogonal choices 2^2 = 4
&lt;br&gt;-- 
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;Adrian Brock
&lt;br&gt;Chief Scientist
&lt;br&gt;JBoss, a division of Red Hat
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Goals-was%3A-Re%3A-Supporting-OSGi-Bundles-in-the-Java-Module-System-tp17753303p17800503.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17800090</id>
	<title>ModuleDefinition construction WAS Re: Goals was: Re: Supporting OSGi Bundles in the Java Module System</title>
	<published>2008-06-12T06:21:02Z</published>
	<updated>2008-06-12T06:21:02Z</updated>
	<author>
		<name>Adrian Brock-4</name>
	</author>
	<content type="html">On Wed, 2008-06-11 at 22:31 -0700, Stanley M. Ho wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi Adrian,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Adrian Brock wrote:
&lt;br&gt;&amp;gt; &amp;gt; My critisms of using the JSR277 repositories to do the integration
&lt;br&gt;&amp;gt; &amp;gt; included:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I want to better understand your concerns around developing 
&lt;br&gt;&amp;gt; repositories, since I believe some of your concerns have already been 
&lt;br&gt;&amp;gt; addressed in the draft API.
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;The comments I included were from discussions (a year ago)
&lt;br&gt;before the current api changes, so some parts maybe out-of-date.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt; * There are already lots of orthogonal reasons for swapping
&lt;br&gt;&amp;gt; &amp;gt; repository implementations
&lt;br&gt;&amp;gt; &amp;gt; 
&lt;br&gt;&amp;gt; &amp;gt; On Mon, 2007-02-26 at 12:26 +0100, Adrian wrote:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; So besides the peer/hierarchy argument there
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; is also the problem that the repository is dealing
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; with too many concerns.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; 1) ModuleDefinition construction
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The draft API provides a Modules.newJamModuleDefinition() method to 
&lt;br&gt;&amp;gt; construct a ModuleDefinition from JAM's metadata and ModuleContent. The 
&lt;br&gt;&amp;gt; ModuleContent abstraction enables a module archive to be stored in the 
&lt;br&gt;&amp;gt; repository in any form under the cover. This should make it easier for a 
&lt;br&gt;&amp;gt; repository implementation to construct ModuleDefinitions from JAM files, 
&lt;br&gt;&amp;gt; or from other archive formats (as long as the metadata information of a 
&lt;br&gt;&amp;gt; module can be expressed as JAM's metadata, and the content of the module 
&lt;br&gt;&amp;gt; can be exposed through the ModuleContent abstraction).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; In your original use case in JavaEE, the appserver wants to use the 
&lt;br&gt;&amp;gt; module system for &amp;quot;plain old module&amp;quot; wiring but also wants to define its 
&lt;br&gt;&amp;gt; own &amp;quot;modules&amp;quot; for wars, ears, etc., and some of which looks nothing like 
&lt;br&gt;&amp;gt; jars/jams in structure. Do you think the draft API and the ModuleContent 
&lt;br&gt;&amp;gt; abstraction are sufficient to address the ModuleDefinition construction 
&lt;br&gt;&amp;gt; issue you were concerned with?
&lt;/div&gt;&lt;br&gt;I see a number of possible use cases here 
&lt;br&gt;(I'll continue with appserver example):
&lt;br&gt;&lt;br&gt;1) Fully JSR 277
&lt;br&gt;&lt;br&gt;The appserver and JavaEE specs are updated to fully understand
&lt;br&gt;JSR277/294. In this case, the JavaEE deployment process would 
&lt;br&gt;probably make use of a JSR 277 repository.
&lt;br&gt;&lt;br&gt;2) Partial JSR 277
&lt;br&gt;&lt;br&gt;The appserver knows about JSR277/294 but the JavaEE specs
&lt;br&gt;haven't been updated (or they are legacy deployments).
&lt;br&gt;&lt;br&gt;In this case the appserver could try to adapt the deployments
&lt;br&gt;to conform to the ModuleDefinition/Content.
&lt;br&gt;&lt;br&gt;In this case, there probably wouldn't be a real repository
&lt;br&gt;implementation, instead the &amp;quot;repository&amp;quot; would be dummy.
&lt;br&gt;It would just be serving as an adapter from the old deployment packaging
&lt;br&gt;and metadata to the new one at runtime.
&lt;br&gt;&lt;br&gt;3) Mixed
&lt;br&gt;&lt;br&gt;Similar to 2, but the opposite. 
&lt;br&gt;The appserver knows about JSR277/294 and wants to support
&lt;br&gt;.jam files as well as .jar files in JavaEE deployments.
&lt;br&gt;i.e. .jam files would be unpacked from a .jar EAR deployment
&lt;br&gt;and then added to the module system runtime.
&lt;br&gt;&lt;br&gt;Conclusion:
&lt;br&gt;&lt;br&gt;I expect there are other possible uses.
&lt;br&gt;&lt;br&gt;The question is whether Repository is the best api
&lt;br&gt;for cases (2) and (3). i.e. we implement a dummy
&lt;br&gt;repository with a dummy &amp;quot;URL&amp;quot; for the source
&lt;br&gt;or whether there should be a more abstract parent
&lt;br&gt;class (I called it ModuleSource) that doesn't
&lt;br&gt;assume a physical repository behind the scenes.
&lt;br&gt;&lt;br&gt;At least for cases (2) and (3) all we really want
&lt;br&gt;to do is to PUSH a ModuleDefinition/Content to the
&lt;br&gt;jsr 277 module system such that we can get back
&lt;br&gt;a Module/Classloader with the imports resolved.
&lt;br&gt;-- 
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;Adrian Brock
&lt;br&gt;Chief Scientist
&lt;br&gt;JBoss, a division of Red Hat
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Goals-was%3A-Re%3A-Supporting-OSGi-Bundles-in-the-Java-Module-System-tp17753303p17800090.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17799502</id>
	<title>Re: ImportDependency</title>
	<published>2008-06-12T05:52:33Z</published>
	<updated>2008-06-12T05:52:33Z</updated>
	<author>
		<name>Adrian Brock-4</name>
	</author>
	<content type="html">I agree, getType() looks wrong to me
&lt;br&gt;(not very object orientated ;-)
&lt;br&gt;&lt;br&gt;But I'm not sure that the spec should define import module and package
&lt;br&gt;as explicit subclasses or that Import[Dependency] should be a 
&lt;br&gt;concrete class?
&lt;br&gt;&lt;br&gt;I'd prefer to see interfaces. The factory methods would
&lt;br&gt;just construct implementations of those interfaces.
&lt;br&gt;&lt;br&gt;Somebody else would be free to implement them in a different way,
&lt;br&gt;e.g. as a wrapper/adapter to the equivalent manifest information of a
&lt;br&gt;291 implementation.
&lt;br&gt;&lt;br&gt;On Wed, 2008-06-11 at 13:11 -0700, Bryan Atsatt wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; The design of this class seems broken to me with the addition of two 
&lt;br&gt;&amp;gt; &amp;quot;types&amp;quot;. Why not:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 1. Make ImportDependency abstract, removing the getType() and newX methods.
&lt;br&gt;&amp;gt; 2. Make ImportPackage and ImportModule subclasses, each with their own 
&lt;br&gt;&amp;gt; newX method.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; (I also strongly suggest that we rename ImportDependency to simply 
&lt;br&gt;&amp;gt; &amp;quot;Import&amp;quot; :^)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This model also obviously enables new subtypes, an extensibility point 
&lt;br&gt;&amp;gt; that may come in handy in the future.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; // Bryan
&lt;/div&gt;-- 
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;Adrian Brock
&lt;br&gt;Chief Scientist
&lt;br&gt;JBoss, a division of Red Hat
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ImportDependency-tp17786336p17799502.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17798435</id>
	<title>Re: Refactorability proposal...</title>
	<published>2008-06-12T05:01:26Z</published>
	<updated>2008-06-12T05:01:26Z</updated>
	<author>
		<name>Adrian Brock-4</name>
	</author>
	<content type="html">Another issue would be how you handle the generated package
&lt;br&gt;constraints.
&lt;br&gt;&lt;br&gt;e.g. Suppose you a module JavaEE:4.0.0 that
&lt;br&gt;contains packages javax.jms:1.1.0, javax.resource:1.5.0, etc.
&lt;br&gt;&lt;br&gt;I then declare a module constraint
&lt;br&gt;JavaEE:[4.0.0, 5.0.0)
&lt;br&gt;i.e. I work with JavaEE4 but not JavaEE5
&lt;br&gt;&lt;br&gt;What do the package constraints resolve to for jms and jca
&lt;br&gt;if we don't have a JavaEE5 module in the repository? :-)
&lt;br&gt;&lt;br&gt;JavaEE is not a very a good example since package versions
&lt;br&gt;wouldn't change across a major release, but they could
&lt;br&gt;in other cases or more general module version constraints.
&lt;br&gt;&lt;br&gt;On Tue, 2008-06-10 at 18:27 -0700, Bryan Atsatt wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; (FYI: I've discussed this with Stanley but wanted to ensure it was 
&lt;br&gt;&amp;gt; visible to everyone.)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Proposal
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 1. Eliminate runtime use of import-by-module in the JAM system:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; a. Support the (very convenient) import-by-module at the source level.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; b. jam tool transforms import-by-module to a list of 
&lt;br&gt;&amp;gt; import-by-package statements.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 2. Add APIs to fully support import-by-package in the JAM system:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;a. Support Version annotation in package-info.java (or in 
&lt;br&gt;&amp;gt; module-info.java). If a
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;package does not declare a version, it &amp;quot;inherits&amp;quot; that of the 
&lt;br&gt;&amp;gt; enclosing module.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;b. Add ImportPackage annotation with version constraints.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 3. Add APIs to fully support import-by-package in the abstract framework:
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; a. Add methods to Query to produce import-by-package nodes.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; b. Replace Query.getIndexableNames() with fully generic variants (I 
&lt;br&gt;&amp;gt; proposed
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a solution here previously which I will re-post).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Rationale
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Module refactoring is inevitable, particularly during the transition 
&lt;br&gt;&amp;gt; from the current, effectively flat class space to a fine-grained space 
&lt;br&gt;&amp;gt; provided by module systems. We have significant experience with this 
&lt;br&gt;&amp;gt; issue at Oracle (with the transition to our own module system), and OSGi 
&lt;br&gt;&amp;gt; best-practices for conversion include starting with everything in one 
&lt;br&gt;&amp;gt; bundle and then separating out pieces as experience is gained.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; A very common pattern, in our experience, is for developers to start 
&lt;br&gt;&amp;gt; with many extra jars in their initial module (a mini version of 
&lt;br&gt;&amp;gt; class-path hell). As that module is put into wider use, someone 
&lt;br&gt;&amp;gt; discovers that package X is also contained in their module, and that 
&lt;br&gt;&amp;gt; duplication either leads to runtime conflicts (very bad), or just plain 
&lt;br&gt;&amp;gt; footprint bloat. The obvious answer is to put package X in a separate 
&lt;br&gt;&amp;gt; module, and have everyone share it via imports.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; But... not so fast. If there are consumers of that module who import it 
&lt;br&gt;&amp;gt; by module name alone, then pulling X out of it will cause those 
&lt;br&gt;&amp;gt; importers to break. And if it is possible for your module to have been 
&lt;br&gt;&amp;gt; imported by *anyone* by name alone, then you are stuck: either you break 
&lt;br&gt;&amp;gt; them or you live with the incorrect granularity (which just isn't an 
&lt;br&gt;&amp;gt; option in the conflict scenarios). Not a happy choice.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Originally, I had proposed to do away with import-by-module altogether, 
&lt;br&gt;&amp;gt; both to avoid this problem and to eliminate the conceptual disconnect. 
&lt;br&gt;&amp;gt; Your code does not today contain import statements that name *jars*, it 
&lt;br&gt;&amp;gt; names packages and/or specific classes in those packages. Why invent a 
&lt;br&gt;&amp;gt; new system that takes such a large step backwards?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The answer is simply convenience. Imagine a module that contains 100 
&lt;br&gt;&amp;gt; packages and it is obvious that writing a single import statement is far 
&lt;br&gt;&amp;gt; easier than discovering and explicitly writing all the package imports. 
&lt;br&gt;&amp;gt; Yes, IDEs will likely mostly eliminate this issue, but it still makes 
&lt;br&gt;&amp;gt; sense to be able to do this by hand.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This proposal is an attempt to maintain the convenience while adding the 
&lt;br&gt;&amp;gt; crucial ability to safely refactor: step 1b is the central idea.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; // Bryan
&lt;/div&gt;-- 
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;Adrian Brock
&lt;br&gt;Chief Scientist
&lt;br&gt;JBoss, a division of Red Hat
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Refactorability-proposal...-tp17768285p17798435.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17798265</id>
	<title>Re: Refactorability proposal...</title>
	<published>2008-06-12T04:50:41Z</published>
	<updated>2008-06-12T04:50:41Z</updated>
	<author>
		<name>Adrian Brock-4</name>
	</author>
	<content type="html">Refactoring:
&lt;br&gt;&lt;br&gt;Aren't there cases where resolving a module import 
&lt;br&gt;into its packages during deployment into the repository
&lt;br&gt;will break with some refactorings?
&lt;br&gt;&lt;br&gt;I'm not talking about the more stable module refactorings
&lt;br&gt;where modules are broken into other modules (which
&lt;br&gt;you seem to be addressing).
&lt;br&gt;&lt;br&gt;This is more development time practices where somebody 
&lt;br&gt;is refactoring module contents. i.e. the importing
&lt;br&gt;module could end up with a &amp;quot;stale&amp;quot; view of what it
&lt;br&gt;should be importing.
&lt;br&gt;&lt;br&gt;A not very good example would be my module B imports a module A
&lt;br&gt;where A exports com.acme.a.interfaces and 
&lt;br&gt;com.acme.a.implementation
&lt;br&gt;I don't use com.acme.a.implementation explicitly so it
&lt;br&gt;shouldn't really be one of my constraints.
&lt;br&gt;&lt;br&gt;Somebody then refactors module B such that the
&lt;br&gt;implementation is now in com.acme.a.impl
&lt;br&gt;but my module wants to import the now non-existant
&lt;br&gt;(or at least stale) com.acme.a.implementation.
&lt;br&gt;&lt;br&gt;Overrides in the repository:
&lt;br&gt;&lt;br&gt;I know we avoid these discussions on the list since it
&lt;br&gt;is really a tooling issue. 
&lt;br&gt;&lt;br&gt;But it is a lot easier for a sysadmin to change 
&lt;br&gt;a single version constraint for a module import 
&lt;br&gt;than it is to have to figure out
&lt;br&gt;what package versions they need to change on the
&lt;br&gt;package imports and change each one individually.
&lt;br&gt;&lt;br&gt;Basically, the convenience of import-by-module
&lt;br&gt;extends beyond the development/source code phase.
&lt;br&gt;&lt;br&gt;OSGi/291
&lt;br&gt;&lt;br&gt;There's still going to be a kind of module import
&lt;br&gt;somewhere to handle OSGi's bundle import constraint.
&lt;br&gt;i.e. OSGi bundle B issues a request to import bundle A
&lt;br&gt;which is really a 277 module.
&lt;br&gt;&lt;br&gt;On Tue, 2008-06-10 at 18:27 -0700, Bryan Atsatt wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; (FYI: I've discussed this with Stanley but wanted to ensure it was 
&lt;br&gt;&amp;gt; visible to everyone.)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Proposal
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 1. Eliminate runtime use of import-by-module in the JAM system:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; a. Support the (very convenient) import-by-module at the source level.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; b. jam tool transforms import-by-module to a list of 
&lt;br&gt;&amp;gt; import-by-package statements.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 2. Add APIs to fully support import-by-package in the JAM system:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;a. Support Version annotation in package-info.java (or in 
&lt;br&gt;&amp;gt; module-info.java). If a
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;package does not declare a version, it &amp;quot;inherits&amp;quot; that of the 
&lt;br&gt;&amp;gt; enclosing module.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;b. Add ImportPackage annotation with version constraints.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 3. Add APIs to fully support import-by-package in the abstract framework:
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; a. Add methods to Query to produce import-by-package nodes.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; b. Replace Query.getIndexableNames() with fully generic variants (I 
&lt;br&gt;&amp;gt; proposed
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a solution here previously which I will re-post).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Rationale
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Module refactoring is inevitable, particularly during the transition 
&lt;br&gt;&amp;gt; from the current, effectively flat class space to a fine-grained space 
&lt;br&gt;&amp;gt; provided by module systems. We have significant experience with this 
&lt;br&gt;&amp;gt; issue at Oracle (with the transition to our own module system), and OSGi 
&lt;br&gt;&amp;gt; best-practices for conversion include starting with everything in one 
&lt;br&gt;&amp;gt; bundle and then separating out pieces as experience is gained.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; A very common pattern, in our experience, is for developers to start 
&lt;br&gt;&amp;gt; with many extra jars in their initial module (a mini version of 
&lt;br&gt;&amp;gt; class-path hell). As that module is put into wider use, someone 
&lt;br&gt;&amp;gt; discovers that package X is also contained in their module, and that 
&lt;br&gt;&amp;gt; duplication either leads to runtime conflicts (very bad), or just plain 
&lt;br&gt;&amp;gt; footprint bloat. The obvious answer is to put package X in a separate 
&lt;br&gt;&amp;gt; module, and have everyone share it via imports.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; But... not so fast. If there are consumers of that module who import it 
&lt;br&gt;&amp;gt; by module name alone, then pulling X out of it will cause those 
&lt;br&gt;&amp;gt; importers to break. And if it is possible for your module to have been 
&lt;br&gt;&amp;gt; imported by *anyone* by name alone, then you are stuck: either you break 
&lt;br&gt;&amp;gt; them or you live with the incorrect granularity (which just isn't an 
&lt;br&gt;&amp;gt; option in the conflict scenarios). Not a happy choice.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Originally, I had proposed to do away with import-by-module altogether, 
&lt;br&gt;&amp;gt; both to avoid this problem and to eliminate the conceptual disconnect. 
&lt;br&gt;&amp;gt; Your code does not today contain import statements that name *jars*, it 
&lt;br&gt;&amp;gt; names packages and/or specific classes in those packages. Why invent a 
&lt;br&gt;&amp;gt; new system that takes such a large step backwards?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The answer is simply convenience. Imagine a module that contains 100 
&lt;br&gt;&amp;gt; packages and it is obvious that writing a single import statement is far 
&lt;br&gt;&amp;gt; easier than discovering and explicitly writing all the package imports. 
&lt;br&gt;&amp;gt; Yes, IDEs will likely mostly eliminate this issue, but it still makes 
&lt;br&gt;&amp;gt; sense to be able to do this by hand.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This proposal is an attempt to maintain the convenience while adding the 
&lt;br&gt;&amp;gt; crucial ability to safely refactor: step 1b is the central idea.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; // Bryan
&lt;/div&gt;-- 
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;Adrian Brock
&lt;br&gt;Chief Scientist
&lt;br&gt;JBoss, a division of Red Hat
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Refactorability-proposal...-tp17768285p17798265.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17792802</id>
	<title>Re: Goals was: Re: Supporting OSGi Bundles in the Java Module System</title>
	<published>2008-06-11T22:31:07Z</published>
	<updated>2008-06-11T22:31:07Z</updated>
	<author>
		<name>Stanley M. Ho</name>
	</author>
	<content type="html">Hi Adrian,
&lt;br&gt;&lt;br&gt;Adrian Brock wrote:
&lt;br&gt;&amp;gt; My critisms of using the JSR277 repositories to do the integration
&lt;br&gt;&amp;gt; included:
&lt;br&gt;&lt;br&gt;I want to better understand your concerns around developing 
&lt;br&gt;repositories, since I believe some of your concerns have already been 
&lt;br&gt;addressed in the draft API.
&lt;br&gt;&lt;br&gt;&amp;gt; * There are already lots of orthogonal reasons for swapping
&lt;br&gt;&amp;gt; repository implementations
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; On Mon, 2007-02-26 at 12:26 +0100, Adrian wrote:
&lt;br&gt;&amp;gt;&amp;gt; So besides the peer/hierarchy argument there
&lt;br&gt;&amp;gt;&amp;gt; is also the problem that the repository is dealing
&lt;br&gt;&amp;gt;&amp;gt; with too many concerns.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; 1) ModuleDefinition construction
&lt;br&gt;&lt;br&gt;The draft API provides a Modules.newJamModuleDefinition() method to 
&lt;br&gt;construct a ModuleDefinition from JAM's metadata and ModuleContent. The 
&lt;br&gt;ModuleContent abstraction enables a module archive to be stored in the 
&lt;br&gt;repository in any form under the cover. This should make it easier for a 
&lt;br&gt;repository implementation to construct ModuleDefinitions from JAM files, 
&lt;br&gt;or from other archive formats (as long as the metadata information of a 
&lt;br&gt;module can be expressed as JAM's metadata, and the content of the module 
&lt;br&gt;can be exposed through the ModuleContent abstraction).
&lt;br&gt;&lt;br&gt;In your original use case in JavaEE, the appserver wants to use the 
&lt;br&gt;module system for &amp;quot;plain old module&amp;quot; wiring but also wants to define its 
&lt;br&gt;own &amp;quot;modules&amp;quot; for wars, ears, etc., and some of which looks nothing like 
&lt;br&gt;jars/jams in structure. Do you think the draft API and the ModuleContent 
&lt;br&gt;abstraction are sufficient to address the ModuleDefinition construction 
&lt;br&gt;issue you were concerned with?
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; 2) Model - parent/child or peer
&lt;br&gt;&lt;br&gt;I think you meant the module system inteorp model, not the repository 
&lt;br&gt;delegation model. Right?
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; 3) QoS - what tools are available for the repository
&lt;br&gt;&lt;br&gt;The Java Module System implementation will come with a standard tool to 
&lt;br&gt;manage module archives in the repository, e.g. install/uninstall, etc. 
&lt;br&gt;Is there any particular aspect of the tools support that you are 
&lt;br&gt;concerned with but currently not possible in the draft API?
&lt;br&gt;&lt;br&gt;&amp;gt;&amp;gt; 4) Location - file system/url based, etc.
&lt;br&gt;&lt;br&gt;This is handled by the ModuleContent abstraction described above.
&lt;br&gt;&lt;br&gt;&amp;gt; * Developing a full repository just to define a different archive
&lt;br&gt;&amp;gt; format is too much (e.g. legacy javaee deployments)
&lt;br&gt;&lt;br&gt;I would like to know what you think about the draft API to see if it is 
&lt;br&gt;still too much to develop a repository.
&lt;br&gt;&lt;br&gt;- Stanley
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Goals-was%3A-Re%3A-Supporting-OSGi-Bundles-in-the-Java-Module-System-tp17753303p17792802.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17786336</id>
	<title>ImportDependency</title>
	<published>2008-06-11T13:11:53Z</published>
	<updated>2008-06-11T13:11:53Z</updated>
	<author>
		<name>Bryan Atsatt</name>
	</author>
	<content type="html">The design of this class seems broken to me with the addition of two 
&lt;br&gt;&amp;quot;types&amp;quot;. Why not:
&lt;br&gt;&lt;br&gt;1. Make ImportDependency abstract, removing the getType() and newX methods.
&lt;br&gt;2. Make ImportPackage and ImportModule subclasses, each with their own 
&lt;br&gt;newX method.
&lt;br&gt;&lt;br&gt;(I also strongly suggest that we rename ImportDependency to simply 
&lt;br&gt;&amp;quot;Import&amp;quot; :^)
&lt;br&gt;&lt;br&gt;This model also obviously enables new subtypes, an extensibility point 
&lt;br&gt;that may come in handy in the future.
&lt;br&gt;&lt;br&gt;// Bryan
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/ImportDependency-tp17786336p17786336.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17784432</id>
	<title>Re: Exported Classes and OSGi Re: Supporting OSGi Bundles in the Java Module System</title>
	<published>2008-06-11T11:37:56Z</published>
	<updated>2008-06-11T11:37:56Z</updated>
	<author>
		<name>Stanley M. Ho</name>
	</author>
	<content type="html">Adrian Brock wrote:
&lt;br&gt;&amp;gt; So a 291 module that hasn't been updated to reflect changes from 294
&lt;br&gt;&amp;gt; would just expose package exports and the importing 277 module
&lt;br&gt;&amp;gt; would know how to deal with that?
&lt;br&gt;&lt;br&gt;A 291 module which exports packages is fundamentally exporting public 
&lt;br&gt;types, which will continue to work across module boundaries. If a JAM 
&lt;br&gt;module imports a 291 module, it'll know how to deal with this if 
&lt;br&gt;getExportedClasses() is not supported in the imported ModuleDefinition.
&lt;br&gt;&lt;br&gt;&amp;gt; The 291 module classes would be like legacy classes that
&lt;br&gt;&amp;gt; don't belong to a module in the 294 sense.
&lt;br&gt;&amp;gt; i.e. Class.getModuleInfo() would return null
&lt;br&gt;&lt;br&gt;Types which are not in a named module are in the unnamed module; the 
&lt;br&gt;changes in the Java Language Specification (JLS) will say this. null is 
&lt;br&gt;probably as good a value as any for representing this.
&lt;br&gt;&lt;br&gt;- Stanley
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Exported-Classes-and-OSGi-Re%3A-Supporting-OSGi-Bundles-in-the-Java-Module-System-tp17753821p17784432.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17776189</id>
	<title>Re: Exported Classes and OSGi Re: Supporting OSGi Bundles in the Java Module System</title>
	<published>2008-06-11T05:08:57Z</published>
	<updated>2008-06-11T05:08:57Z</updated>
	<author>
		<name>Adrian Brock-4</name>
	</author>
	<content type="html">On Tue, 2008-06-10 at 17:10 -0700, Stanley M. Ho wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt; ModuleDefinition still refers to exported and member classes.
&lt;br&gt;&amp;gt; &amp;gt; Although this is probably more of an issue for 294/291 interoperation,
&lt;br&gt;&amp;gt; &amp;gt; I don't think 291 has such notions?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; With modules in the language, only public types are accessible outside 
&lt;br&gt;&amp;gt; their development modules. A deployment module system could leverage 
&lt;br&gt;&amp;gt; this by considering public types (or a subset thereof) as 'exported', 
&lt;br&gt;&amp;gt; and the granularity of exports can therefore be types or packages. The 
&lt;br&gt;&amp;gt; JAM module system integrates tightly with development modules and it 
&lt;br&gt;&amp;gt; will expose type-level exports, but other module systems can continue to 
&lt;br&gt;&amp;gt; expose package-level exports. Thus, ModuleDefinition should support both 
&lt;br&gt;&amp;gt; granularity levels. If a module system does not support type-level 
&lt;br&gt;&amp;gt; exports (e.g. 291), the implementation of 
&lt;br&gt;&amp;gt; ModuleDefinition.getExportedClasses()/getMemberClasses() could simply 
&lt;br&gt;&amp;gt; throw UnsupportedOperationException.
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;So a 291 module that hasn't been updated to reflect changes from 294
&lt;br&gt;would just expose package exports and the importing 277 module
&lt;br&gt;would know how to deal with that?
&lt;br&gt;&lt;br&gt;The 291 module classes would be like legacy classes that
&lt;br&gt;don't belong to a module in the 294 sense.
&lt;br&gt;i.e. Class.getModuleInfo() would return null
&lt;br&gt;&lt;br&gt;&amp;gt; - Stanley
&lt;br&gt;-- 
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;Adrian Brock
&lt;br&gt;Chief Scientist
&lt;br&gt;JBoss, a division of Red Hat
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Exported-Classes-and-OSGi-Re%3A-Supporting-OSGi-Bundles-in-the-Java-Module-System-tp17753821p17776189.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17768285</id>
	<title>Refactorability proposal...</title>
	<published>2008-06-10T18:27:28Z</published>
	<updated>2008-06-10T18:27:28Z</updated>
	<author>
		<name>Bryan Atsatt</name>
	</author>
	<content type="html">(FYI: I've discussed this with Stanley but wanted to ensure it was 
&lt;br&gt;visible to everyone.)
&lt;br&gt;&lt;br&gt;Proposal
&lt;br&gt;&lt;br&gt;1. Eliminate runtime use of import-by-module in the JAM system:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; a. Support the (very convenient) import-by-module at the source level.
&lt;br&gt;&amp;nbsp; &amp;nbsp; b. jam tool transforms import-by-module to a list of 
&lt;br&gt;import-by-package statements.
&lt;br&gt;&lt;br&gt;2. Add APIs to fully support import-by-package in the JAM system:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;a. Support Version annotation in package-info.java (or in 
&lt;br&gt;module-info.java). If a
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;package does not declare a version, it &amp;quot;inherits&amp;quot; that of the 
&lt;br&gt;enclosing module.
&lt;br&gt;&amp;nbsp; &amp;nbsp;b. Add ImportPackage annotation with version constraints.
&lt;br&gt;&lt;br&gt;3. Add APIs to fully support import-by-package in the abstract framework:
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp; a. Add methods to Query to produce import-by-package nodes.
&lt;br&gt;&amp;nbsp; &amp;nbsp; b. Replace Query.getIndexableNames() with fully generic variants (I 
&lt;br&gt;proposed
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a solution here previously which I will re-post).
&lt;br&gt;&lt;br&gt;Rationale
&lt;br&gt;&lt;br&gt;Module refactoring is inevitable, particularly during the transition 
&lt;br&gt;from the current, effectively flat class space to a fine-grained space 
&lt;br&gt;provided by module systems. We have significant experience with this 
&lt;br&gt;issue at Oracle (with the transition to our own module system), and OSGi 
&lt;br&gt;best-practices for conversion include starting with everything in one 
&lt;br&gt;bundle and then separating out pieces as experience is gained.
&lt;br&gt;&lt;br&gt;A very common pattern, in our experience, is for developers to start 
&lt;br&gt;with many extra jars in their initial module (a mini version of 
&lt;br&gt;class-path hell). As that module is put into wider use, someone 
&lt;br&gt;discovers that package X is also contained in their module, and that 
&lt;br&gt;duplication either leads to runtime conflicts (very bad), or just plain 
&lt;br&gt;footprint bloat. The obvious answer is to put package X in a separate 
&lt;br&gt;module, and have everyone share it via imports.
&lt;br&gt;&lt;br&gt;But... not so fast. If there are consumers of that module who import it 
&lt;br&gt;by module name alone, then pulling X out of it will cause those 
&lt;br&gt;importers to break. And if it is possible for your module to have been 
&lt;br&gt;imported by *anyone* by name alone, then you are stuck: either you break 
&lt;br&gt;them or you live with the incorrect granularity (which just isn't an 
&lt;br&gt;option in the conflict scenarios). Not a happy choice.
&lt;br&gt;&lt;br&gt;Originally, I had proposed to do away with import-by-module altogether, 
&lt;br&gt;both to avoid this problem and to eliminate the conceptual disconnect. 
&lt;br&gt;Your code does not today contain import statements that name *jars*, it 
&lt;br&gt;names packages and/or specific classes in those packages. Why invent a 
&lt;br&gt;new system that takes such a large step backwards?
&lt;br&gt;&lt;br&gt;The answer is simply convenience. Imagine a module that contains 100 
&lt;br&gt;packages and it is obvious that writing a single import statement is far 
&lt;br&gt;easier than discovering and explicitly writing all the package imports. 
&lt;br&gt;Yes, IDEs will likely mostly eliminate this issue, but it still makes 
&lt;br&gt;sense to be able to do this by hand.
&lt;br&gt;&lt;br&gt;This proposal is an attempt to maintain the convenience while adding the 
&lt;br&gt;crucial ability to safely refactor: step 1b is the central idea.
&lt;br&gt;&lt;br&gt;// Bryan
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Refactorability-proposal...-tp17768285p17768285.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17767945</id>
	<title>Re: Goals was: Re: Supporting OSGi Bundles in the Java Module System</title>
	<published>2008-06-10T17:53:47Z</published>
	<updated>2008-06-10T17:53:47Z</updated>
	<author>
		<name>Stanley M. Ho</name>
	</author>
	<content type="html">Hi Adrian,
&lt;br&gt;&lt;br&gt;Adrian Brock wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Mon, 2008-04-28 at 20:16 -0700, Stanley M. Ho wrote:
&lt;br&gt;&amp;gt;&amp;gt; 2. Requirements
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;1. It shall be possible for an OSGi container to implement the
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Java Module System.
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;2. It shall be possible for a JAM module to express an import
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dependency on any Module Definition in any Java Module System.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; These goals appear to have changed from the ones we agreed?
&lt;br&gt;&amp;gt; I am misreading it or is this document only expressing one side of 
&lt;br&gt;&amp;gt; the equation?
&lt;/div&gt;&lt;br&gt;This document only addresses how to use OSGi bundles in the Java Module 
&lt;br&gt;System (i.e. the original goal #1).
&lt;br&gt;&lt;br&gt;The Java Module System already provides reflective API that allows the 
&lt;br&gt;OSGi framework to make use of JAM modules (i.e. the original goal #2) if 
&lt;br&gt;the framework implementation chooses to provide the support. That said, 
&lt;br&gt;defining the semantic and syntax of how an OSGi bundle should import a 
&lt;br&gt;JAM module in the OSGi framework is actually outside the scope of 277, 
&lt;br&gt;thus it is not covered in this document.
&lt;br&gt;&lt;br&gt;I'm going to be offline very soon. I will follow up the remaining issues 
&lt;br&gt;you raised tomorrow.
&lt;br&gt;&lt;br&gt;- Stanley
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Goals-was%3A-Re%3A-Supporting-OSGi-Bundles-in-the-Java-Module-System-tp17753303p17767945.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17767513</id>
	<title>Re: Exported Classes and OSGi Re: Supporting OSGi Bundles in the Java Module System</title>
	<published>2008-06-10T17:10:36Z</published>
	<updated>2008-06-10T17:10:36Z</updated>
	<author>
		<name>Stanley M. Ho</name>
	</author>
	<content type="html">Hi Adrian,
&lt;br&gt;&lt;br&gt;Adrian Brock wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Mon, 2008-04-28 at 20:16 -0700, Stanley M. Ho wrote:
&lt;br&gt;&amp;gt;&amp;gt; 3.2 ModuleDefinition class
&lt;br&gt;&amp;gt;&amp;gt; Two new methods are added in the ModuleDefinition class to return the
&lt;br&gt;&amp;gt;&amp;gt; exported packages and member packages respectively. The export and
&lt;br&gt;&amp;gt;&amp;gt; member definitions contained in the OSGi metadata are in package
&lt;br&gt;&amp;gt;&amp;gt; granularity. In addition, a new PackageDefinition class is added to
&lt;br&gt;&amp;gt;&amp;gt; allow an OSGi bundle to expose the metadata for an exported package.
&lt;br&gt;&amp;gt;&amp;gt; This is required to meet the requirements (1) and (2). 
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; ModuleDefinition class:
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; public abstract Set&amp;lt;PackageDefinition&amp;gt; getExportedPackageDefinitions();
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; public abstract Set&amp;lt;PackageDefinition&amp;gt; getMemberPackageDefinitions();
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; PackageDefinition class:
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; public abstract class PackageDefinition {
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public String getName();
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public Version getVersion();
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public Set&amp;lt;String&amp;gt; getAttributeNames();
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public String getAttribute(String name); 
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ModuleDefinition still refers to exported and member classes.
&lt;br&gt;&amp;gt; Although this is probably more of an issue for 294/291 interoperation,
&lt;br&gt;&amp;gt; I don't think 291 has such notions?
&lt;/div&gt;&lt;br&gt;With modules in the language, only public types are accessible outside 
&lt;br&gt;their development modules. A deployment module system could leverage 
&lt;br&gt;this by considering public types (or a subset thereof) as 'exported', 
&lt;br&gt;and the granularity of exports can therefore be types or packages. The 
&lt;br&gt;JAM module system integrates tightly with development modules and it 
&lt;br&gt;will expose type-level exports, but other module systems can continue to 
&lt;br&gt;expose package-level exports. Thus, ModuleDefinition should support both 
&lt;br&gt;granularity levels. If a module system does not support type-level 
&lt;br&gt;exports (e.g. 291), the implementation of 
&lt;br&gt;ModuleDefinition.getExportedClasses()/getMemberClasses() could simply 
&lt;br&gt;throw UnsupportedOperationException.
&lt;br&gt;&lt;br&gt;- Stanley
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Exported-Classes-and-OSGi-Re%3A-Supporting-OSGi-Bundles-in-the-Java-Module-System-tp17753821p17767513.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17767425</id>
	<title>Re: Supporting OSGi Bundles in the Java Module System</title>
	<published>2008-06-10T17:00:38Z</published>
	<updated>2008-06-10T17:00:38Z</updated>
	<author>
		<name>Stanley M. Ho</name>
	</author>
	<content type="html">Hi Michal,
&lt;br&gt;&lt;br&gt;Yes, we're working on an implementation. Alex and I are currently 
&lt;br&gt;working on the EDR2 spec. After the spec is ready for the EG to discuss 
&lt;br&gt;and review, we expect to make the implementation available to the EG.
&lt;br&gt;&lt;br&gt;- Stanley
&lt;br&gt;&lt;br&gt;&lt;br&gt;Michal Cierniak wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi Stanley,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thank you for providing this proposal. &amp;nbsp;I think that it looks quite
&lt;br&gt;&amp;gt; reasonable. &amp;nbsp;Once we have an implementation (are you working on one?),
&lt;br&gt;&amp;gt; we should have a look at details like: what exactly the behavior for
&lt;br&gt;&amp;gt; circular dependencies should be (I don't think there is a problem --
&lt;br&gt;&amp;gt; it's just one of those things where it's possible to overlook details
&lt;br&gt;&amp;gt; until you start to implement something). &amp;nbsp;But I think that the overall
&lt;br&gt;&amp;gt; proposal is a pretty good approach to this very important problem of
&lt;br&gt;&amp;gt; interop.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I'm curious what the OSGi experts think.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Michal
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-Supporting-OSGi-Bundles-in-the-Java-Module-System-tp17748785p17767425.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17754168</id>
	<title>Re: Supporting OSGi Bundles in the Java Module System</title>
	<published>2008-06-10T05:21:04Z</published>
	<updated>2008-06-10T05:21:04Z</updated>
	<author>
		<name>BJ Hargrave</name>
	</author>
	<content type="html">
&lt;br&gt;&lt;tt&gt;&lt;font size=2&gt;&amp;gt; I'm curious what the OSGi experts think.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Michal&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;/font&gt;&lt;/tt&gt;
&lt;br&gt;&lt;font size=2 face=&quot;sans-serif&quot;&gt;I am still waiting for EDR2 to become
available. There are too many references to new EDR2 content to properly
evaluate the somewhat thin OSGi interop proposal.&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;&lt;font size=2 face=&quot;sans-serif&quot;&gt;I have many issues with the interop
proposal, but I can't be sure understand the interop proposal until I have
EDR2 in hand.&lt;/font&gt;
&lt;br&gt;&lt;font size=3&gt;-- &lt;/font&gt;
&lt;p&gt;
&lt;table&gt;
&lt;tr valign=top&gt;
&lt;td&gt;&lt;font size=2 face=&quot;sans-serif&quot;&gt;&lt;b&gt;BJ Hargrave&lt;/b&gt;&lt;/font&gt;&lt;font size=1 face=&quot;sans-serif&quot;&gt;&lt;br&gt;
Senior Technical Staff Member, IBM&lt;br&gt;
OSGi Fellow and CTO of the &lt;/font&gt;&lt;a href=http://www.osgi.org target=&quot;_top&quot; rel=&quot;nofollow&quot; /&gt;&lt;font size=1 color=blue face=&quot;sans-serif&quot;&gt;&lt;u&gt;OSGi
Alliance&lt;/u&gt;&lt;/font&gt;&lt;/a&gt;&lt;font size=1 color=blue face=&quot;sans-serif&quot;&gt;&lt;u&gt;&lt;br&gt;
&lt;/u&gt;&lt;/font&gt;&lt;a href=mailto:hargrave@us.ibm.com target=nw rel=&quot;nofollow&quot;&gt;&lt;font size=1 color=blue face=&quot;sans-serif&quot;&gt;&lt;u&gt;hargrave@...&lt;/u&gt;&lt;/font&gt;&lt;/a&gt;
&lt;td&gt;
&lt;div align=right&gt;&lt;font size=1 face=&quot;sans-serif&quot;&gt;&lt;br&gt;
office: +1 386 848 1781&lt;br&gt;
mobile: +1 386 848 3788&lt;/font&gt;&lt;/div&gt;&lt;/table&gt;
&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-Supporting-OSGi-Bundles-in-the-Java-Module-System-tp17748785p17754168.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17753821</id>
	<title>Exported Classes and OSGi Re: Supporting OSGi Bundles in the Java Module System</title>
	<published>2008-06-10T04:57:13Z</published>
	<updated>2008-06-10T04:57:13Z</updated>
	<author>
		<name>Adrian Brock-4</name>
	</author>
	<content type="html">On Mon, 2008-04-28 at 20:16 -0700, Stanley M. Ho wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 3.2 ModuleDefinition class
&lt;br&gt;&amp;gt; Two new methods are added in the ModuleDefinition class to return the
&lt;br&gt;&amp;gt; exported packages and member packages respectively. The export and
&lt;br&gt;&amp;gt; member definitions contained in the OSGi metadata are in package
&lt;br&gt;&amp;gt; granularity. In addition, a new PackageDefinition class is added to
&lt;br&gt;&amp;gt; allow an OSGi bundle to expose the metadata for an exported package.
&lt;br&gt;&amp;gt; This is required to meet the requirements (1) and (2). 
&lt;br&gt;&amp;gt; &amp;nbsp; ModuleDefinition class:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; public abstract Set&amp;lt;PackageDefinition&amp;gt; getExportedPackageDefinitions();
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; public abstract Set&amp;lt;PackageDefinition&amp;gt; getMemberPackageDefinitions();
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt; &amp;nbsp; PackageDefinition class:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; public abstract class PackageDefinition {
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public String getName();
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public Version getVersion();
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public Set&amp;lt;String&amp;gt; getAttributeNames();
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public String getAttribute(String name); 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;/div&gt;&lt;br&gt;ModuleDefinition still refers to exported and member classes.
&lt;br&gt;Although this is probably more of an issue for 294/291 interoperation,
&lt;br&gt;I don't think 291 has such notions?
&lt;br&gt;-- 
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;Adrian Brock
&lt;br&gt;Chief Scientist
&lt;br&gt;JBoss, a division of Red Hat
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Exported-Classes-and-OSGi-Re%3A-Supporting-OSGi-Bundles-in-the-Java-Module-System-tp17753821p17753821.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17753741</id>
	<title>Re: Supporting OSGi Bundles in the Java Module System</title>
	<published>2008-06-10T04:52:25Z</published>
	<updated>2008-06-10T04:52:25Z</updated>
	<author>
		<name>Adrian Brock-4</name>
	</author>
	<content type="html">On Mon, 2008-04-28 at 20:16 -0700, Stanley M. Ho wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; 3.1.2 Constraint Checking
&lt;br&gt;&amp;gt; A new method ModuleSystem.getModules is added to allow a ModuleSystem
&lt;br&gt;&amp;gt; implementation to instantiate Module instances for multiple
&lt;br&gt;&amp;gt; ModuleDefinitions in the same resolution and also to enforce
&lt;br&gt;&amp;gt; constraints specified in these Modules. 
&lt;br&gt;&amp;gt; &amp;nbsp; ModuleSystem class:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; /**
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* Returns the list of Module instances for the imports 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* in the same resolution for the specified importer.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* The returned Module instances are instantiated and initialized
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* using the algorithm specific to this ModuleSystem.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* This method is called by a ModuleSystem when initializing
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* a Module instance (importer) that imports Modules (imports) 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* from this ModuleSystem.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*/
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; public List&amp;lt;Module&amp;gt; getModules(ModuleDefinition importer,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;List&amp;lt;ModuleDefinition&amp;gt; imports)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; throws ModuleInitializationException;
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt; OSGi allows to put constraints on the importer through the metadata
&lt;br&gt;&amp;gt; for an exported package in another bundle. The OSGi module system can
&lt;br&gt;&amp;gt; enforce the constraints on the importer in the implementation of this
&lt;br&gt;&amp;gt; getModules method. The importer can be a ModuleDefinition from other
&lt;br&gt;&amp;gt; ModuleSystem. 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; For example, the Apache Xerces XML parser bundle in Example 1 of
&lt;br&gt;&amp;gt; Section 1 exports the org.apache.xerces.parsers package whose export
&lt;br&gt;&amp;gt; definition has a &amp;quot;use&amp;quot; constraint. This export definition puts a
&lt;br&gt;&amp;gt; constraint on the importer of the org.apache.xerces.parsers package to
&lt;br&gt;&amp;gt; use the org.apache.commons.logging package wired to the
&lt;br&gt;&amp;gt; org.apache.xerces.parsers package in the same resolution. The 1.0
&lt;br&gt;&amp;gt; version of the Wombat application imports the
&lt;br&gt;&amp;gt; org.apache.xerces.parsers bundle and the org.apache.derby bundle. The
&lt;br&gt;&amp;gt; org.apache.xerces.parsers package will get wired to the version 1.0.4
&lt;br&gt;&amp;gt; logging package and the constraint is satisfied and thus it can be
&lt;br&gt;&amp;gt; wired successfully. 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Let's say a new version of the Wombat application (say version 1.2) is
&lt;br&gt;&amp;gt; updated and it depends on an additional Apache Commons Logging utility
&lt;br&gt;&amp;gt; which is also an OSGi bundle. 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; //
&lt;br&gt;&amp;gt; &amp;nbsp; // com/wombat/app/module-info.java
&lt;br&gt;&amp;gt; &amp;nbsp; //
&lt;br&gt;&amp;gt; &amp;nbsp; @Version(&amp;quot;1.2&amp;quot;) 
&lt;br&gt;&amp;gt; &amp;nbsp; @ImportModules({
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; @ImportModule(name=&amp;quot;org.apache.xerces.parsers&amp;quot;, version=&amp;quot;2.6.6+&amp;quot;)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; @ImportModule(name=&amp;quot;org.apache.derby&amp;quot;, version=&amp;quot;10.0+&amp;quot;)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; @ImportModule(name=&amp;quot;org.apache.commons.logging&amp;quot;, version=&amp;quot;2.0+&amp;quot;)
&lt;br&gt;&amp;gt; &amp;nbsp; })
&lt;br&gt;&amp;gt; &amp;nbsp; module com.wombat.app;
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt; The bundle manifest header for the Apache Commons Logging utility is: 
&lt;br&gt;&amp;gt; &amp;nbsp; org.apache.commons.logging:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;Bundle-SymbolicName: org.apache.commons.logging
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;Bundle-Version: 2.0
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;Export-Package: org.apache.commons.logging; version=2.0
&lt;br&gt;&amp;gt; &amp;nbsp; 
&lt;br&gt;&amp;gt; The 1.2 version of the Wombat application imports the
&lt;br&gt;&amp;gt; org.apache.commons.logging bundle that violates the constraint if the
&lt;br&gt;&amp;gt; org.apache.xerces.parsers package is wired to the version 1.0.4
&lt;br&gt;&amp;gt; logging package but the Wombat application requires the version 2.0
&lt;br&gt;&amp;gt; logging package. The version 1.2 of the Wombat application should fail
&lt;br&gt;&amp;gt; to initialize due to this constraint. In other words, the getModules()
&lt;br&gt;&amp;gt; method of the OSGi module system should throw a
&lt;br&gt;&amp;gt; ModuleInitializationException when the OSGi module system determines
&lt;br&gt;&amp;gt; that the constraint is violated. 
&lt;/div&gt;&lt;br&gt;I assume the list of &amp;quot;importers&amp;quot; is intended to take the place
&lt;br&gt;of Glynn's ResolutionContext?
&lt;br&gt;&lt;br&gt;On Mon, 2007-02-26 at 09:58 +0000, Glyn Normington wrote:
&lt;br&gt;&amp;gt; Yes, if we want to support first class interoperation. Without
&lt;br&gt;&amp;gt; something
&lt;br&gt;&amp;gt; like a resolution context, I don't see how we can maximise sharing of
&lt;br&gt;&amp;gt; dependencies between module systems. If we don't do that, we'll get
&lt;br&gt;&amp;gt; all
&lt;br&gt;&amp;gt; the usual symptoms of inconsistent class spaces, like class cast
&lt;br&gt;&amp;gt; exceptions, broken loading constraints, etc. 
&lt;br&gt;&lt;br&gt;Assuming that is its purpose, I think the api is incomplete?
&lt;br&gt;&lt;br&gt;&amp;gt;From Glynn's original examples what is needed is to not to just look at
&lt;br&gt;direct imports from the same module system.
&lt;br&gt;Instead, to maximise sharing and consistency it needs to know about 
&lt;br&gt;all other resolutions in a given top level resolution request.
&lt;br&gt;&lt;br&gt;I made a similar point on Glynn's original prototype:
&lt;br&gt;&lt;br&gt;On Mon, 2007-02-26 at 12:26 +0100, Adrian wrote: 
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Mon, 2007-02-26 at 09:58 +0000, Glyn Normington wrote:
&lt;br&gt;&amp;gt; &amp;gt; So the default behaviour in AbstractWireFactory.create calls
&lt;br&gt;&amp;gt; &amp;gt; createLocal first so that the local name space takes precedence over
&lt;br&gt;&amp;gt; &amp;gt; those of other module systems. The rationale is that the current
&lt;br&gt;&amp;gt; &amp;gt; module system is like a local scope and we don't want other module
&lt;br&gt;&amp;gt; &amp;gt; systems coming along and subverting the value associated with a given
&lt;br&gt;&amp;gt; &amp;gt; module name that is defined locally.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; But equally, we want two module systems using the same module
&lt;br&gt;&amp;gt; where possible.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; e.g. If we are configured to have both a 277/291 repository
&lt;br&gt;&amp;gt; and both define log4j:1.2.8 then the default mechanism
&lt;br&gt;&amp;gt; should choose one of them, NOT each module system
&lt;br&gt;&amp;gt; prefers its own.
&lt;/div&gt;&lt;br&gt;I made another point (but I can't find the original e-mail :-) 
&lt;br&gt;where I thought it probably wasn't enough to just pass
&lt;br&gt;the modules in the current resolution process (i.e.
&lt;br&gt;those just being resolved).
&lt;br&gt;&lt;br&gt;Instead, when resolving a module, there should be some
&lt;br&gt;&amp;quot;ClassLoading Space&amp;quot; where the resolution can determine
&lt;br&gt;all other modules that are already related due to
&lt;br&gt;imports/exports (including transient ones).
&lt;br&gt;-- 
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;Adrian Brock
&lt;br&gt;Chief Scientist
&lt;br&gt;JBoss, a division of Red Hat
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-Supporting-OSGi-Bundles-in-the-Java-Module-System-tp17748785p17753741.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17753303</id>
	<title>Goals was: Re: Supporting OSGi Bundles in the Java Module System</title>
	<published>2008-06-10T04:28:12Z</published>
	<updated>2008-06-10T04:28:12Z</updated>
	<author>
		<name>Adrian Brock-4</name>
	</author>
	<content type="html">On Mon, 2008-04-28 at 20:16 -0700, Stanley M. Ho wrote:
&lt;br&gt;&amp;gt; 2. Requirements
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;1. It shall be possible for an OSGi container to implement the
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Java Module System.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;2. It shall be possible for a JAM module to express an import
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dependency on any Module Definition in any Java Module System.
&lt;br&gt;&lt;br&gt;These goals appear to have changed from the ones we agreed?
&lt;br&gt;I am misreading it or is this document only expressing one side of 
&lt;br&gt;the equation?
&lt;br&gt;&lt;br&gt;On Fri, 2007-02-16 at 13:08 -0800, Stanley M. Ho wrote: 
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Goals:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 1. It shall be possible for JSR-277 modules to make use of modules from
&lt;br&gt;&amp;gt; other module systems (e.g. JSR-291) (i.e. if other module systems expose
&lt;br&gt;&amp;gt; their modules as JSR-277 modules through a repository implementation.)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 2. It shall be possible for other module systems (e.g. JSR-291) to be
&lt;br&gt;&amp;gt; implemented on top of the JSR-277 APIs such that the modules from other
&lt;br&gt;&amp;gt; module system can make use of JSR-277 modules.
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;I originally read (2) as a rewording of Glynn's original
&lt;br&gt;definition where the goal is to create a more peer orientated
&lt;br&gt;delegation.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Fri, 2007-01-12 at 09:49 +0000, Glyn Normington wrote:
&lt;br&gt;&amp;gt; &amp;gt; Michal Cierniak &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=17753303&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cierniak@...&lt;/a&gt;&amp;gt; wrote on 09/01/2007 20:20:12:
&lt;br&gt;&amp;gt; &amp;gt; Co[u]ld you write a one-paragraph outline of what &amp;quot;first class
&lt;br&gt;&amp;gt; &amp;gt; interoperation with JSR 291&amp;quot; would mean?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; First class interoperation with JSR 291 means that JSR 291
&lt;br&gt;&amp;gt; implementations
&lt;br&gt;&amp;gt; should be implementable on top of Java 7 APIs such that JSR 291
&lt;br&gt;&amp;gt; bundles can
&lt;br&gt;&amp;gt; make effective use of JSR 277 modules and vice versa.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; (I guess JSR 291 modules residing in JSR 277 repositories would be
&lt;br&gt;&amp;gt; helpful
&lt;br&gt;&amp;gt; too, especially if anyone needs to create a hybrid application
&lt;br&gt;&amp;gt; containing
&lt;br&gt;&amp;gt; modules of both sorts.)
&lt;/div&gt;&lt;br&gt;My critisms of using the JSR277 repositories to do the integration
&lt;br&gt;included:
&lt;br&gt;&lt;br&gt;* There are already lots of orthogonal reasons for swapping
&lt;br&gt;repository implementations
&lt;br&gt;&lt;br&gt;On Mon, 2007-02-26 at 12:26 +0100, Adrian wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; So besides the peer/hierarchy argument there
&lt;br&gt;&amp;gt; is also the problem that the repository is dealing
&lt;br&gt;&amp;gt; with too many concerns.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 1) ModuleDefinition construction
&lt;br&gt;&amp;gt; 2) Model - parent/child or peer
&lt;br&gt;&amp;gt; 3) QoS - what tools are available for the repository
&lt;br&gt;&amp;gt; 4) Location - file system/url based, etc.
&lt;br&gt;&amp;gt; 5) Delegation - links to standard repositories
&lt;br&gt;&amp;gt; etc. 
&lt;/div&gt;&lt;br&gt;* Developing a full repository just to define a different archive
&lt;br&gt;format is too much (e.g. legacy javaee deployments)
&lt;br&gt;&lt;br&gt;On Wed, 2007-02-28 at 17:12 +0100, Adrian wrote:
&lt;br&gt;On Mon, 2007-02-26 at 18:05 -0800, Stanley M. Ho wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt; If I understand you correctly, your primary concern is around
&lt;br&gt;&amp;gt; requiring
&lt;br&gt;&amp;gt; &amp;gt; other module systems which support 277 modules that are stored
&lt;br&gt;&amp;gt; &amp;gt; differently (e.g. war, ear, etc.) to implement the classloading and
&lt;br&gt;&amp;gt; &amp;gt; other functionalities from scratch. Is this accurate?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Not just that, anybody that wants to integrate their own
&lt;br&gt;&amp;gt; packaging format and construct module definition (wrappers)
&lt;br&gt;&amp;gt; should be able to plugin without dictating
&lt;br&gt;&amp;gt; or developing a full repository.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The examples so far discussed are:
&lt;br&gt;&amp;gt; OSGi modules
&lt;br&gt;&amp;gt; JavaEE deployment packages 
&lt;/div&gt;&lt;br&gt;* The concern about hierarchical integration
&lt;br&gt;&lt;br&gt;On Wed, 2007-02-28 at 17:18 +0100, Adrian wrote: 
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Mon, 2007-02-26 at 18:05 -0800, Stanley M. Ho wrote:
&lt;br&gt;&amp;gt; &amp;gt; Hi Adrian,
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; The hierarchical assumption of repositories makes it difficult
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; to plugin peer modules, unless we are going to define
&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; a composite repository for this purpose.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Can you give me an example of peer modules that you are concerned with?
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; It is really peer module systems.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; e.g. My repository is made up of modules from
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 1) a local JSR77 repository
&lt;br&gt;&amp;gt; 2) an OSGi repository handled by my OSGi &amp;quot;module system&amp;quot;
&lt;br&gt;&amp;gt; 3) Some JavaEE deployments handled by the appserver's &amp;quot;module system&amp;quot;
&lt;br&gt;&amp;gt; 4) a link to a repository on the internet
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I want my JavaEE modules to be able to use OSGi modules
&lt;br&gt;&amp;gt; and vice versa OSGi modules should be able to use my JavaEE modules
&lt;br&gt;&amp;gt; (e.g. an appclient or a resource adapter)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This requires a peer integration at the classloader and security
&lt;br&gt;&amp;gt; level.
&lt;/div&gt;-- 
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;Adrian Brock
&lt;br&gt;Chief Scientist
&lt;br&gt;JBoss, a division of Red Hat
&lt;br&gt;xxxxxxxxxxxxxxxxxxxxxxxxxxxx
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Goals-was%3A-Re%3A-Supporting-OSGi-Bundles-in-the-Java-Module-System-tp17753303p17753303.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-17748785</id>
	<title>Re: Supporting OSGi Bundles in the Java Module System</title>
	<published>2008-06-09T23:39:11Z</published>
	<updated>2008-06-09T23:39:11Z</updated>
	<author>
		<name>Michal Cierniak</name>
	</author>
	<content type="html">Hi Stanley,
&lt;br&gt;&lt;br&gt;Thank you for providing this proposal. &amp;nbsp;I think that it looks quite
&lt;br&gt;reasonable. &amp;nbsp;Once we have an implementation (are you working on one?),
&lt;br&gt;we should have a look at details like: what exactly the behavior for
&lt;br&gt;circular dependencies should be (I don't think there is a problem --
&lt;br&gt;it's just one of those things where it's possible to overlook details
&lt;br&gt;until you start to implement something). &amp;nbsp;But I think that the overall
&lt;br&gt;proposal is a pretty good approach to this very important problem of
&lt;br&gt;interop.
&lt;br&gt;&lt;br&gt;I'm curious what the OSGi experts think.
&lt;br&gt;&lt;br&gt;Michal
&lt;br&gt;&lt;br&gt;On Mon, Apr 28, 2008 at 8:16 PM, Stanley M. Ho &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=17748785&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Stanley.Ho@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; Dear 277 experts,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The first attachment is a draft spec for supporting OSGi bundles in the Java
&lt;br&gt;&amp;gt; Module System. This is based on the past EG discussion in particular the
&lt;br&gt;&amp;gt; proposals and inputs from Glyn, Richard, and Bryan. This is a work in
&lt;br&gt;&amp;gt; progress and is expected to evolve based on further inputs from this EG.
&lt;br&gt;&amp;gt;
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A-Supporting-OSGi-Bundles-in-the-Java-Module-System-tp17748785p17748785.html" />
</entry>

</feed>
