<html><head> | |
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | |
<title>8.7 Scoping and Substitutable Exports</title><link rel="stylesheet" href="css/stylesheet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="Virgo Programmer Guide"><link rel="up" href="ch08.html" title="8. Known Issues"><link rel="prev" href="ch08s06.html" title="8.6 Hibernate Resolution Issue"><link rel="next" href="ch08s08.html" title="8.8 EclipseLink Resolution Issue"><!--Begin Google Analytics code--><script type="text/javascript"> | |
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); | |
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); | |
</script><script type="text/javascript"> | |
var pageTracker = _gat._getTracker("UA-2728886-3"); | |
pageTracker._setDomainName("none"); | |
pageTracker._setAllowLinker(true); | |
pageTracker._trackPageview(); | |
</script><!--End Google Analytics code--></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">8.7 Scoping and Substitutable Exports</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch08s06.html">Prev</a> </td><th width="60%" align="center">8. Known Issues</th><td width="20%" align="right"> <a accesskey="n" href="ch08s08.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="scoping-and-substitutable-exports"></a>8.7 Scoping and Substitutable Exports</h2></div></div></div><p> | |
The restriction described in <a class="link" href="ch04s03.html#developing-applications-plans-scoping" title="Plans and Scoping">Plans and Scoping</a> that | |
no package may be exported by more than one bundle in a given scope can cause problems for bundles with | |
<span class="emphasis"><em>substitutable exports</em></span>. A substitutable export is a package which is exported and imported | |
by the same bundle. The OSGi framework will discard either the import or the export of the package when the | |
bundle is resolved. | |
</p><p> | |
However, if more than one bundle in a scope has a substitutable export of the same package, then Virgo will fail | |
to deploy the scoped application because the above restriction appears to be broken. Virgo could only spot that | |
the restriction was not actually being broken by second guessing the resolution behaviour of the OSGi framework, | |
something that Virgo generally avoids because of the fragility of that approach. | |
</p><p> | |
It may be possible to work around this issue by omitting one of the bundles containing the substitutable export | |
from the scoped application. | |
</p><p> | |
It may also be possible to work around this issue by moving the bundles containing the substitutable exports outside the scope, | |
although this will not give correct behaviour if the bundles' exported packages need to be available for thread | |
context class loading. | |
</p><p> | |
See <a class="ulink" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=330643" target="_top">bug 330643</a> for an example of this issue. | |
</p></div><!--Begin LoopFuse code--><script src="http://loopfuse.net/webrecorder/js/listen.js" type="text/javascript"></script><script type="text/javascript"> | |
_lf_cid = "LF_48be82fa"; | |
_lf_remora(); | |
</script><!--End LoopFuse code--><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch08s06.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch08.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch08s08.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">8.6 Hibernate Resolution Issue </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 8.8 EclipseLink Resolution Issue</td></tr></table></div></body></html> |