You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by ha...@apache.org on 2003/04/27 09:56:43 UTC

cvs commit: avalon-phoenix/examples/demo/src/manifest AltrmiHelloWorldTest.mf

hammant     2003/04/27 00:56:43

  Modified:    examples/demo build.xml
               examples/demo/src/java/org/apache/avalon/apps/demos/helloworldserver
                        package.html
  Removed:     examples/demo/src/conf avalon-altrmidemo-assembly.xml
                        avalon-altrmidemo-config.xml
               examples/demo/src/java/org/apache/avalon/apps/demos/altrmihelloworldserver
                        AltrmiHelloWorldServerTester.java package.html
               examples/demo/src/manifest AltrmiHelloWorldTest.mf
  Log:
  AltRMI block demo moves to AltRMI sub-project
  
  Revision  Changes    Path
  1.5       +16 -102   avalon-phoenix/examples/demo/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/examples/demo/build.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- build.xml	6 Apr 2003 11:52:07 -0000	1.4
  +++ build.xml	27 Apr 2003 07:56:43 -0000	1.5
  @@ -40,9 +40,17 @@
           <fileset dir="../../dist/lib">
               <include name="**/*.jar"/>
           </fileset>
  +        <fileset dir="../../target/lib">
  +            <include name="*.jar"/>
  +        </fileset>        
  +        <fileset dir="../../lib/tools">
  +            <include name="*.jar"/>
  +        </fileset>        
  +        <!--
           <fileset dir="../../dist/tools/lib">
               <include name="**/*.jar"/>
           </fileset>
  +        -->
       </path>
   
       <property name="avalon-site.dir" value="../../avalon-site"/>
  @@ -54,10 +62,6 @@
           <classpath refid="project.class.path"/>
       </taskdef>
   
  -    <taskdef name="altrmiproxies" classname="org.apache.altrmi.generator.ant.ProxyGenerationTask">
  -        <classpath refid="project.class.path"/>
  -    </taskdef>
  -
       <!-- Compiles project -->
       <target name="compile">
   
  @@ -82,18 +86,6 @@
               <classpath refid="project.class.path"/>
           </rmic>
   
  -        <altrmiproxies genname="helloworld" srcgendir="${target.dir}/genjava"
  -            interfaces="org.apache.avalon.apps.demos.helloworldserver.HelloWorldServer"
  -            classgendir="${target.dir}/genclasses">
  -            <classpath>
  -                <pathelement location="../common/lib/altrmi-client-interfaces-${altrmi.ver}.jar"/>
  -                <pathelement location="../common/lib/altrmi-client-impl-${altrmi.ver}.jar"/>
  -                <pathelement location="../common/lib/altrmi-common-${altrmi.ver}.jar"/>
  -                <pathelement location="../common/lib/altrmi-generator-${altrmi.ver}.jar"/>
  -                <pathelement path="${target.classes}"/>
  -            </classpath>
  -        </altrmiproxies>
  -
           <copy todir="${target.classes}">
               <fileset dir="${java.dir}">
                   <exclude name="**/test/**"/>
  @@ -108,6 +100,13 @@
   
           <mkdir dir="${target.metagenerate}"/>
   
  +        <copy todir="${target.classes}">
  +            <fileset dir="${java.dir}">
  +                <exclude name="**/test/**"/>
  +                <exclude name="**/*.java"/>
  +            </fileset>
  +        </copy>
  +
           <taskdef name="generatemeta" classname="org.apache.avalon.phoenix.tools.metagenerate.MetaGenerateTask">
               <classpath refid="project.class.path"/>
           </taskdef>
  @@ -147,23 +146,6 @@
   
           </jar>
   
  -        <jar jarfile="${target.lib}/demo-altrmihelloworld.jar">
  -            <fileset dir="${target.classes}">
  -                <include name="org/apache/avalon/apps/demos/altrmihelloworldserver/*"/>
  -            </fileset>
  -            <fileset dir="${target.metagenerate}">
  -                <include name="org/apache/avalon/apps/demos/altrmihelloworldserver/*.xinfo"/>
  -                <include name="org/apache/avalon/apps/demos/altrmihelloworldserver/*.mxinfo"/>
  -            </fileset>
  -
  -        </jar>
  -
  -        <jar jarfile="${target.lib}/HelloWorldAltrmiProxy.jar" compress="false">
  -            <fileset dir="${target.dir}/genclasses">
  -                <include name="**"/>
  -            </fileset>
  -        </jar>
  -
           <jar jarfile="${target.lib}/demo-lifecycle.jar"
               basedir="${target.classes}">
   
  @@ -174,32 +156,11 @@
               </fileset>
           </jar>
   
  -        <mkdir dir="${target.dir}/temp"/>
  -        <unzip src="../common/lib/altrmi-common-${altrmi.ver}.jar" dest="${target.dir}/temp"/>
  -        <unzip src="../common/lib/altrmi-client-interfaces-${altrmi.ver}.jar" dest="${target.dir}/temp"/>
  -        <unzip src="../common/lib/altrmi-client-impl-${altrmi.ver}.jar" dest="${target.dir}/temp"/>
  -
  -        <jar jarfile="${target.lib}/avalon-altrmidemo-tester.jar" compress="false" manifest="${manifest.dir}/AltrmiHelloWorldTest.mf">
  -            <fileset dir="${target.dir}/genclasses">
  -                <include name="**"/>
  -            </fileset>
  -            <fileset dir="${target.dir}/temp">
  -                <include name="org/apache/altrmi/**"/>
  -            </fileset>
  -            <fileset dir="${target.dir}/classes">
  -                <include name="org/apache/avalon/apps/demos/altrmihelloworldserver/AltrmiHelloWorldServer.class"/>
  -                <include name="org/apache/avalon/apps/demos/altrmihelloworldserver/AltrmiHelloWorldServerTester.class"/>
  -                <include name="org/apache/avalon/apps/demos/helloworldserver/HelloWorldServer.class"/>
  -            </fileset>
  -        </jar>
  -
  -        <delete dir="${target.dir}/temp"/>
  -
       </target>
   
       <target name="main" depends="sars" description="Default target to generate build products"/>
   
  -    <target name="sars" depends="jars, demo-sar, rmidemo-sar, altrmidemo-sar, lifecycledemo-sar" description="Create SARs">
  +    <target name="sars" depends="jars, demo-sar, rmidemo-sar, lifecycledemo-sar" description="Create SARs">
   
           <mkdir dir="dist"/>
   
  @@ -253,42 +214,6 @@
   
       </target>
   
  -    <target name="altrmidemo-sar" depends="jars" description="Create the AltRMI demo SAR">
  -
  -        <sar sarfile="${target.lib}/avalon-altrmidemo.sar"
  -            config="${conf.dir}/avalon-altrmidemo-config.xml"
  -            environment="${conf.dir}/avalon-altrmidemo-environment.xml"
  -            assembly="${conf.dir}/avalon-altrmidemo-assembly.xml">
  -
  -            <lib dir="${target.lib}/">
  -                <include name="demo-helloworld.jar"/>
  -                <include name="demo-altrmihelloworld.jar"/>
  -            </lib>
  -
  -            <lib dir="../common/lib">
  -                <include name="cornerstone.jar"/>
  -            </lib>
  -
  -            <lib dir="../common/lib">
  -                <include name="altrmi-common-${altrmi.ver}.jar"/>
  -                <include name="altrmi-server-interfaces-${altrmi.ver}.jar"/>
  -                <include name="altrmi-server-impl-${altrmi.ver}.jar"/>
  -                <include name="altrmi-generator-${altrmi.ver}.jar"/>
  -                <include name="altrmi-blocks-${altrmi.ver}.jar"/>
  -                <include name="altrmi-registry-${altrmi.ver}.jar"/>
  -                <include name="excalibur-thread*.jar"/>
  -                <include name="excalibur-pool*.jar"/>
  -                <include name="excalibur-collections*.jar"/>
  -            </lib>
  -
  -            <fileset dir="${target.lib}">
  -                <include name="HelloWorldAltrmiProxy.jar"/>
  -            </fileset>
  -
  -        </sar>
  -
  -    </target>
  -
       <target name="lifecycledemo-sar" depends="jars" description="Create the lifecycle SAR">
   
           <sar sarfile="${target.lib}/avalon-lifecycledemo.sar"
  @@ -314,15 +239,6 @@
           </java>
       </target>
   
  -    <!-- Performs Altrmi related unit tests -->
  -    <target name="test-altrmi" depends="compile">
  -        <java classname="org.apache.avalon.apps.demos.altrmihelloworldserver.AltrmiHelloWorldServerTester">
  -            <classpath>
  -                <pathelement location="${target.dir}/lib/avalon-altrmidemo-tester.jar"/>
  -            </classpath>
  -        </java>
  -    </target>
  -
       <!-- Performs unit tests -->
       <target name="rmi-demo-test" depends="check-rmi" description="Change the HelloWorld message via the RMI API (a test aid)"/>
   
  @@ -364,8 +280,6 @@
   
           <copy file="${target.lib}/avalon-demo.sar" tofile="${bin.dist.dir}/avalon-demo-${version}.sar"/>
           <copy file="${target.lib}/avalon-lifecycledemo.sar" tofile="${bin.dist.dir}/avalon-lifecycledemo-${version}.sar"/>
  -        <copy file="${target.lib}/avalon-altrmidemo.sar" tofile="${bin.dist.dir}/avalon-altrmidemo-${version}.sar"/>
  -        <copy file="${target.lib}/avalon-altrmidemo-tester.jar" tofile="${bin.dist.dir}/avalon-altrmidemo-tester-${version}.jar"/>
   
           <chmod dir="${bin.dist.dir}" perm="go-rwx"/>
       </target>
  
  
  
  1.2       +81 -94    avalon-phoenix/examples/demo/src/java/org/apache/avalon/apps/demos/helloworldserver/package.html
  
  Index: package.html
  ===================================================================
  RCS file: /home/cvs/avalon-phoenix/examples/demo/src/java/org/apache/avalon/apps/demos/helloworldserver/package.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- package.html	4 Apr 2003 23:00:53 -0000	1.1
  +++ package.html	27 Apr 2003 07:56:43 -0000	1.2
  @@ -1,96 +1,83 @@
  -<html><body>
  -<h1>AltRMI HelloWorld Demo</h1>
  +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  +<html>
  +<head>
  +</head>
  +<body>
  +<h1>HelloWorld Demo</h1>
   <center>By Paul Hammant</center>
  -
   <h2>Introduction</h2>
  -      <p>
  -        The 'Hello World' demo server component is a socket listener app that replies 'Hello World' to client applications that open the port.  The reply is in HTML form so can be viewed by a Browser.  The HTTP headers are missing, but it still works.  Telnet is another client that can view the message.
  -      </p>
  -    <h2>Architecture</h2>
  -      <p>
  -        The following shows how the HelloWorld demo block depends on ConnectionManager from cornerstone.  These
  -        two blocks packaged as a server application (.SAR file) are loaded and launched by Phoenix, itself sitting on top of Avalon's framework.
  -      </p>
  -
  -    <h2>Relevant source modules</h2>
  -      <p>
  -        The HelloWorld demo compiles as part of the build process for avalon-apps demo.  The important modules that contribute to the demo are listed here.  All are within the src directory
  -      </p>
  -      <ol>
  -        <li>
  -          <b>org.apache.avalon.apps.demos.helloworldserver package</b> This package contains the Java source for 'Hello World' and the xinfo block descriptor.
  -        </li>
  -        <li>
  -          <b>conf\avalon-demo-assembly.xml</b> This contains the assembly instructions for the resulting server archive (sar) file.
  -        </li>
  -        <li>
  -          <b>conf\avalon-demo-config.xml</b> This contains the configuration for the resulting server archive (sar) file.
  -        </li>
  -      </ol>
  -
  -    <h2>Java Source</h2>
  -      <h2>HelloWorldHandler.java</h2>
  -        <p>
  -          Instantiated and dispatched by the impl once per socket request that comes in.
  -        </p>
  -
  -      <h2>HelloWorldServer.java</h2>
  -        <p>
  -          The interface that's the contract for the Server block.  As it happens HelloWorld is not that resusable.  If it were "ObjectDataBase.java" many server apps could use it through this interface.  The interface could set more useful things that the greeting ("Hello", "Bonjour" etc.)
  -        </p>
  -
  -      <h2>HelloWorldServerImpl.java</h2>
  -        <p>
  -          This like all impls implements an interface.  Which interface is rather obvious in this case. It's a standard pattern that uses other blocks (SocketManager and ConnectionManager) to do the hard work of listening on a port, pooling threads and connections and organizing socket invokations in a queue and multi app friendly way.
  -        </p>
  -
  -
  -    <h2>avalon-demo-assembly xml</h2>
  -    <p>
  -      The file is renamed as part of the build process to assembly.xml, and only has a separate name here to aid development.  The bulk of the contents of the file pertain to other blocks including ones that HelloWorld is dependant upon.  Here's the section that's for HelloWorld
  -    </p>
  -<pre>
  -(text snipped)
  -    &lt;block class="org.apache.avalon.apps.demos.helloworldserver.HelloWorldServerImpl"
  -           name="helloworldserver" &gt;
  -        &lt;provide name="socketsection" role="org.apache.avalon.cornerstone.services.sockets.SocketManager"/&gt;
  -        &lt;provide name="connections"
  -                 role="org.apache.avalon.cornerstone.services.connection.ConnectionManager" /&gt;
  -    &lt;/block&gt;
  -(text snipped)
  -</pre>
  -      <p>
  -        Of the block element, listed attributes are the instatiatable class implementing the HelloWorld interface (not mentioned itself in this assembly xml), the display name of the block, and two services that HelloWorld needs.
  -      </p>
  -
  -    <h2>avalon-altrmidemo-config xml</h2>
  -    <p>
  -      The file is renamed as part of the build process to config.xml, and only has a separate name here to aid development.  Again here is the pertinent section:
  -    </p>
  -<pre>
  -(text snipped)
  -        &lt;helloworldserver&gt;
  -          &lt;port&gt;8999&lt;/port&gt;
  -          &lt;bind&gt;127.0.0.1&lt;/bind&gt;
  -          &lt;helloworldhandler&gt;
  -             &lt;connectiontimeout&gt; 360000 &lt;/connectiontimeout&gt;
  -          &lt;/helloworldhandler&gt;
  -        &lt;/helloworldserver&gt;
  -(text snipped)
  -</pre>
  -      <p>
  -        The configuration element named &lt;helloworldserver&gt; is used as it's name suggests and is passed the blocks being used for the app. Elements port and bind are used by the socket manager.
  -      </p>
  -      <p>
  -        If you had configuration for an app, you'd specify it here in with element and attribute names that are invented for the application.
  -      </p>
  -
  -    <h2>Starting your own server project</h2>
  -      <p>
  -        Familiarity with Ant and it's build script would be a good place to start.  After learning how Cornerstone compiles and jars the demos would be a good second step.  Thirdly, as I've done before, take the demos out of Cornerstone, delete classes and xml not relating to the HelloWorld server and rename from HelloWorld to whatever suits you.  I import into the lib dir avalon-cornerstone-compilation-0.x.jar to allow things that use it to compile.  I also import cornerstone-0.x.bar to the same place to allow it's inclusion in the sar file being made.  The build xml file even contains a target that allow you to install the freshly made sar file into a nearby Avalon installation - "build install", though for development you'll initially only be running "build" and "build clean".
  -      </p>
  -      <p>
  -        As a secondary process, it would be handy to learn xdocs (the technology that allows the creation of these book pages).  You're copying cornerstone to be (after some selective trimming) the foundation stone for new server app, so you might as well take adavantage of all it's templates..  "build xdocs" and look in build/docs.  All the Apache java based projects do this and then copy that to the website.  The project I'm involved with <a href="http://www.jesktop.org">Jesktop</a> does too.
  -      </p>
  -
  -</body></html>
  +<p> The 'Hello World' demo server component is a socket listener app
  +that replies 'Hello World' to client applications that open the port. 
  +The reply is in HTML form so can be viewed by a Browser.  The HTTP
  +headers are missing, but it still works.  Telnet is another client that
  +can view the message. </p>
  +<h2>Architecture</h2>
  +<p> The following shows how the HelloWorld demo block depends on
  +ConnectionManager from cornerstone.  These         two blocks packaged
  +as a server application (.SAR file) are loaded and launched by Phoenix,
  +itself sitting on top of Avalon's framework. </p>
  +<h2>Relevant source modules</h2>
  +<p> The HelloWorld demo compiles as part of the build process for
  +avalon-apps demo.  The important modules that contribute to the demo
  +are listed here.  All are within the src directory </p>
  +<ol>
  +  <li> <b>org.apache.avalon.apps.demos.helloworldserver package</b> This
  +package contains the Java source for 'Hello World' and the xinfo block
  +descriptor. </li>
  +  <li> <b>conf\avalon-demo-assembly.xml</b> This contains the assembly
  +instructions for the resulting server archive (sar) file. </li>
  +  <li> <b>conf\avalon-demo-config.xml</b> This contains the
  +configuration for the resulting server archive (sar) file. </li>
  +</ol>
  +<h2>Java Source</h2>
  +<h2>HelloWorldHandler.java</h2>
  +<p> Instantiated and dispatched by the impl once per socket request that
  +comes in. </p>
  +<h2>HelloWorldServer.java</h2>
  +<p> The interface that's the contract for the Server block.  As it
  +happens HelloWorld is not that resusable.  If it were
  +"ObjectDataBase.java" many server apps could use it through this
  +interface.  The interface could set more useful things that the
  +greeting ("Hello", "Bonjour" etc.) </p>
  +<h2>HelloWorldServerImpl.java</h2>
  +<p> This like all impls implements an interface.  Which interface is
  +rather obvious in this case. It's a standard pattern that uses other
  +blocks (SocketManager and ConnectionManager) to do the hard work of
  +listening on a port, pooling threads and connections and organizing
  +socket invokations in a queue and multi app friendly way. </p>
  +<h2>avalon-demo-assembly xml</h2>
  +<p> The file is renamed as part of the build process to assembly.xml,
  +and only has a separate name here to aid development.  The bulk of the
  +contents of the file pertain to other blocks including ones that
  +HelloWorld is dependant upon.  Here's the section that's for HelloWorld
  + </p>
  +<pre>(text snipped)<br>    &lt;block class="org.apache.avalon.apps.demos.helloworldserver.HelloWorldServerImpl"<br>           name="helloworldserver" &gt;<br>        &lt;provide name="socketsection" role="org.apache.avalon.cornerstone.services.sockets.SocketManager"/&gt;<br>        &lt;provide name="connections"<br>                 role="org.apache.avalon.cornerstone.services.connection.ConnectionManager" /&gt;<br>    &lt;/block&gt;<br>(text snipped)<br></pre>
  +<p> Of the block element, listed attributes are the instatiatable class
  +implementing the HelloWorld interface (not mentioned itself in this
  +assembly xml), the display name of the block, and two services that
  +HelloWorld needs. </p>
  +<h2>avalon-demo-config xml</h2>
  +<p> The file is renamed as part of the build process to config.xml, and
  +only has a separate name here to aid development.  Again here is the
  +pertinent section: </p>
  +<pre>(text snipped)<br>        &lt;helloworldserver&gt;<br>          &lt;port&gt;8999&lt;/port&gt;<br>          &lt;bind&gt;127.0.0.1&lt;/bind&gt;<br>          &lt;helloworldhandler&gt;<br>             &lt;connectiontimeout&gt; 360000 &lt;/connectiontimeout&gt;<br>          &lt;/helloworldhandler&gt;<br>        &lt;/helloworldserver&gt;<br>(text snipped)<br></pre>
  +<p> The configuration element named &lt;helloworldserver&gt; is used as
  +it's name suggests and is passed the blocks being used for the app.
  +Elements port and bind are used by the socket manager. </p>
  +<p> If you had configuration for an app, you'd specify it here in with
  +element and attribute names that are invented for the application.     </p>
  +<h2>Starting your own server project</h2>
  +<p> Familiarity with Ant and it's build script would be a good place to
  +start.  After learning how Cornerstone compiles and jars the demos
  +would be a good second step.  Thirdly, as I've done before, take the
  +demos out of Cornerstone, delete classes and xml not relating to the
  +HelloWorld server and rename from HelloWorld to whatever suits you.  I
  +import into the lib dir avalon-cornerstone-compilation-0.x.jar to allow
  +things that use it to compile.  I also import cornerstone-0.x.bar to
  +the same place to allow it's inclusion in the sar file being made.  The
  +build xml file even contains a target that allow you to install the
  +freshly made sar file into a nearby Avalon installation - "build
  +install", though for development you'll initially only be running
  +"build" and "build clean".</p>
  +</body>
  +</html>
  
  
  

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


