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/library/src/documentation/content/xdocs/hivemind-lib ChainFactory.xml
Date Sun, 16 Jan 2005 15:54:05 GMT
hlship      2005/01/16 07:54:05

  Modified:    src/documentation/content/xdocs links.ent site.xml
               library/src/test/org/apache/hivemind/lib/chain
                        TestChainBuilder.java
               .        status.xml
               library/src/java/org/apache/hivemind/lib/chain
                        ChainBuilderImpl.java
               library/src/descriptor/META-INF hivemodule.xml
  Added:       library/src/test/org/apache/hivemind/lib/chain
                        ChainCommand.java ChainFactoryIntegration.xml
               library/src/java/org/apache/hivemind/lib/chain
                        ChainContribution.java ChainFactory.java
               library/src/documentation/content/xdocs/hivemind-lib
                        ChainFactory.xml
  Log:
  Add hivemind.lib.ChainFactory.
  
  Revision  Changes    Path
  1.22      +2 -1      jakarta-hivemind/src/documentation/content/xdocs/links.ent
  
  Index: links.ent
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/src/documentation/content/xdocs/links.ent,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- links.ent	16 Jan 2005 00:40:22 -0000	1.21
  +++ links.ent	16 Jan 2005 15:54:05 -0000	1.22
  @@ -156,4 +156,5 @@
   <!ENTITY hivemind.lib.EJBProxyFactory '<link href="site:hivemind.lib.EJBProxyFactory">hivemind.lib.EJBProxyFactory</link>'>
   <!ENTITY hivemind.lib.NameLookup '<link href="site:hivemind.lib.NameLookup">hivemind.lib.NameLookup</link>'>
   <!ENTITY hivemind.lib.RemoteExceptionCoordinator '<link href="site:hivemind.lib.RemoteExceptionCoordinator">hivemind.lib.RemoteExceptionCoordinator</link>'>
  -<!ENTITY hivemind.lib.ChainBuilder '<link href="site:hivemind.lib.ChainBuilder">hivemind.lib.ChainBuilder</link>'>
  \ No newline at end of file
  +<!ENTITY hivemind.lib.ChainBuilder '<link href="site:hivemind.lib.ChainBuilder">hivemind.lib.ChainBuilder</link>'>
  +<!ENTITY hivemind.lib.ChainFactory '<link href="site:hivemind.lib.ChainFactory">hivemind.lib.ChainFactory</link>'>
  \ No newline at end of file
  
  
  
  1.40      +1 -0      jakarta-hivemind/src/documentation/content/xdocs/site.xml
  
  Index: site.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/src/documentation/content/xdocs/site.xml,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- site.xml	16 Jan 2005 01:01:39 -0000	1.39
  +++ site.xml	16 Jan 2005 15:54:05 -0000	1.40
  @@ -118,6 +118,7 @@
         <hivemind.lib.AdapterRegistryFactory label="AdapterRegistryFactory" href="AdapterRegistryFactory.html"/>
         <hivemind.lib.BeanFactoryBuilder label="BeanFactoryBuilder" href="BeanFactoryBuilder.html"/>
         <hivemind.lib.ChainBuilder label="ChainBuilder" href="ChainBuilder.html"/>
  +      <hivemind.lib.ChainFactory label="ChainFactory" href="ChainFactory.html"/>
         <hivemind.lib.DefaultImplementationBuilder label="DefaultImplementationBuilder"
