[jboss-svn-commits] JBL Code SVN: r34169 - in labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US: Chapter-Examples and 7 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jul 26 06:25:58 EDT 2010


Author: ge0ffrey
Date: 2010-07-26 06:25:57 -0400 (Mon, 26 Jul 2010)
New Revision: 34169

Modified:
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Authoring/Section-Decision_Tables.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Authoring/Section-Templates.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-BankingExample.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-FibonacciExample.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-HelloWorldExample.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-HonestPoliticianExample.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-NumberGuessExample.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-PetStoreExample.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-PricingExample.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-QuickStart.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-ShoppingExample.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-StateExample.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-TroubleTicketExample.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-IDE/Chapter-QuickStart.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-JSR94/Section-How_To_Use.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Language_Reference/Section-Package.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Language_Reference/Section-Rule.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Quick_Start/Section-A_Little_More_Theory.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Quick_Start/Section-More_On_Building_And_Deploying.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Quick_Start/Section-The_Basics.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-Rules.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-The_Drools_Rule_Engine.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Language/Section-Package.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-User_Guide/Section-Building.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-User_Guide/Section-Deploying.xml
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-User_Guide/Section-Running.xml
Log:
JBRULES-2587 code highlighting java for drools-expert

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Authoring/Section-Decision_Tables.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Authoring/Section-Decision_Tables.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Authoring/Section-Decision_Tables.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -738,7 +738,7 @@
 
       <para>The code to run this is simple:</para>
 
-      <programlisting>//first we compile the spreadsheet with the template
+      <programlisting role="JAVA">//first we compile the spreadsheet with the template
 //to create a whole lot of rules.
 final ExternalSpreadsheetCompiler converter = new ExternalSpreadsheetCompiler();
 //the data we are interested in starts at row 2, column 2 (e.g. B2)

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Authoring/Section-Templates.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Authoring/Section-Templates.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Authoring/Section-Templates.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -133,7 +133,7 @@
 limit
 word</programlisting>
         the following Java class could be used:
