You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2011/12/15 17:44:27 UTC

svn commit: r1214850 [1/2] - in /incubator/lcf/trunk: ./ framework/ framework/example-common/ framework/example-multiprocess/ framework/example-singleprocess/ framework/jetty-example/ framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunn...

Author: kwright
Date: Thu Dec 15 16:44:26 2011
New Revision: 1214850

URL: http://svn.apache.org/viewvc?rev=1214850&view=rev
Log:
Fix for CONNECTORS-313.

Added:
    incubator/lcf/trunk/framework/example-common/
      - copied from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/example-common/
    incubator/lcf/trunk/framework/example-common/connectors.xml
      - copied unchanged from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/example-common/connectors.xml
    incubator/lcf/trunk/framework/example-multiprocess/
      - copied from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/
    incubator/lcf/trunk/framework/example-multiprocess/initialize.bat
      - copied unchanged from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/initialize.bat
    incubator/lcf/trunk/framework/example-multiprocess/initialize.sh
      - copied unchanged from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/initialize.sh
    incubator/lcf/trunk/framework/example-multiprocess/lock-clean.bat
      - copied unchanged from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/lock-clean.bat
    incubator/lcf/trunk/framework/example-multiprocess/lock-clean.sh
      - copied unchanged from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/lock-clean.sh
    incubator/lcf/trunk/framework/example-multiprocess/logging.ini
      - copied unchanged from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/logging.ini
    incubator/lcf/trunk/framework/example-multiprocess/properties.xml
      - copied unchanged from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/properties.xml
    incubator/lcf/trunk/framework/example-multiprocess/start-agents.bat
      - copied unchanged from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/start-agents.bat
    incubator/lcf/trunk/framework/example-multiprocess/start-agents.sh
      - copied unchanged from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/start-agents.sh
    incubator/lcf/trunk/framework/example-multiprocess/start-database.bat
      - copied unchanged from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/start-database.bat
    incubator/lcf/trunk/framework/example-multiprocess/start-database.sh
      - copied unchanged from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/start-database.sh
    incubator/lcf/trunk/framework/example-multiprocess/stop-agents.bat
      - copied unchanged from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/stop-agents.bat
    incubator/lcf/trunk/framework/example-multiprocess/stop-agents.sh
      - copied unchanged from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/example-multiprocess/stop-agents.sh
    incubator/lcf/trunk/framework/example-singleprocess/
      - copied from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/example-singleprocess/
    incubator/lcf/trunk/framework/example-singleprocess/logging.ini
      - copied unchanged from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/example-singleprocess/logging.ini
    incubator/lcf/trunk/framework/example-singleprocess/properties.xml
      - copied unchanged from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/example-singleprocess/properties.xml
    incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/InitializeAndRegister.java
      - copied unchanged from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/InitializeAndRegister.java
    incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/Connectors.java
      - copied unchanged from r1214848, incubator/lcf/branches/CONNECTORS-313/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/Connectors.java
Removed:
    incubator/lcf/trunk/framework/jetty-example/
    incubator/lcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/Connectors.java
Modified:
    incubator/lcf/trunk/   (props changed)
    incubator/lcf/trunk/CHANGES.txt
    incubator/lcf/trunk/build.xml
    incubator/lcf/trunk/framework/build.xml
    incubator/lcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFJettyRunner.java
    incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
    incubator/lcf/trunk/site/src/documentation/content/xdocs/how-to-build-and-deploy.xml

Propchange: incubator/lcf/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 15 16:44:26 2011
@@ -12,4 +12,5 @@
 /incubator/lcf/branches/CONNECTORS-284:1189305-1190398
 /incubator/lcf/branches/CONNECTORS-287:1200390-1210394
 /incubator/lcf/branches/CONNECTORS-290:1204836-1205502
+/incubator/lcf/branches/CONNECTORS-313:1213173-1214848
 /incubator/lcf/branches/CONNECTORS-32:1092556-1094216

Modified: incubator/lcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/CHANGES.txt?rev=1214850&r1=1214849&r2=1214850&view=diff
==============================================================================
--- incubator/lcf/trunk/CHANGES.txt (original)
+++ incubator/lcf/trunk/CHANGES.txt Thu Dec 15 16:44:26 2011
@@ -3,6 +3,10 @@ $Id$
 
 ======================= 0.4-dev =====================
 
+CONNECTORS-313: Reorganize the dist directory to include a multiprocess
+example as well as a single process example.
+(Shinichiro Abe, Karl Wright)
+
 CONNECTORS-320: Fix issues with remote HSQLDB driver having to do
 with schema discovery.
 (Karl Wright)

Modified: incubator/lcf/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/build.xml?rev=1214850&r1=1214849&r2=1214850&view=diff
==============================================================================
--- incubator/lcf/trunk/build.xml (original)
+++ incubator/lcf/trunk/build.xml Thu Dec 15 16:44:26 2011
@@ -1178,19 +1178,43 @@
           </copy>
     </target>
 
-    <target name="deliver-framework" depends="build-framework">
-        <mkdir dir="dist/processes"/>
-        <copy todir="dist/processes">
-            <fileset dir="framework/dist/processes"/>
+    <target name="preclean-for-delivery">
+        <mkdir dir="dist"/>
+        <mkdir dir="dist/example"/>
+        <mkdir dir="dist/multiprocess-example"/>
+        <delete file="dist/connectors.xml"/>
+        <delete file="dist/example/properties.xml"/>
+        <delete file="dist/multiprocess-example/properties.xml"/>
+    </target>
+    
+    <target name="deliver-framework" depends="preclean-for-delivery,build-framework">
+        <mkdir dir="dist/multiprocess-example"/>
+        <copy todir="dist/multiprocess-example">
+            <fileset dir="framework/dist/multiprocess-example"/>
+        </copy>
+        <mkdir dir="dist/example"/>
+        <copy todir="dist/example">
+            <fileset dir="framework/dist/example"/>
         </copy>
         <mkdir dir="dist/script-engine"/>
         <copy todir="dist/script-engine">
             <fileset dir="framework/dist/script-engine"/>
         </copy>
-        <mkdir dir="dist/web"/>
-        <copy todir="dist/web">
-            <fileset dir="framework/dist/web"/>
+        <mkdir dir="dist"/>
+        <copy todir="dist">
+            <fileset dir="framework/dist">
+                <include name="connectors.xml"/>
+            </fileset>
         </copy>
+        <mkdir dir="dist/multiprocess-example/syncharea"/>
+        <!-- Build a manifest file.  There doesn't seem to be any good way to do this automatically in ant without developing my own
+        custom task, so I've hard coded all the class path libs. -->
+        <mkdir dir="build/example"/>
+        <manifest file="build/example/manifest">
+            <attribute name="Main-Class" value="org.apache.manifoldcf.jettyrunner.ManifoldCFJettyRunner"/>
+            <attribute name="Class-Path" value="lib/commons-codec.jar lib/commons-collections.jar lib/commons-el.jar lib/commons-fileupload.jar lib/commons-httpclient-mcf.jar lib/commons-io.jar lib/commons-logging.jar lib/hsqldb.jar lib/derbyclient.jar lib/derby.jar lib/derbyLocale_cs.jar lib/derbyLocale_de_DE.jar lib/derbyLocale_es.jar lib/derbyLocale_fr.jar lib/derbyLocale_hu.jar lib/derbyLocale_it.jar lib/derbyLocale_ja_JP.jar lib/derbyLocale_ko_KR.jar lib/derbyLocale_pl.jar lib/derbyLocale_pt_BR.jar lib/derbyLocale_ru.jar lib/derbyLocale_zh_CN.jar lib/derbyLocale_zh_TW.jar lib/derbynet.jar lib/derbyrun.jar lib/derbytools.jar lib/eclipse-ecj.jar lib/jasper-6.0.24.jar lib/jasper-el-6.0.24.jar lib/jdbcpool-0.99.jar lib/jetty-6.1.26-patched-JETTY-1340.jar lib/jetty-util-6.1.26-patched-JETTY-1340.jar lib/jsp-api-2.1-glassfish-2.1.v20091210.jar lib/json.jar lib/mcf-agents.jar lib/mcf-core.jar lib/mcf-jetty-runner.jar lib/mcf-pull-agent.jar lib/mcf-ui-core.jar lib/log4j-1.2.jar
  lib/postgresql.jar lib/serializer.jar lib/servlet-api-2.5-20081211.jar lib/tomcat-juli-6.0.24.jar lib/xalan2.jar lib/xercesImpl-mcf.jar lib/xml-apis.jar"/>