href="DefaultImplementationBuilder.html"/>
   			<hivemind.lib.EJBProxyFactory label="EJBProxyFactory" href="EJBProxyFactory.html"/>
   			<hivemind.lib.NameLookup label="NameLookup" href="NameLookup.html"/>
  
  
  
  1.2       +26 -12    jakarta-hivemind/library/src/test/org/apache/hivemind/lib/chain/TestChainBuilder.java
  
  Index: TestChainBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/library/src/test/org/apache/hivemind/lib/chain/TestChainBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestChainBuilder.java	16 Jan 2005 00:40:22 -0000	1.1
  +++ TestChainBuilder.java	16 Jan 2005 15:54:05 -0000	1.2
  @@ -28,7 +28,8 @@
   import org.easymock.MockControl;
   
   /**
  - * Tests for {@link org.apache.hivemind.lib.chain.ChainBuilderImpl}.
  + * Tests for {@link org.apache.hivemind.lib.chain.ChainBuilderImpl}and
  + * {@link org.apache.hivemind.lib.chain.ChainFactory}.
    * 
    * @author Howard M. Lewis Ship
    * @since 1.1
  @@ -64,12 +65,8 @@
   
           BodyBuilder builder = new BodyBuilder();
           builder.begin();
  -        builder.addln("java.util.Iterator i = _commands.iterator();");
  -        builder.addln("while (i.hasNext())");
  -        builder.begin();
  -        builder.addln("java.lang.Runnable command = (java.lang.Runnable) i.next();");
  -        builder.addln("command.run($$);");
  -        builder.end();
  +        builder.addln("for (int i = 0; i < _commands.length; i++)");
  +        builder.addln("_commands[i].run($$);");
           builder.end();
   
           cf.addMethod(Modifier.PUBLIC, sig, builder.toString());
  @@ -95,12 +92,9 @@
           BodyBuilder builder = new BodyBuilder();
           builder.begin();
           builder.addln("boolean result = false;");
  -        builder.addln("java.util.Iterator i = _commands.iterator();");
  -        builder.addln("while (i.hasNext())");
  +        builder.addln("for (int i = 0; i < _commands.length; i++)");
           builder.begin();
  -        builder
  -                .addln("org.apache.hivemind.lib.chain.ChainInterface command = (org.apache.hivemind.lib.chain.ChainInterface)
i.next();");
  -        builder.addln("result = command.execute($$);");
  +        builder.addln("result = _commands[i].execute($$);");
           builder.addln("if (result != false) break;");
           builder.end();
           builder.addln("return result;");
  @@ -149,11 +143,22 @@
                   commands,
                   "<Chain>");
   
  +        ChainInterface chain2 = (ChainInterface) cb.buildImplementation(
  +                ChainInterface.class,
  +                commands,
  +                "<Chain2>");
  +
           replayControls();
   
           assertEquals(false, chain.execute("fred"));
           assertEquals("<Chain>", chain.toString());
   
  +        // This checks that implementations are cached, but that toString is unique
  +        // for each instance.
  +
  +        assertEquals("<Chain2>", chain2.toString());
  +        assertSame(chain.getClass(), chain2.getClass());
  +
           verifyControls();
       }
   
  @@ -183,6 +188,15 @@
           assertEquals(true, chain.execute("barney"));
   
           verifyControls();
  +    }
  +
  +    public void testChainFactoryIntegration() throws Exception
  +    {
  +        Registry r = buildFrameworkRegistry("ChainFactoryIntegration.xml");
  +
  +        ChainInterface chain = (ChainInterface) r.getService(ChainInterface.class);
  +
  +        assertEquals(true, chain.execute("whatever"));
       }
   
   }
  
  
  
  1.1                  jakarta-hivemind/library/src/test/org/apache/hivemind/lib/chain/ChainCommand.java
  
  Index: ChainCommand.java
  ===================================================================
  // 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.
  
  package org.apache.hivemind.lib.chain;
  
  /**
   * @author Howard M. Lewis Ship
   * @since 1.1
   */
  public class ChainCommand implements ChainInterface
  {
  
      public boolean execute(String parameter)
      {
          return true;
      }
  
  }
  
  
  1.1                  jakarta-hivemind/library/src/test/org/apache/hivemind/lib/chain/ChainFactoryIntegration.xml
  
  Index: ChainFactoryIntegration.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.lib" version="1.1.0">
    
    <configuration-point id="MyChain" schema-id="hivemind.lib.ChainContribution"/>
    
    <contribution configuration-id="MyChain">
      <command id="solo" object="instance:org.apache.hivemind.lib.chain.ChainCommand"/>
    </contribution>
    
    <service-point id="MyChain" interface="org.apache.hivemind.lib.chain.ChainInterface">
      <invoke-factory service-id="hivemind.lib.ChainFactory">
        <construct configuration-id="MyChain"/>
      </invoke-factory>
    </service-point>
    
  </module>
  
  
  1.93      +3 -0      jakarta-hivemind/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/status.xml,v
  retrieving revision 1.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- status.xml	16 Jan 2005 00:40:22 -0000	1.92
  +++ status.xml	16 Jan 2005 15:54:05 -0000	1.93
  @@ -146,6 +146,9 @@
         <action type="add" dev="HLS">
           Add hivemind.lib.ChainBuilder service, an implementation of Gang Of Four Chain
