...
#Contribution Class Loading
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 \entry in [2\] Wiki Markup
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 its contribution via the URLClassLoader behaviour.unmigrated-wiki-markup
The itest project _import-export-tests_ has a class TestTestCase with method testOneNode which demonstrates a more complex scenario where a cross contribution 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 ... 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 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. and using the set of remaining contributions to resolve the import, potentially more than once.
[1] \[[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\] [|http://svn.apache.org/reposviewvc/asf/tuscany/sca-java-2.x/trunk/modules/contributiondeployment/src/main/resourcesjava/META-INForg/servicesapache/org.apache.tuscany/sca/deployment/impl/DeployerImpl.java?view=markup&pathrev=948564] Wiki Markup
[2] .sca.contribution.resolver.ModelResolver|http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/modules/contribution/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.resolver.ModelResolver]