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/framework/src/test/hivemind/test/services/impl ConstructorAccessImpl.java
Date Fri, 03 Oct 2003 20:00:16 GMT
hlship      2003/10/03 13:00:16

  Modified:    hivemind/framework/src/java/org/apache/commons/hivemind/util
                        EventListenerList.java
               hivemind/framework/src/test/hivemind/test/services
                        TestServices.java TestThreadedModel.java
               hivemind/xdocs ioc.xml rules.xml
               hivemind/framework/src/descriptor/META-INF hivemodule.xml
               hivemind/framework/src/java/org/apache/commons/hivemind/service/impl
                        BuilderFactory.java BuilderParameter.java
               hivemind/framework/xdocs BuilderFactory.xml
               hivemind/framework/src/java/org/apache/commons/hivemind/schema/rules
                        InvokeParentRule.java
               hivemind/framework/src/java/org/apache/commons/hivemind
                        HiveMind.java
               hivemind/framework/src/java/org/apache/commons/hivemind/parse
                        DescriptorParser.java
               hivemind/framework/src/java/org/apache/commons/hivemind/impl
                        ThreadedServiceModel.java
  Added:       hivemind/framework/src/test/hivemind/test/services
                        ConstructorAccess.java ConstructorFactory.xml
               hivemind/framework/src/java/org/apache/commons/hivemind/service/impl
                        BuilderFacet.java BuilderLogFacet.java
                        BuilderMessagesFacet.java
                        BuilderServiceIdFacet.java
                        BuilderPropertyFacet.java
               hivemind/framework/src/test/hivemind/test/services/impl
                        ConstructorAccessImpl.java
  Removed:     hivemind/framework/src/java/org/apache/commons/hivemind/service/impl
                        SetPropertyValue.java
  Log:
  Allow the BuilderFactory to invoke core implementation constructor.
  Adapted from patch provided by Knut Wannheden.
  
  Revision  Changes    Path
  1.2       +73 -67    jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/util/EventListenerList.java
  
  Index: EventListenerList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/util/EventListenerList.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EventListenerList.java	29 Sep 2003 20:56:19 -0000	1.1
  +++ EventListenerList.java	3 Oct 2003 20:00:15 -0000	1.2
  @@ -81,42 +81,42 @@
   
       private class ListenerIterator implements Iterator
       {
  -    	private Object[] _localListeners;
  -    	private int _localCount;
  -    	private int _localUid;
  -    	private int _pos;
  -    	
  -    	private ListenerIterator()
  -    	{
  -    		_localListeners = _listeners;
  -    		_localCount = _count;
  -    		_localUid = _uid;
  -    	}
  -    	
  +        private Object[] _localListeners;
  +        private int _localCount;
  +        private int _localUid;
  +        private int _pos;
  +
  +        private ListenerIterator()
  +        {
  +            _localListeners = _listeners;
  +            _localCount = _count;
  +            _localUid = _uid;
  +        }
  +
           public boolean hasNext()
           {
  -			if (_pos >= _localCount)
  -			{
  -				// If _listeners has not been recopied during the lifespan
  -				// of this iterator, then knock the count down by one.
  -				
  -				if (_uid == _localUid)
  -					_iteratorCount--;
  -	
  -				_localListeners = null;
  -				_localCount = 0;
  -				_localUid = -1;
  -				_pos = 0;
  -				
  -				return false;			
  -			}
  -			
  -			return true;
  +            if (_pos >= _localCount)
  +            {
  +                // If _listeners has not been recopied during the lifespan
  +                // of this iterator, then knock the count down by one.
  +
  +                if (_uid == _localUid)
  +                    _iteratorCount--;
  +
  +                _localListeners = null;
  +                _localCount = 0;
  +                _localUid = -1;
  +                _pos = 0;
  +
  +                return false;
  +            }
  +
  +            return true;
           }
   
           public Object next()
           {
  -			return _localListeners[_pos++];
  +            return _localListeners[_pos++];
           }
   
           public void remove()
  @@ -125,23 +125,28 @@
           }
   
       }
  -    
  +
       /**
        * Returns an Iterator used to find all the listeners previously added.
        * The order in which listeners are returned is not guaranteed.
        * Currently, you may not invoke <code>remove()</code> on the Iterator.
  +     * 
  +     * <p>
  +     * Invoking this method takes a "snapshot" of the current list of listeners. 
  +     * You may invoke {@link #addListener(Object)} or {@link #removeListener(Object)},
  +     * but that won't affect the sequence of listeners returned by the Iterator.
  +     */
  +    public Iterator getListeners()
  +    {
  +        _iteratorCount++;
  +
  +        return new ListenerIterator();
  +    }
  +
  +    /**
  +     * Adds a new listener to the list of listeners. The same instance
  +     * will may be added multiple times.
        */
  -	public Iterator getListeners()
  -	{
  -		_iteratorCount++;
  -		
  -		return new ListenerIterator();
  -	}
  -
  -	/**
  -	 * Adds a new listener to the list of listeners. The same instance
  -	 * will may be added multiple times.
  -	 */
       public void addListener(Object listener)
       {
           copyOnWrite(_count + 1);
  @@ -151,51 +156,52 @@
           _count++;
       }
   
  -	/**
  -	 * Removes a listener from the list.  Does nothing if the listener
  -	 * is not already in the list. Comparison is based on identity, not equality.
  -	 * If the listener is in the list multiple times, only a single
  -	 * instance is removed.
  -	 */
  +    /**
  +     * Removes a listener from the list.  Does nothing if the listener
  +     * is not already in the list. Comparison is based on identity, not equality.
  +     * If the listener is in the list multiple times, only a single
  +     * instance is removed.
  +     */
       public void removeListener(Object listener)
       {
           for (int i = 0; i < _count; i++)
           {
               if (_listeners[i] == listener)
               {
  -				removeListener(i);
  +                removeListener(i);
                   return;
               }
           }
       }
  -    
  +
       private void removeListener(int index)
       {
  -		copyOnWrite(_count);
  +        copyOnWrite(_count);
   
  -	   	// Move the last listener in the list into the index to be removed.
  -    	
  -    	_listeners[index] = _listeners[_count - 1];
  -    	
  -    	// Null out the old position.
  -    	
  -    	_listeners[_count - 1] = null;
  -    	
  -    	_count--;
  +        // Move the last listener in the list into the index to be removed.
  +
  +        _listeners[index] = _listeners[_count - 1];
  +
  +        // Null out the old position.
  +
  +        _listeners[_count - 1] = null;
  +
  +        _count--;
       }
   
  -	/**
  -	 * Copies the array before an update operation if necessary (because there
  -	 * is a known iterator for the current array, or because the 
  -	 * array is not large enough).
  -	 */
  +    /**
  +     * Copies the array before an update operation if necessary (because there
  +     * is a known iterator for the current array, or because the 
  +     * array is not large enough).
  +     */
       private void copyOnWrite(int requiredSize)
       {
           int size = _listeners == null ? 0 : _listeners.length;
   
           if (_iteratorCount > 0 || size < requiredSize)
           {
  -            int newSize = Math.max(requiredSize, START_SIZE);
  +            int newSize =
  +                (size == 0) ? Math.max(requiredSize, START_SIZE) : Math.max(requiredSize, 2 * size);
   
               Object[] newListeners = new Object[newSize];
   
  
  
  
  1.6       +21 -1     jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/services/TestServices.java
  
  Index: TestServices.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/services/TestServices.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestServices.java	1 Oct 2003 20:43:21 -0000	1.5
  +++ TestServices.java	3 Oct 2003 20:00:16 -0000	1.6
  @@ -307,6 +307,26 @@
           assertLoggedMessagePattern("Unable to set property EVIL of hivemind\\.test\\.services\\.impl\\.BuilderAccessImpl@.*: Unknown property 'EVIL'");
       }
   
  +	public void testConstructorFactory() throws Exception
  +	{
  +		Registry r = buildFrameworkRegistry("ConstructorFactory.xml");
  +
  +		interceptLogging("hivemind");
  +
  +		String[] servicesToTest = {"DefaultConstructor", "LongConstructor", "MultiConstructor",
  +			"ConfigurationConstructor", "LogAndMessagesConstructor"
  +		};
  +
  +		for (int i = 0; i < servicesToTest.length; i++)
  +		{
  +			ConstructorAccess s =
  +				(ConstructorAccess) r.getService(
  +					"hivemind.test.services." + servicesToTest[i],
  +				ConstructorAccess.class);
  +			s.verify();
  +		}
  +	}
  +
       public void testArrayResult() throws Exception
       {
           Registry r = buildFrameworkRegistry("ArrayResult.xml");
  
  
  
  1.5       +11 -8     jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/services/TestThreadedModel.java
  
  Index: TestThreadedModel.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/services/TestThreadedModel.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestThreadedModel.java	2 Oct 2003 18:42:06 -0000	1.4
  +++ TestThreadedModel.java	3 Oct 2003 20:00:16 -0000	1.5
  @@ -59,6 +59,7 @@
   
   import hivemind.test.FrameworkTestCase;
   
  +import org.apache.commons.hivemind.HiveMind;
   import org.apache.commons.hivemind.Registry;
   import org.apache.commons.hivemind.service.ThreadEventNotifier;
   
  @@ -98,7 +99,7 @@
               (StringHolder) r.getService("hivemind.test.services.StringHolder", StringHolder.class);
           ThreadEventNotifier n =
               (ThreadEventNotifier) r.getService(
  -                "hivemind.ThreadEventNotifier",
  +                HiveMind.THREAD_EVENT_NOTIFIER_SERVICE,
                   ThreadEventNotifier.class);
   
           interceptLogging("hivemind.test.services.StringHolder");
  @@ -222,16 +223,18 @@
               (StringHolder) r.getService(
                   "hivemind.test.services.ThreadedDiscardable",
                   StringHolder.class);
  -                
  +
           h.setValue("bar");
  -        
  -        ThreadEventNotifier n = (ThreadEventNotifier)r.getService("hivemind.ThreadEventNotifier",
  -        ThreadEventNotifier.class);
  -        
  +
  +        ThreadEventNotifier n =
  +            (ThreadEventNotifier) r.getService(
  +                "hivemind.ThreadEventNotifier",
  +                ThreadEventNotifier.class);
  +
           interceptLogging("hivemind");
  -        
  +
           n.fireThreadCleanup();
  -        
  +
           assertLoggedMessage("threadDidDiscardService() has been invoked.");
       }
   }
  
  
  
  1.1                  jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/services/ConstructorAccess.java
  
  Index: ConstructorAccess.java
  ===================================================================
  /*
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package hivemind.test.services;
  
  import junit.framework.AssertionFailedError;
  
  /**
   * Used to test constructor parameter passing of
   * {@link org.apache.commons.hivemind.service.impl.BuilderFactory}.
   */
  public interface ConstructorAccess
  {
  
  	void setExpectedConstructorMessage(String expectedMessage);
  
  	void verify() throws AssertionFailedError;
  
  }
  
  
  
  1.1                  jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/services/ConstructorFactory.xml
  
  Index: ConstructorFactory.xml
  ===================================================================
  <?xml version="1.0"?>
  <module id="hivemind.test.services" version="1.0.0">
  
    <service-point id="DefaultConstructor" interface="hivemind.test.services.ConstructorAccess">
    	<invoke-factory service-id="hivemind.BuilderFactory">
    		<construct class="hivemind.test.services.impl.ConstructorAccessImpl">
    			<set property="expectedConstructorMessage" value="()"/>
    		</construct>
    	</invoke-factory>	
    </service-point>
  
    <service-point id="LongConstructor" interface="hivemind.test.services.ConstructorAccess">
    	<invoke-factory service-id="hivemind.BuilderFactory">
    		<construct class="hivemind.test.services.impl.ConstructorAccessImpl">
    			<long>42</long>
    			<set property="expectedConstructorMessage" value="(long)"/>
    		</construct>
    	</invoke-factory>	
    </service-point>
  
    <service-point id="ServiceConstructor" interface="hivemind.test.services.ConstructorAccess">
    	<invoke-factory service-id="hivemind.BuilderFactory">
    		<construct class="hivemind.test.services.impl.ConstructorAccessImpl">
    			<service>DefaultConstructor</service>
    			<set property="expectedConstructorMessage" value="(ConstructorAccess)"/>
    		</construct>
    	</invoke-factory>	
    </service-point>
  
    <service-point id="MultiConstructor" interface="hivemind.test.services.ConstructorAccess">
    	<invoke-factory service-id="hivemind.BuilderFactory">
    		<construct class="hivemind.test.services.impl.ConstructorAccessImpl">
    			<service>DefaultConstructor</service>
    			<service-id/>
    			<set property="expectedConstructorMessage" value="(ConstructorAccess, String)"/>
    		</construct>
    	</invoke-factory>	
    </service-point>
  
    <service-point id="ConfigurationConstructor" interface="hivemind.test.services.ConstructorAccess">
    	<invoke-factory service-id="hivemind.BuilderFactory">
    		<construct class="hivemind.test.services.impl.ConstructorAccessImpl">
    			<configuration>DummyConfiguration</configuration>
    			<set property="expectedConstructorMessage" value="(List)"/>
    		</construct>
    	</invoke-factory>	
    </service-point>
  
    <service-point id="ConfigurationConstructor" interface="hivemind.test.services.ConstructorAccess">
    	<invoke-factory service-id="hivemind.BuilderFactory">
    		<construct class="hivemind.test.services.impl.ConstructorAccessImpl">
    			<configuration>DummyConfiguration</configuration>
    			<set property="expectedConstructorMessage" value="(List)"/>
    		</construct>
    	</invoke-factory>	
    </service-point>
  
    <service-point id="LogAndMessagesConstructor" interface="hivemind.test.services.ConstructorAccess">
    	<invoke-factory service-id="hivemind.BuilderFactory">
    		<construct class="hivemind.test.services.impl.ConstructorAccessImpl">
    			<log/>
    			<messages/>
    			<set property="expectedConstructorMessage" value="(Log, Messages)"/>
    		</construct>
    	</invoke-factory>	
    </service-point>
  
    <configuration-point id="DummyConfiguration"/>
  
  </module>
  
  
  1.15      +4 -4      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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ioc.xml	29 Sep 2003 16:16:35 -0000	1.14
  +++ ioc.xml	3 Oct 2003 20:00:16 -0000	1.15
  @@ -41,9 +41,9 @@
   </p>
   
   <p>
  -Much of the rest of Inversion of Control, the life cycle aspects, don't apply to HiveMind services because
  -they are explicitly multi-threaded singletons.  
  -They are created as needed and persist as long as the repository persists.	
  +HiveMind's lifecycle support is much more rudimentary than Avalon's. Your service implementations
  +can get callsbacks when they are first created, and when they are discarded, by implementing
  +certain interfaces.
   </p>
   
   <p>
  
  
  
  1.10      +11 -3     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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- rules.xml	29 Sep 2003 16:16:35 -0000	1.9
  +++ rules.xml	3 Oct 2003 20:00:16 -0000	1.10
  @@ -126,8 +126,9 @@
   <p>
   The &_invoke-parent; rule is used to connect the child (top object on the stack) to its parent
   (the next object down).  A method of the parent is invoked, passing the child as a parameter.	
  -This invocation occurs inside the rule's <code>end()</code> method, to ensure
  -that the child object is fully configured before being added to the parent.
  +This invocation occurs inside the rule's <code>begin()</code> method; to ensure
  +that the child object is fully configured before being added to the parent place this rule
  +after all properties of the child object have been configured.
   </p>	
   
   	
  @@ -144,6 +145,13 @@
   					<td>yes</td>
   					<td>The name of the method to invoke on the parent object.</td>
   				</tr>	
  +				<tr>
  +					<td>depth</td>	
  +					<td>number</td>
  +					<td>no</td>
  +					<td>The depth of the parent object within the object stack. The top object (the child)
  +						is at depth 0, and default depth of the parent is 1.</td>
  +				</tr>
   			</table>
   			
   <p>
  
  
  
  1.4       +154 -23   jakarta-commons-sandbox/hivemind/framework/src/descriptor/META-INF/hivemodule.xml
  
  Index: hivemodule.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/descriptor/META-INF/hivemodule.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- hivemodule.xml	25 Sep 2003 21:38:40 -0000	1.3
  +++ hivemodule.xml	3 Oct 2003 20:00:16 -0000	1.4
  @@ -149,7 +149,7 @@
   	
   	<service-point id="BuilderFactory" interface="org.apache.commons.hivemind.ServiceImplementationFactory" model="singleton">
   		<description>
  -		Used to construct a service from a class name and a set of properties and values to be set in the instantiated class.	
  +		Used to construct a service from a class name and optional constructor parameters and properties.	
   		</description>
   		<parameters-schema>
   		  <element name="construct">
  @@ -182,13 +182,144 @@
   		  	
   		  	<rules>
   		  		<create-object class="org.apache.commons.hivemind.service.impl.BuilderParameter"/>
  -		  		<read-attribute property="className" attribute="class"/>
  -		  		<read-attribute attribute="messages-property" property="messagesPropertyName"/>
  -		  		<read-attribute attribute="log-property" property="logPropertyName"/>
  -		  		<read-attribute attribute="service-id-property" property="serviceIdPropertyName"/>
  -		  		<invoke-parent method="addElement"/>	
  -		  	</rules>	
  +		  		<read-attribute property="className" attribute="class"/>				  		
  +		   		<invoke-parent method="addElement"/>	
  +		   			  				  		
  +		  		<create-object class="org.apache.commons.hivemind.service.impl.BuilderMessagesFacet"/>
  +		  		<read-attribute attribute="messages-property" property="propertyName"/>
  +		  		<invoke-parent method="addProperty"/>
  +		  		
  +		  		<create-object class="org.apache.commons.hivemind.service.impl.BuilderLogFacet"/>
  +		  		<read-attribute attribute="log-property" property="propertyName"/>
  +		  		<invoke-parent method="addProperty" depth="2"/>
  +
  +		  		<create-object class="org.apache.commons.hivemind.service.impl.BuilderServiceIdFacet"/>
  +		  		<read-attribute attribute="service-id-property" property="propertyName"/>
  +		  		<invoke-parent method="addProperty" depth="3"/>	 	  	 		
  +		  	</rules>
  +		  	
  +		  	<element name="string">
  +		  		<description>
  +		  		A string value constructor parameter.
  +		  		</description>
  +		  	  
  +		  	  <rules>
  +		  	  	<create-object class="org.apache.commons.hivemind.service.impl.BuilderPropertyFacet"/>
  +		  	  	<read-content property="value"/>
  +		  	  	<invoke-parent method="addParameter" depth="4"/>	
  +		  	  </rules>
  +		  	</element>
  +		  	
  +		  	
  +		  	<element name="int">
  +		  		<description>
  +		  		An integer value constructor parameter.
  +		  		</description>
  +		  	  
  +		  	  <rules>
  +		  	  	<create-object class="org.apache.commons.hivemind.service.impl.BuilderPropertyFacet"/>
  +		  	  	<read-content property="value" translator="int"/>
  +		  	  	<invoke-parent method="addParameter" depth="4"/>	
  +		  	  </rules>
  +		  	</element>
  +		  	
  +		  	<element name="long">
  +		  		<description>
  +		  		A long (64-bit) integer value constructor parameter.
  +		  		</description>
  +		  	  
  +		  	  <rules>
  +		  	  	<create-object class="org.apache.commons.hivemind.service.impl.BuilderPropertyFacet"/>
  +		  	  	<read-content property="value" translator="long"/>
  +		  	  	<invoke-parent method="addParameter" depth="4"/>	
  +		  	  </rules>
  +		  	</element>
  +		  	
  +		  	<element name="boolean">
  +		  		<description>
  +		  		A boolean value constructor parameter.
  +		  		</description>
  +		  	  
  +		  	  <rules>
  +		  	  	<create-object class="org.apache.commons.hivemind.service.impl.BuilderPropertyFacet"/>
  +		  	  	<read-content property="value" translator="enumeration,java.lang.Boolean,true=TRUE,false=FALSE"/>
  +		  	  	<invoke-parent method="addParameter" depth="4"/>	
  +		  	  </rules>
  +		  	</element>		  	
  +			  	
  +		  	<element name="service">
  +		  		<description>
  +		  		A service constructor parameter.
  +		  		</description>
  +		  		
  +		  		<rules>
  +		  			<create-object class="org.apache.commons.hivemind.service.impl.BuilderPropertyFacet"/>
  +		  			<read-content property="value" translator="service"/>
  +		  			<invoke-parent method="addParameter" depth="4"/>
  +		  		</rules>
  +		  	</element>
   		  	
  +		  	<element name="configuration">
  +		  		<description>
  +		  		All elements contributed to a configuration point as a List constructor parameter.
  +		  		</description>
  +			
  +					<rules>
  +		  			<create-object class="org.apache.commons.hivemind.service.impl.BuilderPropertyFacet"/>
  +		  			<read-content property="value" translator="configuration"/>
  +		  			<invoke-parent method="addParameter" depth="4"/>						
  +					</rules> 
  +				</element> 	
  +					
  +		  	<element name="resource">
  +		  		<description>
  +		  		A Resource constructor parameter.
  +		  		</description>
  +			
  +					<rules>
  +		  			<create-object class="org.apache.commons.hivemind.service.impl.BuilderPropertyFacet"/>
  +		  			<read-content property="value" translator="resource"/>
  +		  			<invoke-parent method="addParameter" depth="4"/>						
  +					</rules>  					
  +			  	
  +		  	</element>
  +
  +		  	<element name="log">
  +		  		<description>
  +		  		Placeholder for a Log instance for the constructed service as constructor parameter.
  +		  		</description>
  +			
  +					<rules>
  +						<create-object class="org.apache.commons.hivemind.service.impl.BuilderLogFacet"/>
  +		  			<invoke-parent method="addParameter" depth="4"/>						
  +					</rules>  					
  +			  	
  +		  	</element>
  +
  +		  	<element name="messages">
  +		  		<description>
  +		  		Placeholder for a Messages object (from the invoking module) as constructor parameter.
  +		  		</description>
  +			
  +					<rules>
  +						<create-object class="org.apache.commons.hivemind.service.impl.BuilderMessagesFacet"/>
  +		  			<invoke-parent method="addParameter" depth="4"/>						
  +					</rules>  					
  +			  	
  +		  	</element>
  +
  +		  	<element name="service-id">
  +		  		<description>
  +		  		Placeholder for the service id (of the constructed service) as constructor parameter.
  +		  		</description>
  +			
  +					<rules>
  +						<create-object class="org.apache.commons.hivemind.service.impl.BuilderServiceIdFacet"/>
  +		  			<invoke-parent method="addParameter" depth="4"/>						
  +					</rules>  					
  +			  	
  +		  	</element>
  +
   		  	<element name="set">
   		  		<description>
   		  		Configures a property of the service instance to a string value.
  @@ -201,10 +332,10 @@
   		  	  </attribute>
   		  	  
   		  	  <rules>
  -		  	  	<create-object class="org.apache.commons.hivemind.service.impl.SetPropertyValue"/>
  +		  	  	<create-object class="org.apache.commons.hivemind.service.impl.BuilderPropertyFacet"/>
   		  	  	<read-attribute property="propertyName" attribute="property"/>
   		  	  	<read-attribute property="value" attribute="value"/>
  -		  	  	<invoke-parent method="addProperty"/>	
  +		  	  	<invoke-parent method="addProperty" depth="4"/>	
   		  	  </rules>
   		  	</element>
   		  	
  @@ -221,10 +352,10 @@
   		  	  </attribute>
   		  	  
   		  	  <rules>
  -		  	  	<create-object class="org.apache.commons.hivemind.service.impl.SetPropertyValue"/>
  +		  	  	<create-object class="org.apache.commons.hivemind.service.impl.BuilderPropertyFacet"/>
   		  	  	<read-attribute property="propertyName" attribute="property"/>
   		  	  	<read-attribute property="value" attribute="value" translator="int"/>
  -		  	  	<invoke-parent method="addProperty"/>	
  +		  	  	<invoke-parent method="addProperty" depth="4"/>	
   		  	  </rules>
   		  	</element>
   		  	
  @@ -242,10 +373,10 @@
   		  	  </attribute>
   		  	  
   		  	  <rules>
  -		  	  	<create-object class="org.apache.commons.hivemind.service.impl.SetPropertyValue"/>
  +		  	  	<create-object class="org.apache.commons.hivemind.service.impl.BuilderPropertyFacet"/>
   		  	  	<read-attribute property="propertyName" attribute="property"/>
   		  	  	<read-attribute property="value" attribute="value" translator="long"/>
  -		  	  	<invoke-parent method="addProperty"/>	
  +		  	  	<invoke-parent method="addProperty" depth="4"/>	
   		  	  </rules>
   		  	</element>
   		  	
  @@ -263,10 +394,10 @@
   		  	  </attribute>
   		  	  
   		  	  <rules>
  -		  	  	<create-object class="org.apache.commons.hivemind.service.impl.SetPropertyValue"/>
  +		  	  	<create-object class="org.apache.commons.hivemind.service.impl.BuilderPropertyFacet"/>
   		  	  	<read-attribute property="propertyName" attribute="property"/>
   		  	  	<read-attribute property="value" attribute="value" translator="enumeration,java.lang.Boolean,true=TRUE,false=FALSE"/>
  -		  	  	<invoke-parent method="addProperty"/>	
  +		  	  	<invoke-parent method="addProperty" depth="4"/>	
   		  	  </rules>
   		  	</element>		  	
   			  	
  @@ -284,10 +415,10 @@
   		  		</attribute>
   		  		
   		  		<rules>
  -		  			<create-object class="org.apache.commons.hivemind.service.impl.SetPropertyValue"/>
  +		  			<create-object class="org.apache.commons.hivemind.service.impl.BuilderPropertyFacet"/>
   		  			<read-attribute property="propertyName" attribute="property"/>
   		  			<read-attribute property="value" attribute="service-id" translator="service"/>
  -		  			<invoke-parent method="addProperty"/>
  +		  			<invoke-parent method="addProperty" depth="4"/>
   		  		</rules>
   		  		
   		  	</element>
  @@ -306,10 +437,10 @@
   			  	</attribute>
   			
   					<rules>
  -		  			<create-object class="org.apache.commons.hivemind.service.impl.SetPropertyValue"/>
  +		  			<create-object class="org.apache.commons.hivemind.service.impl.BuilderPropertyFacet"/>
   		  			<read-attribute property="propertyName" attribute="property"/>
   		  			<read-attribute property="value" attribute="configuration-id" translator="configuration"/>
  -		  			<invoke-parent method="addProperty"/>						
  +		  			<invoke-parent method="addProperty" depth="4"/>						
   					</rules> 
   					
   				</element> 	
  @@ -328,10 +459,10 @@
   			  	</attribute>
   			
   					<rules>
  -		  			<create-object class="org.apache.commons.hivemind.service.impl.SetPropertyValue"/>
  +		  			<create-object class="org.apache.commons.hivemind.service.impl.BuilderPropertyFacet"/>
   		  			<read-attribute property="propertyName" attribute="property"/>
   		  			<read-attribute property="value" attribute="path" translator="resource"/>
  -		  			<invoke-parent method="addProperty"/>						
  +		  			<invoke-parent method="addProperty" depth="4"/>						
   					</rules>  					
   			  	
   		  	</element>
  @@ -340,7 +471,7 @@
   		
   		<create-instance class="org.apache.commons.hivemind.service.impl.BuilderFactory"/>
   	</service-point>
  -	
  +
   
   	
   	<service-point id="ThreadEventNotifier" interface="org.apache.commons.hivemind.service.ThreadEventNotifier">
  
  
  
  1.3       +42 -18    jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/service/impl/BuilderFactory.java
  
  Index: BuilderFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/service/impl/BuilderFactory.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BuilderFactory.java	24 Sep 2003 16:07:53 -0000	1.2
  +++ BuilderFactory.java	3 Oct 2003 20:00:16 -0000	1.3
  @@ -59,6 +59,7 @@
   
   import java.util.List;
   
  +import org.apache.commons.beanutils.ConstructorUtils;
   import org.apache.commons.beanutils.PropertyUtils;
   import org.apache.commons.hivemind.ApplicationRuntimeException;
   import org.apache.commons.hivemind.ClassResolver;
  @@ -74,12 +75,12 @@
    * that can instantiate an object and then configure its properties.
    * 
    * <p>
  - * This service exists to allow the a service to be configured fully
  - * without the service having to implement {@link org.apache.commons.hivemind.Initializable},
  + * This service exists to allow a service to be fully configured without
  + * the implementation having to implement {@link org.apache.commons.hivemind.Initializable},
    * which allows for a more IoC (Inversion of Control) feel.  A service 
    * implements <code>Initializable</code> typically to access
    * its module's messages, or its own extension point id, but BuilderFactory
  - * is capable of providing the service with that information by setting properties.
  + * is capable of providing the service with this information.
    * 
    * <p>
    * Some thought has been given to using bytecode generation to create properties
  @@ -87,6 +88,10 @@
    * undermines the ability to test service implemenations as POJOs, outside the
    * framework of HiveMind.  Implementing <code>Initializiable</code> also makes
    * it difficult to test service implementations properly.
  + * 
  + * <p>
  + * Instead the service is configured by means of the implementation's
  + * constructor and setter methods.
    *
    * @author Howard Lewis Ship
    * @version $Id$
  @@ -113,7 +118,9 @@
               ClassResolver resolver = invokingModule.getClassResolver();
               Class serviceClass = resolver.findClass(parameter.getClassName());
   
  -            result = serviceClass.newInstance();
  +            Object[] constructorParameters = buildConstructorParameters(parameter, invokingModule, point);
  +
  +            result = ConstructorUtils.invokeConstructor(serviceClass, constructorParameters);
           }
           catch (Exception ex)
           {
  @@ -126,29 +133,46 @@
                   ex);
           }
   
  -        String name = parameter.getServiceIdPropertyName();
  +        List properties = parameter.getProperties();
  +        int count = properties.size();
   
  -        if (name != null)
  -            set(result, name, point.getExtensionPointId());
  +        for (int i = 0; i < count; i++)
  +        {
  +            BuilderFacet facet = (BuilderFacet) properties.get(i);
  +            String propertyName = facet.getPropertyName();
   
  -        name = parameter.getLogPropertyName();
  +            // There will be a facet for log, messages and service-id even if no
  +            // property name is specified, so we skip it here.
   
  -        if (name != null)
  -            set(result, name, LogFactory.getLog(point.getExtensionPointId()));
  +            if (propertyName == null)
  +                continue;
   
  -        name = parameter.getMessagesPropertyName();
  +            Object value = facet.getFacetValue(point, invokingModule);
   
  -        if (name != null)
  -            set(result, name, invokingModule.getMessages());
  +            set(result, propertyName, value);
  +        }
   
  -        List properties = parameter.getProperties();
  -        int count = properties.size();
  +        return result;
  +    }
  +
  +    private Object[] buildConstructorParameters(
  +        BuilderParameter parameter,
  +        Module invokingModule,
  +        ServiceExtensionPoint point)
  +    {
  +        List parameters = parameter.getParameters();
  +        int count = parameters.size();
  +
  +        if (count == 0)
  +            return null;
  +
  +        Object[] result = new Object[count];
   
           for (int i = 0; i < count; i++)
           {
  -            SetPropertyValue property = (SetPropertyValue) properties.get(i);
  +            BuilderFacet facet = (BuilderFacet) parameters.get(i);
   
  -            set(result, property.getPropertyName(), property.getValue());
  +            result[i] = facet.getFacetValue(point, invokingModule);
           }
   
           return result;
  
  
  
  1.3       +17 -53    jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/service/impl/BuilderParameter.java
  
  Index: BuilderParameter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/service/impl/BuilderParameter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BuilderParameter.java	24 Sep 2003 16:07:53 -0000	1.2
  +++ BuilderParameter.java	3 Oct 2003 20:00:16 -0000	1.3
  @@ -71,72 +71,36 @@
   {
   	private String _className;
   	private List _properties = new ArrayList();
  -	private String _messagesPropertyName;
  -	private String _serviceIdPropertyName;
  -	private String _logPropertyName;	
  -	
  -	public void addProperty(SetPropertyValue property)
  -	{
  -		_properties.add(property);
  -	}
  -	
  -	public List getProperties()
  -	{
  -		return _properties;
  -	}
  +	private List _parameters = new ArrayList();
   	
       public String getClassName()
       {
           return _className;
       }
   
  -    public void setClassName(String string)
  -    {
  -        _className = string;
  -    }
  -
  -    public String getServiceIdPropertyName()
  -    {
  -        return _serviceIdPropertyName;
  -    }
  -
  -    public String getLogPropertyName()
  -    {
  -        return _logPropertyName;
  -    }
  -
  -    public String getMessagesPropertyName()
  -    {
  -        return _messagesPropertyName;
  -    }
  +	public void addParameter(BuilderFacet facet)
  +	{
  +		_parameters.add(facet);
  +	}
   
  -	/**
  -	 * Sets the name of a property to which the services' extension point id
  -	 * will be set.  
  -	 */
  -    public void setServiceIdPropertyName(String string)
  +    public List getParameters()
       {
  -        _serviceIdPropertyName = string;
  +        return _parameters;
       }
   
  -	/**
  -	 * Sets the name of a property to which a
  -	 * {@link org.apache.commons.logging.Log} instance will be set.
  -	 * The <code>Log</code> is constructed from the extension point id.
  -	 */
  -    public void setLogPropertyName(String string)
  +	public void addProperty(BuilderFacet facet)
  +	{
  +		_properties.add(facet);
  +	}
  +	
  +    public List getProperties()
       {
  -        _logPropertyName = string;
  +        return _properties;
       }
   
  -	/**
  -	 * Sets the name of a property to which  the invoking module's
  -	 * {@link org.apache.commons.hivemind.Messages} instance
  -	 * will be assigned.
  -	 */
  -    public void setMessagesPropertyName(String string)
  +    public void setClassName(String string)
       {
  -        _messagesPropertyName = string;
  +        _className = string;
       }
   
   }
  
  
  
  1.1                  jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/service/impl/BuilderFacet.java
  
  Index: BuilderFacet.java
  ===================================================================
  /*
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.commons.hivemind.service.impl;
  
  import org.apache.commons.hivemind.Module;
  import org.apache.commons.hivemind.ServiceExtensionPoint;
  
  /**
   * Represents one facet of constructing a service implementation instance.
   * A facet is either a property to be set on the constructed instance,
   * or a parameter to the instance class' constructor. Facets are nested
   * properties within {@link org.apache.commons.hivemind.service.impl.BuilderParameter},
   * and are used by {@link org.apache.commons.hivemind.service.impl.BuilderFactory}.
   *
   * @author Howard Lewis Ship
   * @version $Id: BuilderFacet.java,v 1.1 2003/10/03 20:00:16 hlship Exp $
   */
  public abstract class BuilderFacet
  {
      private String _propertyName;
  
      /**
       * Implemented in subclasses to provide a specific value for the facet
       * (for use as a constructor parameter, or as a value to set a property to).
       */
      public abstract Object getFacetValue(ServiceExtensionPoint point, Module invokingModule);
  
      public String getPropertyName()
      {
          return _propertyName;
      }
  
      public void setPropertyName(String string)
      {
          _propertyName = string;
      }
  
  }
  
  
  
  1.1                  jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/service/impl/BuilderLogFacet.java
  
  Index: BuilderLogFacet.java
  ===================================================================
  /*
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.commons.hivemind.service.impl;
  
  import org.apache.commons.hivemind.Module;
  import org.apache.commons.hivemind.ServiceExtensionPoint;
  import org.apache.commons.logging.LogFactory;
  
  /**
   * Facet whose value is the <code>Log</code> instance for the service
   * (which is based on the service id, not the class name).
   *
   * @author Howard Lewis Ship
   * @version $Id: BuilderLogFacet.java,v 1.1 2003/10/03 20:00:16 hlship Exp $
   */
  public class BuilderLogFacet extends BuilderFacet
  {
      public Object getFacetValue(ServiceExtensionPoint point, Module module)
      {
          return LogFactory.getLog(point.getExtensionPointId());
      }
  
  }
  
  
  
  1.1                  jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/service/impl/BuilderMessagesFacet.java
  
  Index: BuilderMessagesFacet.java
  ===================================================================
  /*
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.commons.hivemind.service.impl;
  
  import org.apache.commons.hivemind.Module;
  import org.apache.commons.hivemind.ServiceExtensionPoint;
  
  /**
   * {@link org.apache.commons.hivemind.service.impl.BuilderFacet} whose
   * value is the {@link org.apache.commons.hivemind.Messages}
   * for the module containing the service being constructed.
   *
   * @author Howard Lewis Ship
   * @version $Id: BuilderMessagesFacet.java,v 1.1 2003/10/03 20:00:16 hlship Exp $
   */
  public class BuilderMessagesFacet extends BuilderFacet
  {
  
      public Object getFacetValue(ServiceExtensionPoint point, Module invokingModule)
      {
          return invokingModule.getMessages();
      }
  
  }
  
  
  
  1.1                  jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/service/impl/BuilderServiceIdFacet.java
  
  Index: BuilderServiceIdFacet.java
  ===================================================================
  /*
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.commons.hivemind.service.impl;
  
  import org.apache.commons.hivemind.Module;
  import org.apache.commons.hivemind.ServiceExtensionPoint;
  
  /**
   * {@link org.apache.commons.hivemind.service.impl.BuilderFacet} whose value
   * is the service id of the service being constructed.
   *
   * @author Howard Lewis Ship
   * @version $Id: BuilderServiceIdFacet.java,v 1.1 2003/10/03 20:00:16 hlship Exp $
   */
  public class BuilderServiceIdFacet extends BuilderFacet
  {
  
      public Object getFacetValue(ServiceExtensionPoint point, Module invokingModule)
      {
          return point.getExtensionPointId();
      }
  
  }
  
  
  
  1.1                  jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/service/impl/BuilderPropertyFacet.java
  
  Index: BuilderPropertyFacet.java
  ===================================================================
  /*
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.commons.hivemind.service.impl;
  
  import org.apache.commons.hivemind.Module;
  import org.apache.commons.hivemind.ServiceExtensionPoint;
  
  /**
   * Implementation of {@link org.apache.commons.hivemind.service.impl.BuilderFacet}
   * that stores a value.  This corresponds to the
   * &lt;set&gt; type elements.
   *
   * @author Howard Lewis Ship
   * @version $Id: BuilderPropertyFacet.java,v 1.1 2003/10/03 20:00:16 hlship Exp $
   */
  public class BuilderPropertyFacet extends BuilderFacet
  {
      private Object _value;
  
      public Object getFacetValue(ServiceExtensionPoint point, Module invokingModule)
      {
          return _value;
      }
  
      public void setValue(Object object)
      {
          _value = object;
      }
  
  }
  
  
  
  1.4       +117 -20   jakarta-commons-sandbox/hivemind/framework/xdocs/BuilderFactory.xml
  
  Index: BuilderFactory.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/xdocs/BuilderFactory.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BuilderFactory.xml	29 Sep 2003 16:16:35 -0000	1.3
  +++ BuilderFactory.xml	3 Oct 2003 20:00:16 -0000	1.4
  @@ -30,6 +30,17 @@
       messages-property=". . ."
       service-id-property=". . .">
      
  +    <log/>
  +    <messages/>
  +    <service-id/>
  +    <string>. . .</string>
  +    <boolean>. . .</boolean>
  +    <configuration>. . .</configuration>
  +    <int>. . .</int>
  +    <long>. . .</long>
  +    <resource>. . .</resource>
  +    <service>. . .</service>
  +
       <set property=". . ." value=". . ."/>   
       <set-boolean property=". . ." value=". . ."/> 
       <set-configuration property=". . ." configuration-id=". . ."/>    
  @@ -45,8 +56,9 @@
   </p>
     	
   <p>
  -The attributes of the &lt;construct&gt; element are used to instantiate the class and set basic
  -properties.  Additional &lt;set-...&gt; elements configure specific properties of the implementation.	
  +The attributes of the &lt;construct&gt; element are used to specify the implementation class and
  +set common service properties.  Nested elements supply the constructor parameters and configure
  +other specific properties of the implementation (the &lt;set-...&gt; elements).	
   </p>
   
       </section>
  @@ -55,11 +67,10 @@
   
   <table>
   	<tr>
  -		<th>Element</th>	 <th>Required ?</th> <th>Description</th>
  +		<th>Attribute</th>	 <th>Required ?</th> <th>Description</th>
   	</tr>	
   	<tr>
  -		<td>class</td>	 <td>yes</td> <td>The complete name of the class to instantiate, which must
  -			have a public, no-arguments constructor.</td>
  +		<td>class</td>	 <td>yes</td> <td>The fully qualified name of the class to instantiate.</td>
   	</tr>
   	<tr>
   		<td>log-property</td>	
  @@ -87,11 +98,96 @@
   	
   <p>
   The remaining elements are enclosed by the &lt;construct&gt; element, and are used to
  -configure properties of the constructed service implementation.	
  +supply constructor parameters and configure properties of the constructed service implementation.	
   </p>
   </section>
   
  -<section name="set">
  +<section name="Constructor Parameter Elements">
  +<p>
  +The following table summarizes the elements which can be used to specify constructor parameters
  +for the class to instantiate.  These elements can be mixed freely with the properties configuring
  +elements.  It is important to know that the number, type, and order of the constructor parameter
  +elements determine the constructor that will be used to instantiate the implementation.
  +</p>
  +
  +<table>
  +	<tr>
  +			<th>Element</th> <th>Matched Parameter Type</th> <th>Passed Parameter Value</th>
  +	</tr>	
  +	<tr>
  +		<td>log</td>
  +		<td>org.apache.commons.logging.Log</td>
  +		<td>The Log is created from the complete service id (not the name of the class) of the
  +		created service.
  +		</td>
  +	</tr>
  +	<tr>
  +		<td>messages</td>
  +		<td>org.apache.commons.hivemind.Messages</td>
  +		<td>The <a href="&apiroot;/Messages.html">Messages</a> object of the invoking module.
  +		</td>
  +	</tr>
  +	<tr>
  +		<td>service-id</td>
  +		<td>java.lang.String</td>
  +		<td>The service id of the <i>constructed</i> service.
  +		</td>
  +	</tr>
  +	<tr>
  +		<td>string</td>
  +		<td>java.lang.String</td>
  +		<td>This element's content.
  +		</td>
  +	</tr>
  +	<tr>
  +		<td>boolean</td>
  +		<td>boolean</td>
  +		<td>This element's content.  Must be either "true" or "false".
  +		</td>
  +	</tr>
  +	<tr>
  +		<td>configuration</td>
  +		<td>java.util.List</td>
  +		<td>The List of the elements of the configuration specified by this element's content
  +		as a configuration id.  The id can either by a simple id for a configuration within the
  +		same module as the constructed service, or a complete id.
  +		</td>
  +	</tr>
  +	<tr>
  +		<td>int</td>
  +		<td>int</td>
  +		<td>This element's content parsed as an integer value.
  +		</td>
  +	</tr>
  +	<tr>
  +		<td>long</td>
  +		<td>long</td>
  +		<td>This element's content parsed as a long value.
  +		</td>
  +	</tr>
  +	<tr>
  +		<td>resource</td>
  +		<td>org.apache.commons.hivemind.Resource</td>
  +		<td>This element's content parsed as a path to a
  +		<a href="&apiroot;/Resource.html">Resource</a>, which is relative to the contributing
  +		module's deployment descriptor.  If available, a localized version of the Resource will
  +		be selected.
  +		</td>
  +	</tr>
  +	<tr>
  +		<td>service</td>
  +		<td>interface corresponding to specified service</td>
  +		<td>The implementation of the service with the id given in this element's content.
  +		The id can either be a simple id for a service within the same module as the constructed
  +		service, or a complete id.
  +		</td>
  +	</tr>
  +</table>	
  +
  +</section>
  +
  +<section name="Service Property Configuring Elements">
  +<subsection name="set">
   
   <table>
   	<tr>
  @@ -105,9 +201,9 @@
   	</tr>
   </table>	
   	
  -</section>
  +</subsection>
   
  -<section name="set-boolean">
  +<subsection name="set-boolean">
   
   <table>
   	<tr>
  @@ -121,9 +217,9 @@
   	</tr>
   </table>	
   	
  -</section>
  +</subsection>
   
  -<section name="set-configuration">
  +<subsection name="set-configuration">
   	
   	<table>
   	<tr>
  @@ -140,9 +236,9 @@
   	</tr>
   </table>	
   
  -	</section>
  +	</subsection>
   	
  -<section name="set-int">
  +<subsection name="set-int">
   	
   	<table>
   	<tr>
  @@ -156,9 +252,9 @@
   	</tr>
   </table>	
   
  -</section>
  +</subsection>
   
  -<section name="set-long">
  +<subsection name="set-long">
   
   <table>
   	<tr>
  @@ -172,9 +268,9 @@
   	</tr>
   </table>		
   
  -</section>
  +</subsection>
   
  -<section name="set-resource">
  +<subsection name="set-resource">
   
   <table>
   	<tr>
  @@ -194,9 +290,9 @@
   		</td>
   	</tr>
   </table>		
  -</section>
  +</subsection>
   
  -<section name="set-service">
  +<subsection name="set-service">
   
   <table>
   	<tr>
  @@ -211,6 +307,7 @@
   			The property will be assigned the service.</td>
   	</tr>
   </table>		
  +</subsection>
   </section>
       
     </body>
  
  
  
  1.2       +12 -3     jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/schema/rules/InvokeParentRule.java
  
  Index: InvokeParentRule.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/schema/rules/InvokeParentRule.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InvokeParentRule.java	16 Sep 2003 18:51:24 -0000	1.1
  +++ InvokeParentRule.java	3 Oct 2003 20:00:16 -0000	1.2
  @@ -76,14 +76,15 @@
   public class InvokeParentRule extends BaseRule
   {
       private String _methodName;
  +    private int _depth = 1;
   
       /**
        * Invokes the named method on the parent object (using reflection).
        */
  -    public void end(SchemaProcessor processor, Element element)
  +    public void begin(SchemaProcessor processor, Element element)
       {
           Object child = processor.peek();
  -        Object parent = processor.peek(1);
  +        Object parent = processor.peek(_depth);
   
           try
           {
  @@ -108,6 +109,14 @@
       public void setMethodName(String string)
       {
           _methodName = string;
  +    }
  +
  +	/**
  +	 * Sets the depth of the parent object. The default is 1.
  +	 */
  +    public void setDepth(int i)
  +    {
  +        _depth = i;
       }
   
   }
  
  
  
  1.6       +7 -1      jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/HiveMind.java
  
  Index: HiveMind.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/HiveMind.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- HiveMind.java	1 Oct 2003 20:43:23 -0000	1.5
  +++ HiveMind.java	3 Oct 2003 20:00:16 -0000	1.6
  @@ -84,6 +84,12 @@
           _bundle = ResourceBundle.getBundle(HiveMind.class.getName() + "Messages");
       }
   
  +	/**
  +	 * The full id of the {@link org.apache.commons.hivemind.service.ThreadEventNotifier}
  +	 * service.
  +	 */
  +	public static final String THREAD_EVENT_NOTIFIER_SERVICE = "hivemind.ThreadEventNotifier";
  +
       private HiveMind()
       {
           // Prevent instantiation
  
  
  
  1.7       +5 -1      jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/parse/DescriptorParser.java
  
  Index: DescriptorParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/parse/DescriptorParser.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DescriptorParser.java	1 Oct 2003 20:43:23 -0000	1.6
  +++ DescriptorParser.java	3 Oct 2003 20:00:16 -0000	1.7
  @@ -259,6 +259,7 @@
   
       {
           INVOKE_PARENT_ATTRIBUTES.put("method", Boolean.TRUE);
  +        INVOKE_PARENT_ATTRIBUTES.put("depth", Boolean.FALSE);
       }
   
       private final Map SET_PARENT_ATTRIBUTES = new HashMap();
  @@ -1229,6 +1230,9 @@
               checkAttributes(INVOKE_PARENT_ATTRIBUTES);
   
               rule.setMethodName(getAttribute("method"));
  +            
  +            if (isAttribute("depth"))
  +            	rule.setDepth(getIntAttribute("depth"));
   
               elementModel.addRule(rule);
               return;
  
  
  
  1.5       +4 -4      jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/impl/ThreadedServiceModel.java
  
  Index: ThreadedServiceModel.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/hivemind/framework/src/java/org/apache/commons/hivemind/impl/ThreadedServiceModel.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ThreadedServiceModel.java	2 Oct 2003 18:42:06 -0000	1.4
  +++ ThreadedServiceModel.java	3 Oct 2003 20:00:16 -0000	1.5
  @@ -104,7 +104,7 @@
   
       class CleanupListener implements ThreadCleanupListener
       {
  -    	// The core, wrapped by any interceptors
  +        // The core, wrapped by any interceptors
           private Object _service;
           // The core itself
           private Object _core;
  @@ -117,7 +117,7 @@
   
           public void threadDidCleanup()
           {
  -        	// Orhpan this object
  +            // Orhpan this object
               _notifier.removeThreadCleanupListener(this);
   
               discardActiveService();
  @@ -303,7 +303,7 @@
   
                   _notifier =
                       (ThreadEventNotifier) registry.getService(
  -                        "hivemind.ThreadEventNotifier",
  +                        HiveMind.THREAD_EVENT_NOTIFIER_SERVICE,
                           ThreadEventNotifier.class);
               }
   
  
  
  
  1.1                  jakarta-commons-sandbox/hivemind/framework/src/test/hivemind/test/services/impl/ConstructorAccessImpl.java
  
  Index: ConstructorAccessImpl.java
  ===================================================================
  /*
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package hivemind.test.services.impl;
  
  import java.util.List;
  
  import org.apache.commons.hivemind.Messages;
  import org.apache.commons.logging.Log;
  
  import junit.framework.Assert;
  import junit.framework.AssertionFailedError;
  
  import hivemind.test.services.ConstructorAccess;
  
  /**
   * Used to test constructor parameter passing of
   * {@link org.apache.commons.hivemind.service.impl.BuilderFactory}.
   */
  public class ConstructorAccessImpl implements ConstructorAccess
  {
  
  	private String actualMessage;
  	private String expectedMessage;
  
  	public ConstructorAccessImpl()
  	{
  		actualMessage = "()";
  	}
  
  	public ConstructorAccessImpl(long l)
  	{
  		actualMessage = "(long)";
  	}
  
  	public ConstructorAccessImpl(ConstructorAccess service)
  	{
  		actualMessage = "(ConstructorAccess)";
  	}
  
  	public ConstructorAccessImpl(ConstructorAccess service, String s)
  	{
  		actualMessage = "(ConstructorAccess, String)";
  	}
  
  	public ConstructorAccessImpl(List configurations)
  	{
  		actualMessage = "(List)";
  	}
  
  	public ConstructorAccessImpl(Log log, Messages messages)
  	{
  		actualMessage = "(Log, Messages)";
  	}
  
  	public void setExpectedConstructorMessage(String expectedMessage)
  	{
  		this.expectedMessage = expectedMessage;
  	}
  
  	public void verify() throws AssertionFailedError
  	{
  		Assert.assertEquals(expectedMessage, actualMessage);
  	}
  
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message