commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject cvs commit: jakarta-commons-sandbox/hivemind/src/test/hivemind/test/parse TestToString.java
Date Mon, 15 Sep 2003 14:41:11 GMT
hlship      2003/09/15 07:41:11

  Modified:    hivemind/src/java/org/apache/commons/hivemind/impl
                        InterceptorStackImpl.java
               hivemind/xdocs index.xml multithreading.xml localization.xml
                        descriptor.xml extension-points.xml registry.xml
                        ioc.xml override.xml case1.xml bootstrap.xml
                        services.xml rules.xml interceptors.xml
               hivemind/src/java/org/apache/commons/hivemind
                        ExtensionPoint.java ClassResolver.java
                        HiveMind.java ServiceExtensionPoint.java
               hivemind/common links.xml
               hivemind/src/test/hivemind/test/parse TestToString.java
  Log:
  Add HiveMind.constructDefaultRegistry().
  Cleanup some javadoc and slim down some interfaces.
  Adjust xdocs for Maven 1.0-rc-1.
  
  Revision  Changes    Path
  1.11      +6 -7      jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/impl/InterceptorStackImpl.java
  
  Index: InterceptorStackImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/impl/InterceptorStackImpl.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- InterceptorStackImpl.java	12 Sep 2003 19:27:50 -0000	1.10
  +++ InterceptorStackImpl.java	15 Sep 2003 14:41:10 -0000	1.11
  @@ -61,7 +61,6 @@
   import org.apache.commons.hivemind.HiveMind;
   import org.apache.commons.hivemind.InterceptorStack;
   import org.apache.commons.hivemind.Module;
  -import org.apache.commons.hivemind.Registry;
   import org.apache.commons.hivemind.ServiceExtensionPoint;
   import org.apache.commons.hivemind.ServiceInterceptorContribution;
   import org.apache.commons.lang.builder.ToStringBuilder;
  @@ -83,14 +82,12 @@
       private ServiceExtensionPoint _sep;
       private Class _interfaceClass;
       private Object _top;
  -    private Registry _registry;
   
       public InterceptorStackImpl(ServiceExtensionPoint sep, Object root)
       {
           _sep = sep;
           _top = root;
           _interfaceClass = sep.getServiceInterface();
  -        _registry = sep.getModule().getRegistry();
       }
   
       public String toString()
  @@ -157,10 +154,12 @@
   
       public void process(ServiceInterceptorContribution contribution)
       {
  -        String factoryId = contribution.getFactoryServiceId();
  -
           if (LOG.isDebugEnabled())
  -            LOG.debug("Applying interceptor factory " + factoryId + " to " + _top);
  +            LOG.debug(
  +                "Applying interceptor factory "
  +                    + contribution.getFactoryServiceId()
  +                    + " to "
  +                    + _top);
   
           // And now we can finally do this!
   
  
  
  
  1.11      +2 -2      jakarta-commons-sandbox/hivemind/xdocs/index.xml
  
  Index: index.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/index.xml,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- index.xml	12 Sep 2003 19:27:49 -0000	1.10
  +++ index.xml	15 Sep 2003 14:41:10 -0000	1.11
  @@ -1,7 +1,7 @@
   <?xml version="1.0"?>
   <!-- $Id$ -->
   <!DOCTYPE document [
  -	<!ENTITY % common-links SYSTEM "../common/links.xml">
  +	<!ENTITY % common-links SYSTEM "common/links.xml">
   	%common-links;
   	]>
   <document>
  
  
  
  1.5       +4 -4      jakarta-commons-sandbox/hivemind/xdocs/multithreading.xml
  
  Index: multithreading.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/multithreading.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- multithreading.xml	8 Sep 2003 20:14:18 -0000	1.4
  +++ multithreading.xml	15 Sep 2003 14:41:10 -0000	1.5
  @@ -1,7 +1,7 @@
   <?xml version="1.0"?>
   <!-- $Id$ -->
   <!DOCTYPE document [
  -	<!ENTITY % common-links SYSTEM "../common/links.xml">
  +	<!ENTITY % common-links SYSTEM "common/links.xml">
   	%common-links;
   	]>
   <document>
  @@ -35,7 +35,7 @@
   is the early state, the construction state, where the module deployment descriptors
   are located and parsed, and the contents used to assemble the registry; this is the
   domain of
  -<a href="apidocs/org/apache/commons/hivemind/impl/RegistryBuilder.html">RegistryBuilder</a>
.
  +<a href="&apiroot;/impl/RegistryBuilder.html">RegistryBuilder</a>	.
   </p>
   
   <p>
  @@ -46,7 +46,7 @@
   <p>
   The construction state ends when the <code>RegistryBuilder</code>	returns
   the
  -<a href="apidocs/org/apache/commons/hivemind/Registry.html">Registry</a>
  +<a href="&apiroot;/Registry.html">Registry</a>
   from method <code>constructRegistry()</code>.  The registry is thread-safe.
   </p>
   	
  
  
  
  1.7       +5 -5      jakarta-commons-sandbox/hivemind/xdocs/localization.xml
  
  Index: localization.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/localization.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- localization.xml	12 Aug 2003 20:46:30 -0000	1.6
  +++ localization.xml	15 Sep 2003 14:41:10 -0000	1.7
  @@ -1,7 +1,7 @@
   <?xml version="1.0"?>
   <!-- $Id$ -->
   <!DOCTYPE document [
  -	<!ENTITY % common-links SYSTEM "../common/links.xml">
  +	<!ENTITY % common-links SYSTEM "common/links.xml">
   	%common-links;
   	]>
   <document>
  @@ -29,7 +29,7 @@
   <p>
   Services can gain access to localized messages, as an instance
   of
  -<a href="apidocs/org/apache/commons/hivemind/Messages.html">Messages</a>, which
includes methods
  +<a href="&apiroot;/Messages.html">Messages</a>, which includes methods
   for accessing messages and formatting messages with arguments.
   </p>	
   
  @@ -77,9 +77,9 @@
   <p>
   
   When a 
  -<a href="apidocs/org/apache/commons/hivemind/Registry.html">Registry</a>
  +<a href="&apiroot;/Registry.html">Registry</a>
   is created by the
  -<a href="apidocs/org/apache/commons/hivemind/impl/RegistryBuilder.html">RegistryBuilder</a>,
  +<a href="&apiroot;/impl/RegistryBuilder.html">RegistryBuilder</a>,
   a locale is specified.  This is the locale for the Registry and, by extension, for all
Modules
   in the registry.
   The locale may not be changed.
  
  
  
  1.24      +3 -3      jakarta-commons-sandbox/hivemind/xdocs/descriptor.xml
  
  Index: descriptor.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/descriptor.xml,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- descriptor.xml	5 Sep 2003 22:32:38 -0000	1.23
  +++ descriptor.xml	15 Sep 2003 14:41:10 -0000	1.24
  @@ -1,7 +1,7 @@
   <?xml version="1.0"?>
   <!-- $Id$ -->
   <!DOCTYPE document [
  -	<!ENTITY % common-links SYSTEM "../common/links.xml">
  +	<!ENTITY % common-links SYSTEM "common/links.xml">
   	%common-links;
   	]>
   <document>
  @@ -223,7 +223,7 @@
   				extension point. An interceptor factory is a service which implements
   				the 
   				
  -	<a href="apidocs/org/apache/commons/hivemind/ServiceInterceptorFactory.html">ServiceInterceptorFactory</a>
  +	<a href="&apiroot;/ServiceInterceptorFactory.html">ServiceInterceptorFactory</a>
   				
   			 interface.</p>
   			<table>
  
  
  
  1.10      +4 -4      jakarta-commons-sandbox/hivemind/xdocs/extension-points.xml
  
  Index: extension-points.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/extension-points.xml,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- extension-points.xml	12 Sep 2003 19:27:50 -0000	1.9
  +++ extension-points.xml	15 Sep 2003 14:41:10 -0000	1.10
  @@ -1,7 +1,7 @@
   <?xml version="1.0"?>
   <!-- $Id$ -->
   <!DOCTYPE document [
  -	<!ENTITY % common-links SYSTEM "../common/links.xml">
  +	<!ENTITY % common-links SYSTEM "common/links.xml">
   	%common-links;
   	]>
   <document>
  @@ -269,7 +269,7 @@
   	</p>
   	
   	<p>
  -	<a href="apidocs/org/apache/commons/hivemind/impl/SystemPropertiesSymbolSource.html">SystemPropertiesSymbolSource</a>
  +	<a href="&apiroot;/impl/SystemPropertiesSymbolSource.html">SystemPropertiesSymbolSource</a>
   	is a one-line implementation that allows access to system properties as substitution symbols.
   	</p>
   	
  @@ -294,7 +294,7 @@
   	
   	<p>
   		You can omit the schema, in which case the elements are left as XML
  -		(instances of <a href="apidocs/org/apache/commons/hivemind/Element.html">Element</a>)
and your code
  +		(instances of <a href="&apiroot;/Element.html">Element</a>) and your
code
   		is responsible for walking the elements and attributes ... but why bother? Far easier
to let
   		HiveMind do the conversions and validations.
   	</p>
  
  
  
  1.3       +2 -2      jakarta-commons-sandbox/hivemind/xdocs/registry.xml
  
  Index: registry.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/registry.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- registry.xml	5 Aug 2003 15:41:44 -0000	1.2
  +++ registry.xml	15 Sep 2003 14:41:10 -0000	1.3
  @@ -1,7 +1,7 @@
   <?xml version="1.0"?>
   <!-- $Id$ -->
   <!DOCTYPE document [
  -	<!ENTITY % common-links SYSTEM "../common/links.xml">
  +	<!ENTITY % common-links SYSTEM "common/links.xml">
   	%common-links;
   	]>
   <document>
  
  
  
  1.8       +3 -3      jakarta-commons-sandbox/hivemind/xdocs/ioc.xml
  
  Index: ioc.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/ioc.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ioc.xml	12 Sep 2003 19:27:50 -0000	1.7
  +++ ioc.xml	15 Sep 2003 14:41:10 -0000	1.8
  @@ -1,7 +1,7 @@
   <?xml version="1.0"?>
   <!-- $Id$ -->
   <!DOCTYPE document [
  -	<!ENTITY % common-links SYSTEM "../common/links.xml">
  +	<!ENTITY % common-links SYSTEM "common/links.xml">
   	%common-links;
   	]>
   <document>
  @@ -94,7 +94,7 @@
   
   <p>
   The <code>message-property</code> attribute identifies a property of type
  -<a href="apidocs/org/apache/commons/hivemind/Messages.html">Messages</a>, 
  +<a href="&apiroot;/Messages.html">Messages</a>, 
   the localized messages from the invoking module.
   </p>
   
  
  
  
  1.2       +2 -2      jakarta-commons-sandbox/hivemind/xdocs/override.xml
  
  Index: override.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/override.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- override.xml	9 Sep 2003 22:09:21 -0000	1.1
  +++ override.xml	15 Sep 2003 14:41:10 -0000	1.2
  @@ -1,7 +1,7 @@
   <?xml version="1.0"?>
   <!-- $Id$ -->
   <!DOCTYPE document [
  -	<!ENTITY % common-links SYSTEM "../common/links.xml">
  +	<!ENTITY % common-links SYSTEM "common/links.xml">
   	%common-links;
   	]>
   <document>
  
  
  
  1.5       +4 -4      jakarta-commons-sandbox/hivemind/xdocs/case1.xml
  
  Index: case1.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/case1.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- case1.xml	12 Sep 2003 19:27:50 -0000	1.4
  +++ case1.xml	15 Sep 2003 14:41:10 -0000	1.5
  @@ -1,7 +1,7 @@
   <?xml version="1.0"?>
   <!-- $Id$ -->
   <!DOCTYPE document [
  -	<!ENTITY % common-links SYSTEM "../common/links.xml">
  +	<!ENTITY % common-links SYSTEM "common/links.xml">
   	%common-links;
   	]>
   <document>
  @@ -327,7 +327,7 @@
   <p>
   Task implements <code>Executable</code>, simply delegating to its <code>executable</code>
property. In addition,
   it implements
  -<a href="apidocs/org/apache/commons/hivemind/Orderable.html">Orderable</a>,
which simply defines the <code>order</code>
  +<a href="&apiroot;/Orderable.html">Orderable</a>, which simply defines
the <code>order</code>
   property (but simplifies sorting of the elements).
   </p>
   </subsection>
  @@ -562,7 +562,7 @@
   
   <p>
   The class implements
  -<a href="apidocs/org/apache/commons/hivemind/Locatable.html">Locatable</a>,
which is used
  +<a href="&apiroot;/Locatable.html">Locatable</a>, which is used
   in method <code>isNull()</code> when reporting errors; the location will be
the location
   of the &lt;invoke-static&gt; element the StaticTask instance was created from.
   </p>
  
  
  
  1.3       +12 -6     jakarta-commons-sandbox/hivemind/xdocs/bootstrap.xml
  
  Index: bootstrap.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/bootstrap.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- bootstrap.xml	8 Sep 2003 20:14:18 -0000	1.2
  +++ bootstrap.xml	15 Sep 2003 14:41:10 -0000	1.3
  @@ -1,7 +1,7 @@
   <?xml version="1.0"?>
   <!-- $Id$ -->
   <!DOCTYPE document [
  -	<!ENTITY % common-links SYSTEM "../common/links.xml">
  +	<!ENTITY % common-links SYSTEM "common/links.xml">
   	%common-links;
   	]>
   <document>
  @@ -20,7 +20,7 @@
   
   <p>
   The key class here is
  -<a href="apidocs/org/apache/commons/hivemind/impl/RegistryBuilder.html">RegistryBuilder</a>,
which contains
  +<a href="&apiroot;/impl/RegistryBuilder.html">RegistryBuilder</a>, which
contains
   code for locating and parsing the module deployment descriptors and constructing a registry
from the combined
   data.
   </p>
  @@ -134,10 +134,10 @@
   <p>
   Building the registry requires four steps:
   <ul>
  -<li>Create a <a href="apidocs/org/apache/commons/hivemind/ClassResolver.html">ClassResolver</a>
instance. 
  +<li>Create a <a href="&apiroot;/ClassResolver.html">ClassResolver</a>
instance. 
   	DefaultClassResolver uses the thread's context class loader.</li>	
   <li>
  -Create a <a href="apidocs/org/apache/commons/hivemind/impl/RegistryBuilder.html">RegistryBuilder</a>
instance.
  +Create a <a href="&apiroot;/impl/RegistryBuilder.html">RegistryBuilder</a>
instance.
   </li>
   <li>
   Invoke <code>processModules()</code> to find and parse all HiveMind module
deployment descriptors visible on
  @@ -148,12 +148,18 @@
   <li>
   Invoke <code>constructRegistry()</code>	to integrate and validate all the information
in all
   of the HiveMind module deployment descriptors and produce a 
  -<a href="apidocs/org/apache/commons/hivemind/Registry.html">Registry</a> from
it.
  +<a href="&apiroot;/Registry.html">Registry</a> from it.
   </li>
   
   </ul>	
   
   </p>
  +
  +<p>
  +Alternately, the static method 
  +<a href="&apiroot;/HiveMind.html#constructDefaultRegistry()">constructDefaultRegistry()</a>
can be invoked.  It's just those same four lines of code.
  +</p>
  +
   
   <p>
   Now that we have the registry, we can use the full id of the Adder service, <code>hivemind.examples.Adder</code>,

  
  
  
  1.21      +6 -6      jakarta-commons-sandbox/hivemind/xdocs/services.xml
  
  Index: services.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/services.xml,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- services.xml	8 Sep 2003 20:14:18 -0000	1.20
  +++ services.xml	15 Sep 2003 14:41:10 -0000	1.21
  @@ -1,7 +1,7 @@
   <?xml version="1.0"?>
   <!-- $Id$ -->
   <!DOCTYPE document [
  -	<!ENTITY % common-links SYSTEM "../common/links.xml">
  +	<!ENTITY % common-links SYSTEM "common/links.xml">
   	%common-links;
   	]>
   <document>
  @@ -89,7 +89,7 @@
   					includes a service-id attribute, the id of a
   					service implementation factory service (which implements the
   					
  -					<a href="apidocs/org/apache/commons/hivemind/ServiceImplementationFactory.html">ServiceImplementationFactory</a>

  +					<a href="&apiroot;/ServiceImplementationFactory.html">ServiceImplementationFactory</a>

   					
   					interface).</p>
   					
  @@ -131,7 +131,7 @@
   					element. The service-id attribute identifies a service interceptor factory
   					service: a service that implements the
   					
  -					<a href="apidocs/org/apache/commons/hivemind/ServiceInterceptorFactory.html">ServiceInterceptorFactory</a>
  +					<a href="&apiroot;/ServiceInterceptorFactory.html">ServiceInterceptorFactory</a>
   					
   					interface.</p>
   					
  @@ -307,7 +307,7 @@
   		<p>
   		When a service is first requested
   		(using
  -		<a href="apidocs/org/apache/commons/hivemind/ServiceExtensionPoint.html#getService(java.lang.Class)">ServiceExtensionPoint.getService()</a>
  +		<a href="&apiroot;/ServiceExtensionPoint.html#getService(java.lang.Class)">ServiceExtensionPoint.getService()</a>
   		),
   		a <em>proxy</em>	for the service is created. This proxy implements
   		 the same service interface as the actual service and,
  @@ -406,7 +406,7 @@
   				is instantiated), then
   				your class should implement the
   				
  -				<a href="apidocs/org/apache/commons/hivemind/Initializable.html">Initializable</a>
  +				<a href="&apiroot;/Initializable.html">Initializable</a>
   				interface (in addition to the service interface).
   				  This interface defines a callback that occurs only after
   				the core service has been constructed and configured, and the interceptor stack
  
  
  
  1.6       +6 -6      jakarta-commons-sandbox/hivemind/xdocs/rules.xml
  
  Index: rules.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/rules.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- rules.xml	8 Sep 2003 20:14:18 -0000	1.5
  +++ rules.xml	15 Sep 2003 14:41:10 -0000	1.6
  @@ -1,7 +1,7 @@
   <?xml version="1.0"?>
   <!-- $Id$ -->
   <!DOCTYPE document [
  -	<!ENTITY % common-links SYSTEM "../common/links.xml">
  +	<!ENTITY % common-links SYSTEM "common/links.xml">
   	%common-links;
   	]>
   <document>
  @@ -27,13 +27,13 @@
   <p>
   Rules are attached to &element;s.  Each rule object has two methods:  the 
   
  -<a href="apidocs/org/apache/commons/hivemind/schema/Rule.html#begin(org.apache.commons.hivemind.schema.SchemaProcessor,
