Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Contribution Class Loading

The ClassLoaderModelResolver (CLMR) specializes java.net.URL.URLClassLoader and implements o.a.t.s....ModelResolver. Each contribution is associated with a single CLMR . On construction the CLMR is endowed with a set of URLs that allow it to find all classes in it's contribution via the URLClassLoader behaviour.

Wiki Markup
*T{*}he itest project import-export-tests has a class TestTestCase with method testOneNode which demonstrates a more complex scenario where a cross contribution import/export of a java package exists between the contributions.  In this example a node is created using 2 composite URIs for contributions ... "../exports/target/classes", "../imports/target/classes". An imported class is resolved using the CLMR of the exporting contribution.  The exporter's CLMR is made available to the importing CLMR by deployment \[1\] code which traverses all contributions, identifying cross contribution dependencies (see buildDependencies at \[1\])  and using the set of remaining contributions to resolve the import, potentially more than once.
When a contribution is read, containing an implementation.java element, a ClassReference is instantiated, which contains the name of the class. ClassReference instances are resolved by a ClassLoaderModelResolver, by virtue of the entry in \[2\]

The ClassLoaderModelResolver (CLMR) specializes java.net.URL.URLClassLoader and implements o.a.t.s....ModelResolver. Each contribution is associated with a single CLMR . On construction the CLMR is endowed with a set of URLs that allow it to find all classes in it's contribution via the URLClassLoader behaviour.

Wiki Markup
*T{*}he itest project import-export-tests has a class TestTestCase with method testOneNode which demonstrates a more complex scenario where a cross contribution import/export of a java package exists between the contributions.  In this example a node is created using 2 composite URIs for contributions ... "../exports/target/classes", "../imports/target/classes". An imported class is resolved using the CLMR of the exporting contribution.  The exporter's CLMR is made available to the importing CLMR by deployment \[1\] code which traverses all contributions, identifying cross contribution dependencies (see buildDependencies at \[1\])  and using the set of remaining contributions to resolve the import, potentially more than once.

Wiki Markup
\[[1]\] [http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java?view=markup&pathrev=948564]\|http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java?view=markup&pathrev=948564\]

Wiki Markup
\[2\] [
[1 
http://svn.apache.org/
viewvc
repos/asf/tuscany/sca-java-2.x/trunk/modules/
deployment
contribution/src
/main/java
/main/resources/META-INF/services/org
/
.apache
/
.tuscany
/sca/deployment/impl/DeployerImpl.java?view=markup&pathrev=948564Image Removed
.sca.contribution.resolver.ModelResolver|http://svn.apache.org/repos/
viewvc
asf/tuscany/sca-java-2.x/trunk/modules/
deployment
contribution/src/main/
java
resources/META-INF/services/org
/
.apache
/
.tuscany
/sca/deployment/impl/DeployerImpl.java?view=markup&pathrev=948564
.sca.contribution.resolver.ModelResolver]

                                

...