User: vharcq  
  Date: 01/06/23 04:27:38

  Modified:    src/docs cmp.xml
  Log:
  Complete Chapter 4 examples
  
  Revision  Changes    Path
  1.12      +20 -32    manual/src/docs/cmp.xml
  
  Index: cmp.xml
  ===================================================================
  RCS file: /cvsroot/jboss/manual/src/docs/cmp.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- cmp.xml   2001/06/23 08:37:50     1.11
  +++ cmp.xml   2001/06/23 11:27:38     1.12
  @@ -33,12 +33,19 @@
           "CDCollection" EJB that lists and searches collections of CDs.</para>       
                        <para> 
          The full source code to accompany this chapter can be found 
  -       in either zip (cdEJB.zip) or tar/gzip (cdEJB.tar.gz) format 
  -       from the <ulink url="http://www.jboss.org/doco_files/";>file section</ulink> 
of the manual.
  -       This archive
  -contains the Java source code, JavaDoc documentation, and a text file of test 
  -data (CDs.txt) to initialize the
  -database.</para>
  +       in zip format (documentation-example.zip) or tar/gzip 
(documentation-example.tar.gz) format 
  +       from the file section of the documentation section
  +       on <ulink 
url="http://www.jboss.org/doco_files/";>http://www.jboss.org/doco_files/</ulink>.</para>
  +       <para>Download this file and extract it to any directory.  Open a DOS/Shell 
box under the "build"
  +subdirectory.  Now specify 3 environment variables JBOSS_HOME, ANT_HOME and 
JAVA_HOME that must refer
  +respectively to the JBoss installation directory, the Ant installation directory 
and the JDK installation
  +directory.</para>
  +             <para>In this chapter you will be asked to run "build xxx" scripts to 
generate ejb jar or to run client
  +code.  You have to be in this "build" directory with correct environment variables 
to be able to do that.  The reason
  +for using Ant is to have OS independant scripts.</para>
  +             <para>The files (sources, build scripts and configuration files) 
needed for this chapter are under 
  +"documentation-example/org/jboss/docs/cmp/cd".  Take the time to review them, as 
well as how the classpath is set prior
  +to compiling/running the sources.</para>
                </section>
                <section>
                        <title>Pre-requisites</title>
  @@ -362,11 +369,6 @@
   process space. 
   Because the CD Bean is essentially passive -- a data repository -- it only has 
   a few methods. </para>
  -     <para>To be able to compile these classes, you need to add to your classpath 
  -a jar containing definitions of javax.ejb.*.  Usually this is done by ejb.jar or 
  -j2ee.jar.  With JBoss, you have to use instead jboss-client.jar which is a bundle of
  -all J2EE API (javax.ejb, javax.jms, javax.resource, javax.transaction).
  - JBoss, you</para>
        </section>
        <section>
                <title>Packaging and deploying the Beans</title>
  @@ -475,9 +477,9 @@
   ]]></programlisting>
                <para>This says the "CDBean" has the JNDI name "cd/CD" and 
"CDCollectionBean" has 
   the JNDI name "cd/CDCollection". </para>
  -             <para>When packaging these Beans, don't forget to include the files 
ejb-jar.xml and 
  -jboss.jar in the
  -directory META-INF.During deployment (simply copy the packaged beans to the 
  +     <para>To compile and package the EJBs, run "build cmp-cd-compile".  It 
compiles the sources
  +and create an EJB jar file ready for deployment.</para>
  +<para>During deployment (simply copy 
"documentation-example/build-examples/cmp-cd/ejb/cd.jar" to the
   "deploy" subdirectory 
   of the JBoss directory) you should see a message like the following:</para>
                <literallayout>
  @@ -547,7 +549,7 @@
                <para>To avoid the necessity to specify the URL of the Bean server in 
the client 
   source code, 
   this client reads the required information from a properties file called 
  -"cd.properties". 
  +"jndi.properties".  This file can be found under "documentation-example/resources"
   The file should contain the URL and driver for the naming service, like this:</para>
                
<para><literallayout>java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
   java.naming.provider.url=localhost
  @@ -583,21 +585,6 @@
   
      public static void main(String[] args)
      {
  -      // Get information about the Bean server from the properties file
  -      Properties props = new Properties();
  -      Properties sysProps = System.getProperties();
  -      try
  -      {
  -         props.load (new FileInputStream ("cd.properties"));
  -         sysProps.putAll(props);
  -      }
  -      catch (Exception e)
  -      {
  -         System.err.println ("Can't read cd.properties");
  -         System.exit (-1);
  -      }
  -      System.setProperties (sysProps);
  -
         // Enclosing the whole process in a single "try" block is not an ideal way
         // to do exception handling, but I don't want to clutter the program up
         // with catch blocks
  @@ -630,8 +617,9 @@
   
   }
    ]]></programlisting>
  -             <para>To run this client you will need to specify in the CLASSPATH the 
location the 
  -JBoss client libraries.  These are jboss-client.jar, jbosssw-client.jar and 
jnp-client.jar.</para>
  +             <para>To run this client run "build cmp-cd-list".  Before you have to 
run "build cmp-cd-upload"
  +to load some data (from "cds.txt") into the database.  To delete all records, run 
"build cmp-cd-remove".
  +These programs can be found under 
"documentation-example\org\jboss\docs\cmp\cd".</para>
                <para>You'll agree, that it isn't that much more complicated than 
   creating a session EJB. The additional steps required are: </para>
                <para>The ejb-jar.xml file needs to indicate that the object is 
persistent, and list 
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to