avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcconn...@apache.org
Subject cvs commit: avalon-cornerstone/threads/tutorial/src/java/org/apache/avalon/cornerstone/threads/tutorial ThreadConsumer.java
Date Mon, 05 May 2003 20:50:28 GMT
mcconnell    2003/05/05 13:50:28

  Modified:    .        project.xml
               site/xdocs/components threads.xml
               site/xdocs/examples index.xml navigation.xml
               threads/tutorial/src/java/org/apache/avalon/cornerstone/threads/tutorial
                        ThreadConsumer.java
  Added:       site/xdocs/examples/merlin index.xml navigation.xml
                        threads.xml
  Log:
  Refactoring/improving the approach to the presentation of examples.
  
  Revision  Changes    Path
  1.2       +23 -15    avalon-cornerstone/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/avalon-cornerstone/project.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- project.xml	4 May 2003 12:19:48 -0000	1.1
  +++ project.xml	5 May 2003 20:50:27 -0000	1.2
  @@ -47,14 +47,14 @@
   
     <developers>
       <developer>
  -      <name>Stephen McConnell</name>
  -      <id>mcconnell</id>
  -      <email>mcconnell@apache.org</email>
  +      <name>Peter Donald</name>
  +      <email>donaldp@apache.org</email>
  +      <id>donaldp</id>
       </developer>
       <developer>
  -      <name>Leo Simons</name>
  -      <id>leosimons</id>
  -      <email>leosimons@apache.org</email>
  +      <name>Paul Hammant</name>
  +      <email>hammant@apache.org</email>
  +      <id>hammant</id>
       </developer>
       <developer>
         <name>Berin Loritsch</name>
  @@ -62,21 +62,29 @@
         <email>bloritsch@apache.org</email>
       </developer>
       <developer>
  -      <name>Jeff Turner</name>
  -      <id>jefft</id>
  -      <email>jefft@apache.org</email>
  +      <name>Stephen McConnell</name>
  +      <id>mcconnell</id>
  +      <email>mcconnell@apache.org</email>
       </developer>
       <developer>
  -      <name>Peter Donald</name>
  -      <email>donaldp@apache.org</email>
  -      <id>donaldp</id>
  +      <name>Leo Simons</name>
  +      <id>leosimons</id>
  +      <email>leosimons@apache.org</email>
       </developer>
       <developer>
  -      <name>Paul Hammant</name>
  -      <email>hammant@apache.org</email>
  -      <id>hammant</id>
  +      <name>Jeff Turner</name>
  +      <id>jefft</id>
  +      <email>jefft@apache.org</email>
       </developer>
     </developers>
  +
  +  <contributors>
  +    <contributor>
  +      <name>Mauro Talevi</name>
  +      <email>mauro.talevi@aquilonia.org</email>
  +      <role>Build process validation and input to Maven related questions.</role>
  +    </contributor>
  +  </contributors>
   
     <build>
   
  
  
  
  1.4       +5 -92     avalon-cornerstone/site/xdocs/components/threads.xml
  
  Index: threads.xml
  ===================================================================
  RCS file: /home/cvs/avalon-cornerstone/site/xdocs/components/threads.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- threads.xml	5 May 2003 19:03:11 -0000	1.3
  +++ threads.xml	5 May 2003 20:50:27 -0000	1.4
  @@ -51,108 +51,21 @@
             </tr>
           </table>
         </subsection>
  -      <subsection name="Example">
  +      <subsection name="Examples">
           <table>
  -          <tr><th>Source</th><th>Description</th></tr>
  +          <tr><th>Container</th><th>Description</th></tr>
             <tr>
  -            <td><a href="http://cvs.apache.org/viewcvs.cgi/avalon-cornerstone/threads/tutorial/src/java/org/apache/avalon/cornerstone/threads/tutorial/ThreadConsumer.java">ThreadConsumer.java</a>
  -            </td>
  +            <td><a href="../examples/merlin/threads.html">Merlin</a></td>
               <td>
                 A demonstration component implementation demonstrates the resolution
                 of a ThreadManager and subsequent access to a ThreadPoll against 
                 which a Runnable object is launched.  Termination of the container 
  -              before this time will trigger disposal of the compoennt causing the 
  +              before this time will trigger disposal of the component causing the 
                 interuption of the subsidiary thread.
               </td>
             </tr>
  -          <tr>
  -            <td>
  -              <a href="http://cvs.apache.org/viewcvs.cgi/avalon-cornerstone/threads/tutorial/src/java/org/apache/avalon/cornerstone/threads/tutorial/Counter.java">Counter.java</a>
  -            </td>
  -            <td>
  -              The runnable object that simply iniates a countdown and will normally 
  -              complete and teminate within 10 seconds.  Used by the ThreadConsumer
  -              component to establish a threaded activity.
  -            </td>
  -          </tr>
  -          <tr>
  -            <td>
  -              <a href="http://cvs.apache.org/viewcvs.cgi/*checkout*/avalon-cornerstone/threads/tutorial/src/conf/BLOCK-INF/block.xml">block.xml</a>
  -            </td>
  -            <td>
  -              Merlin deployment directive.
  -<source><![CDATA[
  -<block>
  -
  -   <info>
  -     <name>threads-tutorial</name>
  -   </info>
  -
  -   <implementation>
  -
  -     <categories priority="INFO"/>
  -
  -     <engine>
  -       <classpath>
  -         <repository>
  -           <resource id="cornerstone:cornerstone-threads-api" version="1.0"/>
  -           <resource id="excalibur:excalibur-thread" version="1.1.1"/>
  -           <resource id="excalibur:excalibur-event" version="2.0"/>
  -         </repository>
  -       </classpath>
  -     </engine>
  -
  -     <include id="cornerstone:cornerstone-threads-impl" version="1.0"/>
  -
  -     <component name="test" 
  -        class="org.apache.avalon.cornerstone.threads.tutorial.ThreadConsumer" 
  -        activation="true"/>
  -
  -   </implementation>
  -
  -</block>
  -
  -]]></source>
  -            </td>
  -          </tr>
           </table>
  -      </subsection>
  -      <subsection name="Runtime">
  -<p>
  -To execute this demonstation please make sure that you copy the cornerstone-threads-* jar