+        </manifest>
+        <jar destfile="dist/example/start.jar" manifest="build/example/manifest"/>
     </target>
     
     <target name="deliver-framework-doc" depends="doc-framework">
@@ -1215,10 +1239,11 @@
     </target>
 
     <target name="deliver-activedirectory-connector" depends="calculate-activedirectory-condition" if="activedirectory.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/activedirectory/dist/lib"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your authority connectors here --&gt;" value="&lt;!-- Add your authority connectors here --&gt;&#0010;  &lt;authorityconnector name=&quot;Active Directory&quot; class=&quot;org.apache.manifoldcf.authorities.authorities.activedirectory.ActiveDirectoryAuthority&quot;/&gt;"/>
     </target>
 
     <target name="deliver-activedirectory-connector-doc" depends="calculate-activedirectory-doc-condition" if="activedirectory-doc.include">
@@ -1253,10 +1278,11 @@
     </target>
 
     <target name="deliver-alfresco-connector" depends="calculate-alfresco-condition" if="alfresco.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/alfresco/dist/lib"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;Alfresco&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.alfresco.AlfrescoRepositoryConnector&quot;/&gt;"/>
     </target>
 
     <target name="deliver-alfresco-connector-doc" depends="calculate-alfresco-doc-condition" if="alfresco-doc.include">
@@ -1281,10 +1307,12 @@
     </target>
 
     <target name="deliver-cmis-connector" depends="calculate-cmis-condition" if="cmis.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/cmis/dist/lib"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;CMIS&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.cmis.CmisRepositoryConnector&quot;/&gt;"/>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your authority connectors here --&gt;" value="&lt;!-- Add your authority connectors here --&gt;&#0010;  &lt;authorityconnector name=&quot;CMIS&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.cmis.CmisAuthorityConnector&quot;/&gt;"/>
     </target>
 
     <target name="deliver-cmis-connector-doc" depends="calculate-cmis-doc-condition" if="cmis-doc.include">
@@ -1309,8 +1337,8 @@
     </target>
 
     <target name="deliver-documentum-connector" depends="calculate-documentum-condition" if="documentum.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/documentum/dist/lib"/>
         </copy>
         <mkdir dir="dist/documentum-server-process"/>
@@ -1321,6 +1349,8 @@
         <copy todir="dist/documentum-registry-process">
             <fileset dir="connectors/documentum/dist/registry-process"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your authority connectors here --&gt;" value="&lt;!-- Add your authority connectors here --&gt;&#0010;  &lt;authorityconnector name=&quot;Documentum&quot; class=&quot;org.apache.manifoldcf.crawler.authorities.DCTM.AuthorityConnector&quot;/&gt;"/>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;Documentum&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.DCTM.DCTM&quot;/&gt;"/>
     </target>
     
     <target name="deliver-documentum-connector-doc" depends="calculate-documentum-doc-condition" if="documentum-doc.include">
@@ -1345,8 +1375,8 @@
     </target>
 
     <target name="deliver-filenet-connector" depends="calculate-filenet-condition" if="filenet.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/filenet/dist/lib"/>
         </copy>
         <mkdir dir="dist/filenet-server-process"/>
@@ -1357,6 +1387,7 @@
         <copy todir="dist/filenet-registry-process">
             <fileset dir="connectors/filenet/dist/registry-process"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;FileNet&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector&quot;/&gt;"/>
     </target>
     
     <target name="deliver-filenet-connector-doc" depends="calculate-filenet-doc-condition" if="filenet-doc.include">
@@ -1381,10 +1412,11 @@
     </target>
 
     <target name="deliver-filesystem-connector" depends="calculate-filesystem-condition" if="filesystem.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/filesystem/dist/lib"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;File system&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector&quot;/&gt;"/>
     </target>
     
     <target name="deliver-filesystem-connector-doc" depends="calculate-filesystem-doc-condition" if="filesystem-doc.include">
@@ -1409,10 +1441,11 @@
     </target>
 
     <target name="deliver-gts-connector" depends="calculate-gts-condition" if="gts.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/gts/dist/lib"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your output connectors here --&gt;" value="&lt;!-- Add your output connectors here --&gt;&#0010;  &lt;outputconnector name=&quot;MetaCarta GTS&quot; class=&quot;org.apache.manifoldcf.agents.output.gts.GTSConnector&quot;/&gt;"/>
     </target>
     
     <target name="deliver-gts-connector-doc" depends="calculate-gts-doc-condition" if="gts-doc.include">
@@ -1437,10 +1470,11 @@
     </target>
 
     <target name="deliver-jdbc-connector" depends="calculate-jdbc-condition" if="jdbc.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/jdbc/dist/lib"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;JDBC&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConnector&quot;/&gt;"/>
     </target>
     
     <target name="deliver-jdbc-connector-doc" depends="calculate-jdbc-doc-condition" if="jdbc-doc.include">
@@ -1465,10 +1499,11 @@
     </target>
 
     <target name="deliver-jcifs-connector" depends="calculate-jcifs-condition" if="jcifs.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/jcifs/dist/lib"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;Windows shares&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.sharedrive.SharedDriveConnector&quot;/&gt;"/>
     </target>
     
     <target name="deliver-jcifs-connector-doc" depends="calculate-jcifs-doc-condition" if="jcifs-doc.include">
@@ -1493,10 +1528,12 @@
     </target>
 
     <target name="deliver-livelink-connector" depends="calculate-livelink-condition" if="livelink.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/livelink/dist/lib"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your authority connectors here --&gt;" value="&lt;!-- Add your authority connectors here --&gt;&#0010;  &lt;authorityconnector name=&quot;LiveLink&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.livelink.LivelinkAuthority&quot;/&gt;"/>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;LiveLink&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.livelink.LivelinkConnector&quot;/&gt;"/>
     </target>
 
     <target name="deliver-livelink-connector-doc" depends="calculate-livelink-doc-condition" if="livelink-doc.include">
@@ -1521,14 +1558,15 @@
     </target>
 
     <target name="deliver-solr-connector" depends="calculate-solr-condition" if="solr.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/solr/dist/lib"/>
         </copy>
         <mkdir dir="dist/solr-integration"/>
         <copy todir="dist/solr-integration">
             <fileset dir="connectors/solr/dist/integration"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your output connectors here --&gt;" value="&lt;!-- Add your output connectors here --&gt;&#0010;  &lt;outputconnector name=&quot;Solr&quot; class=&quot;org.apache.manifoldcf.agents.output.solr.SolrConnector&quot;/&gt;"/>
     </target>
     
     <target name="deliver-solr-connector-doc" depends="calculate-solr-doc-condition" if="solr-doc.include">
@@ -1553,10 +1591,12 @@
     </target>
 
     <target name="deliver-memex-connector" depends="calculate-memex-condition" if="memex.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/memex/dist/lib"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your authority connectors here --&gt;" value="&lt;!-- Add your authority connectors here --&gt;&#0010;  &lt;authorityconnector name=&quot;Memex Patriarch&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.memex.MemexAuthority&quot;/&gt;"/>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;Memex Patriarch&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.memex.MemexConnector&quot;/&gt;"/>
     </target>
     
     <target name="deliver-memex-connector-doc" depends="calculate-memex-doc-condition" if="memex-doc.include">
@@ -1581,8 +1621,8 @@
     </target>
 
     <target name="deliver-meridio-connector" depends="calculate-meridio-condition" if="meridio.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/meridio/dist/lib"/>
         </copy>
         <mkdir dir="dist/wsdd"/>
@@ -1593,6 +1633,10 @@
         <copy todir="dist/meridio-integration">
             <fileset dir="connectors/meridio/dist/integration"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your authority connectors here --&gt;" value="&lt;!-- Add your authority connectors here --&gt;&#0010;  &lt;authorityconnector name=&quot;Meridio&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.meridio.MeridioAuthority&quot;/&gt;"/>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;Meridio&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.meridio.MeridioConnector&quot;/&gt;"/>
+        <replace file="dist/example/properties.xml" token="&lt;!-- WSDD references --&gt;" value="&lt;!-- WSDD references --&gt;&#0010;  &lt;property name=&quot;org.apache.manifoldcf.meridio.wsddpath&quot; value=&quot;../wsdd/meridio-client-config.wsdd&quot;/&gt;"/>
+        <replace file="dist/multiprocess-example/properties.xml" token="&lt;!-- WSDD references --&gt;" value="&lt;!-- WSDD references --&gt;&#0010;  &lt;property name=&quot;org.apache.manifoldcf.meridio.wsddpath&quot; value=&quot;../wsdd/meridio-client-config.wsdd&quot;/&gt;"/>
     </target>
     
     <target name="deliver-meridio-connector-doc" depends="calculate-meridio-doc-condition" if="meridio-doc.include">