of Command.
         </action> 
  +      <action type="add" dev="HLS">
  +        Add hivemind.lib.ChainFactory service.
  +      </action>
       </release>
   
      <release version="1.0" date="Sep 22 2004">
  
  
  
  1.2       +59 -25    jakarta-hivemind/library/src/java/org/apache/hivemind/lib/chain/ChainBuilderImpl.java
  
  Index: ChainBuilderImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/library/src/java/org/apache/hivemind/lib/chain/ChainBuilderImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ChainBuilderImpl.java	16 Jan 2005 00:40:22 -0000	1.1
  +++ ChainBuilderImpl.java	16 Jan 2005 15:54:05 -0000	1.2
  @@ -15,8 +15,11 @@
   package org.apache.hivemind.lib.chain;
   
   import java.lang.reflect.Modifier;
  +import java.util.HashMap;
   import java.util.List;
  +import java.util.Map;
   
  +import org.apache.hivemind.ClassResolver;
   import org.apache.hivemind.service.BodyBuilder;
   import org.apache.hivemind.service.ClassFab;
   import org.apache.hivemind.service.ClassFabUtils;
  @@ -27,52 +30,87 @@
   import org.apache.hivemind.util.Defense;
   
   /**
  - * TODO: All implementations for a given interface are identical, so we could (should?)
cache those
  - * implementations.
  + * Gang of Four Chain of Commands Pattern.
    * 
    * @author Howard M. Lewis Ship
    * @since 3.1
    */
   public class ChainBuilderImpl implements ChainBuilder
   {
  +    private ClassResolver _classResolver;
  +
       private ClassFactory _classFactory;
   
  +    /**
  +     * Map, keyed on service interface, of Class.
  +     */
  +
  +    private Map _implementations = new HashMap();
  +
       public Object buildImplementation(Class commandInterface, List commands, String toString)
       {
           Defense.notNull(commandInterface, "commandInterface");
           Defense.notNull(commands, "commands");
           Defense.notNull(toString, "toString");
   
  +        Class instanceClass = findImplementationClass(commandInterface);
  +
  +        return createInstance(instanceClass, commands, toString);
  +    }
  +
  +    private synchronized Class findImplementationClass(Class commandInterface)
  +    {
  +        Class result = (Class) _implementations.get(commandInterface);
  +
  +        if (result == null)
  +        {
  +            result = constructImplementationClass(commandInterface);
  +
  +            _implementations.put(commandInterface, result);
  +        }
  +
  +        return result;
  +    }
  +
  +    private Class constructImplementationClass(Class commandInterface)
  +    {
           String name = ClassFabUtils.generateClassName(commandInterface);
   
           ClassFab cf = _classFactory.newClass(name, Object.class);
   
           addInfrastructure(cf, commandInterface);
   
  -        addMethods(cf, commandInterface, toString);
  +        addMethods(cf, commandInterface);
   
  -        return createInstance(cf, commands, toString);
  +        return cf.createClass();
       }
   
       void addInfrastructure(ClassFab cf, Class commandInterface)
       {
  +        Class array = _classResolver.findClass(commandInterface.getName() + "[]");
  +
           cf.addInterface(commandInterface);
  -        cf.addField("_commands", List.class);
  +        cf.addField("_commands", array);
           cf.addField("_toString", String.class);
   
  +        BodyBuilder builder = new BodyBuilder();
  +
  +        builder.begin();
  +        builder.addln("_commands = ({0}[]) $1.toArray(new {0}[0]);", commandInterface.getName());
  +        builder.addln("_toString = $2;");
  +        builder.end();
  +
           cf.addConstructor(new Class[]
  -        { List.class, String.class }, null, "{ _commands = $1; _toString = $2; }");
  +        { List.class, String.class }, null, builder.toString());
       }
   
  -    private Object createInstance(ClassFab cf, List commands, String toString)
  +    private Object createInstance(Class instanceClass, List commands, String toString)
       {
  -        Class instanceClass = cf.createClass();
  -
           return ConstructorUtils.invokeConstructor(instanceClass, new Object[]
           { commands, toString });
       }
   
  -    void addMethods(ClassFab cf, Class commandInterface, String toString)
  +    void addMethods(ClassFab cf, Class commandInterface)
       {
           MethodIterator mi = new MethodIterator(commandInterface);
   
  @@ -84,7 +122,7 @@
           }
   
           if (!mi.getToString())
  -            addToString(cf, toString);
  +            addToString(cf);
       }
   
       void addMethod(ClassFab cf, Class commandInterface, MethodSignature sig)
  @@ -107,12 +145,10 @@
                           "{0} result = {1};",
                           ClassFabUtils.getJavaClassName(returnType),
                           defaultValue);
  -        builder.addln("java.util.Iterator i = _commands.iterator();");
  -        builder.addln("while (i.hasNext())");
  +        builder.addln("for (int i = 0; i < _commands.length; i++)");
   
           builder.begin();
  -        builder.addln("{0} command = ({0}) i.next();", commandInterface.getName());
  -        builder.addln("result = command.{0}($$);", sig.getName());
  +        builder.addln("result = _commands[i].{0}($$);", sig.getName());
   
           builder.addln("if (result != {0}) break;", defaultValue);
   
  @@ -146,22 +182,15 @@
   
           builder.begin();
   
  -        builder.addln("java.util.Iterator i = _commands.iterator();");
  -        builder.addln("while (i.hasNext())");
  -
  -        builder.begin();
  -
  -        builder.addln("{0} command = ({0}) i.next();", commandInterface.getName());
  -        builder.addln("command.{0}($$);", sig.getName());
  -
  -        builder.end();
  +        builder.addln("for (int i = 0; i < _commands.length; i++)");
  +        builder.addln("_commands[i].{0}($$);", sig.getName());
   
           builder.end();
   
           cf.addMethod(Modifier.PUBLIC, sig, builder.toString());
       }
   
  -    void addToString(ClassFab cf, String toString)
  +    void addToString(ClassFab cf)
       {
           MethodSignature sig = new MethodSignature(String.class, "toString", null, null);
   
  @@ -171,5 +200,10 @@
       public void setClassFactory(ClassFactory classFactory)
       {
           _classFactory = classFactory;
  +    }
  +
  +    public void setClassResolver(ClassResolver classResolver)
  +    {
  +        _classResolver = classResolver;
       }
   }
  
  
  
  1.1                  jakarta-hivemind/library/src/java/org/apache/hivemind/lib/chain/ChainContribution.java
  
  Index: ChainContribution.java
  ===================================================================
  // 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.
  
  package org.apache.hivemind.lib.chain;
  
  /**
   * A contribution used with {@link  org.apache.hivemind.lib.chain.ChainFactory}.
   * 
   * @author Howard M. Lewis Ship
   * @since 1.1
   */
  public class ChainContribution
  {
      private String _id;
  
      private String _before;
  
      private String _after;
  
      private Object _command;
  
      public String getAfter()
      {
          return _after;
      }
  
      public void setAfter(String after)
      {
          _after = after;
      }
  
      public String getBefore()
      {
          return _before;
      }
  
      public void setBefore(String before)
      {
          _before = before;
      }
  
      public Object getCommand()
      {
          return _command;
      }
  
      public void setCommand(Object command)
      {
          _command = command;
      }
  
      public String getId()
      {
          return _id;
      }
  
      public void setId(String id)
      {
          _id = id;
      }
  }
  
  
  1.1                  jakarta-hivemind/library/src/java/org/apache/hivemind/lib/chain/ChainFactory.java
  
  Index: ChainFactory.java
  ===================================================================
  // 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.
  
  package org.apache.hivemind.lib.chain;
  
  import java.util.ArrayList;
  import java.util.Iterator;
  import java.util.List;
  
  import org.apache.hivemind.ServiceImplementationFactory;
  import org.apache.hivemind.ServiceImplementationFactoryParameters;
  import org.apache.hivemind.order.Orderer;
  
  /**
   * Builds a service implementation using {@link org.apache.hivemind.lib.chain.ChainBuilder}.
   * 
   * @author Howard M. Lewis Ship
   * @since 1.1
   */
  public class ChainFactory implements ServiceImplementationFactory
  {
      private ChainBuilder _chainBuilder;
  
      public Object createCoreServiceImplementation(
              ServiceImplementationFactoryParameters factoryParameters)
      {
          List contributions = (List) factoryParameters.getFirstParameter();
  
          Orderer orderer = new Orderer(factoryParameters.getErrorLog(), "command");
  
          Iterator i = contributions.iterator();
          while (i.hasNext())
          {
              ChainContribution cc = (ChainContribution) i.next();
              orderer.add(cc, cc.getId(), cc.getAfter(), cc.getBefore());
          }
  
          List ordered = orderer.getOrderedObjects();
  
          List commands = new ArrayList(ordered.size());
  
          i = ordered.iterator();
          while (i.hasNext())
          {
              ChainContribution cc = (ChainContribution) i.next();
  
              // TODO: Validate that command for each ChainContribution implements the
              // service interface.
  
              commands.add(cc.getCommand());
          }
  
          String toString = "<ChainImplementation for " + factoryParameters.getServiceId()
+ "("
                  + factoryParameters.getServiceInterface().getName() + ")>";
  
          return _chainBuilder.buildImplementation(
                  factoryParameters.getServiceInterface(),
                  commands,
                  toString);
      }
  
      public void setChainBuilder(ChainBuilder chainBuilder)
      {
          _chainBuilder = chainBuilder;
      }
  }
  
  
  1.21      +52 -0     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.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- hivemodule.xml	16 Jan 2005 00:40:22 -0000	1.20
  +++ hivemodule.xml	16 Jan 2005 15:54:05 -0000	1.21
  @@ -389,4 +389,56 @@
       
     </service-point>
     
  +  <schema id="ChainContribution">
  +    
  +    Contribution used to set up a chain of commands for use with ChainFactory.
  +    
  +    <element name="command">
  +      <attribute name="id" unique="true" required="true" translator="qualified-id">
  +        An id for the command, which is used when ordering the commands.
  +      </attribute>
  +      <attribute name="before" translator="id-list">
  +        List of command ids which should be processed after this command.
  +      </attribute>
  +      <attribute name="after" translator="id-list">
  +        List of command ids which should be processed before this command.
  +      </attribute>
  +      <attribute name="object" translator="object" required="true">
  +        The object implementing the command interface.
  +      </attribute>
  +      
  +      <conversion class="org.apache.hivemind.lib.chain.ChainContribution">
  +        <map attribute="object" property="command"/>
  +      </conversion>
  +    </element>
  +    
  +  </schema>
  +  
  +  <service-point id="ChainFactory" interface="org.apache.hivemind.ServiceImplementationFactory">
  +    
  +    Service implementation factory that produces a chain of command based on a 
  +    configuration point that conforms tothe hivemind.lib.ChainContribution schema.
  +    
  +    <invoke-factory>
  +      <construct class="org.apache.hivemind.lib.chain.ChainFactory">
  +        <set-service property="chainBuilder" service-id="ChainBuilder"/>
  +      </construct>
  +    </invoke-factory>
  +    
  +    <parameters-schema>
  +      <element name="construct">
  +        <attribute name="configuration-id" required="true" translator="configuration">
  +          The configuration (conforming to the ChainContribution schema).
  +        </attribute>
  +    
  +        <rules>
  +          <push-attribute attribute="configuration-id"/>
  +          <invoke-parent method="addElement"/>
  +        </rules>
  +        
  +      </element>
  +    </parameters-schema>
  +    
  +  </service-point>
  +  
   </module>
  
  
  
  1.1                  jakarta-hivemind/library/src/documentation/content/xdocs/hivemind-lib/ChainFactory.xml
  
  Index: ChainFactory.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.
  -->
  
  <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.3//EN" 
    "http://xml.apache.org/forrest/dtd/document-v13.dtd" [
    <!ENTITY projectroot '../'>
    <!ENTITY % common-links SYSTEM "../links.ent">
    %common-links;
    ]>
  <document>
    <header>
      <title>hivemind.lib.ChainFactory Service</title>
    </header>
    <body>
      <p>The <link href="&hivedoc;/service/hivemind.lib.ChainFactory.html">ChainFactory</link>
service implementation 
        factory is based on &hivemind.lib.ChainBuilder;. The chain's command interface
is the service interface, and the 
        service parameters identify the configuration that identifies the chain of commands.
</p>
      <section>
        <title>Usage</title>
        <p> The factory expects a single parameter element: </p>
        <source><![CDATA[
  <construct configuration-id="..."/>      
        ]]></source>
        <p>The configuration-id identifies a configuration that implements the <link

          href="&hivedoc;/schema/hivemind.lib.ChainContribution.html">hivemind.lib.ChainContribution</link>
schema. </p>
      </section>
      <section>
        <title>Configuration</title>
        <p> The configuration identifies the command objects that form the chain, including
the order of the commands: 
          </p>
        <source> <![CDATA[
  <command id="..." before="..." after="..." object="..."/>
  ]]> </source>
        <p> Each command has an id (which is qualified with the module id) and may specify
a list of commands which 
          precede or follow it. </p>
        <p> The object is specified as an &object-reference;. </p>
      </section>
    </body>
  </document>
  
  

---------------------------------------------------------------------
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