[jboss-cvs] JBossAS SVN: r94136 - projects/docs/community/5/Clustering_Guide/en-US.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Sep 29 23:12:49 EDT 2009


Author: bstansberry at jboss.com
Date: 2009-09-29 23:12:48 -0400 (Tue, 29 Sep 2009)
New Revision: 94136

Modified:
   projects/docs/community/5/Clustering_Guide/en-US/Clustering_Guide_HTTP.xml
Log:
Make stuff fit on PDF

Modified: projects/docs/community/5/Clustering_Guide/en-US/Clustering_Guide_HTTP.xml
===================================================================
--- projects/docs/community/5/Clustering_Guide/en-US/Clustering_Guide_HTTP.xml	2009-09-30 03:06:03 UTC (rev 94135)
+++ projects/docs/community/5/Clustering_Guide/en-US/Clustering_Guide_HTTP.xml	2009-09-30 03:12:48 UTC (rev 94136)
@@ -73,8 +73,7 @@
       <section>
         <title>Configure Apache to load mod_jk</title>
         <para>Modify APACHE_HOME/conf/httpd.conf and add a single line at the end of the file:</para>
-        <programlisting>
-# Include mod_jk's specific configuration file  
+        <programlisting># Include mod_jk's specific configuration file  
 Include conf/mod-jk.conf  
             </programlisting>
         <para>Next, create a new file named <literal>APACHE_HOME/conf/mod-jk.conf</literal>:</para>
@@ -122,8 +121,7 @@
     Order deny,allow
     Deny from all
     Allow from 127.0.0.1
-&lt;/Location&gt;    
-            </programlisting>
+&lt;/Location&gt;</programlisting>
         <para>Please note that two settings are very important:</para>
         <itemizedlist>
           <listitem>
@@ -146,15 +144,13 @@
                         <literal>uriworkermap.properties</literal> file in the <literal>APACHE_HOME/conf</literal>
                     directory. The format of the file is <literal>/url=worker_name</literal>. To get things started,
                     paste the following example into the file you created:</para>
