hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject cvs commit: jakarta-hivemind/src/documentation/content/xdocs descriptor.xml
Date Thu, 31 Mar 2005 00:24:20 GMT
hlship      2005/03/30 16:24:20

  Modified:    framework/src/test/hivemind/test/parse
                        TestDescriptorParser.java
               examples/src/documentation/content/xdocs/hivemind-examples
                        calc.xml
               framework/src/descriptor/META-INF hivemodule.xml
               .        status.xml
               framework/src/java/org/apache/hivemind/parse
                        DescriptorParser.java DescriptorParser.properties
               examples/src/descriptor/META-INF examples.xml
               library/src/descriptor/META-INF hivemodule.xml
               src/documentation/content/xdocs descriptor.xml
  Added:       framework/src/test/hivemind/test/parse NoInterface.xml
  Log:
  Make the interface attribute of <service-point> optional, and default to the service
point's id.
  
  Revision  Changes    Path
  1.33      +13 -2     jakarta-hivemind/framework/src/test/hivemind/test/parse/TestDescriptorParser.java
  
  Index: TestDescriptorParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/test/hivemind/test/parse/TestDescriptorParser.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- TestDescriptorParser.java	28 Feb 2005 12:35:43 -0000	1.32
  +++ TestDescriptorParser.java	31 Mar 2005 00:24:20 -0000	1.33
  @@ -190,8 +190,8 @@
           InterceptorDescriptor id = (InterceptorDescriptor) l.get(0);
           assertEquals("MyInterceptor", id.getFactoryServiceId());
           assertEquals("OtherInterceptor", id.getBefore());
  -        assertEquals( "MyInterceptorName", id.getName() );
  -        
  +        assertEquals("MyInterceptorName", id.getName());
  +
           id = (InterceptorDescriptor) l.get(1);
           assertEquals("OtherInterceptor", id.getFactoryServiceId());
           assertEquals("MyInterceptorName", id.getAfter());
  @@ -610,4 +610,15 @@
   
           assertEquals("my.package.MyServiceInterface", spd.getInterfaceClassName());
       }
  +
  +    /** @since 1.1 */
  +
  +    public void testNoInterface() throws Exception
  +    {
  +        ModuleDescriptor md = parse("NoInterface.xml");
  +
  +        ServicePointDescriptor spd = (ServicePointDescriptor) md.getServicePoints().get(0);
  +
  +        assertEquals("hivemind.test.NoInterface", spd.getInterfaceClassName());
  +    }
   }
  \ No newline at end of file
  
  
  
  1.1                  jakarta-hivemind/framework/src/test/hivemind/test/parse/NoInterface.xml
  
  Index: NoInterface.xml
  ===================================================================
  <?xml version="1.0"?>
  <!-- 
     Copyright 2005 The Apache Software Foundation
  
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
  
         http://www.apache.org/licenses/LICENSE-2.0
  
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
  -->
  
  <module id="hivemind.test" version="1.1.0">
    
    <service-point id="NoInterface"/>
    
  </module>
  
  
  1.9       +12 -7     jakarta-hivemind/examples/src/documentation/content/xdocs/hivemind-examples/calc.xml
  
  Index: calc.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/examples/src/documentation/content/xdocs/hivemind-examples/calc.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- calc.xml	10 Feb 2005 01:04:33 -0000	1.8
  +++ calc.xml	31 Mar 2005 00:24:20 -0000	1.9
  @@ -102,23 +102,23 @@
   <source><![CDATA[
   <?xml version="1.0"?>
   <module id="examples" version="1.0.0" package="org.apache.hivemind.examples">
  -    <service-point id="Adder" interface="Adder">
  +    <service-point id="Adder">
           <create-instance class="impl.AdderImpl"/>
           <interceptor service-id="hivemind.LoggingInterceptor"/>
       </service-point>
  -    <service-point id="Subtracter" interface="Subtracter">
  +    <service-point id="Subtracter">
           <create-instance class="impl.SubtracterImpl"/>
           <interceptor service-id="hivemind.LoggingInterceptor"/>
       </service-point>
  -    <service-point id="Multiplier" interface="Multiplier">
  +    <service-point id="Multiplier">
           <create-instance class="impl.MultiplierImpl"/>
           <interceptor service-id="hivemind.LoggingInterceptor"/>
       </service-point>
  -    <service-point id="Divider" interface="Divider">
  +    <service-point id="Divider">
           <create-instance class="impl.DividerImpl"/>
           <interceptor service-id="hivemind.LoggingInterceptor"/>
       </service-point>
  -    <service-point id="Calculator" interface="Calculator">
  +    <service-point id="Calculator">
           <invoke-factory>
               <!-- Most properties are autowired by the BuilderFactory -->
               <construct class="impl.CalculatorImpl"/>
  @@ -138,9 +138,14 @@
   </p>    
   
   <p>
  -This module descriptor also demonstrates a new feature of HiveMind 1.1:  A package name
is provided
  -in the &module; element, allowing class names to be abbreviated when referenced elsewhere
in the descriptor.
  +This module descriptor also demonstrates two new feature of HiveMind 1.1:
   </p>
   
  +<ul>
  +<li>A package name is provided
  +in the &module; element, allowing class names to be abbreviated when referenced elsewhere
in the descriptor.</li>
  +<li>The interface attribute of &service-point; is omitted, because it defaults
to the service point id.</li>
  +</ul>
  +
     </body>
   </document>
  
  
  
  1.27      +1 -1      jakarta-hivemind/framework/src/descriptor/META-INF/hivemodule.xml
  
  Index: hivemodule.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/descriptor/META-INF/hivemodule.xml,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- hivemodule.xml	19 Feb 2005 17:57:40 -0000	1.26
  +++ hivemodule.xml	31 Mar 2005 00:24:20 -0000	1.27
  @@ -555,7 +555,7 @@
       <translator name="object" service-id="ObjectTranslator"/>
     </contribution>
     
  -  <service-point id="ShutdownCoordinator" interface="ShutdownCoordinator">
  +  <service-point id="ShutdownCoordinator">
       
       A source of event notifications for when the Registry is shutdown.
         
  
  
  
  1.116     +1 -0      jakarta-hivemind/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/status.xml,v
  retrieving revision 1.115
  retrieving revision 1.116
  diff -u -r1.115 -r1.116
  --- status.xml	30 Mar 2005 15:19:32 -0000	1.115
  +++ status.xml	31 Mar 2005 00:24:20 -0000	1.116
  @@ -34,6 +34,7 @@
         <action type="fix" dev="JC" fixes-bug="HIVEMIND-102" >Multiple interceptors
with different names for the same interceptor factory id were treated as duplicates.</action>
         <action type="fix" dev="JC" fixes-bug="HIVEMIND-103" >Core service implementations
which implement RegistryShutdownListener are not notified for primitive and singleton service
models.</action>
         <action type="update" dev="HLS"> Rename AdapterRegistry to StrategyRegistry,
and AdapterRegistryFactory to StrategyFactory, to better reflect the relationship to the Gang-of-Four
Strategy pattern.</action>
  +      <action type="update" dev="HLS"> Make the interface attribute of &lt;service-point&gt;
optional, and default the service point's id. </action>
       </release>
       <release version="1.1-alpha-3" date="Mar 22 2005">
         <action type="fix" dev="JC" fixes-bug="HIVEMIND-96" >Interceptors can now be
ordered by name rather than interceptor factory id.</action>
  
  
  
  1.50      +13 -3     jakarta-hivemind/framework/src/java/org/apache/hivemind/parse/DescriptorParser.java
  
  Index: DescriptorParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/parse/DescriptorParser.java,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- DescriptorParser.java	28 Feb 2005 12:36:54 -0000	1.49
  +++ DescriptorParser.java	31 Mar 2005 00:24:20 -0000	1.50
  @@ -935,7 +935,7 @@
   
           id.setBefore(getAttribute("before"));
           id.setAfter(getAttribute("after"));
  -        id.setName(getAttribute("name" ));
  +        id.setName(getAttribute("name"));
           sd.addInterceptor(id);
   
       }
  @@ -1047,11 +1047,21 @@
   
           checkAttributes();
   
  -        spd.setId(getValidatedAttribute("id", ID_PATTERN, "id-format"));
  +        String id = getValidatedAttribute("id", ID_PATTERN, "id-format");
  +
  +        // Get the interface name, and default it to the service id if omitted.
  +
  +        String interfaceAttribute = getAttribute("interface", id);
  +
  +        // Qualify the interface name with the defined package name (which will
  +        // often implicitly or explicitly match the module id).
   
           String interfaceName = IdUtils.qualify(
                   _moduleDescriptor.getPackageName(),
  -                getAttribute("interface"));
  +                interfaceAttribute);
  +
  +        spd.setId(id);
  +
           spd.setInterfaceClassName(interfaceName);
   
           spd.setParametersSchemaId(getAttribute("parameters-schema-id"));
  
  
  
  1.20      +1 -1      jakarta-hivemind/framework/src/java/org/apache/hivemind/parse/DescriptorParser.properties
  
  Index: DescriptorParser.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/parse/DescriptorParser.properties,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- DescriptorParser.properties	28 Feb 2005 12:36:54 -0000	1.19
  +++ DescriptorParser.properties	31 Mar 2005 00:24:20 -0000	1.20
  @@ -25,7 +25,7 @@
   required.configuration-point.visibility=false
   
   required.service-point.id=true
  -required.service-point.interface=true
  +required.service-point.interface=false
   required.service-point.parameters-schema-id=false
   required.service-point.parameters-occurs=false
   required.service-point.visibility=false
  
  
  
  1.8       +5 -5      jakarta-hivemind/examples/src/descriptor/META-INF/examples.xml
  
  Index: examples.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/examples/src/descriptor/META-INF/examples.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- examples.xml	10 Feb 2005 01:04:33 -0000	1.7
  +++ examples.xml	31 Mar 2005 00:24:20 -0000	1.8
  @@ -16,23 +16,23 @@
   -->
   
   <module id="examples" version="1.0.0" package="org.apache.hivemind.examples">
  -    <service-point id="Adder" interface="Adder">
  +    <service-point id="Adder">
           <create-instance class="impl.AdderImpl"/>
           <interceptor service-id="hivemind.LoggingInterceptor"/>
       </service-point>
  -    <service-point id="Subtracter" interface="Subtracter">
  +    <service-point id="Subtracter">
           <create-instance class="impl.SubtracterImpl"/>
           <interceptor service-id="hivemind.LoggingInterceptor"/>
       </service-point>
  -    <service-point id="Multiplier" interface="Multiplier">
  +    <service-point id="Multiplier">
           <create-instance class="impl.MultiplierImpl"/>
           <interceptor service-id="hivemind.LoggingInterceptor"/>
       </service-point>
  -    <service-point id="Divider" interface="Divider">
  +    <service-point id="Divider">
           <create-instance class="impl.DividerImpl"/>
           <interceptor service-id="hivemind.LoggingInterceptor"/>
       </service-point>
  -    <service-point id="Calculator" interface="Calculator">
  +    <service-point id="Calculator">
           <invoke-factory>
             
               <!-- Most properties are autowired by the BuilderFactory -->
  
  
  
  1.25      +3 -3      jakarta-hivemind/library/src/descriptor/META-INF/hivemodule.xml
  
  Index: hivemodule.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/library/src/descriptor/META-INF/hivemodule.xml,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- hivemodule.xml	30 Mar 2005 15:19:32 -0000	1.24
  +++ hivemodule.xml	31 Mar 2005 00:24:20 -0000	1.25
  @@ -19,14 +19,14 @@
     
     Standard library for HiveMind, providing commonly used services.
       
  -  <service-point id="RemoteExceptionCoordinator" interface="RemoteExceptionCoordinator">
  +  <service-point id="RemoteExceptionCoordinator">
       
       Used to coordinate propogation of remote exceptions (typically, to allow cached remote
data to be discarded after a remote exception).
         
       <create-instance class="impl.RemoteExceptionCoordinatorImpl" model="primitive"/>
     </service-point>
       
  -  <service-point id="NameLookup" interface="NameLookup">
  +  <service-point id="NameLookup">
       
       A service which can perform name lookups of objects using JNDI.
       <invoke-factory>
  @@ -193,7 +193,7 @@
       <provider prefix="bean" service-id="BeanFactoryObjectProvider"/>
     </contribution>
     
  -  <service-point id="DefaultImplementationBuilder" interface="DefaultImplementationBuilder">
  +  <service-point id="DefaultImplementationBuilder">
       
       A service which can create a default implementation of an arbitrary interface. The
instance returned does nothing. 
       Returned instances are cached and re-used.
  
  
  
  1.24      +3 -2      jakarta-hivemind/src/documentation/content/xdocs/descriptor.xml
  
  Index: descriptor.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/src/documentation/content/xdocs/descriptor.xml,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- descriptor.xml	28 Feb 2005 12:37:54 -0000	1.23
  +++ descriptor.xml	31 Mar 2005 00:24:20 -0000	1.24
  @@ -583,10 +583,11 @@
   				<tr>
   					<td>interface</td>
   					<td>class name</td>
  -					<td>yes</td>
  +					<td>no</td>
   					<td>The name of the Java interface 
               (<link href="services.html#Bean+Services">or class</link>) supplied
by this
  -						service extension point.</td>
  +						service extension point.  If no value is provided, the interface defaults to the
  +            service id (and will then be qualified by the module's package).</td>
   				</tr>
           <tr>
             <td>visibility</td>
  
  
  

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


Mime
View raw message