@@ -1617,10 +1661,11 @@
     </target>
 
    <target name="deliver-opensearchserver-connector" depends="calculate-opensearchserver-condition" if="opensearchserver.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/opensearchserver/dist/lib"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your output connectors here --&gt;" value="&lt;!-- Add your output connectors here --&gt;&#0010;  &lt;outputconnector name=&quot;OpenSearchServer&quot; class=&quot;org.apache.manifoldcf.agents.output.opensearchserver.OpenSearchServerConnector&quot;/&gt;"/>
     </target>
 
     <target name="deliver-opensearchserver-connector-doc" depends="calculate-opensearchserver-doc-condition" if="opensearchserver-doc.include">
@@ -1645,10 +1690,11 @@
     </target>
 
     <target name="deliver-nullauthority-connector" depends="calculate-nullauthority-condition" if="nullauthority.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/nullauthority/dist/lib"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your authority connectors here --&gt;" value="&lt;!-- Add your authority connectors here --&gt;&#0010;  &lt;authorityconnector name=&quot;Null&quot; class=&quot;org.apache.manifoldcf.authorities.authorities.nullauthority.NullAuthority&quot;/&gt;"/>
     </target>
     
     <target name="deliver-nullauthority-connector-doc" depends="calculate-nullauthority-doc-condition" if="nullauthority-doc.include">
@@ -1673,10 +1719,11 @@
     </target>
 
     <target name="deliver-nulloutput-connector" depends="calculate-nulloutput-condition" if="nulloutput.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/nulloutput/dist/lib"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your output connectors here --&gt;" value="&lt;!-- Add your output connectors here --&gt;&#0010;  &lt;outputconnector name=&quot;Null&quot; class=&quot;org.apache.manifoldcf.agents.output.nullconnector.NullConnector&quot;/&gt;"/>
     </target>
     
     <target name="deliver-nulloutput-connector-doc" depends="calculate-nulloutput-doc-condition" if="nulloutput-doc.include">
@@ -1701,10 +1748,11 @@
     </target>
 
     <target name="deliver-rss-connector" depends="calculate-rss-condition" if="rss.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/rss/dist/lib"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;RSS&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.rss.RSSConnector&quot;/&gt;"/>
     </target>
     
     <target name="deliver-rss-connector-doc" depends="calculate-rss-doc-condition" if="rss-doc.include">
@@ -1729,8 +1777,8 @@
     </target>
 
     <target name="deliver-sharepoint-connector" depends="calculate-sharepoint-condition" if="sharepoint.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/sharepoint/dist/lib"/>
         </copy>
         <mkdir dir="dist/wsdd"/>
@@ -1741,6 +1789,9 @@
         <copy todir="dist/sharepoint-integration">
             <fileset dir="connectors/sharepoint/dist/integration"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;SharePoint&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.sharepoint.SharePointRepository&quot;/&gt;"/>
+        <replace file="dist/example/properties.xml" token="&lt;!-- WSDD references --&gt;" value="&lt;!-- WSDD references --&gt;&#0010;  &lt;property name=&quot;org.apache.manifoldcf.sharepoint.wsddpath&quot; value=&quot;../wsdd/sharepoint-client-config.wsdd&quot;/&gt;"/>
+        <replace file="dist/multiprocess-example/properties.xml" token="&lt;!-- WSDD references --&gt;" value="&lt;!-- WSDD references --&gt;&#0010;  &lt;property name=&quot;org.apache.manifoldcf.sharepoint.wsddpath&quot; value=&quot;../wsdd/sharepoint-client-config.wsdd&quot;/&gt;"/>
     </target>
     
     <target name="deliver-sharepoint-connector-doc" depends="calculate-sharepoint-doc-condition" if="sharepoint-doc.include">
@@ -1765,10 +1816,11 @@
     </target>
 
     <target name="deliver-webcrawler-connector" depends="calculate-webcrawler-condition" if="webcrawler.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/webcrawler/dist/lib"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;Web&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.webcrawler.WebcrawlerConnector&quot;/&gt;"/>
     </target>
     
     <target name="deliver-webcrawler-connector-doc" depends="calculate-webcrawler-doc-condition" if="webcrawler-doc.include">
@@ -1793,10 +1845,11 @@
     </target>
 
     <target name="deliver-wiki-connector" depends="calculate-wiki-condition" if="wiki.include">
-        <mkdir dir="dist/lib"/>
-        <copy todir="dist/lib">
+        <mkdir dir="dist/connector-lib"/>
+        <copy todir="dist/connector-lib">
             <fileset dir="connectors/wiki/dist/lib"/>
         </copy>
+        <replace file="dist/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;Wiki&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.wiki.WikiConnector&quot;/&gt;"/>
     </target>
     
     <target name="deliver-wiki-connector-doc" depends="calculate-wiki-doc-condition" if="wiki-doc.include">
@@ -1806,221 +1859,6 @@
         </copy>
     </target>
 