files from your Maven repository to you <a href="http://avalon.apache.org/sandbox/merlin/">Merlin</a>
repository.
  -</p>
  -<source><![CDATA[
  -$ cd avalon-cornerstone\threads\tutorial
  -$ merlin target\cornerstone-threads-tutorial-1.0.jar
  -
  -[INFO   ] (sys): initialization: localhost
  -[INFO   ] (sys): commencing block assembly phase
  -[INFO   ] (test): aquiring cornerstone threads service
  -[INFO   ] (threads): container initialization: threads
  -[INFO   ] (test): initialization
  -[INFO   ] (sys): Block hierarchy established.
  -[INFO   ] (test.counter): count: 10
  -[INFO   ] (test.counter): count: 9
  -[INFO   ] (test.counter): count: 8
  -[INFO   ] (test.counter): count: 7
  -]]></source>
  -<p>
  -Interrupting the container (using ^C) will trigger component disposal
  -which in turn will trigger early termination of the thread established
  -using the cornerstone thread manager.
  -</p>
  -<source><![CDATA[
  -[INFO   ] (sys): commencing decommissioning phase
  -[INFO   ] (test): disposal
  -[INFO   ] (test): disposal invoked while child thread active
  -[INFO   ] (test): waiting for child
  -[INFO   ] (test.counter): I've been interrupted.
  -[INFO   ] (test.counter): Time to die.
  -[INFO   ] (test): disposal complete
  -[INFO   ] (sys): bye
  -]]></source>
  -      </subsection>
  -      
  +      </subsection>      
       </section>
   
     </body>
  
  
  
  1.2       +29 -4     avalon-cornerstone/site/xdocs/examples/index.xml
  
  Index: index.xml
  ===================================================================
  RCS file: /home/cvs/avalon-cornerstone/site/xdocs/examples/index.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- index.xml	4 May 2003 12:19:49 -0000	1.1
  +++ index.xml	5 May 2003 20:50:27 -0000	1.2
  @@ -9,12 +9,37 @@
   
     <body>
       <section name="Cornerstone - Examples">
  -      <subsection name="Index">
  -        <p>PLACEHOLDER</p>
  +      <subsection name="Containers">
  +        <p>
  +        Component management is intrinsically linked with the containment 
  +        environment with which a component is deployed.  A container provides
  +        functions covering the establishment of a component, subsequent 
  +        deployment and component decommissioning. At this time there are three
  +        production quality containers with Avalon.  These include  
  +        <a href="http://avalon.apache.org/excalibur/fortress">Fortress</a>,

  +        <a href="http://avalon.apache.org/phoenix">Phoenix</a>, and the 
  +        <a href="http://avalon.apache.org/sandbox/merlin">
  +        Merlin Service Management Platform</a>.  The following links provide
  +        examples of the deployment of cornerstone components across one or 
  +        more of the these respective containers.
  +        </p>
  +      </subsection>
  +      <subsection name="Tutorials">
  +        <table>
  +          <tr><th>Container</th><th>Tutorial Overview</th></tr>
  +          <tr><td><a href="merlin/index.html">Merlin</a></td>
  +            <td>
  +              A set of tutorials using the 
  +              <a href="http://avalon.apache.org/sandbox/merlin">
  +              Merlin Service Management Platform</a>. Currently the tutorials 
  +              address the Thread component.  Tutorials will be expanded to 
  +              include all cornerstone candidate-release components as part of
  +              the overall cornerstone release process.
  +            </td>
  +          </tr>
  +        </table>
         </subsection>
       </section>
     </body>
   
   </document>
  -
  -
  
  
  
  1.2       +3 -1      avalon-cornerstone/site/xdocs/examples/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  RCS file: /home/cvs/avalon-cornerstone/site/xdocs/examples/navigation.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- navigation.xml	4 May 2003 12:19:49 -0000	1.1
  +++ navigation.xml	5 May 2003 20:50:27 -0000	1.2
  @@ -16,7 +16,9 @@
       <menu name="About Cornerstone">
         <item name="Overview" href="/index.html"/>
         <item name="Components" href="/components/index.html"/>
  -      <item name="Examples" href="/examples/index.html"/>
  +      <item name="Examples" href="/examples/index.html">
  +        <item name="Merlin" href="/examples/merlin/index.html"/>
  +      </item>
         <item name="Developer Info" href="/notes/index.html"/>
       </menu>
   
  
  
  
  1.1                  avalon-cornerstone/site/xdocs/examples/merlin/index.xml
  
  Index: index.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <document>
  
    <properties>
      <author email="mcconnell@apache.org">Stephen McConnell</author>
      <title>Cornerstone Thread Manager</title>
    </properties>
  
    <body>
      <section name="Merlin Examples of Cornerstone Components">
      <subsection name="Index">
        <table>
          <tr><th>Component</th><th>Description</th></tr>
          <tr><td><a href="threads.html">Threads</a></td>
            <td>
              <p>
              This tutorial demonstrates the creation of a component that 
              uses the cornerstone thread pool, establishes a work thread
              and demonstrates some of the features of the underlying 
              Excalibur Thread Pool.
              </p>
            </td>
          </tr>
        </table>
      </subsection>
      </section>
    </body>
  
  </document>
  
  
  
  1.1                  avalon-cornerstone/site/xdocs/examples/merlin/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <project>
  
   <title>Cornerstone Threads</title>
  
   <body>
  
      <links>
        <item name="Home" href="http://avalon.apache.org/"/>
        <item name="Framework" href="http://avalon.apache.org/framework/"/>
        <item name="Components" href="http://avalon.apache.org/components"/>
        <item name="Containers" href="http://avalon.apache.org/containers/"/>
        <item name="Sandbox" href="http://avalon.apache.org/sandbox/"/>
      </links>
  
      <menu name="About Cornerstone">
        <item name="Overview" href="/index.html"/>
        <item name="Components" href="/components/index.html"/>
        <item name="Examples" href="/examples/index.html">
          <item name="Merlin" href="/examples/merlin/index.html">
            <item name="Threads" href="/examples/merlin/threads.html"/>
          </item>
        </item>
        <item name="Developer Info" href="/notes/index.html"/>
      </menu>
  
   </body>
  
  </project>
  
  
  
  1.1                  avalon-cornerstone/site/xdocs/examples/merlin/threads.xml
  
  Index: threads.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <document>
  
    <properties>
      <author email="mcconnell@apache.org">Stephen McConnell</author>
      <title>Cornerstone Scheduler</title>
    </properties>
  
    <body>
      <section name="Cornerstone Components - Threads">
        <subsection name="Example">
          <table>
            <tr><th>Source</th><th>Description</th></tr>
            <tr>
              <td><a href="http://cvs.apache.org/viewcvs.cgi/avalon-cornerstone/threads/tutorial/src/java/org/apache/avalon/cornerstone/threads/tutorial/ThreadConsumer.java">ThreadConsumer.java</a>
              </td>
              <td>
                A demonstration component implementation demonstrates the resolution
                of a ThreadManager and subsequent access to a ThreadPoll against 
                which a Runnable object is launched.  Termination of the container 
                before this time will trigger disposal of the component causing the 
                interruption of the subsidiary thread.
              </td>
            </tr>
            <tr>
              <td>
                <a href="http://cvs.apache.org/viewcvs.cgi/avalon-cornerstone/threads/tutorial/src/java/org/apache/avalon/cornerstone/threads/tutorial/Counter.java">Counter.java</a>
              </td>
              <td>
                The runnable object that simply initiates a countdown and will normally 
                complete and terminate within 10 seconds.  Used by the ThreadConsumer
                component to establish a threaded activity.
              </td>
            </tr>
            <tr>
              <td>
                <a href="http://cvs.apache.org/viewcvs.cgi/*checkout*/avalon-cornerstone/threads/tutorial/src/conf/BLOCK-INF/block.xml">block.xml</a>
              </td>
              <td>
                Merlin deployment directive.
  <source><![CDATA[
  <block>
  
     <info>
       <name>threads-tutorial</name>
     </info>
  
     <implementation>
  
       <categories priority="INFO"/>
  
       <engine>
         <classpath>
           <repository>
             <resource id="cornerstone:cornerstone-threads-api" version="1.0"/>
             <resource id="excalibur:excalibur-thread" version="1.1.1"/>
             <resource id="excalibur:excalibur-event" version="2.0"/>
           </repository>
         </classpath>
       </engine>
  
       <include id="cornerstone:cornerstone-threads-impl" version="1.0"/>
  
       <component name="test" 
          class="org.apache.avalon.cornerstone.threads.tutorial.ThreadConsumer" 
          activation="true"/>
  
     </implementation>
  
  </block>
  
  ]]></source>
              </td>
            </tr>
          </table>
        </subsection>
        <subsection name="Runtime">
  <p>
  To execute this demonstration please make sure that you copy the cornerstone-threads-* jar