org.apache.commons.hivemind.Element)">begin()</a>	
  +<a href="&apiroot;/schema/Rule.html#begin(org.apache.commons.hivemind.schema.SchemaProcessor,
org.apache.commons.hivemind.Element)">begin()</a>	
   		
    method is invoked when the element is first
   encountered.  The content of the element is then processed recursively (which will involve
more rules).  Once that completes,
   the 
   
  -<a href="apidocs/org/apache/commons/hivemind/schema/Rule.html#end(org.apache.commons.hivemind.schema.SchemaProcessor,
org.apache.commons.hivemind.Element)">end()</a>
  +<a href="&apiroot;/schema/Rule.html#end(org.apache.commons.hivemind.schema.SchemaProcessor,
org.apache.commons.hivemind.Element)">end()</a>
   
    method is invoked.
   </p>	
  @@ -265,7 +265,7 @@
   
   <p>
   A translator is an object implementing the
  -<a href="apidocs/org/apache/commons/hivemind/schema/Translator.html">Translator</a>
interface.  The 
  +<a href="&apiroot;/schema/Translator.html">Translator</a> interface.  The

   <code>translator</code> value specified in a rule may be either the complete
class name of a class implementing
   the interface, or one of a number of builtin values.
   </p>
  @@ -366,7 +366,7 @@
   <p>
   The resource translator is used to find a resource packaged with (or near) the module's