-
-    <target name="cleanup-example">
-        <delete file="dist/example/connectors.xml"/>
-        <delete file="dist/example/properties.xml"/>
-    </target>
-    
-    <target name="deliver-framework-example" depends="cleanup-example,build-framework">
-        <mkdir dir="dist/example"/>
-        <copy todir="dist/example">
-            <fileset dir="framework/dist/example"/>
-        </copy>
-    </target>
-    
-    <target name="deliver-activedirectory-example" depends="deliver-framework-example,calculate-activedirectory-condition" if="activedirectory.include">
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/activedirectory/dist/lib"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your authority connectors here --&gt;" value="&lt;!-- Add your authority connectors here --&gt;&#0010;  &lt;authorityconnector name=&quot;Active Directory&quot; class=&quot;org.apache.manifoldcf.authorities.authorities.activedirectory.ActiveDirectoryAuthority&quot;/&gt;"/>
-    </target>
-    
-    <target name="deliver-alfresco-example" depends="deliver-framework-example,calculate-alfresco-condition" if="alfresco.include">
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/alfresco/dist/lib"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;Alfresco&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.alfresco.AlfrescoRepositoryConnector&quot;/&gt;"/>
-    </target>
-
-    <target name="deliver-cmis-example" depends="deliver-framework-example,calculate-cmis-condition" if="cmis.include">
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/cmis/dist/lib"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;CMIS&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.cmis.CmisRepositoryConnector&quot;/&gt;"/>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your authority connectors here --&gt;" value="&lt;!-- Add your authority connectors here --&gt;&#0010;  &lt;authorityconnector name=&quot;CMIS&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.cmis.CmisAuthorityConnector&quot;/&gt;"/>
-    </target>
-    
-    <target name="deliver-documentum-example" depends="deliver-framework-example,calculate-documentum-condition" if="documentum.include">
-        <mkdir dir="dist/example/documentum-server-process"/>
-        <copy todir="dist/example/documentum-server-process">
-            <fileset dir="connectors/documentum/dist/server-process"/>
-        </copy>
-        <mkdir dir="dist/example/documentum-registry-process"/>
-        <copy todir="dist/example/documentum-registry-process">
-            <fileset dir="connectors/documentum/dist/registry-process"/>
-        </copy>
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/documentum/dist/lib"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your authority connectors here --&gt;" value="&lt;!-- Add your authority connectors here --&gt;&#0010;  &lt;authorityconnector name=&quot;Documentum&quot; class=&quot;org.apache.manifoldcf.crawler.authorities.DCTM.AuthorityConnector&quot;/&gt;"/>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;Documentum&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.DCTM.DCTM&quot;/&gt;"/>
-    </target>
-
-    <target name="deliver-filesystem-example" depends="deliver-framework-example,calculate-filesystem-condition" if="filesystem.include">
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/filesystem/dist/lib"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;File system&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.filesystem.FileConnector&quot;/&gt;"/>
-    </target>
-
-    <target name="deliver-filenet-example" depends="deliver-framework-example,calculate-filenet-condition" if="filenet.include">
-        <mkdir dir="dist/example/filenet-server-process"/>
-        <copy todir="dist/example/filenet-server-process">
-            <fileset dir="connectors/filenet/dist/server-process"/>
-        </copy>
-        <mkdir dir="dist/example/filenet-registry-process"/>
-        <copy todir="dist/example/filenet-registry-process">
-            <fileset dir="connectors/filenet/dist/registry-process"/>
-        </copy>
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/filenet/dist/lib"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;FileNet&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector&quot;/&gt;"/>
-    </target>
-
-    <target name="deliver-gts-example" depends="deliver-framework-example,calculate-gts-condition" if="gts.include">
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/gts/dist/lib"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your output connectors here --&gt;" value="&lt;!-- Add your output connectors here --&gt;&#0010;  &lt;outputconnector name=&quot;MetaCarta GTS&quot; class=&quot;org.apache.manifoldcf.agents.output.gts.GTSConnector&quot;/&gt;"/>
-    </target>
-
-    <target name="deliver-jcifs-example" depends="deliver-framework-example,calculate-jcifs-condition" if="jcifs.include">
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/jcifs/dist/lib"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;Windows shares&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.sharedrive.SharedDriveConnector&quot;/&gt;"/>
-    </target>
-
-    <target name="deliver-jdbc-example" depends="deliver-framework-example,calculate-jdbc-condition" if="jdbc.include">
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/jdbc/dist/lib"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;JDBC&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConnector&quot;/&gt;"/>
-    </target>
-
-    <target name="deliver-livelink-example" depends="deliver-framework-example,calculate-livelink-condition" if="livelink.include">
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/livelink/dist/lib"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your authority connectors here --&gt;" value="&lt;!-- Add your authority connectors here --&gt;&#0010;  &lt;authorityconnector name=&quot;LiveLink&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.livelink.LivelinkAuthority&quot;/&gt;"/>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;LiveLink&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.livelink.LivelinkConnector&quot;/&gt;"/>
-    </target>
-
-    <target name="deliver-memex-example" depends="deliver-framework-example,calculate-memex-condition" if="memex.include">
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/memex/dist/lib"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your authority connectors here --&gt;" value="&lt;!-- Add your authority connectors here --&gt;&#0010;  &lt;authorityconnector name=&quot;Memex Patriarch&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.memex.MemexAuthority&quot;/&gt;"/>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;Memex Patriarch&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.memex.MemexConnector&quot;/&gt;"/>
-    </target>
-
-    <target name="deliver-meridio-example" depends="deliver-framework-example,calculate-meridio-condition" if="meridio.include">
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/meridio/dist/lib"/>
-        </copy>
-        <mkdir dir="dist/example/wsdd"/>
-        <copy todir="dist/example/wsdd">
-            <fileset dir="connectors/meridio/dist/wsdd"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your authority connectors here --&gt;" value="&lt;!-- Add your authority connectors here --&gt;&#0010;  &lt;authorityconnector name=&quot;Meridio&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.meridio.MeridioAuthority&quot;/&gt;"/>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;Meridio&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.meridio.MeridioConnector&quot;/&gt;"/>
-        <replace file="dist/example/properties.xml" token="&lt;!-- WSDD references --&gt;" value="&lt;!-- WSDD references --&gt;&#0010;  &lt;property name=&quot;org.apache.manifoldcf.meridio.wsddpath&quot; value=&quot;./wsdd/meridio-client-config.wsdd&quot;/&gt;"/>
-    </target>
-
-    <target name="deliver-nullauthority-example" depends="deliver-framework-example,calculate-nullauthority-condition" if="nullauthority.include">
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/nullauthority/dist/lib"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your authority connectors here --&gt;" value="&lt;!-- Add your authority connectors here --&gt;&#0010;  &lt;authorityconnector name=&quot;Null&quot; class=&quot;org.apache.manifoldcf.authorities.authorities.nullauthority.NullAuthority&quot;/&gt;"/>
-    </target>
-
-    <target name="deliver-nulloutput-example" depends="deliver-framework-example,calculate-nulloutput-condition" if="nulloutput.include">
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/nulloutput/dist/lib"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your output connectors here --&gt;" value="&lt;!-- Add your output connectors here --&gt;&#0010;  &lt;outputconnector name=&quot;Null&quot; class=&quot;org.apache.manifoldcf.agents.output.nullconnector.NullConnector&quot;/&gt;"/>
-    </target>
-
-    <target name="deliver-rss-example" depends="deliver-framework-example,calculate-rss-condition" if="rss.include">
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/rss/dist/lib"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;RSS&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.rss.RSSConnector&quot;/&gt;"/>
-    </target>
-
-    <target name="deliver-sharepoint-example" depends="deliver-framework-example,calculate-sharepoint-condition" if="sharepoint.include">
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/sharepoint/dist/lib"/>
-        </copy>
-        <mkdir dir="dist/example/wsdd"/>
-        <copy todir="dist/example/wsdd">
-            <fileset dir="connectors/sharepoint/dist/wsdd"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;SharePoint&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.sharepoint.SharePointRepository&quot;/&gt;"/>
-        <replace file="dist/example/properties.xml" token="&lt;!-- WSDD references --&gt;" value="&lt;!-- WSDD references --&gt;&#0010;  &lt;property name=&quot;org.apache.manifoldcf.sharepoint.wsddpath&quot; value=&quot;./wsdd/sharepoint-client-config.wsdd&quot;/&gt;"/>
-    </target>
-
-    <target name="deliver-solr-example" depends="deliver-framework-example,calculate-solr-condition" if="solr.include">
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/solr/dist/lib"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your output connectors here --&gt;" value="&lt;!-- Add your output connectors here --&gt;&#0010;  &lt;outputconnector name=&quot;Solr&quot; class=&quot;org.apache.manifoldcf.agents.output.solr.SolrConnector&quot;/&gt;"/>
-    </target>
-
-   <target name="deliver-opensearchserver-example" depends="deliver-framework-example,calculate-opensearchserver-condition" if="opensearchserver.include">
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/opensearchserver/dist/lib"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your output connectors here --&gt;" value="&lt;!-- Add your output connectors here --&gt;&#0010;  &lt;outputconnector name=&quot;OpenSearchServer&quot; class=&quot;org.apache.manifoldcf.agents.output.opensearchserver.OpenSearchServerConnector&quot;/&gt;"/>
-    </target>
-	
-    <target name="deliver-webcrawler-example" depends="deliver-framework-example,calculate-webcrawler-condition" if="webcrawler.include">
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/webcrawler/dist/lib"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;Web&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.webcrawler.WebcrawlerConnector&quot;/&gt;"/>
-    </target>
-
-    <target name="deliver-wiki-example" depends="deliver-framework-example,calculate-wiki-condition" if="wiki.include">
-        <mkdir dir="dist/example/connector-lib"/>
-        <copy todir="dist/example/connector-lib">
-            <fileset dir="connectors/wiki/dist/lib"/>
-        </copy>
-        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;Wiki&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.wiki.WikiConnector&quot;/&gt;"/>
-    </target>
-
-    <target name="deliver-example" depends="deliver-framework-example,deliver-activedirectory-example,deliver-alfresco-example,deliver-cmis-example,deliver-documentum-example,deliver-filesystem-example,deliver-filenet-example,deliver-gts-example,deliver-jcifs-example,deliver-jdbc-example,deliver-livelink-example,deliver-memex-example,deliver-meridio-example,deliver-nullauthority-example,deliver-nulloutput-example,deliver-opensearchserver-example,deliver-rss-example,deliver-sharepoint-example,deliver-solr-example,deliver-webcrawler-example,deliver-wiki-example">
-        <!-- Build a manifest file.  There doesn't seem to be any good way to do this automatically in ant without developing my own
-        custom task, so I've hard coded all the class path libs. -->
-        <mkdir dir="build/example"/>
-        <manifest file="build/example/manifest">
-            <attribute name="Main-Class" value="org.apache.manifoldcf.jettyrunner.ManifoldCFJettyRunner"/>
-            <attribute name="Class-Path" value="lib/commons-codec.jar lib/commons-collections.jar lib/commons-el.jar lib/commons-fileupload.jar lib/commons-httpclient-mcf.jar lib/commons-io.jar lib/commons-logging.jar lib/hsqldb.jar lib/derbyclient.jar lib/derby.jar lib/derbyLocale_cs.jar lib/derbyLocale_de_DE.jar lib/derbyLocale_es.jar lib/derbyLocale_fr.jar lib/derbyLocale_hu.jar lib/derbyLocale_it.jar lib/derbyLocale_ja_JP.jar lib/derbyLocale_ko_KR.jar lib/derbyLocale_pl.jar lib/derbyLocale_pt_BR.jar lib/derbyLocale_ru.jar lib/derbyLocale_zh_CN.jar lib/derbyLocale_zh_TW.jar lib/derbynet.jar lib/derbyrun.jar lib/derbytools.jar lib/eclipse-ecj.jar lib/jasper-6.0.24.jar lib/jasper-el-6.0.24.jar lib/jdbcpool-0.99.jar lib/jetty-6.1.26-patched-JETTY-1340.jar lib/jetty-util-6.1.26-patched-JETTY-1340.jar lib/jsp-api-2.1-glassfish-2.1.v20091210.jar lib/json.jar lib/mcf-agents.jar lib/mcf-core.jar lib/mcf-jetty-runner.jar lib/mcf-pull-agent.jar lib/mcf-ui-core.jar lib/log4j-1.2.jar
  lib/postgresql.jar lib/serializer.jar lib/servlet-api-2.5-20081211.jar lib/tomcat-juli-6.0.24.jar lib/xalan2.jar lib/xercesImpl-mcf.jar lib/xml-apis.jar"/>
