You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

antlib_classloaders.html 7.7 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html lang="en">
  3. <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
  4. <head>
  5. <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  6. <title>Apache Ant - Antlib Class Loaders</title>
  7. <link type="text/css" href="../../page.css" rel="stylesheet">
  8. <meta name="author" content="Antoine Levy-Lambert">
  9. <meta name="email" content="antoine@apache.org">
  10. </head>
  11. <body>
  12. <p class="navpath">
  13. <script src="../../breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
  14. </p>
  15. <div class="logobar">
  16. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  17. <tr>
  18. <td align="left"><img border="0" alt="Apache Ant site" src="../../images/group-logo.gif"></td>
  19. <td align="center" width="100%"><img alt="Apache Ant logo" border="0" src="../../images/project-logo.gif"></td>
  20. <td align="right">
  21. <form target="_blank" onsubmit="q.value = query.value + ' site:ant.apache.org'" action="http://www.google.com/search" method="get">
  22. <table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="#4C6C8F">
  23. <tr>
  24. <td colspan="3"><img height="10" width="1" alt="" src="../../images/spacer.gif"></td>
  25. </tr>
  26. <tr>
  27. <td><img height="1" width="1" alt="" src="../../images/spacer.gif"></td>
  28. <td nowrap="nowrap" class="searchcaption">
  29. <input name="q" type="hidden">
  30. <input size="15" id="query" type="text">
  31. <img height="1" width="5" alt="" src="../../images/spacer.gif">
  32. <input name="Search" value="Search" type="submit">
  33. <br>
  34. the Apache Ant site
  35. </td>
  36. <td><img height="1" width="1" alt="" src="../../images/spacer.gif"></td>
  37. </tr>
  38. <tr>
  39. <td><img alt="" border="0" height="10" width="9" src="../../images/search-left.gif"></td>
  40. <td><img height="1" width="1" alt="" src="../../images/spacer.gif"></td>
  41. <td><img alt="" border="0" height="10" width="9" src="../../images/search-right.gif"></td>
  42. </tr>
  43. </table>
  44. </form>
  45. </td>
  46. </tr>
  47. </table>
  48. </div>
  49. <div class="tab">
  50. <table summary="tab bar" border="0" cellpadding="0" cellspacing="0">
  51. <tr>
  52. <td width="5"><img alt="" height="8" width="8" src="../../images/spacer.gif"></td><td valign="bottom">
  53. <table summary="non selected tab" style="height: 1.4em" border="0" cellpadding="0" cellspacing="0">
  54. <tr>
  55. <td valign="top" width="5" bgcolor="#B2C4E0"><img height="5" width="5" alt="" src="../../images/tab-left.gif"></td><td valign="middle" bgcolor="#B2C4E0"><a href="../../index.html"><font size="2" face="Arial, Helvetica, Sans-serif">Home</font></a></td><td valign="top" width="5" bgcolor="#B2C4E0"><img height="5" width="5" alt="" src="../../images/tab-right.gif"></td>
  56. </tr>
  57. </table>
  58. </td>
  59. <td width="5"><img alt="" height="8" width="8" src="../../images/spacer.gif"></td><td valign="bottom">
  60. <table summary="non selected tab" style="height: 1.4em" border="0" cellpadding="0" cellspacing="0">
  61. <tr>
  62. <td valign="top" width="5" bgcolor="#B2C4E0"><img height="5" width="5" alt="" src="../../images/tab-left.gif"></td><td valign="middle" bgcolor="#B2C4E0"><a href="../../projects/index.html"><font size="2" face="Arial, Helvetica, Sans-serif">Projects</font></a></td><td valign="top" width="5" bgcolor="#B2C4E0"><img height="5" width="5" alt="" src="../../images/tab-right.gif"></td>
  63. </tr>
  64. </table>
  65. </td>
  66. </tr>
  67. </table>
  68. </div>
  69. <div class="bluebar"></div>
  70. <div class="menucontainer">
  71. <div class="menu">
  72. <ul>
  73. </ul>
  74. </div>
  75. <img style="float: left" height="10" width="10" border="0" alt="" src="../../images/menu-left.gif">
  76. <img style="float: right" height="10" width="10" border="0" alt="" src="../../images/menu-right.gif">
  77. </div>
  78. <div class="lightbluebar">&nbsp;</div>
  79. <div class="main">
  80. <div class="content">
  81. <h1 class="title">Antlib Class Loaders</h1>
  82. <h3 class="section">
  83. <a name="Jose Alberto Fernandez"></a>
  84. Jose Alberto Fernandez
  85. </h3>
  86. <p>
  87. Let me first say that this feature appeared by the need to be able to say,
  88. </p>
  89. <pre class="code">
  90. &lt;antlib name=&quot;A&quot; classpathref=&quot;XYZ&quot;/&gt;
  91. &lt;antlib name=&quot;B&quot; classpathref=&quot;XYZ&quot;/&gt;
  92. </pre>
  93. <p>
  94. And being able to make sure that B and A use the same classLoader
  95. and therefore they can use each other components.
  96. </p>
  97. <p>
  98. My solution at the time was this idea of a named classloader that
  99. you could define using a classpath, and then tell your antlibs use
  100. this or that classloader, if you use the same classloader visibility
  101. is guaranteed.
  102. </p>
  103. <h3 class="section">
  104. <a name="Stefan Bodewig 23.04.2003 17:11"></a>
  105. Stefan Bodewig 23.04.2003 17:11
  106. </h3>
  107. <p>
  108. I understand that usecase (using the same class loader for 2 different antlibs)
  109. and think it's important. See Steve
  110. Loughran's comment on the .NET tasks wanting to have access to the
  111. datatypes defined in the cpptasks project for example.
  112. </p>
  113. <p>
  114. Take a look at what Costin had done to &lt;taskdef&gt; and &lt;typedef&gt; with
  115. the loaderref attribute. This has now (i.e. CVS HEAD) been
  116. generalized in ClasspathUtils, the infrastructure for named
  117. classloaders is there - at least the foundation for it.
  118. </p>
  119. <p>
  120. Stefan
  121. </p>
  122. <h3 class="section">
  123. <a name="Costin Manolache 29.04.2003 18:52"></a>
  124. Costin Manolache 29.04.2003 18:52
  125. </h3>
  126. <p>
  127. The main issue is how to enforce ordering to deal with dependencies
  128. between the antlibs.
  129. </p>
  130. <p>
  131. Or simply do not deal with dependencies, ie antlibs must not (yet)
  132. depend on on the other, except for the core ones.
  133. </p>
  134. <p>
  135. Using an unified class loader ( at least as default ) - like jboss is doing,
  136. or like JMX loading policy - has a lot of benefits. It also has some cases
  137. that are not well covered - so we'll probably need to deal with both
  138. "unified loader" and "loader hierarchy" cases.
  139. </p>
  140. </div>
  141. </div>
  142. <p class="copyright">
  143. Copyright &copy; 2000-2003&nbsp;The Apache Software Foundation. All rights reserved.
  144. <script type="text/javascript" language="JavaScript"><!--
  145. document.write(" - "+"Last Published: " + document.lastModified);
  146. // -->
  147. </script>
  148. </p>
  149. </body>
  150. </html>