deployment descriptor.
   The input value is the relative path to a file.  The translator converts the input value
to a
  -<a href="apidocs/org/apache/commons/hivemind/Resource.html">Resource</a>	 for
that file.
  +<a href="&apiroot;/Resource.html">Resource</a>	 for that file.
   </p>
   
   <p>
  
  
  
  1.3       +9 -9      jakarta-commons-sandbox/hivemind/xdocs/interceptors.xml
  
  Index: interceptors.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/xdocs/interceptors.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- interceptors.xml	12 Sep 2003 19:27:50 -0000	1.2
  +++ interceptors.xml	15 Sep 2003 14:41:10 -0000	1.3
  @@ -1,7 +1,7 @@
   <?xml version="1.0"?>
   <!-- $Id$ -->
   <!DOCTYPE document [
  -	<!ENTITY % common-links SYSTEM "../common/links.xml">
  +	<!ENTITY % common-links SYSTEM "common/links.xml">
   	%common-links;
   	]>
   <document>
  @@ -45,11 +45,11 @@
   
   <p>
   Interceptor factories are HiveMind services which implement the
  -<a href="apidocs/org/apache/commons/hivemind/ServiceInterceptorFactory.html">ServiceInterceptorFactory</a>

  +<a href="&apiroot;/ServiceInterceptorFactory.html">ServiceInterceptorFactory</a>

   interface. This interface has a single method, <code>createInterceptor()</code>,