-        </manifest>
-        <jar destfile="dist/example/start.jar" manifest="build/example/manifest"/>
-    </target>
-    
     <target name="calculate-filesystem-tests-condition" depends="calculate-filesystem-condition,calculate-nulloutput-condition">
       <condition property="filesystem-tests.include">
         <and>
@@ -3651,7 +3489,7 @@
     <target name="deliver-proprietary-connectors" depends="deliver-documentum-connector,deliver-filenet-connector,deliver-livelink-connector,deliver-memex-connector,deliver-meridio-connector,deliver-sharepoint-connector"/>
     <target name="deliver-proprietary-connectors-doc" depends="deliver-documentum-connector-doc,deliver-filenet-connector-doc,deliver-livelink-connector-doc,deliver-memex-connector-doc,deliver-meridio-connector-doc,deliver-sharepoint-connector-doc"/>
 
-    <target name="build-dev" depends="deliver-framework,deliver-open-connectors,deliver-output-connectors,deliver-lgpl-connectors,deliver-proprietary-connectors,deliver-example"/>
+    <target name="build-dev" depends="deliver-framework,deliver-open-connectors,deliver-output-connectors,deliver-lgpl-connectors,deliver-proprietary-connectors"/>
     <target name="build" depends="build-dev,cleanup-afterbuild"/>
     <target name="javadoc" depends="deliver-framework-doc,deliver-open-connectors-doc,deliver-output-connectors-doc,deliver-lgpl-connectors-doc,deliver-proprietary-connectors-doc"/>
     <target name="doc" depends="deliver-site-doc"/>

Modified: incubator/lcf/trunk/framework/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/build.xml?rev=1214850&r1=1214849&r2=1214850&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/build.xml (original)
+++ incubator/lcf/trunk/framework/build.xml Thu Dec 15 16:44:26 2011
@@ -333,24 +333,39 @@
         </copy>
     </target>
     
+    <target name="example-common">
+        <copy todir="dist">
+            <fileset dir="example-common">
+                <include name="connectors.xml"/>
+            </fileset>
+        </copy>
+    </target>
+    
     <target name="war-authority-service" depends="webapp-authority-service">
-        <mkdir dir="dist/web/war"/>
-        <war destfile="dist/web/war/mcf-authority-service.war" webxml="authority-service/src/main/webapp/WEB-INF/web.xml" basedir="build/webapp/authority-service"/>
+        <mkdir dir="build/war"/>
+        <war destfile="build/war/mcf-authority-service.war" webxml="authority-service/src/main/webapp/WEB-INF/web.xml" basedir="build/webapp/authority-service"/>
     </target>
 
     <target name="war-api-service" depends="webapp-api-service">
-        <mkdir dir="dist/web/war"/>
-        <war destfile="dist/web/war/mcf-api-service.war" webxml="api-service/src/main/webapp/WEB-INF/web.xml" basedir="build/webapp/api-service"/>
+        <mkdir dir="build/war"/>
+        <war destfile="build/war/mcf-api-service.war" webxml="api-service/src/main/webapp/WEB-INF/web.xml" basedir="build/webapp/api-service"/>
     </target>
 
     <target name="war-crawler-ui" depends="webapp-crawler-ui">
-        <mkdir dir="dist/web/war"/>
-        <war destfile="dist/web/war/mcf-crawler-ui.war" webxml="crawler-ui/src/main/webapp/WEB-INF/web.xml" basedir="build/webapp/crawler-ui"/>
+        <mkdir dir="build/war"/>
+        <war destfile="build/war/mcf-crawler-ui.war" webxml="crawler-ui/src/main/webapp/WEB-INF/web.xml" basedir="build/webapp/crawler-ui"/>
     </target>
 
-    <target name="processes" depends="jar-core,jar-agents,jar-pull-agent">
-        <mkdir dir="dist/processes/jar"/>
-        <copy todir="dist/processes/jar">
+    <target name="multi-wars" depends="war-authority-service,war-api-service,war-crawler-ui">
+        <mkdir dir="dist/multiprocess-example/web/war"/>
+        <copy todir="dist/multiprocess-example/web/war">
+            <fileset dir="build/war"/>
+        </copy>
+    </target>
+    
+    <target name="multi-processes" depends="jar-core,jar-agents,jar-pull-agent">
+        <mkdir dir="dist/multiprocess-example/processes/jar"/>
+        <copy todir="dist/multiprocess-example/processes/jar">
             <fileset dir="lib">
                 <include name="commons-codec*.jar"/>
                 <include name="commons-collections*.jar"/>
@@ -373,20 +388,30 @@
                 <include name="derby*.jar"/>
                 <include name="hsqldb*.jar"/>
             </fileset>
-        </copy>
-        <copy todir="dist/processes/jar">
             <fileset dir="build/jar">
                 <include name="mcf-core.jar"/>
                 <include name="mcf-agents.jar"/>
                 <include name="mcf-pull-agent.jar"/>
             </fileset>
         </copy>
-        <mkdir dir="dist/processes/script"/>
-        <copy todir="dist/processes/script">
+        <mkdir dir="dist/multiprocess-example/processes/script"/>
+        <copy todir="dist/multiprocess-example/processes/script">
             <fileset dir="scripts"/>
         </copy>
     </target>
 
+    <target name="multi-process-example" depends="multi-wars,multi-processes">
+        <copy todir="dist/multiprocess-example">
+            <fileset dir="example-multiprocess">
+                <include name="properties.xml"/>
+                <include name="logging.ini"/>
+                <include name="*.sh"/>
+                <include name="*.bat"/>
+            </fileset>
+        </copy>
+        <mkdir dir="dist/multiprocess-example/logs"/>
+    </target>
+    
     <target name="script-engine" depends="jar-script-engine,jar-core">
         <mkdir dir="dist/script-engine/jar"/>
         <copy todir="dist/script-engine/jar">
@@ -398,8 +423,6 @@
                 <include name="commons-logging*.jar"/>
                 <include name="json.jar"/>
             </fileset>
-        </copy>
-        <copy todir="dist/script-engine/jar">
             <fileset dir="build/jar">
                 <include name="mcf-core.jar"/>
                 <include name="mcf-script-engine.jar"/>
@@ -413,7 +436,7 @@
         </copy>
     </target>
     
-    <target name="example" depends="war-crawler-ui,war-api-service,war-authority-service,jar-jetty-runner,jar-core,jar-agents,jar-pull-agent">
+    <target name="single-process-example" depends="war-crawler-ui,war-api-service,war-authority-service,jar-jetty-runner,jar-core,jar-agents,jar-pull-agent">
         <mkdir dir="dist/example/lib"/>
         <copy todir="dist/example/lib">
             <fileset dir="lib">
@@ -444,8 +467,6 @@
                 <include name="derby*.jar"/>
                 <include name="hsqldb*.jar"/>
             </fileset>
-        </copy>
-        <copy todir="dist/example/lib">
             <fileset dir="build/jar">
                 <include name="mcf-core.jar"/>
                 <include name="mcf-ui-core.jar"/>
@@ -456,15 +477,15 @@
         </copy>
         <mkdir dir="dist/example/war"/>
         <copy todir="dist/example/war">
-            <fileset dir="dist/web/war"/>
+            <fileset dir="build/war"/>
         </copy>
-        <mkdir dir="dist/example/connector-lib"/>
         <mkdir dir="dist/example/logs"/>
         <copy todir="dist/example">
-            <fileset dir="jetty-example">
+            <fileset dir="example-singleprocess">
                 <include name="properties.xml"/>
-                <include name="connectors.xml"/>
                 <include name="logging.ini"/>