files from your Maven repository to you <a href="http://avalon.apache.org/sandbox/merlin/">Merlin</a>
repository.
  </p>
  <source><![CDATA[
  $ cd avalon-cornerstone\threads\tutorial
  $ merlin target\cornerstone-threads-tutorial-1.0.jar
  
  [INFO   ] (sys): initialization: localhost
  [INFO   ] (sys): commencing block assembly phase
  [INFO   ] (test): aquiring cornerstone threads service
  [INFO   ] (threads): container initialization: threads
  [INFO   ] (test): initialization
  [INFO   ] (sys): Block hierarchy established.
  [INFO   ] (test.counter): count: 10
  [INFO   ] (test.counter): count: 9
  [INFO   ] (test.counter): count: 8
  [INFO   ] (test.counter): count: 7
  ]]></source>
  <p>
  Interrupting the container (using ^C) will trigger component disposal
  which in turn will trigger early termination of the thread established
  using the cornerstone thread manager.
  </p>
  <source><![CDATA[
  [INFO   ] (sys): commencing decommissioning phase
  [INFO   ] (test): disposal
  [INFO   ] (test): disposal invoked while child thread active
  [INFO   ] (test): waiting for child
  [INFO   ] (test.counter): I've been interrupted.
  [INFO   ] (test.counter): Time to die.
  [INFO   ] (test): disposal complete
  [INFO   ] (sys): bye
  ]]></source>
        </subsection>
        
      </section>
  
    </body>
  
  </document>
  
  
  
  1.2       +0 -2      avalon-cornerstone/threads/tutorial/src/java/org/apache/avalon/cornerstone/threads/tutorial/ThreadConsumer.java
  
  Index: ThreadConsumer.java
  ===================================================================
  RCS file: /home/cvs/avalon-cornerstone/threads/tutorial/src/java/org/apache/avalon/cornerstone/threads/tutorial/ThreadConsumer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ThreadConsumer.java	4 May 2003 17:19:32 -0000	1.1
  +++ ThreadConsumer.java	5 May 2003 20:50:28 -0000	1.2
  @@ -15,8 +15,6 @@
    * ThreadConsumer is a example of a component that uses the ThreadManager
    * servicde to aquired a thread pool.
    *
  - * @avalon.meta.version 1.0
  - * @avalon.meta.name consumer
    * @author Stephen McConnell
    */
   public class ThreadConsumer extends AbstractLogEnabled implements
  
  
  

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


Mime
View raw message