which is passed:
   <ul>
  -<li>The <a href="apidocs/org/apache/commons/hivemind/InterceptorStack.html">InterceptorStack</a>
(an object used to manage the process of creating interceptors for a service)</li>
  -<li>The <a href="apidocs/org/apache/commons/hivemind/Module.html">Module</a>
which invoked the interceptor factory</li>
  +<li>The <a href="&apiroot;/InterceptorStack.html">InterceptorStack</a>
(an object used to manage the process of creating interceptors for a service)</li>
  +<li>The <a href="&apiroot;/Module.html">Module</a> which invoked
the interceptor factory</li>
   <li>A list of parameters</li>
   </ul>
   </p>
  @@ -72,7 +72,7 @@
   
   <p>
   Simple interceptors, those which do not take any parameters, are implemented by subclassing
  -<a href="apidocs/org/apache/commons/hivemind/service/impl/AbstractServiceInterceptorFactory.html">AbstractServiceInterceptorFactory</a>.
  +<a href="&apiroot;/service/impl/AbstractServiceInterceptorFactory.html">AbstractServiceInterceptorFactory</a>.
   It does most of the work, organizing the process of creating the class and methods ...
even adding a
   <code>toString()</code> method implementation automatically.
   </p>
  @@ -126,7 +126,7 @@
   <p>
   The <code>addServiceMethodImplementation()</code>	 method is invoked for each