+                <include name="*.sh"/>
+                <include name="*.bat"/>
             </fileset>
         </copy>
     </target>
@@ -681,7 +702,7 @@
         </java>
     </target>
     
-    <target name="build" depends="processes,war-authority-service,war-crawler-ui,war-api-service,example,script-engine"/>
+    <target name="build" depends="multi-process-example,single-process-example,example-common,script-engine"/>
     
     <target name="all" depends="build,doc,build-tests,run-tests,run-tests-derby,run-tests-postgresql"/>
     

Modified: incubator/lcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFJettyRunner.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFJettyRunner.java?rev=1214850&r1=1214849&r2=1214850&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFJettyRunner.java (original)
+++ incubator/lcf/trunk/framework/jetty-runner/src/main/java/org/apache/manifoldcf/jettyrunner/ManifoldCFJettyRunner.java Thu Dec 15 16:44:26 2011
@@ -19,10 +19,8 @@ package org.apache.manifoldcf.jettyrunne
 
 import java.io.*;
 import org.apache.manifoldcf.core.interfaces.*;
-import org.apache.manifoldcf.agents.interfaces.*;
-import org.apache.manifoldcf.crawler.interfaces.*;
-import org.apache.manifoldcf.authorities.interfaces.*;
-import org.apache.manifoldcf.agents.system.*;
+import org.apache.manifoldcf.crawler.system.*;
+import org.apache.manifoldcf.crawler.*;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -50,18 +48,6 @@ public class ManifoldCFJettyRunner
   public static final String _rcsid = "@(#)$Id: ManifoldCFJettyRunner.java 989983 2010-08-27 00:10:12Z kwright $";
 
   public static final String agentShutdownSignal = org.apache.manifoldcf.agents.AgentRun.agentShutdownSignal;
-
-  // Configuration parameters
-  public static final String connectorsConfigurationFile = "org.apache.manifoldcf.connectorsconfigurationfile";
-  public static final String databaseSuperuserName = "org.apache.manifoldcf.dbsuperusername";
-  public static final String databaseSuperuserPassword = "org.apache.manifoldcf.dbsuperuserpassword";
-  
-  // Connectors configuration file
-  public static final String NODE_OUTPUTCONNECTOR = "outputconnector";
-  public static final String NODE_AUTHORITYCONNECTOR = "authorityconnector";
-  public static final String NODE_REPOSITORYCONNECTOR = "repositoryconnector";
-  public static final String ATTRIBUTE_NAME = "name";
-  public static final String ATTRIBUTE_CLASS = "class";
   
   protected Server server;
   
@@ -138,270 +124,6 @@ public class ManifoldCFJettyRunner
     return conns[0].getLocalPort();
   }
 
-  /** Clear the agents shutdown signal */
-  public static void clearShutdownSignal(IThreadContext tc)
-    throws ManifoldCFException
-  {
-    // Clear the agents shutdown signal.
-    ILockManager lockManager = LockManagerFactory.make(tc);
-    lockManager.clearGlobalFlag(agentShutdownSignal);
-  }
-
-  /** Create the database and the schema */
-  public static void createDatabaseAndSchema(IThreadContext tc, String superuserName, String superuserPassword)
-    throws ManifoldCFException
-  {
-    ManifoldCF.createSystemDatabase(tc,superuserName,superuserPassword);
-    ManifoldCF.installTables(tc);
-  }
-  
-  /** Register the agents */
-  public static void registerAgents(IThreadContext tc)
-    throws ManifoldCFException
-  {
-    // Register 
-    IAgentManager agentMgr = AgentManagerFactory.make(tc);
-    agentMgr.registerAgent("org.apache.manifoldcf.crawler.system.CrawlerAgent");
-  }
-
-  /** Read connectors configuration file.
-  */
-  public static Connectors readConnectorDeclarations(File connectorConfigFile)
-    throws ManifoldCFException
-  {
-    Connectors c = null;
-    if (connectorConfigFile != null)
-    {
-      try
-      {
-        // Open the file, read it, and attempt to do the connector registrations
-        InputStream is = new FileInputStream(connectorConfigFile);
-        try
-        {
-          c = new Connectors(is);
-        }
-        finally
-        {
-          is.close();
-        }
-      }
-      catch (FileNotFoundException e)
-      {
-        throw new ManifoldCFException("Couldn't find connector configuration file: "+e.getMessage(),e);
-      }
-      catch (IOException e)
-      {
-        throw new ManifoldCFException("Error reading connector configuration file: "+e.getMessage(),e);
-      }
-    }
-    return c;
-  }
-
-  /** Unregister all connectors.
-  */
-  public static void unregisterAllConnectors(IThreadContext tc)
-    throws ManifoldCFException
-  {
-    // Grab a database handle, so we can use transactions later.
-    IDBInterface database = DBInterfaceFactory.make(tc,
-      ManifoldCF.getMasterDatabaseName(),
-      ManifoldCF.getMasterDatabaseUsername(),
-      ManifoldCF.getMasterDatabasePassword());
-
-    // Output connectors...
-    {
-      IOutputConnectorManager mgr = OutputConnectorManagerFactory.make(tc);
-      IOutputConnectionManager connManager = OutputConnectionManagerFactory.make(tc);
-      IResultSet classNames = mgr.getConnectors();
-      int i = 0;
-      while (i < classNames.getRowCount())
-      {
-        IResultRow row = classNames.getRow(i++);
-        String className = (String)row.getValue("classname");
-        // Deregistration should be done in a transaction
-        database.beginTransaction();
-        try
-        {
-          // Find the connection names that come with this class
-          String[] connectionNames = connManager.findConnectionsForConnector(className);
-          // For all connection names, notify all agents of the deregistration
-          AgentManagerFactory.noteOutputConnectorDeregistration(tc,connectionNames);
-          // Now that all jobs have been placed into an appropriate state, actually do the deregistration itself.
-          mgr.unregisterConnector(className);
-        }
-        catch (ManifoldCFException e)
-        {
-          database.signalRollback();
-          throw e;
-        }
-        catch (Error e)
-        {
-          database.signalRollback();
-          throw e;
-        }
-        finally
-        {
-          database.endTransaction();
-        }
-      }
-      System.err.println("Successfully unregistered all output connectors");
-    }
-      
-    // Authority connectors...
-    {
-      IAuthorityConnectorManager mgr = AuthorityConnectorManagerFactory.make(tc);
-      IResultSet classNames = mgr.getConnectors();
-      int i = 0;
-      while (i < classNames.getRowCount())
-      {
-        IResultRow row = classNames.getRow(i++);
-        mgr.unregisterConnector((String)row.getValue("classname"));
-      }
-      System.err.println("Successfully unregistered all authority connectors");
-    }
-      
-    // Repository connectors...
-    {
-      IConnectorManager mgr = ConnectorManagerFactory.make(tc);
-      IJobManager jobManager = JobManagerFactory.make(tc);
-      IRepositoryConnectionManager connManager = RepositoryConnectionManagerFactory.make(tc);
-      IResultSet classNames = mgr.getConnectors();
-      int i = 0;
-      while (i < classNames.getRowCount())
-      {
-        IResultRow row = classNames.getRow(i++);
-        String className = (String)row.getValue("classname");
-        // Deregistration should be done in a transaction
-        database.beginTransaction();
-        try
-        {
-          // Find the connection names that come with this class
-          String[] connectionNames = connManager.findConnectionsForConnector(className);
-          // For each connection name, modify the jobs to note that the connector is no longer installed
-          jobManager.noteConnectorDeregistration(connectionNames);
-          // Now that all jobs have been placed into an appropriate state, actually do the deregistration itself.
-          mgr.unregisterConnector(className);
-        }
-        catch (ManifoldCFException e)
-        {
-          database.signalRollback();
-          throw e;
-        }
-        catch (Error e)
-        {
-          database.signalRollback();
-          throw e;
-        }
-        finally
-        {
-          database.endTransaction();
-        }
-      }
-      System.err.println("Successfully unregistered all repository connectors");
-    }
-  }
-
-  /** Register all connectors as specified by a Connectors structure, usually read from the connectors.xml file.
-  */
-  public static void registerConnectors(IThreadContext tc, Connectors c)
-    throws ManifoldCFException
-  {
-    if (c != null)
-    {
-      // Grab a database handle, so we can use transactions later.
-      IDBInterface database = DBInterfaceFactory.make(tc,
-        ManifoldCF.getMasterDatabaseName(),
-        ManifoldCF.getMasterDatabaseUsername(),
-        ManifoldCF.getMasterDatabasePassword());
-        
-      // Other code will go here to discover and register various connectors that exist in the classpath
-      int i = 0;
-      while (i < c.getChildCount())
-      {
-        ConfigurationNode cn = c.findChild(i++);
-        if (cn.getType().equals(NODE_OUTPUTCONNECTOR))
-        {
-          String name = cn.getAttributeValue(ATTRIBUTE_NAME);
-          String className = cn.getAttributeValue(ATTRIBUTE_CLASS);
-          IOutputConnectorManager mgr = OutputConnectorManagerFactory.make(tc);
-          IOutputConnectionManager connManager = OutputConnectionManagerFactory.make(tc);
-          // Registration should be done in a transaction
-          database.beginTransaction();
-          try
-          {
-            // First, register connector
-            mgr.registerConnector(name,className);
-            // Then, signal to all jobs that might depend on this connector that they can switch state
-            // Find the connection names that come with this class
-            String[] connectionNames = connManager.findConnectionsForConnector(className);
-            // For all connection names, notify all agents of the registration
-            AgentManagerFactory.noteOutputConnectorRegistration(tc,connectionNames);
-          }
-          catch (ManifoldCFException e)
-          {
-            database.signalRollback();
-            throw e;
-          }
-          catch (Error e)
-          {
-            database.signalRollback();
-            throw e;
-          }
-          finally
-          {
-            database.endTransaction();
-          }
-          System.err.println("Successfully registered output connector '"+className+"'");
-        }
-        else if (cn.getType().equals(NODE_AUTHORITYCONNECTOR))
-        {
-          String name = cn.getAttributeValue(ATTRIBUTE_NAME);
-          String className = cn.getAttributeValue(ATTRIBUTE_CLASS);
-          IAuthorityConnectorManager mgr = AuthorityConnectorManagerFactory.make(tc);
-          mgr.registerConnector(name,className);
-          System.err.println("Successfully registered authority connector '"+className+"'");
-        }
-        else if (cn.getType().equals(NODE_REPOSITORYCONNECTOR))
-        {
-          String name = cn.getAttributeValue(ATTRIBUTE_NAME);
-          String className = cn.getAttributeValue(ATTRIBUTE_CLASS);
-          IConnectorManager mgr = ConnectorManagerFactory.make(tc);
-          IJobManager jobManager = JobManagerFactory.make(tc);
-          IRepositoryConnectionManager connManager = RepositoryConnectionManagerFactory.make(tc);
-          // Deregistration should be done in a transaction
-          database.beginTransaction();
-          try
-          {
-            // First, register connector
-            mgr.registerConnector(name,className);
-            // Then, signal to all jobs that might depend on this connector that they can switch state
-            // Find the connection names that come with this class
-            String[] connectionNames = connManager.findConnectionsForConnector(className);
-            // For each connection name, modify the jobs to note that the connector is now installed
-            jobManager.noteConnectorRegistration(connectionNames);
-          }
-          catch (ManifoldCFException e)
-          {
-            database.signalRollback();
-            throw e;
-          }
-          catch (Error e)
-          {
-            database.signalRollback();
-            throw e;
-          }
-          finally
-          {
-            database.endTransaction();
-          }
-          System.err.println("Successfully registered repository connector '"+className+"'");
-        }
-        else
-          throw new ManifoldCFException("Unrecognized connectors node type '"+cn.getType()+"'");
-      }
-    }
-  }
-
   /** Run the agents process.  This method will not return unless the agents process is shut down.
   */
   public static void runAgents(IThreadContext tc)