Re: cvs commit: avalon-phoenix/examples/demo/src/manifest AltrmiHelloWorldTest.mf

Posted by Paul Hammant <Pa...@thoughtworks.net>.
Peter,

>  
>
>>hammant     2003/04/27 00:56:43
>>
>>  Modified:    examples/demo build.xml
>>    
>>
>...
>  
>
>>  Log:
>>  AltRMI block demo moves to AltRMI sub-project
>>    
>>
>
>
>Tah - btw you need any help getting altrmi building in gump?
>  
>
I'll have a look. I've mended it a couple of times!

The point of putting it in exampels was to keep it out of Sam's scope!

- Paul


-- 
http://www.thoughtworks.com -> The art of heavy lifting.
Home for many Agile-practicing, Open Source activists...



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


Re: cvs commit: avalon-phoenix/examples/demo/src/manifest AltrmiHelloWorldTest.mf

Posted by Peter Donald <pe...@realityforge.org>.
On Sun, 27 Apr 2003 17:56, hammant@apache.org wrote:
> hammant     2003/04/27 00:56:43
>
>   Modified:    examples/demo build.xml
...
>   Log:
>   AltRMI block demo moves to AltRMI sub-project


Tah - btw you need any help getting altrmi building in gump?

-- 
Cheers,

Peter Donald
------------------------------------------------
 "No. Try not. Do. Or do not. There is no try." 
                                     -- Yoda 
------------------------------------------------ 



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