service method.
   It is passed the
  -<a href="apidocs/org/apache/commons/hivemind/service/ClassFab.html">ClassFab</a>,
an object which represents a class being fabricated, which allows new fields, methods and
constructors
  +<a href="&apiroot;/service/ClassFab.html">ClassFab</a>, an object which
represents a class being fabricated, which allows new fields, methods and constructors
   to be added.
   </p>
   
  @@ -138,7 +138,7 @@
   
   <p>
   The 
  -<a href="apidocs/org/apache/commons/hivemind/service/BodyBuilder.html">BodyBuilder</a>
class helps
  +<a href="&apiroot;/service/BodyBuilder.html">BodyBuilder</a>	class helps
   with assembling method bodies in bits and pieces.  The <code>_inner</code>
variable is a private instance variable,
   the inner for this interceptor.  The <code>($r)</code> reference means "cast
to the return type for this method", and properly handles
   void methods.  The <code>$$</code> is a placeholder for a comma-seperated list
of all the parameters to the method.
  @@ -188,7 +188,7 @@
   <subsection name="AbstractLoggingInterceptor base class">
   <p>
   In most cases, an abstract base class for the interceptor is provided; in this case, it
is
  -<a href="apidocs/org/apache/commons/hivemind/service/impl/AbstractLoggingInterceptor.html">AbstractLoggingInterceptor</a>.
  +<a href="&apiroot;/service/impl/AbstractLoggingInterceptor.html">AbstractLoggingInterceptor</a>.
   This class provides several protected methods used by fabricated interceptors.  To help