@@ -472,30 +194,18 @@ public class ManifoldCFJettyRunner
       ManifoldCF.initializeEnvironment();
       IThreadContext tc = ThreadContextFactory.make();
 
-      // Clear the shutdown signal
-      clearShutdownSignal(tc);
-      
-      // Get the specified superuser name and password, in case this isn't Derby we're using
-      String superuserName = ManifoldCF.getProperty(databaseSuperuserName);
-      if (superuserName == null)
-        superuserName = "";
-      String superuserPassword = ManifoldCF.getProperty(databaseSuperuserPassword);
-      if (superuserPassword == null)
-        superuserPassword = "";
+      // Clear the agents shutdown signal.
+      ILockManager lockManager = LockManagerFactory.make(tc);
+      lockManager.clearGlobalFlag(agentShutdownSignal);
       
       // Do the basic initialization of the database and its schema
-      createDatabaseAndSchema(tc,superuserName,superuserPassword);
-      registerAgents(tc);
+      ManifoldCF.createSystemDatabase(tc);
       
-        // Read connectors configuration file (to figure out what we need to register)
-      File connectorConfigFile = ManifoldCF.getFileProperty(connectorsConfigurationFile);
-      Connectors c = readConnectorDeclarations(connectorConfigFile);
+      ManifoldCF.installTables(tc);
       
-      // Unregister all connectors.
-      unregisterAllConnectors(tc);
-
-      // Register connections specified by connectors.xml
-      registerConnectors(tc,c);
+      org.apache.manifoldcf.crawler.system.ManifoldCF.registerThisAgent(tc);
+      
+      ManifoldCF.reregisterAllConnectors(tc);
       
       System.err.println("Starting jetty...");
       

Modified: incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java?rev=1214850&r1=1214849&r2=1214850&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java (original)
+++ incubator/lcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java Thu Dec 15 16:44:26 2011
@@ -75,12 +75,16 @@ public class ManifoldCF extends org.apac
   // Factor in amount to stuff
   protected static float stuffAmtFactor = 0.5f;
 
+  // Properties
   protected static final String workerThreadCountProperty = "org.apache.manifoldcf.crawler.threads";
   protected static final String deleteThreadCountProperty = "org.apache.manifoldcf.crawler.deletethreads";
   protected static final String cleanupThreadCountProperty = "org.apache.manifoldcf.crawler.cleanupthreads";
   protected static final String expireThreadCountProperty = "org.apache.manifoldcf.crawler.expirethreads";
   protected static final String lowWaterFactorProperty = "org.apache.manifoldcf.crawler.lowwaterfactor";
   protected static final String stuffAmtFactorProperty = "org.apache.manifoldcf.crawler.stuffamountfactor";
+  protected static final String connectorsConfigurationFileProperty = "org.apache.manifoldcf.connectorsconfigurationfile";
+  protected static final String databaseSuperuserNameProperty = "org.apache.manifoldcf.dbsuperusername";
+  protected static final String databaseSuperuserPasswordProperty = "org.apache.manifoldcf.dbsuperuserpassword";
 
   /** This object is used to make sure the initialization sequence is atomic.  Shutdown cannot occur until the system is in a known state. */
   protected static Integer startupLock = new Integer(0);
@@ -104,6 +108,290 @@ public class ManifoldCF extends org.apac
     }
   }
 
