Skip to Content.
Sympa Menu

notify-dpml - svn commit: r1499 - in development/main/central/site/src/docs/products/transit: overview technical/repository

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: mcconnell AT netcompartner.com
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r1499 - in development/main/central/site/src/docs/products/transit: overview technical/repository
  • Date: Sun, 16 Jan 2005 18:15:50 +0100

Author: mcconnell
Date: Sun Jan 16 18:15:48 2005
New Revision: 1499

Modified:
development/main/central/site/src/docs/products/transit/overview/index.xml

development/main/central/site/src/docs/products/transit/technical/repository/instantiation.xml
Log:
add the final page on the plugin instantiation strategy

Modified:
development/main/central/site/src/docs/products/transit/overview/index.xml
==============================================================================
---
development/main/central/site/src/docs/products/transit/overview/index.xml
(original)
+++
development/main/central/site/src/docs/products/transit/overview/index.xml
Sun Jan 16 18:15:48 2005
@@ -34,12 +34,11 @@

<p>
One of the more difficult tasks when building Java applications
- is managing <a href="">classloaders</a>. Often, when combining
+ is managing classloaders. Often, when combining
various projects together into an enterprise application, the
application is not able to load the right classes at the right time,
causing the application to fail in mysterious and sometimes subtle
- ways.
- Although a fundamental issue, classloading has remained
+ ways. Although a fundamental issue, classloading has remained
a rather obscure topic. Not surprisingly, many Java projects fail
to manage classloaders effectively.


Modified:
development/main/central/site/src/docs/products/transit/technical/repository/instantiation.xml
==============================================================================
---
development/main/central/site/src/docs/products/transit/technical/repository/instantiation.xml
(original)
+++
development/main/central/site/src/docs/products/transit/technical/repository/instantiation.xml
Sun Jan 16 18:15:48 2005
@@ -10,12 +10,62 @@
<section name="Plugin Instantiation">

<p>
+ The <a
href="../../../../../@TRANSIT-DOCS-PATH@/net/dpml/transit/repository/Repository.html">
+ Repository</a> service provides a generic plugin instantiation
service. The service is typically
+ used by applications that know more about the type of plugins that
are loaded than Transit does.
+ As such, the plugin instantiation service should be viewed as a
convinience function.
+ </p>
+
+ <p>
+ The plugin instantiation function takes the usual parent classloader
and uri arguments and
+ adds an object array argument. The object array is an optional set
of arguments values that
+ will be used by the repository service when attempting to resolve
plugin constructor parameter
+ arguments.
</p>

<p><i>Example plugin instantiation:</i></p>
<pre>
+Repository repository = new <a
href="../../../../../@TRANSIT-DOCS-PATH@/net/dpml/transit/repository/StandardLoader.html">StandardLoader()</a>;
+ClassLoader parent = getClass().getClassLoader();
+URI uri = new URI( "@METRO-PLUGIN-URI@" );
+String[] args = new String[]{ "-debug", "-audit" ); // simulate cli args
+Object[] params = new Object[]{ args };
+Object plugin = repository.getPlugin( parent, uri, params );
+....
</pre>

+ <subsection name="Constructor Selection and Instantiation">
+
+ <p>
+ The default implementation takes the fist public constructor
declared by the plugin.
+ For predictive behaviour it is recommended to use a single public
constructor as constructor
+ ordering is not assured by the JVM. The parameters declared by the
constructor will be
+ evaluated against the supplied object array values and if type
compatible, the supplied value
+ will be assigned as the parameter argument. If the constructor has
any unresolved parameters,
+ the implementation will attempt to fullfill these using repository
suppled values.
+ </p>
+
+ <p>
+ The following argument types will be supplied by the repository
implementation if the value
+ is declared as a constructor parameter and the parameter is
unresolved following assessment
+ of the supplied arguments.
+ </p>
+
+ <table>
+ <tr><th>Type</th><th>Description</th></tr>
+ <tr><td><a
href="../../../../../@TRANSIT-DOCS-PATH@/net/dpml/transit/repository/Plugin.html">Plugin</a></td><td>The
plugin descriptor.</td></tr>
+ <tr><td>ClassLoader</td><td>The implementation
classloader.</td></tr>
+ <tr><td><a
href="../../../../../@TRANSIT-DOCS-PATH@/net/dpml/transit/repository/Repository.html">Repository</a></td><td>The
repository used to establish the plugin.</td></tr>
+ <tr><td>[]</td><td>An array of any kind that is unresolved will
be assigned an empty array value.</td></tr>
+ </table>
+
+ <p>
+ On completion of construction parameter population and instance of
the class is creating
+ using the selected constructor. No lifecycle processing is applied
to the resulting instance.
+ </p>
+
+ </subsection>
+
</section>
</body>
</document>



  • svn commit: r1499 - in development/main/central/site/src/docs/products/transit: overview technical/repository, mcconnell, 01/16/2005

Archive powered by MHonArc 2.6.24.

Top of Page