ensure
   that there are no conflicts between the method of the service interface and the methods
   provided by the super-class, the provided methods are named with a leading underscore.
 These methods are:
  
  
  
  1.5       +4 -2      jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/ExtensionPoint.java
  
  Index: ExtensionPoint.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/ExtensionPoint.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ExtensionPoint.java	30 Aug 2003 14:29:52 -0000	1.4
  +++ ExtensionPoint.java	15 Sep 2003 14:41:11 -0000	1.5
  @@ -72,7 +72,9 @@
       /**
        * Returns the constructed extensions as a list of elements assembled
        * from the various contributions.  The List is unmodifiable.  May
  -     * return an empty list, but won't return null.
  +     * return an empty list, but won't return null. May return a proxy to
  +     * the actual data (which is constructed only as needed), but user code
  +     * shouldn't care about that.
        */
       
       public List getElements();   
  
  
  
  1.3       +2 -2      jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/ClassResolver.java
  
  Index: ClassResolver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/ClassResolver.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ClassResolver.java	30 Aug 2003 14:29:52 -0000	1.2
  +++ ClassResolver.java	15 Sep 2003 14:41:11 -0000	1.3
  @@ -87,7 +87,7 @@
       /**
        * Forwarded, to the the method
        * <code>Class.forName(String, boolean, ClassLoader)</code>, using
  -     * the application's class loader.
  +     * the resolver's class loader.
        *
        * @throws ApplicationRuntimeException on any error.
        */
  
  
  
  1.20      +22 -2     jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/HiveMind.java
  
  Index: HiveMind.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/HiveMind.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- HiveMind.java	12 Sep 2003 19:27:50 -0000	1.19
  +++ HiveMind.java	15 Sep 2003 14:41:11 -0000	1.20
  @@ -62,10 +62,13 @@
   import java.util.Collections;
   import java.util.Comparator;
   import java.util.List;
  +import java.util.Locale;
   import java.util.Map;
   import java.util.MissingResourceException;
   import java.util.ResourceBundle;
   
  +import org.apache.commons.hivemind.impl.DefaultClassResolver;
  +import org.apache.commons.hivemind.impl.RegistryBuilder;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  @@ -251,7 +254,7 @@
       /**
        * Selects the first {@link Location} in an array of objects.
        * Skips over nulls.  The objects may be instances of
  -     * {Location or {@link Locatable}.  May return null
  +     * Location or {@link Locatable}.  May return null
        * if no Location can be found. 
        */
   
  @@ -280,4 +283,21 @@
           return null;
       }
   
  +    /**
  +     * Constructs a default registry based on just the modules
  +     * visible to the thread context class loader (this is sufficient
  +     * is the majority of cases), and using the default locale. If you have different
  +     * error handling needs, or wish to pick up HiveMind module deployment
  +     * descriptors for non-standard locations, then you can
  +     * use {@link RegistryBuilder} instead.
  +     */
  +    public static Registry constructDefaultRegistry()
  +    {
  +        ClassResolver resolver = new DefaultClassResolver();
  +        RegistryBuilder builder = new RegistryBuilder();
  +
  +        builder.processModules(resolver);
  +
  +        return builder.constructRegistry(Locale.getDefault());
  +    }
   }
  
  
  
  1.9       +7 -14     jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/ServiceExtensionPoint.java
  
  Index: ServiceExtensionPoint.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/java/org/apache/commons/hivemind/ServiceExtensionPoint.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ServiceExtensionPoint.java	12 Sep 2003 19:27:50 -0000	1.8
  +++ ServiceExtensionPoint.java	15 Sep 2003 14:41:11 -0000	1.9
  @@ -77,20 +77,13 @@
       public Class getServiceInterface();
   
       /**
  -     * Obtains the full service implementation for this service extension point, which
  -     * consists of the core service implementation wrapped by all interceptors.
  -     * Service implementations are created in a synchronized block, and are cached for
later
  -     * access (they are singletons).
  +     * Obtains the full service implementation for this service extension point, an
  +     * object that implements the service interface. Because of the different service models,
  +     * and because of the possibility of interceptors, the exact class and object returned
  +     * can't be specified (and may vary at different times), but that is not relevant
  +     * to client code, which is assured that it can invoke
  +     * the service methods defined by the service interface.
        * 
  -     * <p>Once the core implementation is created and the interceptor
  -     * stack is assembled, the core implementation is checked
  -     * to see if it implements {@link Initializable}.
  -     * If so {@link Initializable#initializeService(Object)}
  -     * is invoked, to let the core service implementation
  -     * initialize.
  -     * 
  -     * <p>May return null if the service is optional and no
  -     * factory contribution has been made.
        * 
        * @param interfaceClass the class that the service will be cast to;
        * a check is made that the service is assignable to
  
  
  
  1.12      +3 -1      jakarta-commons-sandbox/hivemind/common/links.xml
  
  Index: links.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/common/links.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- links.xml	20 Aug 2003 20:40:45 -0000	1.11
  +++ links.xml	15 Sep 2003 14:41:11 -0000	1.12
  @@ -1,5 +1,7 @@
   <!-- $Id$ -->
   
  +<!ENTITY apiroot 'apidocs/org/apache/commons/hivemind'>
  +
   <!ENTITY _module '<code>&lt;module&gt;</code>'>
   <!ENTITY module '<a href="descriptor.html#module">&_module;</a>'>
   
  
  
  
  1.12      +42 -1     jakarta-commons-sandbox/hivemind/src/test/hivemind/test/parse/TestToString.java
  
  Index: TestToString.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/src/test/hivemind/test/parse/TestToString.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- TestToString.java	30 Aug 2003 14:29:56 -0000	1.11
  +++ TestToString.java	15 Sep 2003 14:41:11 -0000	1.12
  @@ -61,7 +61,12 @@
   
   import java.util.Locale;
   
  +import org.apache.commons.hivemind.ExtensionPoint;
  +import org.apache.commons.hivemind.Location;
  +import org.apache.commons.hivemind.Module;
  +import org.apache.commons.hivemind.ServiceExtensionPoint;
   import org.apache.commons.hivemind.impl.AttributeImpl;
  +import org.apache.commons.hivemind.impl.InterceptorStackImpl;
   import org.apache.commons.hivemind.impl.ModuleImpl;
   import org.apache.commons.hivemind.impl.ElementImpl;
   import org.apache.commons.hivemind.impl.ExtensionImpl;
  @@ -77,6 +82,7 @@
   import org.apache.commons.hivemind.parse.InvokeFactoryDescriptor;
   import org.apache.commons.hivemind.parse.ModuleDescriptor;
   import org.apache.commons.hivemind.parse.ServiceDescriptor;
  +import org.apache.commons.hivemind.schema.Schema;
   
   /**
    * A cheat, for code-coverage reasons.  We check that all the classes have a toString()
  @@ -88,6 +94,40 @@
   
   public class TestToString extends HiveMindTestCase
   {
  +    private static class MockServiceExtensionPoint implements ServiceExtensionPoint
  +    {
  +
  +        public Schema getParametersSchema()
  +        {
  +            return null;
  +        }
  +
  +        public Object getService(Class interfaceClass)
  +        {
  +            return null;
  +        }
  +
  +        public Class getServiceInterface()
  +        {
  +            return Runnable.class;
  +        }
  +
  +        public String getExtensionPointId()
  +        {
  +            return null;
  +        }
  +
  +        public Module getModule()
  +        {
  +            return null;
  +        }
  +
  +        public Location getLocation()
  +        {
  +            return null;
  +        }
  +
  +    }
       public TestToString(String name)
       {
           super(name);
  @@ -111,5 +151,6 @@
           new AttributeImpl("foo", "bar").toString();
           new ServiceInterceptorContributionImpl().toString();
           new ServiceExtensionPointImpl().toString();
  +        new InterceptorStackImpl(new MockServiceExtensionPoint(), null).toString();
       }
   }
  
  
  

Mime
View raw message