-        <programlisting>
-# Simple worker configuration file
+        <programlisting># Simple worker configuration file
 
 # Mount the Servlet context to the ajp13 worker
 /jmx-console=loadbalancer
 /jmx-console/*=loadbalancer
 /web-console=loadbalancer
-/web-console/*=loadbalancer
-            </programlisting>
+/web-console/*=loadbalancer</programlisting>
         <para>This will configure mod_jk to forward requests to <literal>/jmx-console</literal> and
                         <literal>/web-console</literal> to Tomcat.</para>
         <para>You will most probably not change the other settings in <literal>mod_jk.conf</literal>. They are
@@ -167,8 +163,7 @@
                     load-balanced across them. The configuration file contains one section for each target servlet
                     container and one global section. For a two nodes setup, the file could look like this:</para>
 <!-- The local worker comment is from here: http://jira.jboss.com/jira/browse/JBDOCS-102 -->
-        <programlisting>
-# Define list of workers that will be used
+        <programlisting># Define list of workers that will be used
 # for mapping requests
 worker.list=loadbalancer,status
 
@@ -195,8 +190,7 @@
 #worker.list=loadbalancer
 
 # Status worker for managing load balancer
-worker.status.type=status
-            </programlisting>
+worker.status.type=status</programlisting>
         <para>Basically, the above file configures mod_jk to perform weighted round-robin load balancing with
                     sticky sessions between two servlet containers (i.e. JBoss AS instances) node1 and node2 listening on port
                     8009.</para>
@@ -235,18 +229,14 @@
 			<literal>JBOSS_HOME/server/all/deploy/jbossweb.sar/server.xml</literal> file (replace
                         <literal>/all</literal> with your own server name if necessary). Locate the
                         <literal>&lt;Engine&gt;</literal> element and add an attribute <literal>jvmRoute</literal>:</para>
-        <programlisting>
-&lt;Engine name="jboss.web" defaultHost="localhost" jvmRoute="node1"&gt;
+        <programlisting>&lt;Engine name="jboss.web" defaultHost="localhost" jvmRoute="node1"&gt;
 ... ...
-&lt;/Engine&gt;
-            </programlisting>
+&lt;/Engine&gt;</programlisting>
 	    <para>You also need to be sure the AJP connector in server.xml is enabled (i.e., uncommented). It is enabled by default. 
 	    </para>
-<programlisting><![CDATA[
-<!-- An AJP 1.3 Connector on port 8009 -->
+<programlisting><![CDATA[<!-- An AJP 1.3 Connector on port 8009 -->
 <Connector protocol="AJP/1.3" port="8009" address="${jboss.bind.address}"
-   redirectPort="8443" />]]>
-</programlisting>
+   redirectPort="8443" />]]></programlisting>
 
         <para>At this point, you have a fully working Apache+mod_jk load-balancer setup that will balance call
                     to the Servlet containers of your cluster while taking care of session stickiness (clients will
@@ -303,7 +293,7 @@
       <max-unreplicated-interval>30</max-unreplicated-interval>
       <snapshot-mode>instant</snapshot-mode>
       <snapshot-interval>1000</snapshot-interval>
-      <session-notification-policy>com.example.CustomSessionNotificationPolicy</session-notification-policy>
+      <session-notification-policy>com.example.CustomPolicy</session-notification-policy>
    </replication-config>
 
 </jboss-web>]]></programlisting>
@@ -498,8 +488,7 @@
       <literal>jboss-web.xml</literal> deployment descriptor in your webapp's
       <literal>WEB-INF</literal> directory.</para>
       
-      <programlisting><![CDATA[
-<!DOCTYPE jboss-web PUBLIC
+      <programlisting><![CDATA[<!DOCTYPE jboss-web PUBLIC
     -//JBoss//DTD Web Application 5.0//EN
     http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd>
 
@@ -654,8 +643,7 @@
 public class Address 
 {
 ...
-}]]> 
-</programlisting>
+}]]></programlisting>
 	
 <para>
 If you annotate a class with @Replicable, then all of its subclasses will be automatically annotated as well. Similarly, you can annotate an interface with @Replicable and all of its implementing classes will be annotated. For example:
@@ -669,8 +657,7 @@
 public class Student extends Person
 {
 ...
-}
-]]></programlisting>
+}]]></programlisting>
 	
 <para>There is no need to annotate <literal>Student</literal>. POJO Cache will recognize it as @Replicable because it is a sub-class of <literal>Person</literal>.</para>
 <para>JBoss AS 5 requires JDK 5 at runtime, but some users may still need to build their projects using JDK 1.4.  In this case, annotating classes can be  done via JDK 1.4 style annotations embedded in JavaDocs. For example:
@@ -685,18 +672,15 @@
 public class Address 
 {
 ...
-}
-</programlisting>
+}</programlisting>
 
 <para>
 	Once you have annotated your classes, you will need to perform a pre-processing step to bytecode enhance your classes for use by POJO Cache. You need to use the JBoss AOP pre-compiler <literal>annotationc</literal> and post-compiler <literal>aopc</literal> to process the above source code before and after they are compiled by the Java compiler. The <literal>annotationc</literal> step is only need if the JDK 1.4 style annotations are used; if JDK 5 annotations are used it is not necessary. Here is an example of how to invoke those commands from command line.
 </para>
 
-        <programlisting>
-$ annotationc [classpath] [source files or directories]
+        <programlisting>$ annotationc [classpath] [source files or directories]
 $ javac -cp [classpath] [source files or directories]
-$ aopc [classpath] [class files or directories]            
-            </programlisting>
+$ aopc [classpath] [class files or directories]</programlisting>
 	    
 <para>
 	Please see the JBoss AOP documentation for the usage of the pre- and post-compiler. The JBoss AOP project also provides easy to use ANT tasks to help integrate those steps into your application build process. 
@@ -709,8 +693,7 @@
         </note>
 -->
         <para>Finally, let's see an example on how to use FIELD-level replication on those data classes. First, we see some servlet code that reads some data from the request parameters, creates a couple of objects and stores them in the session:</para>
-        <programlisting>
-Person husband = new Person(getHusbandName(request), getHusbandAge(request));
+        <programlisting>Person husband = new Person(getHusbandName(request), getHusbandAge(request));
 Person wife = new Person(getWifeName(request), getWifeAge(request));
 Address addr = new Address();
 addr.setPostalCode(getPostalCode(request));
@@ -719,14 +702,12 @@
 wife.setAddress(addr); // husband and wife share the same address!
 
 session.setAttribute("husband", husband); // that's it.
-session.setAttribute("wife", wife); // that's it.
-        </programlisting>
+session.setAttribute("wife", wife); // that's it.</programlisting>
         
         <para>Later, a different servlet could update the family's postal code:</para>
-        <programlisting>
-Person wife = (Person)session.getAttribute("wife");
-wife.getAddress().setPostalCode(getPostalCode(request)); // this will update and replicate the postal code.            
-        </programlisting>
+        <programlisting>Person wife = (Person)session.getAttribute("wife");
+// this will update and replicate the postal code
+wife.getAddress().setPostalCode(getPostalCode(request)); </programlisting>
             
         <para>Notice that in there is no need to call <literal>session.setAttribute()</literal> after you make changes to
          the data object, and all changes to the fields are automatically replicated across the cluster.</para>




More information about the jboss-cvs-commits mailing list