+  /** Create system database using superuser properties from properties.xml.
+  */
+  public static void createSystemDatabase(IThreadContext threadContext)
+    throws ManifoldCFException
+  {
+    // Get the specified superuser name and password, in case this isn't Derby we're using
+    String superuserName = getProperty(databaseSuperuserNameProperty);
+    if (superuserName == null)
+      superuserName = "";
+    String superuserPassword = getProperty(databaseSuperuserPasswordProperty);
+    if (superuserPassword == null)
+      superuserPassword = "";
+    createSystemDatabase(threadContext,superuserName,superuserPassword);
+  }
+  
+  /** Register this agent */
+  public static void registerThisAgent(IThreadContext tc)
+    throws ManifoldCFException
+  {
+    // Register 
+    IAgentManager agentMgr = AgentManagerFactory.make(tc);
+    agentMgr.registerAgent("org.apache.manifoldcf.crawler.system.CrawlerAgent");
+  }
+
+  /** Register or re-register all connectors, based on a connectors.xml file.
+  */
+  public static void reregisterAllConnectors(IThreadContext tc)
+    throws ManifoldCFException
+  {
+    // Read connectors configuration file (to figure out what we need to register)
+    File connectorConfigFile = getFileProperty(connectorsConfigurationFileProperty);
+    Connectors c = readConnectorDeclarations(connectorConfigFile);
+      
+    // Unregister all connectors.
+    unregisterAllConnectors(tc);
+
+    // Register connections specified by connectors.xml
+    registerConnectors(tc,c);
+  }
+  
+  /** Read connectors configuration file.
+  */
+  public static Connectors readConnectorDeclarations(File connectorConfigFile)
+    throws ManifoldCFException
+  {
+    Connectors c = null;
+    if (connectorConfigFile != null)
+    {
+      try
+      {
+        // Open the file, read it, and attempt to do the connector registrations
+        InputStream is = new FileInputStream(connectorConfigFile);
+        try
+        {
+          c = new Connectors(is);
+        }
+        finally
+        {
+          is.close();
+        }
+      }
+      catch (FileNotFoundException e)
+      {
+        throw new ManifoldCFException("Couldn't find connector configuration file: "+e.getMessage(),e);
+      }
+      catch (IOException e)
+      {
+        throw new ManifoldCFException("Error reading connector configuration file: "+e.getMessage(),e);
+      }
+    }
+    return c;
+  }
+
+  /** Unregister all connectors.
+  */
+  public static void unregisterAllConnectors(IThreadContext tc)
+    throws ManifoldCFException
+  {
+    // Grab a database handle, so we can use transactions later.
+    IDBInterface database = DBInterfaceFactory.make(tc,
+      ManifoldCF.getMasterDatabaseName(),
+      ManifoldCF.getMasterDatabaseUsername(),
+      ManifoldCF.getMasterDatabasePassword());
+
+    // Output connectors...
+    {
+      IOutputConnectorManager mgr = OutputConnectorManagerFactory.make(tc);
+      IOutputConnectionManager connManager = OutputConnectionManagerFactory.make(tc);
+      IResultSet classNames = mgr.getConnectors();
+      int i = 0;
+      while (i < classNames.getRowCount())
+      {
+        IResultRow row = classNames.getRow(i++);
+        String className = (String)row.getValue("classname");
+        // Deregistration should be done in a transaction
+        database.beginTransaction();
+        try
+        {
+          // Find the connection names that come with this class
+          String[] connectionNames = connManager.findConnectionsForConnector(className);
+          // For all connection names, notify all agents of the deregistration
+          AgentManagerFactory.noteOutputConnectorDeregistration(tc,connectionNames);
+          // Now that all jobs have been placed into an appropriate state, actually do the deregistration itself.
+          mgr.unregisterConnector(className);
+        }
+        catch (ManifoldCFException e)
+        {
+          database.signalRollback();
+          throw e;
+        }
+        catch (Error e)
+        {
+          database.signalRollback();
+          throw e;
+        }
+        finally
+        {
+          database.endTransaction();
+        }
+      }
+      System.err.println("Successfully unregistered all output connectors");
+    }
+      
+    // Authority connectors...
+    {
+      IAuthorityConnectorManager mgr = AuthorityConnectorManagerFactory.make(tc);
+      IResultSet classNames = mgr.getConnectors();
+      int i = 0;
+      while (i < classNames.getRowCount())
+      {
+        IResultRow row = classNames.getRow(i++);
+        mgr.unregisterConnector((String)row.getValue("classname"));
+      }
+      System.err.println("Successfully unregistered all authority connectors");
+    }
+      
+    // Repository connectors...
+    {
+      IConnectorManager mgr = ConnectorManagerFactory.make(tc);
+      IJobManager jobManager = JobManagerFactory.make(tc);
+      IRepositoryConnectionManager connManager = RepositoryConnectionManagerFactory.make(tc);
+      IResultSet classNames = mgr.getConnectors();
+      int i = 0;
+      while (i < classNames.getRowCount())
+      {
+        IResultRow row = classNames.getRow(i++);
+        String className = (String)row.getValue("classname");
+        // Deregistration should be done in a transaction
+        database.beginTransaction();
+        try
+        {
+          // Find the connection names that come with this class
+          String[] connectionNames = connManager.findConnectionsForConnector(className);
+          // For each connection name, modify the jobs to note that the connector is no longer installed
+          jobManager.noteConnectorDeregistration(connectionNames);
+          // Now that all jobs have been placed into an appropriate state, actually do the deregistration itself.
+          mgr.unregisterConnector(className);
+        }
+        catch (ManifoldCFException e)
+        {
+          database.signalRollback();
+          throw e;
+        }
+        catch (Error e)
+        {
+          database.signalRollback();
+          throw e;
+        }
+        finally
+        {
+          database.endTransaction();
+        }
+      }
+      System.err.println("Successfully unregistered all repository connectors");
+    }
+  }
+
+  // Connectors configuration file
+  protected static final String NODE_OUTPUTCONNECTOR = "outputconnector";
+  protected static final String NODE_AUTHORITYCONNECTOR = "authorityconnector";
+  protected static final String NODE_REPOSITORYCONNECTOR = "repositoryconnector";
+  protected static final String ATTRIBUTE_NAME = "name";
+  protected static final String ATTRIBUTE_CLASS = "class";
+
+  /** Register all connectors as specified by a Connectors structure, usually read from the connectors.xml file.
+  */
+  public static void registerConnectors(IThreadContext tc, Connectors c)
+    throws ManifoldCFException
+  {
+    if (c != null)
+    {
+      // Grab a database handle, so we can use transactions later.
+      IDBInterface database = DBInterfaceFactory.make(tc,
+        ManifoldCF.getMasterDatabaseName(),
+        ManifoldCF.getMasterDatabaseUsername(),
+        ManifoldCF.getMasterDatabasePassword());
+        
+      // Other code will go here to discover and register various connectors that exist in the classpath
+      int i = 0;
+      while (i < c.getChildCount())
+      {
+        ConfigurationNode cn = c.findChild(i++);
+        if (cn.getType().equals(NODE_OUTPUTCONNECTOR))
+        {
+          String name = cn.getAttributeValue(ATTRIBUTE_NAME);
+          String className = cn.getAttributeValue(ATTRIBUTE_CLASS);
+          IOutputConnectorManager mgr = OutputConnectorManagerFactory.make(tc);
+          IOutputConnectionManager connManager = OutputConnectionManagerFactory.make(tc);
+          // Registration should be done in a transaction
+          database.beginTransaction();
+          try
+          {
+            // First, register connector
+            mgr.registerConnector(name,className);
+            // Then, signal to all jobs that might depend on this connector that they can switch state
+            // Find the connection names that come with this class
+            String[] connectionNames = connManager.findConnectionsForConnector(className);
+            // For all connection names, notify all agents of the registration
+            AgentManagerFactory.noteOutputConnectorRegistration(tc,connectionNames);
+          }
+          catch (ManifoldCFException e)
+          {
+            database.signalRollback();
+            throw e;
+          }
+          catch (Error e)
+          {
+            database.signalRollback();
+            throw e;
+          }
+          finally
+          {
+            database.endTransaction();
+          }
+          System.err.println("Successfully registered output connector '"+className+"'");
+        }
+        else if (cn.getType().equals(NODE_AUTHORITYCONNECTOR))
+        {
+          String name = cn.getAttributeValue(ATTRIBUTE_NAME);
+          String className = cn.getAttributeValue(ATTRIBUTE_CLASS);
+          IAuthorityConnectorManager mgr = AuthorityConnectorManagerFactory.make(tc);
+          mgr.registerConnector(name,className);
+          System.err.println("Successfully registered authority connector '"+className+"'");
+        }
+        else if (cn.getType().equals(NODE_REPOSITORYCONNECTOR))
+        {
+          String name = cn.getAttributeValue(ATTRIBUTE_NAME);
+          String className = cn.getAttributeValue(ATTRIBUTE_CLASS);
+          IConnectorManager mgr = ConnectorManagerFactory.make(tc);
+          IJobManager jobManager = JobManagerFactory.make(tc);
+          IRepositoryConnectionManager connManager = RepositoryConnectionManagerFactory.make(tc);
+          // Deregistration should be done in a transaction
+          database.beginTransaction();
+          try
+          {
+            // First, register connector
+            mgr.registerConnector(name,className);
+            // Then, signal to all jobs that might depend on this connector that they can switch state
+            // Find the connection names that come with this class
+            String[] connectionNames = connManager.findConnectionsForConnector(className);
+            // For each connection name, modify the jobs to note that the connector is now installed
+            jobManager.noteConnectorRegistration(connectionNames);
+          }
+          catch (ManifoldCFException e)
+          {
+            database.signalRollback();
+            throw e;
+          }
+          catch (Error e)
+          {
+            database.signalRollback();
+            throw e;
+          }
+          finally
+          {
+            database.endTransaction();
+          }
+          System.err.println("Successfully registered repository connector '"+className+"'");
+        }
+        else
+          throw new ManifoldCFException("Unrecognized connectors node type '"+cn.getType()+"'");
+      }
+    }
+  }
 
   /** Install all the crawler system tables.
   *@param threadcontext is the thread context.