-        <programlisting>
+        <programlisting role="JAVA">
 public class ParamSet {
     //...
     public ParamSet( String t, int l, boolean w ) {
@@ -153,7 +153,7 @@
         for a template file <code>template.drl</code>, we can now proceed to
         request its expansion.</para>
 
-        <programlisting>
+        <programlisting role="JAVA">
 Collection&lt;ParamSet&gt; paramSets = new ArrayList&lt;ParamSet&gt;();
 // populate paramSets
 paramSets.add( new ParamSet( "Foo", 42, true ) );
@@ -168,7 +168,7 @@
         feed this to a <code>KnowledgeBuilder</code> and continue with the
         resulting Knowledge Packages.
 
-        <programlisting>
+        <programlisting role="JAVA">
 KnowledgeBase kBase = KnowledgeBaseFactory.newKnowledgeBase();
 KnowledgeBuilder kBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
 Reader rdr = new StringReader( drl );
@@ -190,7 +190,7 @@
         would use the same approach, just differing in the way the
         map collection is composed.</para>
 
-        <programlisting>
+        <programlisting role="JAVA">
 Collection&lt;Map&lt;String,Object&gt;&gt; paramMaps = new ArrayList&lt;Map&lt;String,Object&gt;&gt;();
 // populate paramMaps
 ObjectDataCompiler converter = new ObjectDataCompiler();
@@ -207,7 +207,7 @@
        objects of class <code>Item</code> containing a couple of integer fields and an
        <code>enum</code> field of type <code>ItemCode</code>.</para>
 
-       <programlisting>
+       <programlisting role="JAVA">
 public class Item {
     // ...
     public Item( String n, int p, int w, ItemCode c ){...}
@@ -248,7 +248,7 @@
          parameter sets have to be set up. First, there is class
          <code>ParamSet</code>, for storing a set of actual parameters.</para>
 
-         <programlisting>
+         <programlisting role="JAVA">
 public class ParamSet {
     //...
     private EnumSet&lt;ItemCode&gt; codeSet;
@@ -281,7 +281,7 @@
         takes care of this, using a Knowledge Base, the <code>InputStream</code>
         with the rule template and the collection of parameter sets.</para>     
 
-        <programlisting>
+        <programlisting role="JAVA">
 public class Expander {
 	
     public void expand( KnowledgeBase kBase, InputStream is, Collection&lt;?&gt; act )
@@ -309,7 +309,7 @@
         method shown above. Then we launch a stateful session, insert a
         few <code>Item</code>, and watch what happens.</para>
 
-        <programlisting>
+        <programlisting role="JAVA">
 Collection&lt;ParamSet&gt; cfl = new ArrayList&lt;ParamSet&gt;();
 cfl.add( new ParamSet( "weight",  10,  99, EnumSet.of( ItemCode.LOCK, ItemCode.STOCK ) ) );
 cfl.add( new ParamSet( "price",   10,  50, EnumSet.of( ItemCode.BARREL ) ) );

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-BankingExample.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-BankingExample.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-BankingExample.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -28,7 +28,7 @@
     <example>
       <title>Banking Tutorial: RuleRunner</title>
 
-      <programlisting><![CDATA[public class RuleRunner {
+      <programlisting role="JAVA"><![CDATA[public class RuleRunner {
 
     public RuleRunner() {
     }
@@ -69,7 +69,7 @@
     <example>
       <title>Banking Tutorial : Java Example1</title>
 
-      <programlisting>public class Example1 {
+      <programlisting role="JAVA">public class Example1 {
     public static void main(String[] args) throws Exception {
         new RuleRunner().runRules( new String[] { "Example1.drl" },
                                    new Object[0] );
@@ -108,7 +108,7 @@
     <example>
       <title>Banking Tutorial: Java Example2</title>
 
-      <programlisting>public class Example2 {
+      <programlisting role="JAVA">public class Example2 {
     public static void main(String[] args) throws Exception {
         Number[] numbers = new Number[] {wrap(3), wrap(1), wrap(4), wrap(1), wrap(5)};
         new RuleRunner().runRules( new String[] { "Example2.drl" },
@@ -131,7 +131,7 @@
     <example>
       <title>Banking Tutorial: Rule in Example2.drl</title>
 
-      <programlisting>rule "Rule 02"   
+      <programlisting>rule "Rule 02"
     when
         Number( $intValue : intValue )
     then
@@ -175,7 +175,7 @@
     <example>
       <title>Banking Tutorial: Example3.java</title>
 
-      <programlisting>public class Example3 {
+      <programlisting role="JAVA">public class Example3 {
     public static void main(String[] args) throws Exception {
         Number[] numbers = new Number[] {wrap(3), wrap(1), wrap(4), wrap(1), wrap(5)};
         new RuleRunner().runRules( new String[] { "Example3.drl" },
@@ -238,7 +238,7 @@
     <example>
       <title>Banking Tutorial: Class Cashflow</title>
 
-      <programlisting>public class Cashflow {
+      <programlisting role="JAVA">public class Cashflow {
     private Date   date;
     private double amount;
 
@@ -284,7 +284,7 @@
     <example>
       <title>Banking Tutorial: Example4.java</title>
 
-      <programlisting>public class Example4 {    
+      <programlisting role="JAVA">public class Example4 {
     public static void main(String[] args) throws Exception {
         Object[] cashflows = {
             new Cashflow(new SimpleDate("01/01/2007"), 300.00),
@@ -308,7 +308,7 @@
     <example>
       <title>Banking Tutorial: Class SimpleDate</title>
 
-      <programlisting>public class SimpleDate extends Date {
+      <programlisting role="JAVA">public class SimpleDate extends Date {
     private static final SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
     
     public SimpleDate(String datestr) throws Exception {             
@@ -365,7 +365,7 @@
     <example>
       <title>Banking Tutorial: Class TypedCashflow</title>
 
-      <programlisting>public class TypedCashflow extends Cashflow {
+      <programlisting role="JAVA">public class TypedCashflow extends Cashflow {
     public static final int CREDIT = 0;
     public static final int DEBIT  = 1;
 
@@ -403,7 +403,7 @@
     <example>
       <title>Banking Tutorial: Example5.java</title>
 
-      <programlisting>public class Example5 {    
+      <programlisting role="JAVA">public class Example5 {
     public static void main(String[] args) throws Exception {      
         Object[] cashflows = {
             new TypedCashflow(new SimpleDate("01/01/2007"),    
@@ -484,7 +484,7 @@
     <example>
       <title>Banking Tutorial: Class Account</title>
 
-      <programlisting>public class Account {
+      <programlisting role="JAVA">public class Account {
     private long   accountNo;
     private double balance = 0;
 
@@ -524,7 +524,7 @@
     <example>
       <title>Banking Tutorial: Class AllocatedCashflow</title>
 
-      <programlisting>public class AllocatedCashflow extends TypedCashflow {
+      <programlisting role="JAVA">public class AllocatedCashflow extends TypedCashflow {
     private Account account;
 
     public AllocatedCashflow() {
@@ -560,7 +560,7 @@
     <example>
       <title>Banking Tutorial: Example5.java</title>
 
-      <programlisting>public class Example6 {    
+      <programlisting role="JAVA">public class Example6 {
     public static void main(String[] args) throws Exception {      
         Account acc1 = new Account(1);
         Account acc2 = new Account(2);

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-FibonacciExample.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-FibonacciExample.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-FibonacciExample.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -31,7 +31,7 @@
     <example>
       <title>Fibonacci Class</title>
 
-      <programlisting>public static class Fibonacci {
+      <programlisting role="JAVA">public static class Fibonacci {
     private int  sequence;
     private long value;
 
@@ -97,7 +97,7 @@
     <example>
       <title>Fibonacci Example: Execution</title>
 
-      <programlisting>ksession.insert( new Fibonacci( 50 ) );
+      <programlisting role="JAVA">ksession.insert( new Fibonacci( 50 ) );
 ksession.fireAllRules();</programlisting>
     </example>
 

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-HelloWorldExample.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-HelloWorldExample.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-HelloWorldExample.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -40,7 +40,7 @@
   <example>
     <title>HelloWorld: Creating the KnowledgeBase and Session</title>
 
-    <programlisting>final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
+    <programlisting role="JAVA">final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
 
 // this will parse and compile in one step
 kbuilder.add(ResourceFactory.newClassPathResource("HelloWorld.drl",
@@ -80,7 +80,7 @@
   <example>
     <title>HelloWorld: Event logging and Auditing</title>
 
-    <programlisting>// setup the debug listeners
+    <programlisting role="JAVA">// setup the debug listeners
 ksession.addEventListener( new DebugAgendaEventListener() );
 ksession.addEventListener( new DebugWorkingMemoryEventListener() );
         
@@ -96,7 +96,7 @@
   <example>
     <title>HelloWorld example: Message Class</title>
 
-    <programlisting>public static class Message {
+    <programlisting role="JAVA">public static class Message {
     public static final int HELLO   = 0;
     public static final int GOODBYE = 1;
 
@@ -117,7 +117,7 @@
   <example>
     <title>HelloWorld: Execution</title>
 
-    <programlisting>final Message message = new Message();
+    <programlisting role="JAVA">final Message message = new Message();
 message.setMessage("Hello World");
 message.setStatus(Message.HELLO);
 ksession.insert(message);

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-HonestPoliticianExample.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-HonestPoliticianExample.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-HonestPoliticianExample.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -28,7 +28,7 @@
   <para><example>
     <title>Class Politician</title>
 
-      <programlisting>public class Politician {
+      <programlisting role="JAVA">public class Politician {
     private String name;
     private boolean honest;
     ...
@@ -36,7 +36,7 @@
       </example><example>
     <title>Honest Politician: Execution</title>
 
-    <programlisting>Politician blair = new Politician("blair", true);
+    <programlisting role="JAVA">Politician blair = new Politician("blair", true);
 Politician bush = new Politician("bush", true);
 Politician chirac = new Politician("chirac", true);
 Politician schroder = new Politician("schroder", true);

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-NumberGuessExample.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-NumberGuessExample.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-NumberGuessExample.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -21,7 +21,7 @@
   <example>
     <title>Creating the Number Guess RuleBase: NumberGuessExample.main() - part 1</title>
 
-        <programlisting>final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
+        <programlisting role="JAVA">final KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
 kbuilder.add( ResourceFactory.newClassPathResource( "NumberGuess.drl",
                                                     ShoppingExample.class ),
               ResourceType.DRL );
@@ -43,7 +43,7 @@
   <example>
     <title>Starting the RuleFlow: NumberGuessExample.main() - part 2</title>
 
-    <programlisting>final StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
+    <programlisting role="JAVA">final StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
 
 KnowledgeRuntimeLogger logger =
   KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, "log/numberguess");

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-PetStoreExample.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-PetStoreExample.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-PetStoreExample.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -80,7 +80,7 @@
       <example>
         <title>Creating the PetStore RuleBase in PetStore.main</title>
 
-        <programlisting><![CDATA[KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
+        <programlisting role="JAVA"><![CDATA[KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
 
 kbuilder.add( ResourceFactory.newClassPathResource( "PetStore.drl",
                                                     PetStore.class ),
@@ -119,7 +119,7 @@
       <example>
         <title>Firing the Rules - extract from CheckoutCallBack.checkout()</title>
 
-        <programlisting><![CDATA[public String checkout(JFrame frame, List<Product> items) {
+        <programlisting role="JAVA"><![CDATA[public String checkout(JFrame frame, List<Product> items) {
     Order order = new Order();
 
     // Iterate through list and add to cart
@@ -184,7 +184,7 @@
       <example>
         <title>Package, Imports, Globals and Dialect: extract from PetStore.drl</title>
 
-        <programlisting>package org.drools.examples
+        <programlisting role="JAVA">package org.drools.examples
 
 import org.drools.WorkingMemory
 import org.drools.examples.PetStore.Order
@@ -216,7 +216,7 @@
       <example>
         <title>Java Functions in the Rules: extract from PetStore.drl</title>
 
-        <programlisting><![CDATA[function void doCheckout(JFrame frame, WorkingMemory workingMemory) {
+        <programlisting role="JAVA"><![CDATA[function void doCheckout(JFrame frame, WorkingMemory workingMemory) {
     Object[] options = {"Yes",
                         "No"};
                             

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-PricingExample.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-PricingExample.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-PricingExample.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -37,7 +37,7 @@
       The rules are loaded, the facts inserted and a Stateless Session is
       created. What is different is how the rules are added.</para>
 
-      <programlisting>DecisionTableConfiguration dtableconfiguration =
+      <programlisting role="JAVA">DecisionTableConfiguration dtableconfiguration =
     KnowledgeBuilderFactory.newDecisionTableConfiguration();
         dtableconfiguration.setInputType( DecisionTableInputType.XLS );
 

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-QuickStart.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-QuickStart.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-QuickStart.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -278,7 +278,7 @@
 
     </para>
 
-    <programlisting>BRXMLPersitence read = BRXMLPersitence.getInstance();
+    <programlisting role="JAVA">BRXMLPersitence read = BRXMLPersitence.getInstance();
 BRDRLPersistence write = BRDRLPersistence.getInstance();
 String brl = ... read from the .brl file as needed...
 String outputDRL = write.marshall(read.unmarshal(brl));
@@ -409,7 +409,7 @@
       created when executing the rules engine. To create an audit log, use the
       following code:</para>
 
-      <programlisting>    WorkingMemory workingMemory = ruleBase.newWorkingMemory();
+      <programlisting role="JAVA">    WorkingMemory workingMemory = ruleBase.newWorkingMemory();
     // create a new Working Memory Logger, that logs to file.
     WorkingMemoryFileLogger logger = new WorkingMemoryFileLogger(workingMemory);
     // an event.log file is created in the log dir (which must exist)

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-ShoppingExample.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-ShoppingExample.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-ShoppingExample.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -20,7 +20,7 @@
 
 			<para>The following is a listing of the interesting parts that are used to launch the example:</para>
 
-			<programlisting>Customer mark = new Customer( "mark",
+			<programlisting role="JAVA">Customer mark = new Customer( "mark",
                               0 );
 session.insert( mark );
 Product shoes = new Product( "shoes",

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-StateExample.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-StateExample.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-StateExample.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -39,7 +39,7 @@
       <example>
         <title>State Class</title>
 
-        <programlisting>public class State {
+        <programlisting role="JAVA">public class State {
     public static final int NOTRUN   = 0;
     public static final int FINISHED = 1;
 
@@ -63,7 +63,7 @@
       <example>
         <title>Salience State: Execution</title>
 
-        <programlisting>State a = new State( "A" );
+        <programlisting role="JAVA">State a = new State( "A" );
 State b = new State( "B" );
 State c = new State( "C" );
 final State d = new State( "D" );
@@ -259,7 +259,7 @@
       <example>
         <title>Inserting a Dynamic Fact</title>
   
-        <programlisting>// By setting dynamic to TRUE, Drools will use JavaBean
+        <programlisting role="JAVA">// By setting dynamic to TRUE, Drools will use JavaBean
 // PropertyChangeListeners so you don't have to call modify or update().
 final boolean dynamic = true;
 
@@ -275,7 +275,7 @@
       <example>
         <title>Setter Example with PropertyChangeSupport</title>
   
-        <programlisting>public void setState(final int newState) {
+        <programlisting role="JAVA">public void setState(final int newState) {
     int oldState = this.state;
     this.state = newState;
     this.changes.firePropertyChange( "state",

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-TroubleTicketExample.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-TroubleTicketExample.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Examples/Section-TroubleTicketExample.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -13,7 +13,7 @@
 			<example>
 				<title>Trouble Ticket Example : Creating and Inserting Facts</title>
 
-				<programlisting>Customer a = new Customer( "A",
+				<programlisting role="JAVA">Customer a = new Customer( "A",
                            "Gold" );
 Customer b = new Customer( "B",
                            "Platinum" );
@@ -180,7 +180,7 @@
 			<para>Referring to the above audit log, we can see the events as they happen. Once the rules start firing, the first items are the "Activation Executed" for the new tickets, as expected (they do nothing, just log the fact). Note the "Activation executed" item for the platinum ticket - that is the next one to go (remember it has the default salience, so it happens after the "New ticket" rule, but otherwise it is immediate - there is no "duration" delay for it). The platinum activation results in a Object modification (which is the escalation) - this in turn creates an activation record for the "escalate ticket" rule - which is what we wanted. Straight after that it executes the action to escalate the ticket.</para>
 
 			<para>The next event to occur is due to the:</para>
-			<programlisting>t3.setStatus( "Done" );
+			<programlisting role="JAVA">t3.setStatus( "Done" );
 
 session.update( ft3,
                 t3 );

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-IDE/Chapter-QuickStart.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-IDE/Chapter-QuickStart.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-IDE/Chapter-QuickStart.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -305,7 +305,7 @@
       you can then deploy it as a binary file. Alternatively, you can use the
       following snippet of code to convert the brl to a drl rule.</para>
 
-    <programlisting>BRXMLPersitence read = BRXMLPersitence.getInstance();
+    <programlisting role="JAVA">BRXMLPersitence read = BRXMLPersitence.getInstance();
 BRDRLPersistence write = BRDRLPersistence.getInstance();
 String brl = ... // read from the .brl file as needed...
 String outputDRL = write.marshall(read.unmarshal(brl));
@@ -436,7 +436,7 @@
       created when executing the rules engine. To create an audit log, use the
       following code:</para>
 
-      <programlisting>WorkingMemory workingMemory = ruleBase.newWorkingMemory();
+      <programlisting role="JAVA">WorkingMemory workingMemory = ruleBase.newWorkingMemory();
 // Create a new Working Memory Logger, that logs to file.
 WorkingMemoryFileLogger logger = new WorkingMemoryFileLogger(workingMemory);
 // An event.log file is created in the subdirectory log (which must exist)

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-JSR94/Section-How_To_Use.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-JSR94/Section-How_To_Use.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-JSR94/Section-How_To_Use.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -22,7 +22,7 @@
     <para><example>
         <title>Automatic RuleServiceProvider Registration</title>
 
-        <programlisting>// RuleServiceProviderImpl is registered to "http://drools.org/"
+        <programlisting role="JAVA">// RuleServiceProviderImpl is registered to "http://drools.org/"
 // via a static initialization block
 Class.forName("org.drools.jsr94.rules.RuleServiceProviderImpl");
 
@@ -51,7 +51,7 @@
       <title>Registering a LocalRuleExecutionSet with the RuleAdministrator
       API</title>
 
-      <programlisting>// Get the RuleAdministration 
+      <programlisting role="JAVA">// Get the RuleAdministration
 RuleAdministrator ruleAdministrator = ruleServiceProvider.getRuleAdministrator();
 LocalRuleExecutionSetProvider ruleExecutionSetProvider =
   ruleAdministrator.getLocalRuleExecutionSetProvider( null );
@@ -79,7 +79,7 @@
     <example>
       <title>Specifying a DSL when registering a LocalRuleExecutionSet</title>
 
-      <programlisting>// Get the RuleAdministration 
+      <programlisting role="JAVA">// Get the RuleAdministration
 RuleAdministration ruleAdministrator = ruleServiceProvider.getRuleAdministrator();
 LocalRuleExecutionSetProvider ruleExecutionSetProvider =
   ruleAdministrator.getLocalRuleExecutionSetProvider( null );
@@ -108,7 +108,7 @@
     <example>
       <title>Register the RuleExecutionSet</title>
 
-      <programlisting>// Register the RuleExecutionSet with the RuleAdministrator
+      <programlisting role="JAVA">// Register the RuleExecutionSet with the RuleAdministrator
 String uri = ruleExecutionSet.getName();
 ruleAdministrator.registerRuleExecutionSet(uri, ruleExecutionSet, null);</programlisting>
     </example>
@@ -123,7 +123,7 @@
     <example>
       <title>Getting the RuleRuntime</title>
 
-      <programlisting>RuleRuntime ruleRuntime = ruleServiceProvider.getRuleRuntime();</programlisting>
+      <programlisting role="JAVA">RuleRuntime ruleRuntime = ruleServiceProvider.getRuleRuntime();</programlisting>
     </example>
 
     <para>To create a rule session you must use one of the two RuleRuntime
@@ -138,7 +138,7 @@
     <example>
       <title>Stateful Rule</title>
 
-      <programlisting>(StatefulRuleSession) session =
+      <programlisting role="JAVA">(StatefulRuleSession) session =
   ruleRuntime.createRuleSession( uri,
                                  null,
                                  RuleRuntime.STATEFUL_SESSION_TYPE );
@@ -153,7 +153,7 @@
     <example>
       <title>Stateless</title>
 
-      <programlisting>(StatelessRuleSession) session =
+      <programlisting role="JAVA">(StatelessRuleSession) session =
   ruleRuntime.createRuleSession( uri,
                                  null,
                                  RuleRuntime.STATELESS_SESSION_TYPE );
@@ -175,7 +175,7 @@
       the execution. In the following example the results are collected in a
       java.util.List which is used as global:</para>
 
-      <programlisting>java.util.List globalList = new java.util.ArrayList( );
+      <programlisting role="JAVA">java.util.List globalList = new java.util.ArrayList( );
 java.util.Map map = new java.util.HashMap( );
 map.put( "list", globalList ); 
 //Open a stateless Session

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Language_Reference/Section-Package.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Language_Reference/Section-Package.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Language_Reference/Section-Package.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -120,7 +120,7 @@
         practice to set all global values before asserting any fact to the
         working memory. Example:</para>
 
-        <programlisting>List list = new ArrayList();
+        <programlisting role="JAVA">List list = new ArrayList();
 WorkingMemory wm = rulebase.newStatefulSession();
 wm.setGlobal( "myGlobalList", list );
 </programlisting>

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Language_Reference/Section-Rule.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Language_Reference/Section-Rule.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Language_Reference/Section-Rule.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -2037,7 +2037,7 @@
         Function implementation, the following is the implementation of the
         <literal>average</literal> function:</para>
 
-        <programlisting>/*
+        <programlisting role="JAVA">/*
  * Copyright 2007 JBoss Inc
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -2250,7 +2250,7 @@
           to the various rule groups: activation groups, agenda groups, and
           rule flow groups. A fairly common paradigm is the activation of some
           agenda group, which could be done with the lengthy call:
-          <programlisting>
+          <programlisting role="JAVA">
 // give focus to the agenda group CleanUp
 kcontext.getKnowledgeRuntime().getAgenda().getAgendaGroup( "CleanUp" ).setFocus();</programlisting>
           (You can achieve the same using <code>drools.setFocus( "CleanUp" )</code>.)

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Quick_Start/Section-A_Little_More_Theory.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Quick_Start/Section-A_Little_More_Theory.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Quick_Start/Section-A_Little_More_Theory.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -15,7 +15,7 @@
       feeling like a rule expert and the answer to that is obvious, but let's
       summarize the differences nonetheless.</para>
 
-      <programlisting>public void helloWorld(Person person) {
+      <programlisting role="JAVA">public void helloWorld(Person person) {
     if ( person.getName().equals( "Chuck" ) ) {
         System.out.println( "Hello Chuck" );
     }
@@ -136,7 +136,7 @@
       of what is actually going on under the hood. Three classes will be used,
       as shown below.</para>
 
-      <programlisting>public class CashFlow {
+      <programlisting role="JAVA">public class CashFlow {
     private Date   date;
     private double amount;
     private int    type;

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Quick_Start/Section-More_On_Building_And_Deploying.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Quick_Start/Section-More_On_Building_And_Deploying.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Quick_Start/Section-More_On_Building_And_Deploying.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -35,7 +35,7 @@
     <para>To use the above XML, the code is almost identical as before, except
     we change the resource type to <code>CHANGE_SET</code>.</para>
 
-    <programlisting>KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
+    <programlisting role="JAVA">KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
 kbuilder.add( ResourceFactory.newClasspathResource( "myChangeSet.xml", getClass() ),
               ResourceType.CHANGE_SET );
 if ( kbuilder.hasErrors() ) {
@@ -85,7 +85,7 @@
     regular polling. We hope to add push-based updates and rebuilds in future
     versions.</para>
 
-    <programlisting>KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent( "MyAgent" );
+    <programlisting role="JAVA">KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent( "MyAgent" );
 kagent.applyChangeSet( ResourceFactory.newUrlResource( url ) );
 KnowledgeBase kbase = kagent.getKnowledgeBase();</programlisting>
 
@@ -103,7 +103,7 @@
     </para>
 
     <para>For polling to occur, the polling and notifier services must be started: 
-<programlisting>ResourceFactory.getResourceChangeNotifierService().start();
+<programlisting role="JAVA">ResourceFactory.getResourceChangeNotifierService().start();
 ResourceFactory.getResourceChangeScannerService().start();</programlisting>
     </para>
 
@@ -137,7 +137,7 @@
         serve also when not using incremental change set processing (see the
         section bellow). When the kbase is recreated its configuration is
         reused, so the classloader is maintained.</para>
-<programlisting>KnowledgeBaseConfiguration kbaseConfig =
+<programlisting role="JAVA">KnowledgeBaseConfiguration kbaseConfig =
     KnowledgeBaseFactory.newKnowledgeBaseConfiguration(null, customClassLoader);
 KnowledgeBase kbase =
     KnowledgeBaseFactory.newKnowledgeBase(kbaseConfig); //kbase with custom classloader
@@ -174,7 +174,7 @@
         <para>
             The following code snippet creates a new Knowledge Agent with its
             "newInstace" property set to false
-            <programlisting>KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
+            <programlisting role="JAVA">KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
 aconf.setProperty("drools.agent.newInstance", "false");
 KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("test agent", null, aconf);
             </programlisting>

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Quick_Start/Section-The_Basics.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Quick_Start/Section-The_Basics.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Quick_Start/Section-The_Basics.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -60,7 +60,7 @@
       <para>So let's start with a very simple example using a driving license
       application.</para>
 
-      <programlisting>public class Applicant {
+      <programlisting role="JAVA">public class Applicant {
     private String name;
     private int age;
     private boolean valid;
@@ -105,7 +105,7 @@
       <code>KnowledgeBase</code>. A Knowledge Base is what we call our collection of
       compiled rules, which are compiled using the <code>KnowledgeBuilder</code>.</para>
 
-      <programlisting>KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
+      <programlisting role="JAVA">KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
 kbuilder.add( ResourceFactory.newClassPathResource( "licenseApplication.drl", getClass() ),
               ResourceType.DRL );
 if ( kbuilder.hasErrors() ) {
@@ -122,7 +122,7 @@
       Now we are ready to build our session and execute against some
       data:</para>
 
-      <programlisting>StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
+      <programlisting role="JAVA">StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
 Applicant applicant = new Applicant( "Mr John Smith", 16 );
 assertTrue( applicant.isValid() );
 ksession.execute( applicant );
@@ -138,7 +138,7 @@
       date of the application, and we'll also move the boolean valid field to the
       <code>Application</code> class.</para>
 
-      <programlisting>public class Applicant {
+      <programlisting role="JAVA">public class Applicant {
     private String name;
     private int age;
     // getter and setter methods here
@@ -178,7 +178,7 @@
       shown below executes against an iterable list, where all collection
       elements are inserted before any matched rules are fired.</para>
 
-      <programlisting>StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
+      <programlisting role="JAVA">StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
 Applicant applicant = new Applicant( "Mr John Smith", 16 );
 Application application = new Application();
 assertTrue( application() );
@@ -193,13 +193,13 @@
       <para>A <code>CommandFactory</code> is used to create commands, so that the following is
       equivalent to <code>execute(Iterable it)</code>:</para>
 
-      <programlisting>ksession.execute( CommandFactory.newInsertIterable( new Object[] { application, applicant } ) );
+      <programlisting role="JAVA">ksession.execute( CommandFactory.newInsertIterable( new Object[] { application, applicant } ) );
 </programlisting>
 
       <para>Batch Executor and Command Factory are particularly useful when working
       with multiple Commands and with output identifiers for obtaining results.</para>
 
-      <programlisting>List&lt;Command&gt; cmds = new ArrayList&lt;Command&gt;();
+      <programlisting role="JAVA">List&lt;Command&gt; cmds = new ArrayList&lt;Command&gt;();
 cmds.add( CommandFactory.newInsert( new Person( "Mr John Smith" ), "mrSmith" );
 cmds.add( CommandFactory.newInsert( new Person( "Mr John Doe" ), "mrDoe" );
 BatchExecutionResults results = ksession.execute( CommandFactory.newBatchExecution( cmds ) );
@@ -275,7 +275,7 @@
       has one sprinkler. If a fire starts in a room, we
       represent that with a single <code>Fire</code> instance.</para>
 
-      <programlisting>public class Room {
+      <programlisting role="JAVA">public class Room {
     private String name
     // getter and setter methods here
 }
@@ -400,7 +400,7 @@
       this time we create a Stateful Session from the Knowledge Base, whereas
       before we created a Stateless Session.</para>
 
-      <programlisting>KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
+      <programlisting role="JAVA">KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
 kbuilder.add( ResourceFactory.newClassPathResource( "fireAlarm.drl", getClass() ),
               ResourceType.DRL );
 if ( kbuilder.hasErrors() ) {
@@ -417,7 +417,7 @@
       allows the matched rules to fire, but without a fire that will
       just produce the health message.</para>
 
-      <programlisting>String[] names = new String[]{"kitchen", "bedroom", "office", "livingroom"};
+      <programlisting role="JAVA">String[] names = new String[]{"kitchen", "bedroom", "office", "livingroom"};
 Map&lt;String,Room&gt; name2room = new HashMap&lt;String,Room&gt;();
 for( String name: names ){
     Room room = new Room( name );
@@ -439,7 +439,7 @@
       the engine, once <code>fireAllRules()</code> is called, the alarm is raised and the
       respective sprinklers are turned on.</para>
 
-      <programlisting>Fire kitchenFire = new Fire( name2room.get( "kitchen" ) );
+      <programlisting role="JAVA">Fire kitchenFire = new Fire( name2room.get( "kitchen" ) );
 Fire officeFire = new Fire( name2room.get( "office" ) );
 
 FactHandle kitchenFireHandle = ksession.insert( kitchenFire );
@@ -455,7 +455,7 @@
       instances are retracted. This results in the sprinklers being turned off, the alarm
       being cancelled, and eventually the health message is printed again.</para>
 
-      <programlisting>ksession.retract( kitchenFireHandle );
+      <programlisting role="JAVA">ksession.retract( kitchenFireHandle );
 ksession.retract( officeFireHandle );
 
 ksession.fireAllRules();</programlisting>

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-Rules.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-Rules.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-Rules.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -142,7 +142,7 @@
     </indexterm>
     Rule Set. A Package declares imports, global variables, functions and rules.</para>
 
-    <programlisting>
+    <programlisting role="JAVA">
 <![CDATA[
 package com.sample
 
@@ -185,7 +185,7 @@
 
     <para>The example above is analogous to :</para>
 
-    <programlisting>
+    <programlisting role="JAVA">
 <![CDATA[
 public void cheddarCheese(Cheese cheese) {
   if ( cheese.getType().equals("cheddar") {

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-The_Drools_Rule_Engine.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-The_Drools_Rule_Engine.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-The_Drools_Rule_Engine.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -81,7 +81,7 @@
     <example>
       <title>Building a Package from Multiple Sources</title>
 
-      <programlisting>PackageBuilder builder = new PackageBuilder();
+      <programlisting role="JAVA">PackageBuilder builder = new PackageBuilder();
 builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "package1.drl" ) ) );
 builder.addPackageFromXml( new InputStreamReader( getClass().getResourceAsStream( "package2.xml" ) ) );
 builder.addRuleFlow( new InputStreamReader( getClass().getResourceAsStream( "ruleflow.rfm" ) ) );
@@ -98,7 +98,7 @@
     <example>
       <title>Checking the PackageBuilder for errors</title>
 
-      <programlisting>PackageBuilder builder = new PackageBuilder();
+      <programlisting role="JAVA">PackageBuilder builder = new PackageBuilder();
 builder.addPackageFromDrl( new InputStreamReader( getClass().getResourceAsStream( "package1.drl" ) ) );
 PackageBuilderErrors errors = builder.getErrors();</programlisting>
     </example>
@@ -158,7 +158,7 @@
       <title>Configuring the <code>JavaDialectConfiguration</code> to use JANINO via a
       setter</title>
 
-      <programlisting>PackageBuilderConfiguration cfg = new PackageBuilderConfiguration( );
+      <programlisting role="JAVA">PackageBuilderConfiguration cfg = new PackageBuilderConfiguration( );
 JavaDialectConfiguration javaConf = (JavaDialectConfiguration) cfg.getDialectConfiguration( "java" );
 javaConf.setCompiler( JavaDialectConfiguration.JANINO );            </programlisting>
     </example>
@@ -173,7 +173,7 @@
     <example>
       <title>Configuring the <code>JavaDialectConfiguration</code> to use JANINO</title>
 
-      <programlisting>Properties properties = new Properties();
+      <programlisting role="JAVA">Properties properties = new Properties();
 properties.setProperty( "drools.dialect.java.compiler",
                         "JANINO" );
 PackageBuilderConfiguration cfg = new PackageBuilderConfiguration( properties );
@@ -195,7 +195,7 @@
       <title>Configuring the <code>PackageBuilder</code> to use JANINO via a
       property</title>
 
-      <programlisting>PackageBuilderConfiguration conf = new PackageBuilderConfiguration();
+      <programlisting role="JAVA">PackageBuilderConfiguration conf = new PackageBuilderConfiguration();
 conf.setCompiler( PackageBuilderConfiguration.JANINO );
 PackageBuilder builder = new PackageBuilder( conf );</programlisting>
     </example>
@@ -238,7 +238,7 @@
     <example>
       <title>Adding a Package to a new RuleBase</title>
 
-      <programlisting>RuleBase ruleBase  = RuleBaseFactory.newRuleBase();
+      <programlisting role="JAVA">RuleBase ruleBase  = RuleBaseFactory.newRuleBase();
 ruleBase.addPackage( pkg  );        </programlisting>
     </example>
 
@@ -271,14 +271,14 @@
     to maintain a reference, but only do so if you know the <code>RuleBase</code> will not
     be updated. References are not stored for stateless sessions.</para>
 
-    <programlisting>ruleBase.newStatefulSession();  // maintains a reference.
+    <programlisting role="JAVA">ruleBase.newStatefulSession();  // maintains a reference.
 ruleBase.newStatefulSession( false ); // do not maintain a reference    </programlisting>
 
     <para>Packages can be added and removed at any time, and all changes will be
     propagated to the existing stateful sessions, but don't forget to call
     <code>fireAllRules()</code> for resulting Activations to fire.</para>
 
-    <programlisting>ruleBase.addPackage( pkg );  // Add a package instance
+    <programlisting role="JAVA">ruleBase.addPackage( pkg );  // Add a package instance
 ruleBase.removePackage( "org.com.sample" );  // remove a package, and all its parts, by its namespace
 ruleBase.removeRule( "org.com.sample", "my rule" ); // remove a specific rule from a namespace         </programlisting>
 
@@ -294,7 +294,7 @@
     cross product behavior (remove or keep identity equals across
     products).</para>
 
-    <programlisting>RuleBaseConfiguration conf = new RuleBaseConfiguration();
+    <programlisting role="JAVA">RuleBaseConfiguration conf = new RuleBaseConfiguration();
 conf.setAssertBehaviour( AssertBehaviour.IDENTITY );
 conf.setRemoveIdentities( true );
 RuleBase ruleBase = RuleBaseFactory.newRuleBase( conf );</programlisting>
@@ -368,7 +368,7 @@
       <code>WorkingMemory</code>. It is also used for interactions with the <code>WorkingMemory</code>
       when you wish to retract or modify an object.</para>
 
-      <programlisting>Cheese stilton = new Cheese("stilton");
+      <programlisting role="JAVA">Cheese stilton = new Cheese("stilton");
 FactHandle stiltonHandle = session.insert( stilton );      </programlisting>
 
       <para>As mentioned in the Rule Base section a Working Memory may operate
@@ -397,7 +397,7 @@
       (see the <code>not</code> and <code>exist</code> keywords). Retraction is done using the
       <code>FactHandle</code> that was returned during the assert.</para>
 
-      <programlisting>Cheese stilton = new Cheese("stilton");
+      <programlisting role="JAVA">Cheese stilton = new Cheese("stilton");
 FactHandle stiltonHandle = session.insert( stilton );
 ....
 session.retract( stiltonHandle );            </programlisting>
@@ -419,7 +419,7 @@
       call <code>wm.modifyRetract()</code> before making your changes and
       <code>wm.modifyInsert()</code> after the changes.</para>
 
-      <programlisting>Cheese stilton = new Cheese("stilton");
+      <programlisting role="JAVA">Cheese stilton = new Cheese("stilton");
 FactHandle stiltonHandle = workingMemory.insert( stilton );
 ....
 stilton.setPrice( 100 );
@@ -443,7 +443,7 @@
       the global type and identifier first will result in an exception being
       thrown. To set the global on the session use <code>session.setGlobal(identifier, value)</code>:</para>
 
-      <programlisting>List list = new ArrayList();
+      <programlisting role="JAVA">List list = new ArrayList();
 session.setGlobal("list", list);           </programlisting>
 
       <para>If a rule evaluates on a global before you set it you will get a
@@ -550,7 +550,7 @@
         <example>
           <title>Safely modifying attributes in the application
           code</title>
-          <programlisting>         // create session
+          <programlisting role="JAVA">         // create session
          StatefulSession session = ruleBase.newStatefulSession();
 
          // get facts
@@ -584,7 +584,7 @@
         <para>Alternatively, it is possible to disable shadow facts through an API
         call:</para>
 
-        <programlisting>RuleBaseConfiguration conf = new RuleBaseConfiguration();
+        <programlisting role="JAVA">RuleBaseConfiguration conf = new RuleBaseConfiguration();
 conf.setShadowProxy( false );
 ...
 RuleBase ruleBase = RuleBaseFactory.newRuleBase( conf );
@@ -611,7 +611,7 @@
       of Drools will bundle some to make it easier.) To use an object in
       dynamic mode specify true for the second assertObject parameter.</para>
 
-      <programlisting>Cheese stilton = new Cheese("stilton");
+      <programlisting role="JAVA">Cheese stilton = new Cheese("stilton");
 FactHandle stiltonHandle = workingMemory.insert( stilton, true );  //specifies that this is a dynamic fact            </programlisting>
 
       <para>To make a JavaBean dynamic add a <code>PropertyChangeSupport</code> field
@@ -619,7 +619,7 @@
       calls the <code>PropertyChangeSupport</code> instance with
       <code>firePropertyChange</code>.</para>
 
-      <programlisting>private final PropertyChangeSupport changes = new PropertyChangeSupport( this );
+      <programlisting role="JAVA">private final PropertyChangeSupport changes = new PropertyChangeSupport( this );
 ...
 public void addPropertyChangeListener(final PropertyChangeListener l) {
     this.changes.addPropertyChangeListener( l );
@@ -679,7 +679,7 @@
 
     <example>
       <title>Createing a <code>StatefulSession</code></title>
-      <programlisting>StatefulSession session = ruleBase.newStatefulSession();</programlisting>
+      <programlisting role="JAVA">StatefulSession session = ruleBase.newStatefulSession();</programlisting>
     </example>
   </section>
 
@@ -701,7 +701,7 @@
 
     <example>
       <title>Creating a <code>StatelessSession</code></title>
-      <programlisting>StatelessSession session = ruleBase.newStatelessSession();
+      <programlisting role="JAVA">StatelessSession session = ruleBase.newStatelessSession();
 session.execute( new Cheese( "cheddar" ) );</programlisting>
     </example>
 
@@ -771,7 +771,7 @@
     <example>
       <title><code>GlobalExporter</code> with <code>StatelessSession</code>s</title>
 
-      <programlisting>StatelessSession session = ruleBase.newStatelessSession();
+      <programlisting role="JAVA">StatelessSession session = ruleBase.newStatelessSession();
 session.setGlobalExporter( new CopyIdentifiersGlobalExporter( new String[]{"list"} ) );
 StatelessSessionResult result = session.executeWithResults( new Cheese( "stilton" ) );
 List list = ( List ) result.getGlobal( "list" );</programlisting>
@@ -925,7 +925,7 @@
       <para>To use a filter specify it while calling <code>FireAllRules</code>. The
       following example permits only rules ending in the string <emphasis>Test</emphasis>.
       All others will be filtered out.
-      <programlisting>workingMemory.fireAllRules( new RuleNameEndsWithAgendaFilter( "Test" ) );</programlisting></para>
+      <programlisting role="JAVA">workingMemory.fireAllRules( new RuleNameEndsWithAgendaFilter( "Test" ) );</programlisting></para>
     </section>
   </section>
 
@@ -1116,7 +1116,7 @@
     instance to the session. It prints events resulting from rules being 
     fired.</para>
 
-    <programlisting>session.addEventListener( new DefaultAgendaEventListener() {                            
+    <programlisting role="JAVA">session.addEventListener( new DefaultAgendaEventListener() {
    public void afterActivationFired(AfterActivationFiredEvent event) {
        super.afterActivationFired( event );
        System.out.println( event );
@@ -1129,7 +1129,7 @@
     each method with a debug print statement. To print all Working
     Memory events, you add a listener like this:</para>
 
-    <programlisting>session.addEventListener( new DebugWorkingMemoryEventListener() );        </programlisting>
+    <programlisting role="JAVA">session.addEventListener( new DebugWorkingMemoryEventListener() );        </programlisting>
 
     <para>The Eclipse-based Rule IDE also provides an audit logger and
     graphical viewer, so that the rule engine can log events for later

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Language/Section-Package.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Language/Section-Package.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Language/Section-Package.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -142,7 +142,7 @@
         practice to set all global values before asserting any fact to the
         working memory. Example:</para>
 
-        <programlisting>List list = new ArrayList();
+        <programlisting role="JAVA">List list = new ArrayList();
 WorkingMemory wm = rulebase.newStatefulSession();
 wm.setGlobal( "myGlobalList", list );
 </programlisting>

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-User_Guide/Section-Building.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-User_Guide/Section-Building.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-User_Guide/Section-Building.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -61,7 +61,7 @@
     <example>
       <title>Creating a new KnowledgeBuilder</title>
 
-      <programlisting>KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();</programlisting>
+      <programlisting role="JAVA">KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();</programlisting>
     </example>
 
     <para>A configuration can be created using the <code>KnowledgeBuilderFactory</code>.
@@ -75,7 +75,7 @@
     <example>
       <title>Creating a new KnowledgeBuilder with a custom ClassLoader</title>
 
-      <programlisting>KnowledgeBuilderConfiguration kbuilderConf = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(null, classLoader );
+      <programlisting role="JAVA">KnowledgeBuilderConfiguration kbuilderConf = KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(null, classLoader );
 KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(kbuilderConf);
 </programlisting>
     </example>
@@ -88,7 +88,7 @@
     <example>
       <title>Adding DRL Resources</title>
 
-      <programlisting>kbuilder.add( ResourceFactory.newFileResource( "/project/myrules.drl" ),
+      <programlisting role="JAVA">kbuilder.add( ResourceFactory.newFileResource( "/project/myrules.drl" ),
               ResourceType.DRL);
 </programlisting>
     </example>
@@ -101,7 +101,7 @@
     <example>
       <title>Validating</title>
 
-      <programlisting>if( kbuilder.hasErrors() ) {
+      <programlisting role="JAVA">if( kbuilder.hasErrors() ) {
     System.out.println( kbuilder.getErrors() );
     return;
 }
@@ -117,7 +117,7 @@
     <example>
       <title>Getting the KnowledgePackages</title>
 
-      <programlisting>Collection&lt;KnowledgePackage&gt; kpkgs = kbuilder.getKnowledgePackages();
+      <programlisting role="JAVA">Collection&lt;KnowledgePackage&gt; kpkgs = kbuilder.getKnowledgePackages();
 </programlisting>
     </example>
 
@@ -126,7 +126,7 @@
     <example>
       <title>Putting it all together</title>
 
-      <programlisting>KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
+      <programlisting role="JAVA">KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
 if( kbuilder.hasErrors() ) {
     System.out.println( kbuilder.getErrors() );
     return;
@@ -262,7 +262,7 @@
     <example>
       <title>Loading the ChangeSet XML</title>
 
-      <programlisting>kbuilder.add( ResourceFactory.newUrlResource( url ), ResourceType.CHANGE_SET );
+      <programlisting role="JAVA">kbuilder.add( ResourceFactory.newUrlResource( url ), ResourceType.CHANGE_SET );
 </programlisting>
     </example>
 

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-User_Guide/Section-Deploying.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-User_Guide/Section-Deploying.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-User_Guide/Section-Deploying.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -78,7 +78,7 @@
     <example>
       <title>Creating a new KnowledgeBase</title>
 
-      <programlisting>KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();</programlisting>
+      <programlisting role="JAVA">KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();</programlisting>
     </example>
 
     <para>If a custom class loader was used with the <code>KnowledgeBuilder</code> to
@@ -89,7 +89,7 @@
     <example>
       <title>Creating a new KnowledgeBase with a custom ClassLoader</title>
 
-      <programlisting>KnowledgeBaseConfiguration kbaseConf =
+      <programlisting role="JAVA">KnowledgeBaseConfiguration kbaseConf =
     KnowledgeBaseFactory.createKnowledgeBaseConfiguration( null, cl );
 KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase( kbaseConf );</programlisting>
     </example>
@@ -106,7 +106,7 @@
     <example>
       <title>Add KnowledgePackages to a KnowledgeBase</title>
 
-      <programlisting>Collection&lt;KnowledgePackage&gt; kpkgs = kbuilder.getKnowledgePackages();
+      <programlisting role="JAVA">Collection&lt;KnowledgePackage&gt; kpkgs = kbuilder.getKnowledgePackages();
 
 KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
 kbase.addKnowledgePackages( kpkgs );</programlisting>
@@ -133,7 +133,7 @@
     <example>
       <title>Writing the KnowledgePackage to an OutputStream</title>
 
-      <programlisting>ObjectOutputStream out = new ObjectOutputStream( new FileOutputStream( fileName ) );
+      <programlisting role="JAVA">ObjectOutputStream out = new ObjectOutputStream( new FileOutputStream( fileName ) );
 out.writeObject( kpkgs );
 out.close();
 </programlisting>
@@ -142,7 +142,7 @@
     <example>
       <title>Reading the KnowledgePackage from an InputStream</title>
 
-      <programlisting>ObjectInputStream in = new ObjectInputStream( new FileInputStream( fileName ) );
+      <programlisting role="JAVA">ObjectInputStream in = new ObjectInputStream( new FileInputStream( fileName ) );
 // The input stream might contain an individual
 // package or a collection.
 @SuppressWarnings( "unchecked" )
@@ -210,7 +210,7 @@
     <example>
       <title>Creating the KnowledgeAgent</title>
 
-      <programlisting>KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent( "MyAgent" );
+      <programlisting role="JAVA">KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent( "MyAgent" );
 </programlisting>
     </example>
 
@@ -240,7 +240,7 @@
     <example>
       <title>Writing the KnowledgePackage to an OutputStream</title>
 
-      <programlisting>KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent( "MyAgent" );
+      <programlisting role="JAVA">KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent( "MyAgent" );
 kagent.applyChangeSet( ResourceFactory.newUrlResource( url ) );
 KnowledgeBase kbase = kagent.getKnowledgeBase();
 </programlisting>
@@ -253,7 +253,7 @@
     <example>
       <title>Starting the Scanning and Notification Services</title>
 
-      <programlisting>ResourceFactory.getResourceChangeNotifierService().start();
+      <programlisting role="JAVA">ResourceFactory.getResourceChangeNotifierService().start();
 ResourceFactory.getResourceChangeScannerService().start();
 </programlisting>
     </example>
@@ -267,7 +267,7 @@
     <example>
       <title>Changing the Scanning Intervals</title>
 
-      <programlisting>ResourceChangeScannerConfiguration sconf =
+      <programlisting role="JAVA">ResourceChangeScannerConfiguration sconf =
     ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
 // Set the disk scanning interval to 30s, default is 60s.
 sconf.setProperty( "drools.resource.scanner.interval", "30" ); 
@@ -293,7 +293,7 @@
     <example>
       <title>Using an existing KnowledgeBase</title>
 
-      <programlisting>KnowledgeBaseConfiguration kbaseConf =
+      <programlisting role="JAVA">KnowledgeBaseConfiguration kbaseConf =
     KnowledgeBaseFactory.createKnowledgeBaseConfiguration( null, cl );
 KnowledgeBase kbase KnowledgeBaseFactory.newKnowledgeBase( kbaseConf );
 // Populate kbase with resources here.
@@ -343,7 +343,7 @@
     <example>
       <title>Change the Scanning Behavior</title>
 
-      <programlisting>KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
+      <programlisting role="JAVA">KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
 
 KnowledgeAgentConfiguration kaconf =
     KnowledgeAgentFactory.newKnowledgeAgentConfiguation();

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-User_Guide/Section-Running.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-User_Guide/Section-Running.xml	2010-07-26 09:54:50 UTC (rev 34168)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-User_Guide/Section-Running.xml	2010-07-26 10:25:57 UTC (rev 34169)
@@ -23,7 +23,7 @@
     <example>
       <title>Creating a new KnowledgeBase</title>
 
-      <programlisting>KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();</programlisting>
+      <programlisting role="JAVA">KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();</programlisting>
     </example>
   </section>
 
@@ -47,7 +47,7 @@
     <example>
       <title>Create a StatefulKnowledgeSession from a KnowledgeBase</title>
 
-      <programlisting>StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
+      <programlisting role="JAVA">StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
 </programlisting>
     </example>
   </section>
@@ -118,7 +118,7 @@
         for interactions with the <code>WorkingMemory</code> when you wish to
         retract or modify an object.</para>
 
-        <programlisting>Cheese stilton = new Cheese("stilton");
+        <programlisting role="JAVA">Cheese stilton = new Cheese("stilton");
 FactHandle stiltonHandle = ksession.insert( stilton );      </programlisting>
 
         <para>As mentioned in the Knowledge Base section, a Working Memory may
@@ -150,7 +150,7 @@
         is done using the <code>FactHandle</code> that was returned by the
         insert call.</para>
 
-        <programlisting>Cheese stilton = new Cheese("stilton");
+        <programlisting role="JAVA">Cheese stilton = new Cheese("stilton");
 FactHandle stiltonHandle = ksession.insert( stilton );
 ....
 ksession.retract( stiltonHandle );            </programlisting>
@@ -174,7 +174,7 @@
         <literal>modify</literal> statement is supported, providing simplified calls to
         the object's setters.</para>
 
-        <programlisting>Cheese stilton = new Cheese("stilton");
+        <programlisting role="JAVA">Cheese stilton = new Cheese("stilton");
 FactHandle stiltonHandle = workingMemory.insert( stilton );
 ...
 stilton.setPrice( 100 );
@@ -236,7 +236,7 @@
         <example>
           <title>Simple Query Example</title>
 
-          <programlisting>QueryResults results =
+          <programlisting role="JAVA">QueryResults results =
     ksession.getQueryResults( "my query", new Object[] { "string" } );
 for ( QueryResultsRow row : results ) {
     System.out.println( row.get( "varName" ) );
@@ -283,7 +283,7 @@
         the session use <code>ksession.setGlobal(identifier,
         value)</code>:</para>
 
-        <programlisting>List list = new ArrayList();
+        <programlisting role="JAVA">List list = new ArrayList();
 ksession.setGlobal("list", list);           </programlisting>
 
         <para>If a rule evaluates on a global before you set it you will get a
@@ -335,7 +335,7 @@
         <para>To use a filter specify it while calling
         <code>fireAllRules()</code>. The following example permits only rules
         ending in the string <code>"Test"</code>. All others will be filtered
-        out. <programlisting>ksession.fireAllRules( new RuleNameEndsWithAgendaFilter( "Test" ) );</programlisting></para>
+        out. <programlisting role="JAVA">ksession.fireAllRules( new RuleNameEndsWithAgendaFilter( "Test" ) );</programlisting></para>
       </section>
     </section>
   </section>
@@ -460,7 +460,7 @@
       this group. It is also always the first group on the stack, given focus
       initially, by default.</para>
 
-      <para><programlisting>ksession.getAgenda().getAgendaGroup( "Group A" ).setFocus();</programlisting></para>
+      <para><programlisting role="JAVA">ksession.getAgenda().getAgendaGroup( "Group A" ).setFocus();</programlisting></para>
     </section>
 
     <section>
@@ -482,7 +482,7 @@
       and after that rule has fired all the other rules are cancelled from the
       agenda. The <code>clear()</code> method can be called at any time, which
       cancels all of the activations before one has had a chance to fire.
-      <programlisting>ksession.getAgenda().getActivationGroup( "Group B" ).clear();</programlisting></para>
+      <programlisting role="JAVA">ksession.getAgenda().getActivationGroup( "Group B" ).clear();</programlisting></para>
     </section>
 
     <section>
@@ -505,7 +505,7 @@
       elaboration of the ruleflow diagram reaches the node representing the
       group. Here too, the <code>clear()</code> method can be called at any
       time to cancels all activations still remaining on the Agenda.
-      <programlisting>ksession.getAgenda().getRuleFlowGroup( "Group C" ).clear();</programlisting></para>
+      <programlisting role="JAVA">ksession.getAgenda().getRuleFlowGroup( "Group C" ).clear();</programlisting></para>
     </section>
   </section>
 
@@ -556,7 +556,7 @@
     <example>
       <title>Adding an AgendaEventListener</title>
 
-      <programlisting>ksession.addEventListener( new DefaultAgendaEventListener() {                            
+      <programlisting role="JAVA">ksession.addEventListener( new DefaultAgendaEventListener() {
    public void afterActivationFired(AfterActivationFiredEvent event) {
        super.afterActivationFired( event );
        System.out.println( event );
@@ -572,7 +572,7 @@
     <example>
       <title>Creating a new KnowledgeBuilder</title>
 
-      <programlisting>ksession.addEventListener( new DebugWorkingMemoryEventListener() );     </programlisting>
+      <programlisting role="JAVA">ksession.addEventListener( new DebugWorkingMemoryEventListener() );     </programlisting>
     </example>
 
     <para>All emitted events implement the <code>KnowlegeRuntimeEvent</code>
@@ -669,7 +669,7 @@
     <example>
       <title>FileLogger</title>
 
-      <programlisting>KnowledgeRuntimeLogger logger =
+      <programlisting role="JAVA">KnowledgeRuntimeLogger logger =
   KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, "logdir/mylogfile");
 ...
 logger.close();</programlisting>
@@ -714,7 +714,7 @@
       <title>Simple StatelessKnowledgeSession execution with a
       Collection</title>
 
-      <programlisting>KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
+      <programlisting role="JAVA">KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
 kbuilder.add( ResourceFactory.newFileSystemResource( fileName ), ResourceType.DRL );
 if (kbuilder.hasErrors() ) {
     System.out.println( kbuilder.getErrors() );
@@ -732,7 +732,7 @@
       <title>Simple StatelessKnowledgeSession execution with InsertElements
       Command</title>
 
-      <programlisting>ksession.execute( CommandFactory.newInsertElements( collection ) );  </programlisting>
+      <programlisting role="JAVA">ksession.execute( CommandFactory.newInsertElements( collection ) );  </programlisting>
     </example>
 
     <para>If you wanted to insert the collection itself, and the collection's
@@ -762,7 +762,7 @@
         <example>
           <title>Session scoped global</title>
 
-          <programlisting>StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
+          <programlisting role="JAVA">StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
 // Set a global hbnSession, that can be used for DB interactions in the rules.
 ksession.setGlobal( "hbnSession", hibernateSession );
 // Execute while being able to resolve the "hbnSession" identifier.  
@@ -794,7 +794,7 @@
     <example>
       <title>Out identifiers</title>
 
-      <programlisting>// Set up a list of commands
+      <programlisting role="JAVA">// Set up a list of commands
 List cmds = new ArrayList();
 cmds.add( CommandFactory.newSetGlobal( "list1", new ArrayList(), true ) );
 cmds.add( CommandFactory.newInsert( new Person( "jon", 102 ), "person" ) );
@@ -964,7 +964,7 @@
     <example>
       <title>StatefulKnowledgeSessionPipeline</title>
 
-      <programlisting>Pipeline pipeline = PipelineFactory.newStatefulKnowledgeSessionPipeline( ksession );
+      <programlisting role="JAVA">Pipeline pipeline = PipelineFactory.newStatefulKnowledgeSessionPipeline( ksession );
 pipeline.setReceiver( receiver );</programlisting>
     </example>
 
@@ -981,7 +981,7 @@
     <example>
       <title>StageExceptionHandler</title>
 
-      <programlisting>Transformer transformer = PipelineFactory.newXStreamFromXmlTransformer( xstream );
+      <programlisting role="JAVA">Transformer transformer = PipelineFactory.newXStreamFromXmlTransformer( xstream );
 transformer.setStageExceptionHandler( new StageExceptionHandler() { .... } );
 </programlisting>
     </example>
@@ -1002,7 +1002,7 @@
     <example>
       <title>StageExceptionHandler</title>
 
-      <programlisting>ResultHandler resultHandler = new ResultHandlerImpl();
+      <programlisting role="JAVA">ResultHandler resultHandler = new ResultHandlerImpl();
 pipeline.insert( factHandle, resultHandler );  
 System.out.println( resultHandler );
 ...
@@ -1034,7 +1034,7 @@
     <example>
       <title>Constructing a pipeline</title>
 
-      <programlisting>// Make the results (here: FactHandles) available to the user 
+      <programlisting role="JAVA">// Make the results (here: FactHandles) available to the user
 Action executeResultHandler = PipelineFactory.newExecuteResultHandler();
 
 // Insert the transformed object into the session
@@ -1070,7 +1070,7 @@
     <example>
       <title>Using JMS with Pipeline</title>
 
-      <programlisting>// As this is a service, it's more likely that
+      <programlisting role="JAVA">// As this is a service, it's more likely that
 // the results will be logged or sent as a return message.
 Action resultHandlerStage = PipelineFactory.newExecuteResultHandler();
 
@@ -1111,13 +1111,13 @@
       <para><example>
           <title>XStream FromXML transformer stage</title>
 
-          <programlisting>XStream xstream = new XStream();
+          <programlisting role="JAVA">XStream xstream = new XStream();
 Transformer transformer = PipelineFactory.newXStreamFromXmlTransformer( xstream );
 transformer.setReceiver( nextStage );</programlisting>
         </example> <example>
           <title>XStream ToXML transformer stage</title>
 
-          <programlisting>XStream xstream = new XStream();
+          <programlisting role="JAVA">XStream xstream = new XStream();
 Transformer transformer = PipelineFactory.newXStreamToXmlTransformer( xstream );
 transformer.setReceiver( receiver );</programlisting>
         </example></para>
@@ -1148,7 +1148,7 @@
       <para><example>
           <title>JAXB XSD Generation into the KnowlegeBuilder</title>
 
-          <programlisting>Options xjcOpts = new Options();
+          <programlisting role="JAVA">Options xjcOpts = new Options();
 xjcOpts.setSchemaLanguage( Language.XMLSCHEMA );
 KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
  
@@ -1161,7 +1161,7 @@
         </example> <example>
           <title>JAXB From XML transformer stage</title>
 
-          <programlisting>JAXBContext jaxbCtx =
+          <programlisting role="JAVA">JAXBContext jaxbCtx =
   KnowledgeBuilderHelper.newJAXBContext( classNames, kbase );
 Unmarshaller unmarshaller = jaxbCtx.createUnmarshaller();
 Transformer transformer = PipelineFactory.newJaxbFromXmlTransformer( unmarshaller );
@@ -1170,7 +1170,7 @@
         </example> <example>
           <title>JAXB to XML transformer stage</title>
 
-          <programlisting>Marshaller marshaller = jaxbCtx.createMarshaller();
+          <programlisting role="JAVA">Marshaller marshaller = jaxbCtx.createMarshaller();
 Transformer transformer = PipelineFactory.newJaxbToXmlTransformer( marshaller );
 transformer.setReceiver( receiver );</programlisting>
         </example></para>
@@ -1182,14 +1182,14 @@
       <para><example>
           <title>Smooks FromSource transformer stage</title>
 
-          <programlisting>Smooks smooks = new Smooks( getClass().getResourceAsStream( "smooks-config.xml" ) );
+          <programlisting role="JAVA">Smooks smooks = new Smooks( getClass().getResourceAsStream( "smooks-config.xml" ) );
 Transformer transformer =
   PipelineFactory.newSmooksFromSourceTransformer( smooks, "orderItem" );
 transformer.setReceiver( receiver );</programlisting>
         </example> <example>
           <title>Smooks ToSource transformer stage</title>
 
-          <programlisting>Smooks smooks = new Smooks( getClass().getResourceAsStream( "smooks-config.xml" ) );
+          <programlisting role="JAVA">Smooks smooks = new Smooks( getClass().getResourceAsStream( "smooks-config.xml" ) );
 Transformer transformer = PipelineFactory.newSmooksToSourceTransformer( smooks );
 transformer.setReceiver( receiver );</programlisting>
         </example></para>
@@ -1209,7 +1209,7 @@
       <example>
         <title>JXLS transformer stage</title>
 
-        <programlisting>XLSReader mainReader =
+        <programlisting role="JAVA">XLSReader mainReader =
   ReaderBuilder.buildFromXML( ResourceFactory.newClassPathResource( "departments.xml", getClass() ).getInputStream() );
 String expr = "[ 'departments' : new java.util.ArrayList()," +
               "  'company' : new org.drools.runtime.pipeline.impl.Company() ]";
@@ -1228,7 +1228,7 @@
       <example>
         <title>JMS Messenger stage</title>
 
-        <programlisting>// As this is a service, it's more likely the results will be logged
+        <programlisting role="JAVA">// As this is a service, it's more likely the results will be logged
 // or sent as a return message.
 Action resultHandlerStage = PipelineFactory.newExecuteResultHandler();
 
@@ -1361,7 +1361,7 @@
     <example>
       <title>Insert Command</title>
 
-      <programlisting>StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
+      <programlisting role="JAVA">StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
 ExecutionResults bresults =
   ksession.execute( CommandFactory.newInsert( new Cheese( "stilton" ), "stilton_id" ) );
 Stilton stilton = bresults.getValue( "stilton_id" );
@@ -1375,7 +1375,7 @@
     <example>
       <title>InsertElements Command</title>
 
-      <programlisting>StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
+      <programlisting role="JAVA">StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
 Command cmd = CommandFactory.newInsertElements( Arrays.asList( Object[] { 
                   new Cheese( "stilton" ),
                   new Cheese( "brie" ),
@@ -1407,7 +1407,7 @@
     <example>
       <title>BatchExecution Command</title>
 
-      <programlisting>StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
+      <programlisting role="JAVA">StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
 
 List cmds = new ArrayList();        
 cmds.add( CommandFactory.newInsertObject( new Cheese( "stilton", 1), "stilton") );
@@ -1468,7 +1468,7 @@
     <example>
       <title>Pipeline for CommandExecutor</title>
 
-      <programlisting>Action executeResultHandler = PipelineFactory.newExecuteResultHandler();
+      <programlisting role="JAVA">Action executeResultHandler = PipelineFactory.newExecuteResultHandler();
 
 Action assignResult = PipelineFactory.newAssignObjectAsResult();
 assignResult.setReceiver( executeResultHandler );
@@ -1512,7 +1512,7 @@
     <example>
       <title>Simple Pipeline ResultHandler</title>
 
-      <programlisting>public static class ResultHandlerImpl implements ResultHandler {
+      <programlisting role="JAVA">public static class ResultHandlerImpl implements ResultHandler {
     Object object;
 
     public void handleResult(Object object) {
@@ -1529,7 +1529,7 @@
     <example>
       <title>Using a Pipeline</title>
 
-      <programlisting>
+      <programlisting role="JAVA">
 InputStream inXml = ...;
 ResultHandler resultHandler = new ResultHandlerImpl();
 pipeline.insert( inXml, resultHandler );
@@ -1829,7 +1829,7 @@
     <example>
       <title>Simple Marshaller Example</title>
 
-      <programlisting>// ksession is the StatefulKnowledgeSession
+      <programlisting role="JAVA">// ksession is the StatefulKnowledgeSession
 // kbase is the KnowledgeBase
 ByteArrayOutputStream baos = new ByteArrayOutputStream();
 Marshaller marshaller = MarshallerFactory.newMarshaller( kbase );
@@ -1859,7 +1859,7 @@
     <example>
       <title>IdentityMarshallingStrategy</title>
 
-      <programlisting>ByteArrayOutputStream baos = new ByteArrayOutputStream();
+      <programlisting role="JAVA">ByteArrayOutputStream baos = new ByteArrayOutputStream();
 ObjectMarshallingStrategy oms = MarshallerFactory.newIdentityMarshallingStrategy()
 Marshaller marshaller =
   MarshallerFactory.newMarshaller( kbase, new ObjectMarshallingStrategy[]{ oms } );
@@ -1887,7 +1887,7 @@
     <example>
       <title>IdentityMarshallingStrategy with Acceptor</title>
 
-      <programlisting>ByteArrayOutputStream baos = new ByteArrayOutputStream();
+      <programlisting role="JAVA">ByteArrayOutputStream baos = new ByteArrayOutputStream();
 ObjectMarshallingStrategyAcceptor identityAcceptor =
   MarshallerFactory.newClassFilterAcceptor( new String[] { "org.domain.pkg1.*" } );
 ObjectMarshallingStrategy identityStrategy =
@@ -1918,7 +1918,7 @@
     <example>
       <title>Simple example using transactions</title>
 
-      <programlisting>Environment env = KnowledgeBaseFactory.newEnvironment();
+      <programlisting role="JAVA">Environment env = KnowledgeBaseFactory.newEnvironment();
 env.set( EnvironmentName.ENTITY_MANAGER_FACTORY,
          Persistence.createEntityManagerFactory( "emf-name" ) );
 env.set( EnvironmentName.TRANSACTION_MANAGER,
@@ -1948,7 +1948,7 @@
     <example>
       <title>Loading a StatefulKnowledgeSession</title>
 
-      <programlisting>StatefulKnowledgeSession ksession =
+      <programlisting role="JAVA">StatefulKnowledgeSession ksession =
   JPAKnowledgeService.loadStatefulKnowledgeSession( sessionId, kbase, null, env );
 </programlisting>
     </example>
@@ -1986,7 +1986,7 @@
     <example>
       <title>Configuring JTA DataSource</title>
 
-      <programlisting>PoolingDataSource ds = new PoolingDataSource();
+      <programlisting role="JAVA">PoolingDataSource ds = new PoolingDataSource();
 ds.setUniqueName( "jdbc/BitronixJTADataSource" );
 ds.setClassName( "org.h2.jdbcx.JdbcDataSource" );
 ds.setMaxPoolSize( 3 );



More information about the jboss-svn-commits mailing list