[Mulgara-svn] r282 - in branches/mgr-58: . docs/site-src docs/site-src/integration docs/site-src/itqlcommands docs/site-src/style src/jar/content-mbox/java/org/mulgara/content/mbox src/jar/content-mbox/java/org/mulgara/content/mbox/parser src/jar/content-mp3/java/org/mulgara/content/mp3 src/jar/content-n3/java/org/mulgara/content/n3 src/jar/content-rdfxml/java/org/mulgara/content/rdfxml src/jar/content-rdfxml/java/org/mulgara/content/rdfxml/writer src/jar/content-rio/java/org/mulgara/content/rio src/jar/descriptor/src/java/org/mulgara/descriptor/test src/jar/resolver/java/org/mulgara/resolver src/jar/resolver-distributed/java/org/mulgara/resolver/distributed src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote src/jar/resolver-filesystem/java/org/mulgara/resolver/filesystem src/jar/resolver-memory/java/org/mulgara/resolver/memory src/jar/resolver-spi/java/org/mulgara/resolver/spi src/jar/resolver-store/java/org/mulgara/resolver/store src/jar/resolver-xsd/java/org/mulgara/resolver/xsd

andrae at mulgara.org andrae at mulgara.org
Tue Jun 19 05:50:51 UTC 2007


Author: andrae
Date: 2007-06-19 00:50:50 -0500 (Tue, 19 Jun 2007)
New Revision: 282

Added:
   branches/mgr-58/docs/site-src/integration/jrdfaddtriples.html
   branches/mgr-58/docs/site-src/integration/jrdfcreategraph.html
   branches/mgr-58/docs/site-src/integration/jrdfcreatenodes.html
   branches/mgr-58/docs/site-src/integration/jrdfprereq.html
   branches/mgr-58/docs/site-src/integration/jrdfreify.html
   branches/mgr-58/docs/site-src/integration/jrdfremove.html
   branches/mgr-58/docs/site-src/integration/jrdftutorial.html
   branches/mgr-58/docs/site-src/integration/searchgraph.html
   branches/mgr-58/docs/site-src/style/styleIE7.css
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/ForeignBlankNode.java
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/Config.java
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/RemotePager.java
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/RemotePagerImpl.java
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/SetProxy.java
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/ShortGlobalStatementSet.java
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/StatementSetFactory.java
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/TripleSetAdaptor.java
Removed:
   branches/mgr-58/docs/site-src/integration/httpmp3/
   branches/mgr-58/docs/site-src/jrdf/
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/Config.java
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/RemotePager.java
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/RemotePagerImpl.java
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/SetProxy.java
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/ShortGlobalStatementSet.java
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/StatementSetFactory.java
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/TripleSetAdaptor.java
Modified:
   branches/mgr-58/.classpath
   branches/mgr-58/.project
   branches/mgr-58/README.txt
   branches/mgr-58/docs/site-src/backofbook.html
   branches/mgr-58/docs/site-src/integration/index.html
   branches/mgr-58/docs/site-src/integration/jena.html
   branches/mgr-58/docs/site-src/integration/jsptutorial.html
   branches/mgr-58/docs/site-src/integration/perl.html
   branches/mgr-58/docs/site-src/integration/resolverhttpmp3.html
   branches/mgr-58/docs/site-src/itqlcommands/index.html
   branches/mgr-58/docs/site-src/style/style.css
   branches/mgr-58/docs/site-src/style/styleIE6.css
   branches/mgr-58/src/jar/content-mbox/java/org/mulgara/content/mbox/TestResolverSession.java
   branches/mgr-58/src/jar/content-mbox/java/org/mulgara/content/mbox/parser/MboxDefaultFolder.java
   branches/mgr-58/src/jar/content-mp3/java/org/mulgara/content/mp3/TestResolverSession.java
   branches/mgr-58/src/jar/content-n3/java/org/mulgara/content/n3/N3Statements.java
   branches/mgr-58/src/jar/content-n3/java/org/mulgara/content/n3/Parser.java
   branches/mgr-58/src/jar/content-n3/java/org/mulgara/content/n3/TestResolverSession.java
   branches/mgr-58/src/jar/content-rdfxml/java/org/mulgara/content/rdfxml/TestResolverSession.java
   branches/mgr-58/src/jar/content-rdfxml/java/org/mulgara/content/rdfxml/writer/TestResolverSession.java
   branches/mgr-58/src/jar/content-rio/java/org/mulgara/content/rio/TestResolverSession.java
   branches/mgr-58/src/jar/descriptor/src/java/org/mulgara/descriptor/test/DescriptorUtilServiceTest.java
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/AnswerResolution.java
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/Delegator.java
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/DistributedResolver.java
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/DistributedResolverFactory.java
   branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/NetworkDelegator.java
   branches/mgr-58/src/jar/resolver-filesystem/java/org/mulgara/resolver/filesystem/TestResolverSession.java
   branches/mgr-58/src/jar/resolver-memory/java/org/mulgara/resolver/memory/MemoryResolver.java
   branches/mgr-58/src/jar/resolver-spi/java/org/mulgara/resolver/spi/LocalizedTuples.java
   branches/mgr-58/src/jar/resolver-spi/java/org/mulgara/resolver/spi/ResolverSession.java
   branches/mgr-58/src/jar/resolver-store/java/org/mulgara/resolver/store/StatementStoreResolver.java
   branches/mgr-58/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/TestResolverSession.java
   branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/BackupOperation.java
   branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/BootstrapOperation.java
   branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/CreateModelOperation.java
   branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/DatabaseSession.java
   branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/JRDFResolverSession.java
   branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/LocalQueryResolver.java
   branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/LoginOperation.java
   branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/ModelExistsOperation.java
   branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/ModifyModelOperation.java
   branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/MulgaraTransaction.java
   branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/MulgaraTransactionManager.java
   branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/Operation.java
   branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/PersistentResolverSession.java
   branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/QueryOperation.java
   branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/RestoreOperation.java
   branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/StringPoolSession.java
   branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/TestResolverSession.java
   branches/mgr-58/webdocs.xml
Log:
Bring branch into synch with trunk.

svn merge https://mulgara.org/svn/mulgara/trunk -r263:281 .



Modified: branches/mgr-58/.classpath
===================================================================
--- branches/mgr-58/.classpath	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/.classpath	2007-06-19 05:50:50 UTC (rev 282)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="src" path="src/jar/ant-task/java"/>
+	<classpathentry kind="src" path="src/jar/resolver-distributed/java"/>
 	<classpathentry kind="src" path="src/jar/connector/java"/>
 	<classpathentry kind="src" path="src/war/webui/java"/>
 	<classpathentry kind="src" path="src/jar/doclet/java"/>
@@ -128,12 +129,12 @@
 	<classpathentry kind="lib" path="lib/xalan-2.7.0.jar"/>
 	<classpathentry kind="lib" path="lib/lucene-2.0.0.jar"/>
 	<classpathentry kind="lib" path="lib/jrdf-0.3.4.3.jar"/>
-	<classpathentry kind="lib" path="lib/ant-trax-1.6.5.jar"/>
-	<classpathentry kind="lib" path="lib/ant-nodeps-1.6.5.jar"/>
-	<classpathentry kind="lib" path="lib/ant-launcher-1.6.5.jar"/>
-	<classpathentry kind="lib" path="lib/ant-junit-1.6.5.jar"/>
-	<classpathentry kind="lib" path="lib/ant-apache-bsf-1.6.5.jar"/>
-	<classpathentry kind="lib" path="lib/ant-1.6.5.jar"/>
+	<classpathentry kind="lib" path="lib/ant-trax-1.7.0.jar"/>
+	<classpathentry kind="lib" path="lib/ant-nodeps-1.7.0.jar"/>
+	<classpathentry kind="lib" path="lib/ant-launcher-1.7.0.jar"/>
+	<classpathentry kind="lib" path="lib/ant-junit-1.7.0.jar"/>
+	<classpathentry kind="lib" path="lib/ant-apache-bsf-1.7.0.jar"/>
+	<classpathentry kind="lib" path="lib/ant-1.7.0.jar"/>
 	<classpathentry kind="lib" path="lib/DateUtils1.jar"/>
 	<classpathentry kind="output" path="obj/jar"/>
 </classpath>

Modified: branches/mgr-58/.project
===================================================================
--- branches/mgr-58/.project	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/.project	2007-06-19 05:50:50 UTC (rev 282)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-	<name>Mulgara-1.2</name>
+	<name>Mulgara-1.0</name>
 	<comment></comment>
 	<projects>
 	</projects>
@@ -14,4 +14,11 @@
 	<natures>
 		<nature>org.eclipse.jdt.core.javanature</nature>
 	</natures>
+	<linkedResources>
+		<link>
+			<name>descriptor-client</name>
+			<type>2</type>
+			<location>obj/jar/descriptor-client</location>
+		</link>
+	</linkedResources>
 </projectDescription>

Modified: branches/mgr-58/README.txt
===================================================================
--- branches/mgr-58/README.txt	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/README.txt	2007-06-19 05:50:50 UTC (rev 282)
@@ -8,6 +8,7 @@
     ii. Release Notes
 II. Installing Java
 III. Building Mulgara
+    i. Building Mulgara in Eclipse
 IV. Running a Mulgara Server
 V. Mulgara Server Options
 VI. License
@@ -132,7 +133,25 @@
 To build the distribution in Windows:
 C:\Mulgara\> build dist
 
+ii. Building Mulgara in Eclipse
+-------------------------------
 
+The Mulgara sources include the .project and .classpath files required for
+Eclipse.  However for an error free environment Eclipse also requires access
+to files which are only generated during a build.  To overcome this there is
+an extra ANT target which builds a library containing the required classes
+for the Eclipse IDE.
+
+To build this library from a Unix command line:
+$ ./build.sh ideSupport
+
+To build the library in Windows:
+C:\Mulgara\> build ideSupport
+
+After building the library, do a Refresh (F5) in Eclipse to make the library
+available to the project.
+
+
 IV. Running a Mulgara Server
 ============================
 

Modified: branches/mgr-58/docs/site-src/backofbook.html
===================================================================
--- branches/mgr-58/docs/site-src/backofbook.html	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/docs/site-src/backofbook.html	2007-06-19 05:50:50 UTC (rev 282)
@@ -63,7 +63,7 @@
 		<a href="/overview/about.html">About the Mulgara Project</a><br />
 		<a href="/overview/aboutsite.html">About this site</a><br />
 		<a href="/overview/aboutsite.html#access">Accessibility</a><br />
-		<a href="/jrdf/jrdfaddtriples.html">Adding Triples to the Graph</a><br />
+		<a href="/integration/jrdfaddtriples.html">Adding Triples to the Graph</a><br />
 		<a href="/inferencing/infersemweb.html#o2647">Additional Features for Describing Classes and Properties</a><br />
 		<a href="itqloperations/index.html">Advanced iTQL Operations</a><br />
 		<a href="/descriptors/descadvantages.html">Advantages and Disadvantages of Descriptors</a><br />
@@ -98,7 +98,7 @@
 		<a href="/itqlcommands/comment.html">comment (#)</a><br />
 		<a href="/itqlcommands/commit.html">commit</a><br />
 		<a href="/descriptors/mistakes.html">Common Mistakes</a><br />
-		<a href="/jrdf/jrdfprereq.html#o2899">Comparison of JRDF Graph Implementations</a><br />
+		<a href="/integration/jrdfprereq.html#o2899">Comparison of JRDF Graph Implementations</a><br />
 		<a href="/inferencing/sofa.html#o2639">Compiling and Running the Example</a><br />
 		<a href="/integration/compiling.html">Compiling with Ant</a><br />
 		<a href="/integration/parsers.html#o2704">Configuration and Initialisation</a><br />
@@ -122,10 +122,10 @@
 		<a href="/itqloperations/filesysmodel.html#o3202">Creating Filesystem Models</a><br />
 		<a href="/itqloperations/fulltextmodels.html#o258">Creating Full-Text Models</a><br />
 		<a href="/tutorial/itqlbasics.html#o231">Creating New Models</a><br />
-		<a href="/jrdf/jrdfcreatenodes.html">Creating Nodes and Triples</a><br />
+		<a href="/integration/jrdfcreatenodes.html">Creating Nodes and Triples</a><br />
 		<a href="/itqloperations/nodetyping.html#o2780">Creating Nodetyping Models</a><br />
 		<a href="/integration/jena.html#o3186">Creating Sessions</a><br />
-		<a href="/jrdf/jrdfcreategraph.html">Creating the Graph</a><br />
+		<a href="/integration/jrdfcreategraph.html">Creating the Graph</a><br />
 		<a href="/inferencing/sofa.html#o2626">Creating the Ontology</a><br />
 		<a href="/itqloperations/views.html#o3012">Creating Views</a><br />
 		<a href="/overview/index.html#o1026">Cross OS/Platform Support</a><br />
@@ -225,11 +225,11 @@
 		<a href="/integration/jsptutorial.html">JavaServer Pages Tag Library</a><br />
 		<a href="/integration/jena.html">Jena</a><br />
 		<a href="/system/jrdfapis.html">JRDF APIs</a><br />
-		<a href="/jrdf/jrdfcreategraph.html#o2901">JRDF Graph (Memory Graph)</a><br />
+		<a href="/integration/jrdfcreategraph.html#o2901">JRDF Graph (Memory Graph)</a><br />
 		<a href="/system/jrdfexamples.html#o2514">JRDF Graph (Memory)</a><br />
 		<a href="/system/jrdfgraphs.html">JRDF Graphs</a><br />
 		<a href="/system/jrdfmemory.html">JRDF Memory Implementation</a><br />
-		<a href="/jrdftutorial.html">JRDF Tutorial</a>
+		<a href="/integration/jrdftutorial.html">JRDF Tutorial</a>
 	</div>
 	<div class="anchor indexanchor"><a name="75">&nbsp;</a></div><div class="ABC">K</div>
 	<div class="indexlist">
@@ -286,7 +286,7 @@
 	<div class="anchor indexanchor"><a name="79">&nbsp;</a></div><div class="ABC">O</div>
 	<div class="indexlist">
 		<a href="/system/jrdfgraphs.html#o2473">ObjectNodes</a><br />
-		<a href="/jrdf/jrdfprereq.html#o2898">Obtaining a Session from a Mulgara Server</a><br />
+		<a href="/integration/jrdfprereq.html#o2898">Obtaining a Session from a Mulgara Server</a><br />
 		<a href="/itqlcommands/select.html#o192">offset Clause</a><br />
 		<a href="/overview/index.html#o1032">On-Line Backups</a><br />
 		<a href="/inferencing/ontomanage.html">Ontology Management</a><br />
@@ -360,14 +360,14 @@
 		<a href="/inferencing/infersemweb.html#o3019">Ranges</a><br />
 		<a href="/overview/links.html#o759">RDF Data</a><br />
 		<a href="/overview/links.html#o753">RDF Training</a><br />
-		<a href="/jrdf/jrdfcreategraph.html#o2903">Read Only iTQL Result JRDF Graph (iTQL Graph)</a><br />
+		<a href="/integration/jrdfcreategraph.html#o2903">Read Only iTQL Result JRDF Graph (iTQL Graph)</a><br />
 		<a href="/inferencing/entailment.html#o2932">Reflexivity</a><br />
-		<a href="/jrdf/jrdfreify.html">Reify Triples</a><br />
+		<a href="/integration/jrdfreify.html">Reify Triples</a><br />
 		<a href="/overview/faq.html#o1064">Relational databases</a><br />
 		<a href="/overview/index.html#o1035">Reliability</a><br />
 		<a href="/system/jrdfexamples.html#o2517">Remove a Triple from the JRDF Graph</a><br />
 		<a href="/tutorial/itqlbasics.html#o234">Removing Models</a><br />
-		<a href="/jrdf/jrdfremove.html">Removing Triples from the Graph</a><br />
+		<a href="/integration/jrdfremove.html">Removing Triples from the Graph</a><br />
 		<a href="/system/jsptaglib.html#o489">render</a><br />
 		<a href="/descriptors/reserved.html">Reserved Parameters</a><br />
 		<a href="/resolvers/resolverdbclass.html">Resolver Database Class</a><br />
@@ -383,13 +383,13 @@
 	<div class="indexlist">
 		<a href="/overview/index.html#o1020">Scalability</a><br />
 		<a href="/inferencing/infermulgara.html#o2728">Schema Model</a><br />
-		<a href="/jrdf/searchgraph.html">Searching the Graph</a><br />
+		<a href="/integration/searchgraph.html">Searching the Graph</a><br />
 		<a href="/inferencing/infersitu.html#o3016">Second Search</a><br />
 		<a href="/itqlcommands/select.html">select</a><br />
 		<a href="/itqlcommands/select.html#o188">select Clause</a><br />
 		<a href="/inferencing/infersemweb.html">Semantic Web</a><br />
-		<a href="/jrdf/jrdfcreategraph.html#o2902">Server Backed JRDF Graph (Client Graph)</a><br />
-		<a href="/jrdf/jrdfcreategraph.html#o3189">Server-side JRDF Graph (Server Graph)</a><br />
+		<a href="/integration/jrdfcreategraph.html#o2902">Server Backed JRDF Graph (Client Graph)</a><br />
+		<a href="/integration/jrdfcreategraph.html#o3189">Server-side JRDF Graph (Server Graph)</a><br />
 		<a href="/itqlcommands/set.html">set</a><br />
 		<a href="/inferencing/inferexample.html#o2736">Should I use SOFA or iTQL?</a><br />
 		<a href="/system/soap.html">Simple Object Access Protocol (SOAP)</a><br />

Modified: branches/mgr-58/docs/site-src/integration/index.html
===================================================================
--- branches/mgr-58/docs/site-src/integration/index.html	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/docs/site-src/integration/index.html	2007-06-19 05:50:50 UTC (rev 282)
@@ -42,7 +42,7 @@
 <p class="relateditem"><a href="/integration/jena.html">Jena</a></p>
 <p class="relateditem"><a href="/integration/perl.html">Perl</a></p>
 <p class="relateditem"><a href="/integration/jsptutorial.html">JavaServer Pages Tag Library</a></p>
-<p class="relateditem"><a href="/jrdftutorial.html">JRDF Tutorial</a></p>
+<p class="relateditem"><a href="/integration/jrdftutorial.html">JRDF Tutorial</a></p>
 
 
 			

Modified: branches/mgr-58/docs/site-src/integration/jena.html
===================================================================
--- branches/mgr-58/docs/site-src/integration/jena.html	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/docs/site-src/integration/jena.html	2007-06-19 05:50:50 UTC (rev 282)
@@ -42,7 +42,7 @@
 <p class="relateditem"><a href="/integration/resolverhttpmp3.html">HTTP Resolver and MP3 Content Handler Tutorial</a></p>
 <p class="relateditem"><a href="/integration/perl.html">Perl</a></p>
 <p class="relateditem"><a href="/integration/jsptutorial.html">JavaServer Pages Tag Library</a></p>
-<p class="relateditem"><a href="/jrdftutorial.html">JRDF Tutorial</a></p>
+<p class="relateditem"><a href="/integration/jrdftutorial.html">JRDF Tutorial</a></p>
 
  -->
 

Copied: branches/mgr-58/docs/site-src/integration/jrdfaddtriples.html (from rev 281, trunk/docs/site-src/integration/jrdfaddtriples.html)

Copied: branches/mgr-58/docs/site-src/integration/jrdfcreategraph.html (from rev 281, trunk/docs/site-src/integration/jrdfcreategraph.html)

Copied: branches/mgr-58/docs/site-src/integration/jrdfcreatenodes.html (from rev 281, trunk/docs/site-src/integration/jrdfcreatenodes.html)

Copied: branches/mgr-58/docs/site-src/integration/jrdfprereq.html (from rev 281, trunk/docs/site-src/integration/jrdfprereq.html)

Copied: branches/mgr-58/docs/site-src/integration/jrdfreify.html (from rev 281, trunk/docs/site-src/integration/jrdfreify.html)

Copied: branches/mgr-58/docs/site-src/integration/jrdfremove.html (from rev 281, trunk/docs/site-src/integration/jrdfremove.html)

Copied: branches/mgr-58/docs/site-src/integration/jrdftutorial.html (from rev 281, trunk/docs/site-src/integration/jrdftutorial.html)

Modified: branches/mgr-58/docs/site-src/integration/jsptutorial.html
===================================================================
--- branches/mgr-58/docs/site-src/integration/jsptutorial.html	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/docs/site-src/integration/jsptutorial.html	2007-06-19 05:50:50 UTC (rev 282)
@@ -33,14 +33,14 @@
 <!--
 <p><a href="/integration/perl.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
 
-<p><a href="/jrdftutorial.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p> 
+<p><a href="/integration/jrdftutorial.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p> 
 
 <p class="relatedheading">See Also</p>
 <p class="relateditem"><a href="/integration/index.html">Integration Tutorials</a></p>
 <p class="relateditem"><a href="/integration/resolverhttpmp3.html">HTTP Resolver and MP3 Content Handler Tutorial</a></p>
 <p class="relateditem"><a href="/integration/jena.html">Jena</a></p>
 <p class="relateditem"><a href="/integration/perl.html">Perl</a></p>
-<p class="relateditem"><a href="/jrdftutorial.html">JRDF Tutorial</a></p>
+<p class="relateditem"><a href="/integration/jrdftutorial.html">JRDF Tutorial</a></p>
 
  -->
 

Modified: branches/mgr-58/docs/site-src/integration/perl.html
===================================================================
--- branches/mgr-58/docs/site-src/integration/perl.html	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/docs/site-src/integration/perl.html	2007-06-19 05:50:50 UTC (rev 282)
@@ -33,7 +33,7 @@
 <p class="relateditem"><a href="/integration/resolverhttpmp3.html">HTTP Resolver and MP3 Content Handler Tutorial</a></p>
 <p class="relateditem"><a href="/integration/jena.html">Jena</a></p>
 <p class="relateditem"><a href="/integration/jsptutorial.html">JavaServer Pages Tag Library</a></p>
-<p class="relateditem"><a href="/jrdftutorial.html">JRDF Tutorial</a></p>
+<p class="relateditem"><a href="/integration/jrdftutorial.html">JRDF Tutorial</a></p>
 
  -->
 

Modified: branches/mgr-58/docs/site-src/integration/resolverhttpmp3.html
===================================================================
--- branches/mgr-58/docs/site-src/integration/resolverhttpmp3.html	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/docs/site-src/integration/resolverhttpmp3.html	2007-06-19 05:50:50 UTC (rev 282)
@@ -42,7 +42,7 @@
 <p class="relateditem"><a href="/integration/jena.html">Jena</a></p>
 <p class="relateditem"><a href="/integration/perl.html">Perl</a></p>
 <p class="relateditem"><a href="/integration/jsptutorial.html">JavaServer Pages Tag Library</a></p>
-<p class="relateditem"><a href="/jrdftutorial.html">JRDF Tutorial</a></p>
+<p class="relateditem"><a href="/integration/jrdftutorial.html">JRDF Tutorial</a></p>
 
  -->
 

Copied: branches/mgr-58/docs/site-src/integration/searchgraph.html (from rev 281, trunk/docs/site-src/integration/searchgraph.html)

Modified: branches/mgr-58/docs/site-src/itqlcommands/index.html
===================================================================
--- branches/mgr-58/docs/site-src/itqlcommands/index.html	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/docs/site-src/itqlcommands/index.html	2007-06-19 05:50:50 UTC (rev 282)
@@ -24,7 +24,7 @@
 
 
 <!--
-<p><a href="/jrdf/jrdfremove.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+<p><a href="/integration/jrdfremove.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
 
 <p><a href="/itqlcommands/alias.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p> 
  -->

Modified: branches/mgr-58/docs/site-src/style/style.css
===================================================================
--- branches/mgr-58/docs/site-src/style/style.css	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/docs/site-src/style/style.css	2007-06-19 05:50:50 UTC (rev 282)
@@ -4,6 +4,7 @@
 	body {
 		font-size: small;
 		font-family: Verdana, Geneva, "MS Trebuchet", sans-serif;
+		background-color: #fff;
 		}
 	h1	{ font-size: 24px; margin-top: 4px; padding-top: 0;}
 	h2	{ font-size: 20px; margin-top: 4px; padding-top: 0;}
@@ -99,6 +100,7 @@
 		height: 1em;
 		padding: 0 12px 3px 1px;
 		overflow: hidden;
+		font-size: x-small;
 		}	
 	
 	/*  navSite list issues */
@@ -124,16 +126,16 @@
 		}			
 	#navSite  li li {
 		border-left: 4px solid #aaa;
-		margin: 1px 0;
+		width: 129px;
+		margin: 1px 0 2px 0;
 		padding: 0 0 0 3px;
 		line-height: 90%;
-		font-size: small;
+		font-size: x-small;
 		}
 	#navSite li.secindex	{
 		border-left: 0;
-		margin-left: 0px;
 		margin: 2px 0;
-		line-height: 110%;
+		line-height: 103%;
 		font-size: small;
 		}
 	#navSite .toc 		{
@@ -159,7 +161,7 @@
 		font-size: large;
 		}
 	.navtocseperator	{
-		height: 6px;
+		height: 8px;
 		}
 		
 	/* nav in out arrows */

Modified: branches/mgr-58/docs/site-src/style/styleIE6.css
===================================================================
--- branches/mgr-58/docs/site-src/style/styleIE6.css	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/docs/site-src/style/styleIE6.css	2007-06-19 05:50:50 UTC (rev 282)
@@ -45,30 +45,52 @@
 #verticalLine {
 	margin-left: 0px;
 	top: 8px;
-	height: 447px;
+	height: 421px;
 	}
 
+#navSite  li li, #navSite  ul, li.secindex	{
+	margin: 0;
+	border: 0;
+	height: 0;
+	padding: 0;
+	}	
+#navSite  ul.section li.ulcontainer{
+	margin: -0.1em 0 0.5em 0;
+	}
+#content ol {
+	margin-left: auto;
+	}
 
-#navSite  {
-	line-height: inherit;
-}
+
+
+/*	
 	
 #navSite  li li {
 	margin: 0px 0;
 	padding: 0 0 0 3px;
-	line-height: 70%;
-}	
+	
+	border-left: 4px solid #aaa;
+	width: 129px;
+	margin: 1px 0 2px 0;
+	padding: 0 0 0 3px;
+	font-size: x-small;
+	}
 
 #navSite li.secindex	{
 	border-left: 0;
 	margin: 0;
-	line-height: 80%;
 	font-size: small;
 	}
 #navSite li.secindex2	{
 	border-left: 0;
-	margin-left: 0px;
-	margin: 0px 0;
+	margin: 0;
 	line-height: 70%;
 	font-size: small;
-	}
\ No newline at end of file
+	}
+#navSite  ul.section, #navSite  ul.section li {
+	padding: 0;
+	margin: 0;
+	border: 0;
+	line-height: 1.2em;
+	}
+	*/
\ No newline at end of file

Copied: branches/mgr-58/docs/site-src/style/styleIE7.css (from rev 281, trunk/docs/site-src/style/styleIE7.css)

Modified: branches/mgr-58/src/jar/content-mbox/java/org/mulgara/content/mbox/TestResolverSession.java
===================================================================
--- branches/mgr-58/src/jar/content-mbox/java/org/mulgara/content/mbox/TestResolverSession.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/content-mbox/java/org/mulgara/content/mbox/TestResolverSession.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -132,6 +132,10 @@
     throw new LocalizeException(node, "Not implemented");
   }
 
+  public long newBlankNode() {
+    throw new UnsupportedOperationException("Not implemented");
+  }
+
   public Tuples findStringPoolRange(
       SPObject lowValue, boolean inclLowValue,
       SPObject highValue, boolean inclHighValue

Modified: branches/mgr-58/src/jar/content-mbox/java/org/mulgara/content/mbox/parser/MboxDefaultFolder.java
===================================================================
--- branches/mgr-58/src/jar/content-mbox/java/org/mulgara/content/mbox/parser/MboxDefaultFolder.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/content-mbox/java/org/mulgara/content/mbox/parser/MboxDefaultFolder.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -32,7 +32,7 @@
 
 /*
  * MboxDefaultFolder.java
- * Copyright (C) 2000 allen <allen at suberic.net>
+ * Copyright (C) 2000 allen allen at suberic.net
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public

Modified: branches/mgr-58/src/jar/content-mp3/java/org/mulgara/content/mp3/TestResolverSession.java
===================================================================
--- branches/mgr-58/src/jar/content-mp3/java/org/mulgara/content/mp3/TestResolverSession.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/content-mp3/java/org/mulgara/content/mp3/TestResolverSession.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -132,6 +132,10 @@
     throw new LocalizeException(node, "Not implemented");
   }
 
+  public long newBlankNode() {
+    throw new UnsupportedOperationException("Not implemented");
+  }
+
   public Tuples findStringPoolRange(
       SPObject lowValue, boolean inclLowValue,
       SPObject highValue, boolean inclHighValue

Modified: branches/mgr-58/src/jar/content-n3/java/org/mulgara/content/n3/N3Statements.java
===================================================================
--- branches/mgr-58/src/jar/content-n3/java/org/mulgara/content/n3/N3Statements.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/content-n3/java/org/mulgara/content/n3/N3Statements.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -202,9 +202,8 @@
 
     // Create the parser and start the parsing thread
     try {
-      parser = new Parser(content);
-    }
-    catch (NotModifiedException e) {
+      parser = new Parser(content, resolverSession);
+    } catch (NotModifiedException e) {
       throw new NotModifiedTuplesException(e);
     }
     parser.start();
@@ -287,9 +286,8 @@
       } else {
         // Create a new parser.
         try {
-          p = new Parser(content);
-        }
-        catch (NotModifiedException e) {
+          p = new Parser(content, resolverSession);
+        } catch (NotModifiedException e) {
           throw new NotModifiedTuplesException(e);
         }
         newParser = true;
@@ -340,9 +338,8 @@
         // Create a new parser.
         Parser p;
         try {
-          p = new Parser(content);
-        }
-        catch (NotModifiedException e) {
+          p = new Parser(content, resolverSession);
+        } catch (NotModifiedException e) {
           throw new NotModifiedTuplesException(e);
         }
 

Modified: branches/mgr-58/src/jar/content-n3/java/org/mulgara/content/n3/Parser.java
===================================================================
--- branches/mgr-58/src/jar/content-n3/java/org/mulgara/content/n3/Parser.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/content-n3/java/org/mulgara/content/n3/Parser.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -58,6 +58,8 @@
 import org.mulgara.resolver.spi.ResolverSession;
 import org.mulgara.resolver.spi.Statements;
 import org.mulgara.resolver.spi.StatementsWrapperResolution;
+import org.mulgara.store.nodepool.NodePool;
+import org.mulgara.store.nodepool.NodePoolException;
 import org.mulgara.store.tuples.AbstractTuples;
 import org.mulgara.store.tuples.Tuples;
 import org.mulgara.util.IntFile;
@@ -99,6 +101,10 @@
 
   /** Mapping between blank node rdf:nodeIDs and local node numbers. */
   private StringToLongMap blankNodeNameMap;
+  
+  /** The resolverSession to create new internal identifiers for blank nodes. */
+  private ResolverSession resolverSession;
+  
 
   private InputStream inputStream;
 
@@ -160,26 +166,23 @@
   /**
    * Sole constructor.
    */
-  Parser(Content content) throws NotModifiedException, TuplesException
-  {
-    // Validate "content" parameter
-    if (content == null) {
-      throw new IllegalArgumentException("Null \"content\" parameter");
-    }
+  Parser(Content content, ResolverSession resolverSession) throws NotModifiedException, TuplesException {
+    // Validate parameters
+    if (content == null) throw new IllegalArgumentException("Null \"content\" parameter");
+    if (resolverSession == null) throw new IllegalArgumentException("Null \"resolverSession\" parameter");
 
     // Initialize fields
-    this.baseURI          = content.getURI();
+    this.resolverSession = resolverSession;
+    this.baseURI = content.getURI();
     try {
-      this.blankNodeIdMap   = IntFile.open(
+      this.blankNodeIdMap = IntFile.open(
         TempDir.createTempFile("n3idmap", null), true
       );
       this.blankNodeNameMap = new StringToLongMap();
-      this.inputStream  = content.newInputStream();
+      this.inputStream = content.newInputStream();
+    } catch (IOException e) {
+      throw new TuplesException("Unable to obtain input stream from " + baseURI, e);
     }
-    catch (IOException e) {
-      throw new TuplesException("Unable to obtain input stream from " + baseURI,
-                                e);
-    }
   }
 
   /**
@@ -413,8 +416,7 @@
         String s = ast.toString();
         if (isAnonymous(ast)) {
           return getBlankNode(ast);
-        }
-        else {
+        } else {
           int colonIndex = s.indexOf(':');
           assert colonIndex != -1;
           String qnamePrefix = s.substring(0, colonIndex + 1);
@@ -479,8 +481,9 @@
       BlankNodeImpl blankNode;
       if (resourceNodeId == 0) {
         // need a new anonymous node for this ID
-        blankNode = //BlankNodeFactory.createBlankNode(nodePool);
-                    new BlankNodeImpl();
+        blankNode = createBlankNode();
+        // this was using a new BlankNodeImpl, but we need new internal IDs for every new node
+        
         // need to put this node into a map
         if (anonId >= 0) {
           blankNodeIdMap.putLong(anonId, blankNode.getNodeId());
@@ -490,8 +493,7 @@
         }
       } else {
         // Found the ID, so need to recreate the anonymous resource for it
-        blankNode = //BlankNodeFactory.createBlankNode(resourceNodeId);
-                    new BlankNodeImpl(resourceNodeId);
+        blankNode = new BlankNodeImpl(resourceNodeId);
       }
 
       return blankNode;
@@ -506,6 +508,18 @@
     }
     */
   }
+  
+  /**
+   * Creates an entirely new blank node.
+   * @return A new blank node with a new internal identifier.
+   */
+  private BlankNodeImpl createBlankNode() {
+    try {
+      return new BlankNodeImpl(resolverSession.newBlankNode());
+    } catch (NodePoolException npe) {
+      throw new RuntimeException("Unable to create blank node", npe);
+    }
+  }
 
   /**
    * Parse out the node ID used by a blank node.
@@ -514,6 +528,7 @@
    * @return The number part of the node.
    */
   private long parseAnonId(AST node) {
+    // TODO: This is wrong.  There may be more text after the _:
     try {
       return Long.parseLong(node.toString().substring(ANON_TAG.length()));
     } catch (NumberFormatException nfe) {

Modified: branches/mgr-58/src/jar/content-n3/java/org/mulgara/content/n3/TestResolverSession.java
===================================================================
--- branches/mgr-58/src/jar/content-n3/java/org/mulgara/content/n3/TestResolverSession.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/content-n3/java/org/mulgara/content/n3/TestResolverSession.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -116,6 +116,10 @@
     throw new LocalizeException(node, "Not implemented");
   }
 
+  public long newBlankNode() {
+    throw new UnsupportedOperationException("Not implemented");
+  }
+
   public Tuples findStringPoolRange(
       SPObject lowValue, boolean inclLowValue,
       SPObject highValue, boolean inclHighValue

Modified: branches/mgr-58/src/jar/content-rdfxml/java/org/mulgara/content/rdfxml/TestResolverSession.java
===================================================================
--- branches/mgr-58/src/jar/content-rdfxml/java/org/mulgara/content/rdfxml/TestResolverSession.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/content-rdfxml/java/org/mulgara/content/rdfxml/TestResolverSession.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -116,6 +116,10 @@
     throw new LocalizeException(node, "Not implemented");
   }
 
+  public long newBlankNode() {
+    throw new UnsupportedOperationException("Not implemented");
+  }
+
   public Tuples findStringPoolRange(
       SPObject lowValue, boolean inclLowValue,
       SPObject highValue, boolean inclHighValue

Modified: branches/mgr-58/src/jar/content-rdfxml/java/org/mulgara/content/rdfxml/writer/TestResolverSession.java
===================================================================
--- branches/mgr-58/src/jar/content-rdfxml/java/org/mulgara/content/rdfxml/writer/TestResolverSession.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/content-rdfxml/java/org/mulgara/content/rdfxml/writer/TestResolverSession.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -144,6 +144,10 @@
     throw new LocalizeException(node, "Not implemented");
   }
 
+  public long newBlankNode() {
+    throw new UnsupportedOperationException("Not implemented");
+  }
+
   public Tuples findStringPoolRange(
       SPObject lowValue, boolean inclLowValue,
       SPObject highValue, boolean inclHighValue

Modified: branches/mgr-58/src/jar/content-rio/java/org/mulgara/content/rio/TestResolverSession.java
===================================================================
--- branches/mgr-58/src/jar/content-rio/java/org/mulgara/content/rio/TestResolverSession.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/content-rio/java/org/mulgara/content/rio/TestResolverSession.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -116,6 +116,10 @@
     throw new LocalizeException(node, "Not implemented");
   }
 
+  public long newBlankNode() {
+    throw new UnsupportedOperationException("Not implemented");
+  }
+
   public Tuples findStringPoolRange(
       SPObject lowValue, boolean inclLowValue,
       SPObject highValue, boolean inclHighValue

Modified: branches/mgr-58/src/jar/descriptor/src/java/org/mulgara/descriptor/test/DescriptorUtilServiceTest.java
===================================================================
--- branches/mgr-58/src/jar/descriptor/src/java/org/mulgara/descriptor/test/DescriptorUtilServiceTest.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/descriptor/src/java/org/mulgara/descriptor/test/DescriptorUtilServiceTest.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -65,7 +65,8 @@
     */
 
     public void test1DescriptorServiceInvokeToString() throws Exception {
-        org.mulgara.descriptor.DescriptorServiceSoapBindingStub binding;
+        org.mulgara.descriptor.DescriptorServiceSoapBindingStub binding = null;
+        /*
         try {
             binding = (org.mulgara.descriptor.DescriptorServiceSoapBindingStub)
                           new org.mulgara.descriptor.DescriptorUtilServiceLocator().getDescriptorService();
@@ -75,6 +76,7 @@
                 jre.getLinkedCause().printStackTrace();
             throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
         }
+        */
         assertNotNull("binding is null", binding);
 
         // Time out after a minute

Modified: branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/BackupOperation.java
===================================================================
--- branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/BackupOperation.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/BackupOperation.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -69,6 +69,7 @@
   private final OutputStream outputStream;
   private final URI serverURI;
   private final URI destinationURI;
+  private final ResolverSessionFactory resolverSessionFactory;
 
   //
   // Constructor
@@ -87,12 +88,12 @@
    * @param destinationURI  URI of the file to backup into, may be
    *   <code>null</code> if an <var>outputStream</var> is specified
    */
-  public BackupOperation(
-      OutputStream outputStream, URI serverURI, URI destinationURI
-  ) {
+  public BackupOperation(OutputStream outputStream, URI serverURI, URI destinationURI,
+      ResolverSessionFactory resolverSessionFactory) {
     this.outputStream = outputStream;
     this.serverURI = serverURI;
     this.destinationURI = destinationURI;
+    this.resolverSessionFactory = resolverSessionFactory;
   }
 
   //
@@ -101,7 +102,6 @@
 
   public void execute(OperationContext operationContext,
       SystemResolver systemResolver,
-      ResolverSessionFactory resolverSessionFactory,
       DatabaseMetadata metadata) throws Exception {
     OutputStream os = outputStream;
     Writer writer = null;

Modified: branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/BootstrapOperation.java
===================================================================
--- branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/BootstrapOperation.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/BootstrapOperation.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -38,7 +38,6 @@
 
   public void execute(OperationContext       operationContext,
                       SystemResolver         systemResolver,
-                      ResolverSessionFactory resolverSessionFactory,
                       DatabaseMetadata       metadata) throws Exception {
     // Find the local node identifying the model
     long model = systemResolver.localizePersistent(

Modified: branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/CreateModelOperation.java
===================================================================
--- branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/CreateModelOperation.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/CreateModelOperation.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -135,7 +135,6 @@
 
   public void execute(OperationContext       operationContext,
                       SystemResolver         systemResolver,
-                      ResolverSessionFactory resolverSessionFactory,
                       DatabaseMetadata       metadata) throws Exception
   {
     // Default to the system model type

Modified: branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/DatabaseSession.java
===================================================================
--- branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/DatabaseSession.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/DatabaseSession.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -375,7 +375,7 @@
    */
   public void restore(InputStream inputStream, URI serverURI,
       URI sourceURI) throws QueryException {
-    execute(new RestoreOperation(inputStream, serverURI, sourceURI),
+    execute(new RestoreOperation(inputStream, serverURI, sourceURI, resolverSessionFactory),
             "Unable to restore from " + sourceURI);
   }
 
@@ -587,7 +587,7 @@
   private synchronized void backup(OutputStream outputStream, URI serverURI, URI destinationURI)
       throws QueryException {
     execute(
-        new BackupOperation(outputStream, serverURI, destinationURI),
+        new BackupOperation(outputStream, serverURI, destinationURI, resolverSessionFactory),
         "Unable to backup to " + destinationURI);
   }
 

Modified: branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/JRDFResolverSession.java
===================================================================
--- branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/JRDFResolverSession.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/JRDFResolverSession.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -156,7 +156,7 @@
       if (node == null) {
 
         //create a new mapping
-        node = newBlankNode();
+        node = newJrdfBlankNode();
         blankNodeMap.put( (BlankNodeImpl) node, localNode);
       }
     } catch (GraphException graphException) {
@@ -249,7 +249,7 @@
    * @throws GraphException
    * @return BlankNodeImpl
    */
-  private BlankNodeImpl newBlankNode() throws GraphException {
+  private BlankNodeImpl newJrdfBlankNode() throws GraphException {
 
     String uid = null;
 

Modified: branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/LocalQueryResolver.java
===================================================================
--- branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/LocalQueryResolver.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/LocalQueryResolver.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -26,10 +26,10 @@
  *   per clause 4.1.3 of the above contract.
  *
  *   Various modifications to this file copyright:
- *     2005-2006 Netymon Pty Ltd <mail at netymon.com>
+ *     2005-2006 Netymon Pty Ltd: mail at netymon.com
  *
  *   Various modifications to this file copyright:
- *     2005-2006 Andrae Muys <andrae at muys.id.au>
+ *     2005-2006 Andrae Muys: andrae at muys.id.au
  *
  *   getModel() contributed by Netymon Pty Ltd on behalf of
  *   The Australian Commonwealth Government under contract 4500507038.

Modified: branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/LoginOperation.java
===================================================================
--- branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/LoginOperation.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/LoginOperation.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -114,7 +114,6 @@
 
   public void execute(OperationContext       operationContext,
                       SystemResolver         systemResolver,
-                      ResolverSessionFactory resolverSessionFactory,
                       DatabaseMetadata       metadata) throws Exception
   {
     if (securityDomain.equals(metadata.getSecurityDomainURI())) {

Modified: branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/ModelExistsOperation.java
===================================================================
--- branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/ModelExistsOperation.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/ModelExistsOperation.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -63,7 +63,6 @@
 
   public void execute(OperationContext       operationContext,
                       SystemResolver         systemResolver,
-                      ResolverSessionFactory resolverSessionFactory,
                       DatabaseMetadata       metadata) throws Exception
   {
     long model = systemResolver.lookupPersistent(new URIReferenceImpl(

Modified: branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/ModifyModelOperation.java
===================================================================
--- branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/ModifyModelOperation.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/ModifyModelOperation.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -185,7 +185,6 @@
 
   public void execute(OperationContext       operationContext,
                       SystemResolver         systemResolver,
-                      ResolverSessionFactory resolverSessionFactory,
                       DatabaseMetadata       metadata) throws Exception
   {
     Statements statements;

Modified: branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/MulgaraTransaction.java
===================================================================
--- branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/MulgaraTransaction.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/MulgaraTransaction.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -537,16 +537,13 @@
     }
   }
 
-  void execute(Operation operation,
-               ResolverSessionFactory resolverSessionFactory, // FIXME: We shouldn't need this. - only used for backup and restore operations.
-               DatabaseMetadata metadata) throws MulgaraTransactionException {
+  void execute(Operation operation, DatabaseMetadata metadata) throws MulgaraTransactionException {
     report("Executing Operation");
     try {
       activate();
       try {
         operation.execute(context,
                           context.getSystemResolver(),
-                          resolverSessionFactory,
                           metadata);
       } catch (Throwable th) {
         throw implicitRollback(th);

Modified: branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/MulgaraTransactionManager.java
===================================================================
--- branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/MulgaraTransactionManager.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/MulgaraTransactionManager.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -23,6 +23,8 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.ReentrantLock;
 import javax.transaction.SystemException;
 import javax.transaction.Transaction;
 import javax.transaction.TransactionManager;
@@ -75,6 +77,11 @@
   private MulgaraTransaction userTransaction;
   private boolean autoCommit;
 
+  private ReentrantLock mutex;
+  private Condition writeLockCondition;
+  private Condition reserveCondition;
+  private Thread reservingThread;
+
   /** Set of sessions whose transactions have been rolledback.*/
   private Set<Session> failedSessions;
 
@@ -94,12 +101,16 @@
   /** Map of threads to active transactions. */
   private Map<Thread, MulgaraTransaction> activeTransactions;
 
-  private TransactionManager transactionManager;
+  private final TransactionManager transactionManager;
 
   public MulgaraTransactionManager(TransactionManagerFactory transactionManagerFactory) {
     this.currentWritingSession = null;
     this.userTransaction = null;
     this.autoCommit = true;
+    this.mutex = new ReentrantLock();
+    this.writeLockCondition = this.mutex.newCondition();
+    this.reserveCondition = this.mutex.newCondition();
+    this.reservingThread = null;
 
     this.failedSessions = new HashSet<Session>();
     this.sessions = new HashMap<MulgaraTransaction, Session>();
@@ -119,38 +130,46 @@
    *     obtain the write-lock, create a new transaction object and return it.</li>
    * </ul>
    */
-  public synchronized MulgaraTransaction getTransaction(DatabaseSession session, boolean write) throws MulgaraTransactionException {
+  public MulgaraTransaction getTransaction(DatabaseSession session, boolean write) throws MulgaraTransactionException {
+    acquireMutex();
+    try {
+      if (session == currentWritingSession) {
+        return userTransaction;
+      } 
 
-    if (session == currentWritingSession) {
-      return userTransaction;
-    } 
+      try {
+        MulgaraTransaction transaction = write ?
+            obtainWriteLock(session) :
+            new MulgaraTransaction(this, session.newOperationContext(false));
 
-    try {
-      MulgaraTransaction transaction = write ?
-          obtainWriteLock(session) :
-          new MulgaraTransaction(this, session.newOperationContext(false));
+        sessions.put(transaction, session);
 
-      sessions.put(transaction, session);
+        if (!transactions.containsKey(session)) {
+          transactions.put(session, new HashSet<MulgaraTransaction>());
+        }
+        transactions.get(session).add(transaction);
 
-      if (!transactions.containsKey(session)) {
-        transactions.put(session, new HashSet<MulgaraTransaction>());
+        return transaction;
+      } catch (MulgaraTransactionException em) {
+        throw em;
+      } catch (Exception e) {
+        throw new MulgaraTransactionException("Error creating transaction", e);
       }
-      transactions.get(session).add(transaction);
-
-      return transaction;
-    } catch (MulgaraTransactionException em) {
-      throw em;
-    } catch (Exception e) {
-      throw new MulgaraTransactionException("Error creating transaction", e);
+    } finally {
+      releaseMutex();
     }
   }
 
 
-  private synchronized MulgaraTransaction obtainWriteLock(DatabaseSession session)
+  /** 
+   * Obtains the write lock.
+   * Must hold readMutex on entry - but will drop readMutex if
+   */
+  private MulgaraTransaction obtainWriteLock(DatabaseSession session)
       throws MulgaraTransactionException {
-    while (currentWritingSession != null) {
+    while (currentWritingSession != null && !writeLockReserved()) {
       try {
-        this.wait();
+        writeLockCondition.await();
       } catch (InterruptedException ei) {
         throw new MulgaraTransactionException("Interrupted while waiting for write lock", ei);
       }
@@ -166,190 +185,218 @@
     }
   }
 
-  private synchronized void releaseWriteLock() {
+  private void releaseWriteLock() {
     // Calling this method multiple times is safe as the lock cannot be obtained
     // between calls as this method is private, and all calling methods are
     // synchronized.
     currentWritingSession = null;
     userTransaction = null;
-    this.notify();
+    writeLockCondition.signal();
   }
 
+  public void commit(DatabaseSession session) throws MulgaraTransactionException {
+    acquireMutex();
+    try {
+      reserveWriteLock();
+      if (failedSessions.contains(session)) {
+        throw new MulgaraTransactionException("Attempting to commit failed exception");
+      } else if (session != currentWritingSession) {
+        throw new MulgaraTransactionException(
+            "Attempting to commit while not the current writing transaction");
+      }
 
-  public synchronized void commit(DatabaseSession session) throws MulgaraTransactionException {
-    if (failedSessions.contains(session)) {
-      throw new MulgaraTransactionException("Attempting to commit failed exception");
-    } else if (session != currentWritingSession) {
-      throw new MulgaraTransactionException(
-          "Attempting to commit while not the current writing transaction");
+      setAutoCommit(session, true);
+      setAutoCommit(session, false);
+    } finally {
+      releaseMutex();
     }
-
-    setAutoCommit(session, true);
-    setAutoCommit(session, false);
   }
 
 
   /**
    * This is an explicit, user-specified rollback.
-   * This 
+   * 
    * This needs to be distinguished from an implicit rollback triggered by failure.
    */
-  public synchronized void rollback(DatabaseSession session) throws MulgaraTransactionException {
-    if (session == currentWritingSession) {
-      try {
-        userTransaction.execute(new TransactionOperation() {
-          public void execute() throws MulgaraTransactionException {
-            userTransaction.explicitRollback();
+  public void rollback(DatabaseSession session) throws MulgaraTransactionException {
+    acquireMutex();
+    try {
+      reserveWriteLock();
+      if (session == currentWritingSession) {
+        try {
+          userTransaction.execute(new TransactionOperation() {
+            public void execute() throws MulgaraTransactionException {
+              userTransaction.explicitRollback();
+            }
+          });
+          if (userTransaction != null) {
+            // transaction referenced by something - need to explicitly end it.
+            userTransaction.abortTransaction("Rollback failed",
+                new MulgaraTransactionException("Rollback failed to terminate write transaction"));
           }
-        });
-        if (userTransaction != null) {
-          // transaction referenced by something - need to explicitly end it.
-          userTransaction.abortTransaction("Rollback failed",
-              new MulgaraTransactionException("Rollback failed to terminate write transaction"));
+        } finally {
+          failedSessions.add(session);
+          releaseWriteLock();
+          setAutoCommit(session, false);
         }
-      } finally {
-        failedSessions.add(currentWritingSession);
-        releaseWriteLock();
+      } else if (failedSessions.contains(session)) {
+        failedSessions.remove(session);
         setAutoCommit(session, false);
+      } else {
+        throw new MulgaraTransactionException(
+            "Attempt to rollback while not in the current writing transaction");
       }
-    } else if (failedSessions.contains(session)) {
-      failedSessions.remove(session);
-      setAutoCommit(session, false);
-    } else {
-      throw new MulgaraTransactionException(
-          "Attempt to rollback while not in the current writing transaction");
+    } finally {
+      releaseMutex();
     }
   }
 
-  public synchronized void setAutoCommit(DatabaseSession session, boolean autoCommit)
+  public void setAutoCommit(DatabaseSession session, boolean autoCommit)
       throws MulgaraTransactionException {
-    if (session == currentWritingSession && failedSessions.contains(session)) {
-      userTransaction.abortTransaction("Session failed and transaction not finalized",
-          new MulgaraTransactionException("Failed Session in setAutoCommit"));
-    }
+    acquireMutex();
+    try {
+      if (session == currentWritingSession && failedSessions.contains(session)) {
+        userTransaction.abortTransaction("Session failed and transaction not finalized",
+            new MulgaraTransactionException("Failed Session in setAutoCommit"));
+      }
 
-    if (session == currentWritingSession || failedSessions.contains(session)) {
-      if (autoCommit) {
-        // AutoCommit off -> on === branch on current state of transaction.
-        if (session == currentWritingSession) {
-          // Within active transaction - commit and finalise.
-          try {
-            userTransaction.execute(new TransactionOperation() {
-              public void execute() throws MulgaraTransactionException {
-                userTransaction.dereference();
-                userTransaction.commitTransaction();
-              }
-            });
-          } finally {
-            releaseWriteLock();
-            this.autoCommit = true;
+      if (session == currentWritingSession || failedSessions.contains(session)) {
+        if (autoCommit) {
+          // AutoCommit off -> on === branch on current state of transaction.
+          if (session == currentWritingSession) {
+            // Within active transaction - commit and finalise.
+            try {
+              runWithoutMutex(new TransactionOperation() {
+                public void execute() throws MulgaraTransactionException {
+                  userTransaction.execute(new TransactionOperation() {
+                    public void execute() throws MulgaraTransactionException {
+                      userTransaction.dereference();
+                      userTransaction.commitTransaction();
+                    }
+                  });
+                }
+              });
+            } finally {
+              releaseWriteLock();
+              this.autoCommit = true;
+            }
+          } else if (failedSessions.contains(session)) {
+            // Within failed transaction - cleanup.
+            failedSessions.remove(session);
           }
-        } else if (failedSessions.contains(session)) {
-          // Within failed transaction - cleanup.
-          failedSessions.remove(session);
+        } else {
+          logger.info("Attempt to set autocommit false twice");
+          // AutoCommit off -> off === no-op. Log info.
         }
       } else {
-        logger.info("Attempt to set autocommit false twice");
-        // AutoCommit off -> off === no-op. Log info.
+        if (autoCommit) {
+          // AutoCommit on -> on === no-op.  Log info.
+          logger.info("Attempting to set autocommit true without setting it false");
+        } else {
+          // AutoCommit on -> off == Start new transaction.
+          userTransaction = getTransaction(session, true);
+          userTransaction.reference();
+          this.autoCommit = false;
+        }
       }
-    } else {
-      if (autoCommit) {
-        // AutoCommit on -> on === no-op.  Log info.
-        logger.info("Attempting to set autocommit true without setting it false");
-      } else {
-        // AutoCommit on -> off == Start new transaction.
-        userTransaction = getTransaction(session, true);
-        userTransaction.reference();
-        this.autoCommit = false;
-      }
+    } finally {
+      releaseMutex();
     }
   }
 
-  public synchronized void rollbackCurrentTransactions(Session session)
-      throws MulgaraTransactionException {
+  public void rollbackCurrentTransactions(Session session) throws MulgaraTransactionException {
+    acquireMutex();
     try {
-      if (failedSessions.contains(session)) {
-        failedSessions.remove(session);
-        return;
-      }
+      try {
+        if (failedSessions.contains(session)) {
+          failedSessions.remove(session);
+          return;
+        }
 
-      Throwable error = null;
+        Throwable error = null;
 
-      try {
-        if (session == currentWritingSession) {
-          logger.warn("Terminating session while holding writelock:" + session +
-              ":" + currentWritingSession + ": " + userTransaction);
-          userTransaction.execute(new TransactionOperation() {
-              public void execute() throws MulgaraTransactionException {
-                throw new MulgaraTransactionException("Terminating session while holding writelock");
-              }
-          });
+        try {
+          if (session == currentWritingSession) {
+            logger.warn("Terminating session while holding writelock:" + session + ": " + userTransaction);
+            userTransaction.execute(new TransactionOperation() {
+                public void execute() throws MulgaraTransactionException {
+                  throw new MulgaraTransactionException("Terminating session while holding writelock");
+                }
+            });
+          }
+        } catch (Throwable th) {
+          error = th;
         }
-      } catch (Throwable th) {
-        error = th;
-      }
 
-      final Throwable trigger = new MulgaraTransactionException("trigger rollback");
+        final Throwable trigger = new MulgaraTransactionException("trigger rollback");
 
-      if (transactions.containsKey(session)) {
-        for (MulgaraTransaction transaction : transactions.get(session)) {
-          try {
-            transaction.execute(new TransactionOperation() {
-              public void execute() throws MulgaraTransactionException {
-                throw new MulgaraTransactionException("Rolling back transactions due to session close");
+        if (transactions.containsKey(session)) {
+          for (MulgaraTransaction transaction : transactions.get(session)) {
+            try {
+              transaction.execute(new TransactionOperation() {
+                public void execute() throws MulgaraTransactionException {
+                  throw new MulgaraTransactionException("Rolling back transactions due to session close");
+                }
+              });
+            } catch (MulgaraTransactionException em) {
+              // ignore.
+            } catch (Throwable th) {
+              if (error == null) {
+                error = th;
               }
-            });
-          } catch (MulgaraTransactionException em) {
-            // ignore.
-          } catch (Throwable th) {
-            if (error == null) {
-              error = th;
             }
           }
         }
-      }
 
-      if (error != null) {
-        if (error instanceof MulgaraTransactionException) {
-          throw (MulgaraTransactionException)error;
-        } else {
-          throw new MulgaraTransactionException("Error in rollback on session close", error);
+        if (error != null) {
+          if (error instanceof MulgaraTransactionException) {
+            throw (MulgaraTransactionException)error;
+          } else {
+            throw new MulgaraTransactionException("Error in rollback on session close", error);
+          }
         }
+      } finally {
+        if (transactions.containsKey(session)) {
+          logger.error("Error in transaction rollback due to session close - aborting");
+          abortCurrentTransactions(session);
+        }
       }
     } finally {
-      if (transactions.containsKey(session)) {
-        logger.error("Error in transaction rollback due to session close - aborting");
-        abortCurrentTransactions(session);
-      }
+      releaseMutex();
     }
   }
 
   private void abortCurrentTransactions(Session session) throws MulgaraTransactionException {
+    acquireMutex();
     try {
-      Throwable error = null;
-      for (MulgaraTransaction transaction : transactions.get(session)) {
-        try {
-          transaction.abortTransaction("Transaction still valid on session close", new Throwable());
-        } catch (Throwable th) {
+      try {
+        Throwable error = null;
+        for (MulgaraTransaction transaction : transactions.get(session)) {
           try {
-            if (error == null) {
-              error = th;
-            }
-          } catch (Throwable throw_away) {}
+            transaction.abortTransaction("Transaction still valid on session close", new Throwable());
+          } catch (Throwable th) {
+            try {
+              if (error == null) {
+                error = th;
+              }
+            } catch (Throwable throw_away) {}
+          }
         }
-      }
 
-      if (error != null) {
-        if (error instanceof MulgaraTransactionException) {
-          throw (MulgaraTransactionException)error;
-        } else {
-          throw new MulgaraTransactionException("Error in rollback on session close", error);
+        if (error != null) {
+          if (error instanceof MulgaraTransactionException) {
+            throw (MulgaraTransactionException)error;
+          } else {
+            throw new MulgaraTransactionException("Error in rollback on session close", error);
+          }
         }
+      } finally {
+        if (session == currentWritingSession) {
+          logger.error("Failed to abort write-transaction on session close - Server restart required");
+        }
       }
     } finally {
-      if (session == currentWritingSession) {
-        logger.error("Failed to abort write-transaction on session close - Server restart required");
-      }
+      releaseMutex();
     }
   }
 
@@ -357,95 +404,119 @@
   // Transaction livecycle callbacks.
   //
 
-  public synchronized Transaction transactionStart(MulgaraTransaction transaction)
-      throws MulgaraTransactionException {
+  public Transaction transactionStart(MulgaraTransaction transaction) throws MulgaraTransactionException {
+    acquireMutex();
     try {
-      logger.info("Beginning Transaction");
-      if (activeTransactions.get(Thread.currentThread()) != null) {
-        throw new MulgaraTransactionException(
-            "Attempt to start transaction in thread with exiting active transaction.");
-      } else if (activeTransactions.containsValue(transaction)) {
-        throw new MulgaraTransactionException("Attempt to start transaction twice");
-      }
+      try {
+        logger.info("Beginning Transaction");
+        if (activeTransactions.get(Thread.currentThread()) != null) {
+          throw new MulgaraTransactionException(
+              "Attempt to start transaction in thread with exiting active transaction.");
+        } else if (activeTransactions.containsValue(transaction)) {
+          throw new MulgaraTransactionException("Attempt to start transaction twice");
+        }
 
-      transactionManager.begin();
-      Transaction jtaTrans = transactionManager.getTransaction();
+        transactionManager.begin();
+        Transaction jtaTrans = transactionManager.getTransaction();
 
-      activeTransactions.put(Thread.currentThread(), transaction);
+        activeTransactions.put(Thread.currentThread(), transaction);
 
-      return jtaTrans;
-    } catch (Exception e) {
-      throw new MulgaraTransactionException("Transaction Begin Failed", e);
+        return jtaTrans;
+      } catch (Exception e) {
+        throw new MulgaraTransactionException("Transaction Begin Failed", e);
+      }
+    } finally {
+      releaseMutex();
     }
   }
 
-  public synchronized void transactionResumed(MulgaraTransaction transaction, Transaction jtaXA) 
+  public void transactionResumed(MulgaraTransaction transaction, Transaction jtaXA) 
       throws MulgaraTransactionException {
-    if (activeTransactions.get(Thread.currentThread()) != null) {
-      throw new MulgaraTransactionException(
-          "Attempt to resume transaction in already activated thread");
-    } else if (activeTransactions.containsValue(transaction)) {
-      throw new MulgaraTransactionException("Attempt to resume active transaction");
-    }
-    
+    acquireMutex();
     try {
-      transactionManager.resume(jtaXA);
-      activeTransactions.put(Thread.currentThread(), transaction);
-    } catch (Exception e) {
-      throw new MulgaraTransactionException("Resume Failed", e);
+      if (activeTransactions.get(Thread.currentThread()) != null) {
+        throw new MulgaraTransactionException(
+            "Attempt to resume transaction in already activated thread");
+      } else if (activeTransactions.containsValue(transaction)) {
+        throw new MulgaraTransactionException("Attempt to resume active transaction");
+      }
+      
+      try {
+        transactionManager.resume(jtaXA);
+        activeTransactions.put(Thread.currentThread(), transaction);
+      } catch (Exception e) {
+        throw new MulgaraTransactionException("Resume Failed", e);
+      }
+    } finally {
+      releaseMutex();
     }
   }
 
-  public synchronized Transaction transactionSuspended(MulgaraTransaction transaction)
+  public Transaction transactionSuspended(MulgaraTransaction transaction)
       throws MulgaraTransactionException {
+    acquireMutex();
     try {
-      if (transaction != activeTransactions.get(Thread.currentThread())) {
-        throw new MulgaraTransactionException(
-            "Attempt to suspend transaction from outside thread");
-      }
+      try {
+        if (transaction != activeTransactions.get(Thread.currentThread())) {
+          throw new MulgaraTransactionException(
+              "Attempt to suspend transaction from outside thread");
+        }
 
-      if (autoCommit && transaction == userTransaction) {
-        logger.error("Attempt to suspend write transaction without setting AutoCommit Off");
-        throw new MulgaraTransactionException(
-            "Attempt to suspend write transaction without setting AutoCommit Off");
-      }
+        if (autoCommit && transaction == userTransaction) {
+          logger.error("Attempt to suspend write transaction without setting AutoCommit Off");
+          throw new MulgaraTransactionException(
+              "Attempt to suspend write transaction without setting AutoCommit Off");
+        }
 
-      Transaction xa = transactionManager.suspend();
-      activeTransactions.remove(Thread.currentThread());
+        Transaction xa = transactionManager.suspend();
+        activeTransactions.remove(Thread.currentThread());
 
-      return xa;
-    } catch (Throwable th) {
-      logger.error("Attempt to suspend failed", th);
-      try {
-        transactionManager.setRollbackOnly();
-      } catch (Throwable t) {
-        logger.error("Attempt to setRollbackOnly() failed", t);
+        return xa;
+      } catch (Throwable th) {
+        logger.error("Attempt to suspend failed", th);
+        try {
+          transactionManager.setRollbackOnly();
+        } catch (Throwable t) {
+          logger.error("Attempt to setRollbackOnly() failed", t);
+        }
+        throw new MulgaraTransactionException("Suspend failed", th);
       }
-      throw new MulgaraTransactionException("Suspend failed", th);
+    } finally {
+      releaseMutex();
     }
   }
 
-  public synchronized void transactionComplete(MulgaraTransaction transaction) {
-    if (holdsWriteLock(transaction)) {
-      releaseWriteLock();
+  public void transactionComplete(MulgaraTransaction transaction) {
+    acquireMutex();
+    try {
+      if (transaction == userTransaction) {
+        releaseWriteLock();
+      }
+
+      activeTransactions.remove(Thread.currentThread());
+      Session session = (Session)sessions.get(transaction);
+      sessions.remove(transaction);
+      transactions.remove(session);
+    } finally {
+      releaseMutex();
     }
-
-    activeTransactions.remove(Thread.currentThread());
-    Session session = (Session)sessions.get(transaction);
-    sessions.remove(transaction);
-    transactions.remove(session);
   }
 
-  public synchronized void transactionAborted(MulgaraTransaction transaction) {
+  public void transactionAborted(MulgaraTransaction transaction) {
+    acquireMutex();
     try {
-      // Make sure this cleans up the transaction metadata - this transaction is DEAD!
-      if (transaction == userTransaction) {
-        failedSessions.add(currentWritingSession);
+      try {
+        // Make sure this cleans up the transaction metadata - this transaction is DEAD!
+        if (transaction == userTransaction) {
+          failedSessions.add(currentWritingSession);
+        }
+        transactionComplete(transaction);
+      } catch (Throwable th) {
+        // FIXME: This should probably abort the entire server after logging the error!
+        logger.error("Error managing transaction abort", th);
       }
-      transactionComplete(transaction);
-    } catch (Throwable th) {
-      // FIXME: This should probably abort the entire server after logging the error!
-      logger.error("Error managing transaction abort", th);
+    } finally {
+      releaseMutex();
     }
   }
 
@@ -457,7 +528,59 @@
     }
   }
 
-  private boolean holdsWriteLock(MulgaraTransaction transaction) {
-    return transaction == userTransaction;
+  private void acquireMutex() {
+    mutex.lock();
   }
+
+  private void reserveWriteLock() throws MulgaraTransactionException {
+    if (!mutex.isHeldByCurrentThread()) {
+      throw new IllegalStateException("Attempt to set modify without holding mutex");
+    }
+
+    if (Thread.currentThread().equals(reservingThread)) {
+      return;
+    }
+
+    while (reservingThread != null) {
+      try {
+        reserveCondition.await();
+      } catch (InterruptedException ei) {
+        throw new MulgaraTransactionException("Thread interrupted while reserving write lock", ei);
+      }
+    }
+    reservingThread = Thread.currentThread();
+  }
+
+  private boolean writeLockReserved() {
+    return reservingThread == null || Thread.currentThread().equals(reservingThread);
+  }
+
+  private void releaseMutex() {
+    if (!mutex.isHeldByCurrentThread()) {
+      throw new IllegalStateException("Attempt to release mutex without holding mutex");
+    }
+
+    if (mutex.getHoldCount() == 1 && Thread.currentThread().equals(reservingThread)) {
+      reservingThread = null;
+      reserveCondition.signal();
+    }
+
+    mutex.unlock();
+  }
+
+  private void runWithoutMutex(TransactionOperation proc) throws MulgaraTransactionException {
+    if (!mutex.isHeldByCurrentThread()) {
+      throw new IllegalStateException("Attempt to run procedure without holding mutex");
+    }
+    int holdCount = mutex.getHoldCount();
+    for (int i = 0; i < holdCount; i++) {
+      mutex.unlock();
+    }
+
+    proc.execute();
+
+    for (int i = 0; i < holdCount; i++) {
+      mutex.lock();
+    }
+  }
 }

Modified: branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/Operation.java
===================================================================
--- branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/Operation.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/Operation.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -54,13 +54,11 @@
    * Perform a transactional operation.
    *
    * @param systemResolver
-   * @param resolverSessionFactory
    * @param metadata
    * @throws Exception if the operation cannot be completed
    */
   public void execute(OperationContext         operationContext,
                       SystemResolver           systemResolver,
-                      ResolverSessionFactory   resolverSessionFactory,
                       DatabaseMetadata         metadata) throws Exception;
 
   /**

Modified: branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/PersistentResolverSession.java
===================================================================
--- branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/PersistentResolverSession.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/PersistentResolverSession.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -36,6 +36,7 @@
 import org.mulgara.resolver.spi.GlobalizeException;
 import org.mulgara.resolver.spi.LocalizeException;
 import org.mulgara.resolver.spi.ResolverSession;
+import org.mulgara.store.nodepool.NodePoolException;
 import org.mulgara.store.stringpool.SPObject;
 import org.mulgara.store.stringpool.SPObjectFactory;
 import org.mulgara.store.stringpool.StringPoolException;
@@ -103,6 +104,13 @@
     return resolverSession.localizePersistent(node);
   }
 
+  /*
+   * @see org.mulgara.resolver.spi.ResolverSession#newBlankNode()
+   */
+  public long newBlankNode() throws NodePoolException {
+    return resolverSession.newBlankNode();
+  }
+
   /**
    * @see org.mulgara.resolver.spi.ResolverSession#findStringPoolRange(SPObject,boolean,SPObject,boolean)
    */

Modified: branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/QueryOperation.java
===================================================================
--- branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/QueryOperation.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/QueryOperation.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -147,7 +147,6 @@
 
   public void execute(OperationContext       operationContext,
                       SystemResolver         systemResolver,
-                      ResolverSessionFactory resolverSessionFactory,
                       DatabaseMetadata       metadata) throws Exception
   {
     if (query != null) {

Modified: branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/RestoreOperation.java
===================================================================
--- branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/RestoreOperation.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/RestoreOperation.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -89,6 +89,7 @@
   private final InputStream inputStream;
   private final URI serverURI;
   private final URI sourceURI;
+  private final ResolverSessionFactory resolverSessionFactory;
 
   //
   // Constructor
@@ -104,8 +105,8 @@
    * @throws IllegalArgumentException if the <var>sourceURI</var> is a
    *   relative URI
    */
-  public RestoreOperation(InputStream inputStream, URI serverURI, URI sourceURI)
-  {
+  public RestoreOperation(InputStream inputStream, URI serverURI, URI sourceURI,
+      ResolverSessionFactory resolverSessionFactory) {
     // Validate "sourceURI" parameter
     if (sourceURI != null && sourceURI.getScheme() == null) {
       throw new IllegalArgumentException(
@@ -115,6 +116,7 @@
     this.inputStream = inputStream;
     this.serverURI   = serverURI;
     this.sourceURI   = sourceURI;
+    this.resolverSessionFactory = resolverSessionFactory;
   }
 
   //
@@ -123,7 +125,6 @@
 
   public void execute(OperationContext         operationContext,
                       SystemResolver           systemResolver,
-                      ResolverSessionFactory   resolverSessionFactory,
                       DatabaseMetadata         metadata) throws Exception
   {
     InputStream is = inputStream;

Modified: branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/StringPoolSession.java
===================================================================
--- branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/StringPoolSession.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/StringPoolSession.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -129,6 +129,9 @@
 
   /** Where to store literals which won't outlive this session.  */
   private final StringPool temporaryStringPool;
+  
+  /** Maps blank nodes into remembered IDs. */
+  Map<BlankNode,Long> blankNodeCache = new HashMap<BlankNode,Long>();
 
   private int state;
 
@@ -217,6 +220,10 @@
     return localize(node, WRITE | PERSIST);
   }
 
+  public long newBlankNode() throws NodePoolException {
+    return persistentNodePool.newNode();
+  }
+
   public void refresh(SimpleXAResource[] resources) throws SimpleXAResourceException {
     if (logger.isDebugEnabled()) {
       logger.debug("Obtaining phase on StringPoolSession " + System.identityHashCode(this));
@@ -226,6 +233,7 @@
     synchronized (this.globalLock) {
       this.persistentStringPool.refresh();
       this.persistentNodePool.refresh();
+      blankNodeCache.clear();
       // !!Review: Call rollback on temporary? NB. Can't rollback non XA-SP/NP.
       //this.temporaryStringPool.refresh();
       //this.temporaryNodePool.refresh();
@@ -274,6 +282,7 @@
     synchronized (globalLock) {
       persistentStringPool.commit();
       persistentNodePool.commit();
+      blankNodeCache.clear();
       for (int i = 0; i < resources.length; i++) {
         resources[i].commit();
       }
@@ -292,6 +301,7 @@
     state = ROLLBACK;
     persistentStringPool.rollback();
     persistentNodePool.rollback();
+    blankNodeCache.clear();
     for (int i = 0; i < resources.length; i++) {
       resources[i].rollback();
     }
@@ -313,6 +323,8 @@
 
     persistentStringPool.release();
     persistentNodePool.release();
+    blankNodeCache.clear();
+
     // TODO determine if release() should be called for the temp components.
     //temporaryStringPool.release();
     //temporaryNodePool.release();
@@ -470,8 +482,7 @@
           // persisting.
           if ((bi.getNodeId() < 0) && ((flags & STORE_MASK) == PERSIST)) {
             bi.setNodeId(persistentNodePool.newNode());
-          }
-          else if (bi.getNodeId() == 0) {
+          } else if (bi.getNodeId() == 0) {
             if ((flags & STORE_MASK) == TEMP) {
               bi.setNodeId(-temporaryNodePool.newNode());
             }
@@ -485,31 +496,42 @@
         // id is negative.
         throw new LocalizeException(node, "Attempt to persist a local blank " +
            "node in a read phase");
-      }
+      } else if ((flags & WRITE_MASK) == WRITE) {
       // Some other implementation of BlankNode, so we can't access internal
       // node ID and we can only create one - we must be in the WRITE phase.
-      else if ((flags & WRITE_MASK) == WRITE) {
-        long nodeId;
-        if ((flags & STORE_MASK) == TEMP) {
-          nodeId = -temporaryNodePool.newNode();
-        } else {
-          nodeId = persistentNodePool.newNode();
-        }
+        return getAllocatedNodeId(node, flags);
 
-        return nodeId;
-      }
-      // If it's a read phase and not the local BlankNode then throw an
-      // exception.
-      else {
+      } else {
+        // If it's a read phase and not the local BlankNode then throw an
+        // exception.
         throw new LocalizeException(node, "Attempt to read BlankNode from stringpool");
       }
-    }
-    catch (NodePoolException e) {
+    } catch (NodePoolException e) {
       throw new LocalizeException(node, "Couldn't create blank node", e);
     }
   }
 
+  /**
+   * Allocates new node IDs for unknown nodes.  Stores node IDs for later lookups.
+   * @param bn The blank node to get the ID for.
+   * @param flags Indicates the type of storage for the node ids.
+   * @return The node ID for this given blank node.
+   * @throws NodePoolException An error while allocating a new node.
+   */
+  protected long getAllocatedNodeId(BlankNode bn, int flags) throws NodePoolException {
+    assert !(bn instanceof BlankNodeImpl);
+    if (blankNodeCache.containsKey(bn)) return blankNodeCache.get(bn);
 
+    long nodeId;
+    if ((flags & STORE_MASK) == TEMP) {
+      nodeId = -temporaryNodePool.newNode();
+    } else {
+      nodeId = persistentNodePool.newNode();
+    }
+    blankNodeCache.put(bn, nodeId);
+    return nodeId;
+  }
+
   protected Node globalizeBlankNode(long localNode, SPObject spObject) throws
       GlobalizeException {
 

Modified: branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/TestResolverSession.java
===================================================================
--- branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/TestResolverSession.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver/java/org/mulgara/resolver/TestResolverSession.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -139,6 +139,10 @@
     throw new LocalizeException(node, "Not implemented");
   }
 
+  public long newBlankNode() {
+    throw new UnsupportedOperationException("Not implemented");
+  }
+
   public Tuples findStringPoolRange(
       SPObject lowValue, boolean inclLowValue,
       SPObject highValue, boolean inclHighValue

Modified: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/AnswerResolution.java
===================================================================
--- branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/AnswerResolution.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/AnswerResolution.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -14,26 +14,24 @@
 
 import org.apache.log4j.Logger;  // Apache Log4J
 
+import org.jrdf.graph.Node;
 import org.mulgara.query.Answer;
 import org.mulgara.query.Constraint;
-import org.mulgara.query.rdf.URIReferenceImpl;
+import org.mulgara.query.TuplesException;
+import org.mulgara.query.rdf.BlankNodeImpl;
 
-import org.mulgara.resolver.spi.GlobalizeException;
+import org.mulgara.resolver.spi.LocalizeException;
 import org.mulgara.resolver.spi.LocalizedTuples;
 import org.mulgara.resolver.spi.ResolverSession;
 import org.mulgara.resolver.spi.Resolution;
 
-import org.mulgara.store.tuples.Annotation;
-import org.mulgara.store.tuples.RowComparator;
-import org.mulgara.store.tuples.Tuples;
+import java.net.URI;
 
 /**
  * A {@link Resolution} which extends a LocalizedTuples, which in turn wraps an Answer.
  *
  * @created 2007-03-23
  * @author Paul Gearon
- * @version $Revision: $
- * @modified $Date: $ @maintenanceAuthor $Author: $
  * @copyright &copy; 2007 <a href="mailto:pgearon at users.sourceforge.net">Paul Gearon</a>
  * @licence <a href="{@docRoot}/../../LICENCE.txt">Open Software License v3.0</a>
  */
@@ -44,6 +42,9 @@
 
   /** The constraint. */
   private final Constraint constraint;
+  
+  /** The server URI being accessed. */
+  private final URI serverUri;
 
 
   /**
@@ -53,10 +54,13 @@
    * @param constraint the constraint.
    * @throws IllegalArgumentException if <var>constraint<var> is <code>null</code>
    */
-  AnswerResolution(ResolverSession session, Answer answer, Constraint constraint) {
+  AnswerResolution(URI serverUri, ResolverSession session, Answer answer, Constraint constraint) {
     super(session, answer);
+    logger.debug("Constructed AnswerResolution for distributed resolver");
     if (constraint == null) throw new IllegalArgumentException("Null constraint parameter");
     this.constraint = constraint;
+    this.serverUri = serverUri;
+    logger.debug("Created resolution on server: " + serverUri + " for: " + constraint);
   }
 
 
@@ -76,4 +80,22 @@
     return true;
   }
 
+  /**
+   * Get the bound value for the column, converting Blank Nodes to a
+   * remote representation when needed.
+   * @param column The column of the bound value.
+   * @return the Localized long integer for the bound value.
+   * @throws TuplesException Indicates an error getting the value from the string pool.
+   */
+  public long getColumnValue(int column) throws TuplesException {
+    try {
+      Object obj = answer.getObject(column);
+      assert obj instanceof Node;
+
+      Node node = obj instanceof BlankNodeImpl ? new ForeignBlankNode(serverUri, (BlankNodeImpl)obj) : (Node)obj;
+      return session.localize(node);
+    } catch (LocalizeException e) {
+      throw new TuplesException("Couldn't localize column " + column, e);
+    }
+  }
 }

Modified: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/Delegator.java
===================================================================
--- branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/Delegator.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/Delegator.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -15,6 +15,8 @@
 import org.mulgara.query.Constraint;
 import org.mulgara.query.LocalNode;
 import org.mulgara.resolver.spi.Resolution;
+import org.mulgara.resolver.spi.ResolverException;
+import org.mulgara.resolver.spi.Statements;
 import org.mulgara.query.QueryException;
 
 
@@ -36,6 +38,25 @@
    * @param constraint The constraint to resolve.
    * @param model The LocalNode containing the model
    * @throws QueryException A delegator specific problem occurred resolving the constraint.
+   * @throws ResolverException A delegator specific problem occurred setting up the resolution.
    */
-  public Resolution resolve(Constraint constraint, LocalNode model) throws QueryException;
+  public Resolution resolve(Constraint constraint, LocalNode model) throws QueryException, ResolverException;
+
+  /**
+   * Add a set of statements to a model.
+   * @param model The <code>long</code> containing the model gNode.
+   * @param statements The statements to add to the model.
+   * @throws ResolverException A delegator specific problem occurred adding the data.
+   * @throws QueryException There was an error adding data at the remote end.
+   */
+  public void add(long model, Statements statements) throws ResolverException, QueryException;
+
+  /**
+   * Remove a set of statements from a model.
+   * @param model The <code>long</code> containing the model gNode.
+   * @param statements The statements to remove from the model.
+   * @throws ResolverException A delegator specific problem occurred removing the data.
+   * @throws QueryException There was an error removing data at the remote end.
+   */
+  public void remove(long model, Statements statements) throws ResolverException, QueryException;
 }

Modified: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/DistributedResolver.java
===================================================================
--- branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/DistributedResolver.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/DistributedResolver.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -13,7 +13,6 @@
 package org.mulgara.resolver.distributed;
 
 // Java 2 standard packages
-import java.io.*;
 import java.net.*;
 import java.util.*;
 import javax.transaction.xa.XAResource;
@@ -41,15 +40,12 @@
  *
  * @created 2007-03-20
  * @author <a href="mailto:pgearon at users.sourceforge.net">Paul Gearon</a>
- * @version $Revision: $
- * @modified $Date: $
- * @maintenanceAuthor $Author: $
  * @copyright &copy; 2007 <a href="mailto:pgearon at users.sourceforge.net">Paul Gearon</a>
  * @licence <a href="{@docRoot}/../../LICENCE.txt">Open Software License v3.0</a>
  */
-public class DistributedResolver implements Resolver
-{
-  /** Logger.  */
+public class DistributedResolver implements Resolver {
+
+  /** Logger. */
   private static Logger logger = Logger.getLogger(DistributedResolver.class.getName());
 
   /** The delegator that resolves the constraint on another server.  */
@@ -118,7 +114,13 @@
    * @throws ResolverException The server should not ask this resolver to modify data.
    */
   public void modifyModel(long model, Statements statements, boolean occurs) throws ResolverException {
-    throw new ResolverException("Distributed models are read only");
+    if (logger.isDebugEnabled()) logger.debug(occurs ? "Adding" : "Removing" + " statements from model");
+    try {
+      if (occurs) delegator.add(model, statements);
+      else delegator.remove(model, statements);
+    } catch (QueryException qe) {
+      throw new ResolverException("Error modifying model", qe);
+    }
   }
 
 
@@ -146,7 +148,11 @@
     ConstraintElement modelElement = constraint.getElement(3);
     if (!(modelElement instanceof LocalNode)) throw new QueryException("Constraint not set to a distributed model.");
     
-    return delegator.resolve(constraint, (LocalNode)modelElement);
+    try {
+      return delegator.resolve(constraint, (LocalNode)modelElement);
+    } catch (ResolverException re) {
+      throw new QueryException(re.getMessage(), re);
+    }
   }
 
 

Modified: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/DistributedResolverFactory.java
===================================================================
--- branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/DistributedResolverFactory.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/DistributedResolverFactory.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -14,8 +14,6 @@
 package org.mulgara.resolver.distributed;
 
 // Java 2 standard packages
-import java.io.*;
-import java.net.*;
 import java.util.*;
 
 // Third party packages
@@ -81,6 +79,7 @@
    * {@inheritDoc ResolverFactory}
    */
   public void close() {
+    logger.debug("Closing distributed resolvers");
     for (DistributedResolver r: openResolvers) r.close();
   }
 
@@ -100,6 +99,7 @@
    * @throws InitializerException if the XML Schema resources can't be found or created
    */
   public static ResolverFactory newInstance(ResolverFactoryInitializer initializer) throws InitializerException {
+    logger.debug("Creating new distributed resolver factory");
     return new DistributedResolverFactory(initializer);
   }
 
@@ -118,7 +118,8 @@
   ) throws ResolverFactoryException {
 
     if (resolverSession == null) throw new IllegalArgumentException("No session provided for the resolver!");
-    if (canWrite) throw new IllegalArgumentException("Cannot write to a remote model!");
+    logger.debug("Creating new distributed resolver");
+    if (canWrite) logger.debug("Expecting to write to distributed resolver.");
     DistributedResolver r = new DistributedResolver(resolverSession);
     openResolvers.add(r);
     return r;

Copied: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/ForeignBlankNode.java (from rev 281, trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/ForeignBlankNode.java)

Modified: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/NetworkDelegator.java
===================================================================
--- branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/NetworkDelegator.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/NetworkDelegator.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -21,6 +21,7 @@
 import org.mulgara.query.ModelResource;
 import org.mulgara.query.Query;
 import org.mulgara.query.QueryException;
+import org.mulgara.query.TuplesException;
 import org.mulgara.query.UnconstrainedAnswer;
 import org.mulgara.query.Variable;
 import org.mulgara.query.rdf.URIReferenceImpl;
@@ -30,11 +31,14 @@
 import org.mulgara.server.NonRemoteSessionException;
 import org.mulgara.server.driver.SessionFactoryFinder;
 import org.mulgara.server.driver.SessionFactoryFinderException;
+import org.mulgara.resolver.distributed.remote.StatementSetFactory;
 import org.mulgara.resolver.spi.GlobalizeException;
 import org.mulgara.resolver.spi.Resolution;
 import org.mulgara.resolver.spi.ResolverException;
 import org.mulgara.resolver.spi.ResolverSession;
+import org.mulgara.resolver.spi.Statements;
 
+import org.apache.log4j.Logger;
 import org.jrdf.graph.Node;
 import org.jrdf.graph.URIReference;
 
@@ -47,14 +51,14 @@
  *
  * @created 2007-03-20
  * @author <a href="mailto:gearon at users.sourceforge.net">Paul Gearon</a>
- * @version $Revision: $
- * @modified $Date: $
- * @maintenanceAuthor $Author: $
  * @copyright &copy; 2007 <a href="mailto:pgearon at users.sourceforge.net">Paul Gearon</a>
  * @licence <a href="{@docRoot}/../../LICENCE.txt">Open Software License v3.0</a>
  */
 public class NetworkDelegator implements Delegator {
 
+  /** Logger. */
+  private static Logger logger = Logger.getLogger(NetworkDelegator.class.getName());
+
   /** The session to delegate resolutions through. */
   private ResolverSession session;
 
@@ -82,29 +86,104 @@
    * @param localConstraint The constraint to resolve in local form.
    * @param localModel The LocalNode containing the model.
    * @throws QueryException A error occurred resolving the constraint.
+   * @throws ResolverException A error occurred setting up the resolution.
    */
-  public Resolution resolve(Constraint localConstraint, LocalNode localModel) throws QueryException {
+  public Resolution resolve(Constraint localConstraint, LocalNode localModel) throws QueryException, ResolverException {
     // globalize the model
-    Node modelNode = globalizeNode(localModel);
-    if (!(modelNode instanceof URIReference)) throw new QueryException("Unexpected model type in constraint: (" + modelNode.getClass() + ")" + modelNode.toString());
-    // convert the node to a URIReferenceImpl, which includes the Value interface
-    URIReferenceImpl model = makeRefImpl((URIReference)modelNode);
+    URIReferenceImpl modelRef = getModelRef(localModel); 
 
-    // check if this model is really on a remote server
-    URI modelUri = model.getURI();
-    testForLocality(modelUri);
+    URI serverUri = getServerUri(modelRef);
+    logger.debug("Querying for: " + localConstraint + " in model: " + modelRef + " on server: " + serverUri);
 
-    Answer ans = getModelSession(modelUri).query(globalizedQuery(localConstraint, model));
-    return new AnswerResolution(session, ans, localConstraint);
+    Answer ans = getServerSession(serverUri).query(globalizedQuery(localConstraint, modelRef));
+    return new AnswerResolution(serverUri, session, ans, localConstraint);
   }
 
 
   /**
+   * Add a set of statements to a model.
+   * @param model The <code>long</code> containing the model gNode.
+   * @param statements The statements to add to the model.
+   * @throws ResolverException A delegator specific problem occurred adding the data.
+   * @throws QueryException There was an error adding data at the remote end.
+   */
+  public void add(long model, Statements statements) throws ResolverException, QueryException {
+    // globalize the model
+    URIReferenceImpl modelRef = getModelRef(model);
+    // find and verify the server
+    URI serverUri = getServerUri(modelRef);
+    logger.debug("Adding data to model: " + modelRef + " on server: " + serverUri);
+    // convert the data to something shippable
+    try {
+      Set statementSet = StatementSetFactory.newStatementSet(statements, session);
+      getServerSession(serverUri).insert(modelRef.getURI(), statementSet);
+    } catch (GlobalizeException ge) {
+      throw new ResolverException("Insertion data can't be sent over a network", ge);
+    } catch (TuplesException te) {
+      throw new ResolverException("Insertion data inaccessible", te);
+    }
+  }
+
+
+  /**
+   * Remove a set of statements from a model.
+   * @param model The <code>long</code> containing the model gNode.
+   * @param statements The statements to remove from the model.
+   * @throws ResolverException A delegator specific problem occurred removing the data.
+   * @throws QueryException There was an error removing data at the remote end.
+   */
+  public void remove(long model, Statements statements) throws ResolverException, QueryException {
+    // globalize the model
+    URIReferenceImpl modelRef = getModelRef(model);
+    // find and verify the server
+    URI serverUri = getServerUri(modelRef);
+    logger.debug("Removing data from model: " + modelRef + " on server: " + serverUri);
+    // convert the data to something shippable
+    try {
+      Set statementSet = StatementSetFactory.newStatementSet(statements, session);
+      getServerSession(serverUri).delete(modelRef.getURI(), statementSet);
+    } catch (GlobalizeException ge) {
+      throw new ResolverException("Deletion data can't be sent over a network", ge);
+    } catch (TuplesException te) {
+      throw new ResolverException("Deletion data inaccessible", te);
+    }
+  }
+
+
+  /**
+   * Convert a local node representing a model into a URIReferenceImpl.
+   * @param localModel The local node to convert.
+   * @return The URIReference for the model
+   * @throws ResolverException The Node was not recognized as a model.
+   */
+  protected URIReferenceImpl getModelRef(LocalNode localModel) throws ResolverException {
+    return getModelRef(localModel.getValue());
+  }
+  
+  
+  /**
+   * Convert a model gNode into a URIReferenceImpl.
+   * @param modelGNode The gNode to convert.
+   * @return The URIReference for the model
+   * @throws ResolverException The gNode was not recognized as a model.
+   */
+  protected URIReferenceImpl getModelRef(long modelGNode) throws ResolverException {
+    // globalize the model
+    Node modelNode = globalizeNode(modelGNode);
+    if (!(modelNode instanceof URIReference)) throw new ResolverException("Unexpected model type in constraint: (" + modelNode.getClass() + ")" + modelNode.toString());
+    // convert the node to a URIReferenceImpl, which includes the Value interface
+    return makeRefImpl((URIReference)modelNode);
+  }
+
+
+  /**
    * Create a query for a single constraint.
    * @param constraint The local constraint to query for.
    * @return The globalized query, looking for the single constraint.
+   * @throws ResolverException There was an error globalizing the constraint elements. 
    */
-  protected Query globalizedQuery(Constraint localConstraint, URIReferenceImpl model) throws QueryException {
+  @SuppressWarnings("unchecked")
+  protected Query globalizedQuery(Constraint localConstraint, URIReferenceImpl model) throws ResolverException {
     // convert the constraint to network compatible form
     Constraint globalConstraint = new ConstraintImpl(
             globalizeConstraintElement(localConstraint.getElement(0)),
@@ -113,7 +192,7 @@
             model
     );
 
-    // convert the variable set to a variable list
+    // convert the variable set to a variable list - add types via unchecked casts
     List<Variable> variables = new ArrayList<Variable>((Set<Variable>)globalConstraint.getVariables());
     // build the new query
     return new Query(variables, new ModelResource(model.getURI()), globalConstraint, null, Collections.EMPTY_LIST, null, 0, new UnconstrainedAnswer());
@@ -124,13 +203,24 @@
    * Convert a local node to a global value.
    * @param localNode The node to globalize.
    * @return The globalized node, either a BlankNode, a URIReference, or a Literal.
+   * @throws ResolverException An error occurred while globalizing
+   */
+  protected Node globalizeNode(LocalNode localNode) throws ResolverException {
+      return globalizeNode(localNode.getValue());
+  }
+
+
+  /**
+   * Convert a gNode to a global node value.
+   * @param gNode The node id to globalize.
+   * @return The globalized node, either a BlankNode, a URIReference, or a Literal.
    * @throws QueryException An error occurred while globalizing
    */
-  protected Node globalizeNode(LocalNode localNode) throws QueryException {
+  protected Node globalizeNode(long gNode) throws ResolverException {
     try {
-      return session.globalize(localNode.getValue());
+      return session.globalize(gNode);
     } catch (GlobalizeException ge) {
-      throw new QueryException("Error globalizing node: " + localNode, ge);
+      throw new ResolverException("Error globalizing gNode: " + gNode, ge);
     }
   }
 
@@ -138,18 +228,14 @@
   /**
    * Converts a constraint element from local form into global form.
    * @param localElement The constraint element in local form.
-   * @throws QueryException The constraint element could not be globalized.
+   * @throws ResolverException The constraint element could not be globalized.
    */
-  protected ConstraintElement globalizeConstraintElement(ConstraintElement localElement) throws QueryException {
+  protected ConstraintElement globalizeConstraintElement(ConstraintElement localElement) throws ResolverException {
     // return the element if it does not need to be converted
     if (!(localElement instanceof LocalNode) || (localElement instanceof URIReferenceImpl)) return localElement;
 
-    // try {
-      // convert the reference to a Value
-      return makeRefImpl((URIReference)globalizeNode((LocalNode)localElement));
-    // } catch (ResolverException re) {
-      // throw new QueryException("Unable to globalize constraint element: " + localElement, re);
-    // }
+    // convert the reference to a Value
+    return makeRefImpl((URIReference)globalizeNode((LocalNode)localElement));
   }
 
 
@@ -167,9 +253,9 @@
   /**
    * Tests if a model is really on a different server.  If the model is local then throw an exception.
    * @param modelUri The URI of the model to test.
-   * @throws QueryException Thrown when the model is on the current system.
+   * @throws ResolverException Thrown when the model is on the current system.
    */
-  protected void testForLocality(URI modelUri) throws QueryException {
+  protected static void testForLocality(URI modelUri) throws ResolverException {
     String protocol = modelUri.getScheme();
     if (!DistributedResolverFactory.getProtocols().contains(protocol)) {
       throw new IllegalStateException("Bad Protocol sent to distributed resolver.");
@@ -178,28 +264,30 @@
     if (ServerInfo.getHostnameAliases().contains(host)) {
       // on the same machine.  Check if the server is different.
       if (ServerInfo.getServerURI().getPath().equals(modelUri.getPath())) {
-        throw new QueryException("Attempt to resolve a local model through the distributed resolver.");
+        throw new ResolverException("Attempt to resolve a local model through the distributed resolver.");
       }
     }
   }
 
 
   /**
-   * Gets a remote session on a server specified by a given model URI.
-   * @param modelUri The URI of the model to get a session for.
-   * @return a remote session on the host found in the model.
-   * @throws QueryException Thrown when the model is a bad URI, or the session cannot be created.
+   * Gets the URI for a server.
+   * @param modelUri The URI of the model we are getting the server for.
+   * @return A new URI containing just the server information.
+   * @throws ResolverException The model is not on a remote server.
    */
-  protected Session getModelSession(URI modelUri) throws QueryException {
+  protected static URI getServerUri(URIReference model) throws ResolverException {
     try {
+      // check if this model is really on a remote server
+      URI modelUri = model.getURI();
+      testForLocality(modelUri);
       // use the URI without the model fragment
-      return getServerSession(new URI(modelUri.getScheme(), modelUri.getSchemeSpecificPart(), null));
+      return new URI(modelUri.getScheme(), modelUri.getSchemeSpecificPart(), null);
     } catch (URISyntaxException use) {
       throw new AssertionError(use);
     }
   }
 
-
   /**
    * Retrieves a session for a given server URI, using a cached value if possible.
    * @param serverUri The URI of the server to get a session for.

Copied: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote (from rev 281, trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote)

Deleted: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/Config.java
===================================================================
--- trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/Config.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/Config.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -1,68 +0,0 @@
-/*
- * The contents of this file are subject to the Open Software License
- * Version 3.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.opensource.org/licenses/osl-3.0.txt
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- */
-
-package org.mulgara.resolver.distributed.remote;
-
-/**
- * Defines a set of property names and default values for use with paged remote sets.
- *
- * @created 2007-04-23
- * @author <a href="mailto:gearon at users.sourceforge.net">Paul Gearon</a>
- * @copyright &copy; 2007 <a href="mailto:pgearon at users.sourceforge.net">Paul Gearon</a>
- * @licence <a href="{@docRoot}/../../LICENCE.txt">Open Software License v3.0</a>
- */
-public class Config {
-
-  /** Default maximum number of pages that may be queued. */
-  private static final int DEFAULT_MAX_PAGES = 100;
-
-  /** Name of the Maximum Pages property. */
-  private static final String MAX_PAGES_PROPERTY = "pagedset.pages.max";
-
-  /** Default maximum time to wait for a page to arrive, in milliseconds. */
-  private static final long DEFAULT_TIMEOUT = 10000;
-
-  /** Name of the timeout property. */
-  private static final String TIMEOUT_PROPERTY = "pagedset.timeout";
-
-  /** Default number of entries in a page. */
-  private static final int DEFAULT_PAGE_SIZE = 128;
-
-  /** Name of the page size property. */
-  private static final String PAGE_SIZE_PROPERTY = "pagedset.pages.size";
-
-
-  /**
-   * Get the maximum number of pages to keep in memory at once.
-   * @return The maximum number of pages to keep.
-   */
-  public static int getMaxPages() {
-    return Integer.getInteger(MAX_PAGES_PROPERTY, DEFAULT_MAX_PAGES).intValue();
-  }
-
-  /**
-   * Get the maximum time to wait for a page to arrive, in milliseconds.
-   * @return The maximum timeout for a remote call.
-   */
-  public static long getTimeout() {
-    return Long.getLong(TIMEOUT_PROPERTY, DEFAULT_TIMEOUT).longValue();
-  }
-
-  /**
-   * Get the size of pages to transfer.
-   * @return The number of entries in a page.
-   */
-  public static int getPageSize() {
-    return Integer.getInteger(PAGE_SIZE_PROPERTY, DEFAULT_PAGE_SIZE).intValue();
-  }
-
-}

Copied: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/Config.java (from rev 281, trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/Config.java)

Deleted: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/RemotePager.java
===================================================================
--- trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/RemotePager.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/RemotePager.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -1,34 +0,0 @@
-/*
- * The contents of this file are subject to the Open Software License
- * Version 3.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.opensource.org/licenses/osl-3.0.txt
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- */
-
-package org.mulgara.resolver.distributed.remote;
-
-import java.rmi.*;
-import java.io.Serializable;
-
-/**
- * The interface for paging an iterable object over RMI.
- * @param <E> The elements of the paged list.
- *
- * @created 2007-04-23
- * @author <a href="mailto:gearon at users.sourceforge.net">Paul Gearon</a>
- * @copyright &copy; 2007 <a href="mailto:pgearon at users.sourceforge.net">Paul Gearon</a>
- * @licence <a href="{@docRoot}/../../LICENCE.txt">Open Software License v3.0</a>
- */
-public interface RemotePager<E extends Serializable> extends Remote {
-
-  public int size() throws RemoteException;
-
-  public E[] firstPage() throws RemoteException;
-
-  public E[] nextPage() throws RemoteException;
-}

Copied: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/RemotePager.java (from rev 281, trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/RemotePager.java)

Deleted: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/RemotePagerImpl.java
===================================================================
--- trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/RemotePagerImpl.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/RemotePagerImpl.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -1,126 +0,0 @@
-/*
- * The contents of this file are subject to the Open Software License
- * Version 3.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.opensource.org/licenses/osl-3.0.txt
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- */
-
-package org.mulgara.resolver.distributed.remote;
-
-import java.util.*;
-import java.rmi.*;
-import java.lang.reflect.Array;
-import java.io.Serializable;
-import java.rmi.server.UnicastRemoteObject;
-import java.util.logging.*;
-
-/**
- * Implements the remote pager by iterating on a list and moving pages of elements over RMI.
- * @param <E> The elements of the paged list.
- *
- * @created 2007-04-23
- * @author <a href="mailto:gearon at users.sourceforge.net">Paul Gearon</a>
- * @copyright &copy; 2007 <a href="mailto:pgearon at users.sourceforge.net">Paul Gearon</a>
- * @licence <a href="{@docRoot}/../../LICENCE.txt">Open Software License v3.0</a>
- */
-public class RemotePagerImpl<E extends Serializable> implements RemotePager<E> {
-
-  /** Logger. */
-  protected static final Logger logger = Logger.getLogger(RemotePagerImpl.class.getName());
-
-  /** The type of the wrapped class.  Used for creating pages of elements in arrays. */
-  private Class<E> type;
-
-  /** Stored size of the wrapped collection. */
-  private final int size;
-  
-  /** The objects to page over RMI. */
-  private Collection<E> collection;
-
-  /** Internal iterator for the collection. */
-  private Iterator<E> iter;
-
-  /** The latest page of data. */
-  private E[] currentPage;
-
-  /** The size of a data page. */
-  private final int pageSize = Config.getPageSize();
-
-  /**
-   * Creates a new remote paging object.
-   * @param type The java.lang.Class of the elements to be paged.
-   * @param collection The data to be paged.
-   * @throws RemoteException If the data cannot be sent over RMI.
-   */
-  @SuppressWarnings("unchecked")
-  public RemotePagerImpl(Class<E> type, Collection<E> collection) throws RemoteException {
-    this.type = type;
-    this.collection = collection;
-    size = collection.size();
-    iter = null;
-    currentPage = (E[])Array.newInstance(type, pageSize);
-    UnicastRemoteObject.exportObject(this);
-  }
-
-
-  /**
-   * Gets the number of items in the underlying data.
-   */
-  public int size() {
-    return size;
-  }
-
-  
-  /**
-   * Gets the first page of data as an array with length equal to the size of the page.
-   * @return an array of elements.
-   */
-  public E[] firstPage() throws RemoteException {
-    iter = collection.iterator();
-    return fillPage();
-  }
-
-  
-  /**
-   * Gets the next page of data as an array with length equal to the size of the page.
-   * @return an array of elements.
-   */
-  public E[] nextPage() throws RemoteException {
-    return fillPage();
-  }
-
-  
-  /**
-   * Populates the current page with elements from the underlying collection.
-   * @return The current page.
-   */
-  private E[] fillPage() {
-    logger.finest("Filling page");
-    for (int i = 0; i < pageSize; i++) {
-      if (!iter.hasNext()) return truncatePage(i);
-      currentPage[i] = iter.next();
-    }
-    return currentPage;
-  }
-
-  
-  /**
-   * Reduces the size of an array if there are fewer valid elements than the length of the array.
-   * @param The size of the array.
-   * @return A new current page.
-   */
-  @SuppressWarnings("unchecked")
-  private E[] truncatePage(int offset) {
-    if (offset == 0) return null;
-    logger.finest("Building array of type: " + type +", with length: " + offset);
-    E[] result = (E[])Array.newInstance(type, offset);
-    System.arraycopy(currentPage, 0, result, 0, offset);
-    return result;
-  }
-
-}

Copied: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/RemotePagerImpl.java (from rev 281, trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/RemotePagerImpl.java)

Deleted: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/SetProxy.java
===================================================================
--- trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/SetProxy.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/SetProxy.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -1,299 +0,0 @@
-package org.mulgara.resolver.distributed.remote;
-
-import java.util.*;
-import java.util.logging.*;
-import java.rmi.RemoteException;
-import java.io.Serializable;
-
-/**
- * Represents an iterable object on a remote system as a local Set.
- * Created at the server side, and sent across the network.
- */
-public class SetProxy<E extends Serializable> extends AbstractSet<E> implements Serializable {
-
-  /** Serial ID for versioning. */
-  private static final long serialVersionUID = -8343698708605937025L;
-
-  /** Logger. */
-  protected static final Logger logger = Logger.getLogger(RemotePagerImpl.class.getName());
-
-  /** Stores the currently running iterator. */
-  private static Object currentIterator = null;
-
-  /** A pager for returning sequential pages of a remote collection. */
-  private final RemotePager<E> remotePager;
-
-  /** The size of the remote collection. */
-  private final int cachedSize;
-
-  /**
-   * Creates a new proxy for a remote collection, meeting the Set interface.
-   * @param remotePager A device for sending data from the remote collection one page at a time.
-   */
-  public SetProxy(RemotePager<E> remotePager) {
-    this.remotePager = remotePager;
-    // local call for size
-    try {
-      cachedSize = remotePager.size();
-    } catch (RemoteException re) {
-      throw new IllegalStateException("The proxy should be instantiated on the host side");
-    }
-  }
-
-
-  /**
-   * Returns the number of elements in the underlying collection.
-   * @return The size of the collection.
-   */
-  public int size() {
-    return cachedSize;
-  }
-
-
-  /**
-   * Returns an iterator which will access all the remote data.
-   * NOTE: The current implementation allows only one iterator to be active at a time!
-   * @return A new iterator for the remote data.
-   */
-  public Iterator<E> iterator() {
-    return new PagedIterator();
-  }
-
-
-  /**
-   * An iterator class for traversing remote data.  Network activity is reduced by moving
-   * data in large pages at a time.
-   */
-  private class PagedIterator implements Iterator<E> {
-
-    /** A thread for managing bringing the pages over the network. */
-    private Pager pager;
-
-    /** The most recent page of data. */
-    private E[] currentPage;
-
-    /** The current position in the current page of data. */
-    int index;
-
-    /**
-     * Create a new iterator for traversing pages of data.
-     */
-    public PagedIterator() {
-      currentPage = null;
-      index = 0;
-      currentIterator = this;
-      logger.info("Starting pager");
-      pager = new Pager();
-      currentPage = pager.nextPage();
-      logger.info("Started pager");
-    }
-
-    
-    /**
-     * Remove the current element from the data.  Unsupported.
-     */
-    public void remove() {
-      throw new UnsupportedOperationException();
-    }
-
-
-    /**
-     * Queries the data to check if more data exists.  Should not need to block.
-     * @return <code>true</code> if more data exists.
-     * @throws ConcurrentModificationException If more than one iterator is active.
-     */
-    public boolean hasNext() {
-      logger.info("called SetProxy$Iterator.hasNext()");
-      testState();
-      if (currentPage != null && index < currentPage.length) return true;
-      return currentPage != null;
-    }
-
-
-    /**
-     * Returns the next element of the data.  Will block until data is available.
-     * @return The next item of data in sequence.
-     * @throws ConcurrentModificationException If more than one iterator is active.
-     */
-    public E next() {
-      logger.info("called SetProxy$Iterator.next()");
-      testState();
-      logger.info("Accessing element " + index + " of " + currentPage.length);
-
-      if (currentPage != null && index < currentPage.length) return nextPageElement();
-      return nextPageElement();
-    }
-
-
-    /**
-     * Gets the next element out of the current page.
-     * @return The next element from the current page.
-     */
-    private E nextPageElement() {
-      logger.info("Getting next page element");
-      E element = currentPage[index++];
-      if (index == currentPage.length) updatePage();
-      return element;
-    }
-
-
-    /**
-     * Moves to the next page, if another page is available.
-     */
-    private void updatePage() {
-      logger.info("Moving to next page");
-      currentPage = pager.nextPage();
-      index = 0;
-    }
-
-
-    /**
-     * Check that this is the only iterator being accessed at the moment.
-     * @throws ConcurrentModificationException If this iterator is being accessed
-     *         after a new iterator has been created.
-     */
-    private void testState() {
-      if (currentIterator != this) {
-        throw new ConcurrentModificationException("Unable to use more than one remote iterator on the set");
-      }
-    }
-
-
-    /**
-     * Private thread for getting the next page in the background.
-     */
-    private class Pager extends Thread {
-
-      /** The maximum number of pages that may be queued. */
-      private final int maxPages = Config.getMaxPages();
-
-      /** Maximum time to wait for a page to arrive, in milliseconds. */
-      private final long timeout = Config.getTimeout();
-
-      /** Indicates that the thread has finished. */
-      private boolean complete;
-
-      /** The retrieved pages. */
-      private Queue<E[]> retrievedPages;
-
-      /** Stores exception when one occurs. */
-      private PagerException lastException;
-
-      /**
-       * Initialize and start the thread.
-       * Main thread.
-       */
-      public Pager() {
-        lastException = null;
-        retrievedPages = new LinkedList<E[]>();
-        try {
-          logger.info("Getting first page");
-          E[] page = remotePager.firstPage();
-          if (page != null) {
-            logger.info("Got data in first page: size=" + page.length);
-            retrievedPages.add(page);
-            complete = false;
-            start();
-          } else logger.info("Empty initial page");
-        } catch (RemoteException re) {
-          throw new PagerException("Unable to get the first page", re);
-        }
-      }
-
-
-      /**
-       * Checks if the thread is active.  Main thread.
-       * @return <code>false</code> if the thread is still running, <code>true</code> when complete.
-       */
-      public boolean isComplete() {
-        if (lastException != null) throw lastException;
-        return complete;
-      }
-
-
-      /**
-       * Pick up all the pages.
-       * Runs in the background Paging thread.
-       */
-      public void run() {
-        try {
-          while (true) {
-            synchronized (retrievedPages) {
-              while (retrievedPages.size() >= maxPages) {
-                try {
-                  logger.info("Waiting for queue to empty.  Currently at: " + retrievedPages.size());
-                  retrievedPages.wait();
-                } catch (InterruptedException ie) { }
-              }
-            }
-            E[] page = remotePager.nextPage();
-            if (page == null) {
-              logger.info("Got final page");
-              break;
-            }
-            logger.info("Got next page.  size=" + page.length);
-            synchronized (retrievedPages) {
-              retrievedPages.add(page);
-              logger.info("Queue now at " + retrievedPages.size() + " pages");
-            }
-            synchronized (this) {
-              this.notify();
-            }
-          }
-        } catch (RemoteException re) {
-          logger.severe("Error retrieving remote data: " + re.getMessage());
-          lastException = new PagerException("Unable to retrieve page", re);
-        }
-        complete = true;
-      }
-
-
-      /**
-       * Get the next page, if available.  The page will be an array of the configured length,
-       * or shorter if it is the last page.  If there is no more data, then <code>null</code>
-       * will be returned.
-       * Runs in the Main thread.
-       * @return The next page of data, or <code>null</code> if no more data exists.
-       */
-      public E[] nextPage() {
-        logger.info("Request for next page");
-        if (lastException != null) throw lastException;
-        E[] page;
-        long startTime = System.currentTimeMillis();
-        while (true) {
-          synchronized (retrievedPages) {
-            int oldSize = retrievedPages.size();
-            logger.info("Queue has " + oldSize + " pages");
-            page = retrievedPages.poll();
-            if (oldSize >= maxPages) retrievedPages.notify();
-            logger.info("page @" + page);
-          }
-          long waitTime = timeout + startTime - System.currentTimeMillis();
-          if (waitTime <= 0) throw new PagerException("Timed out waiting for page");
-          try {
-            synchronized (this) {
-              if (page == null && !complete) {
-                logger.info("Waiting for more pages to arrive");
-                this.wait(waitTime);
-              } else break;
-            }
-          } catch (InterruptedException ie) { }
-          if (System.currentTimeMillis() - startTime >= timeout) throw new PagerException("Timed out waiting for page");
-        }
-        logger.info("Returning page = " + page);
-        return page;
-      }
-    }
-  }
-
-
-  /** Exception class for paging.  Must be runtime so it can be thrown through Set interface. */
-  @SuppressWarnings("serial")
-  public static class PagerException extends RuntimeException {
-    public PagerException() { }
-    public PagerException(String message) { super(message); }
-    public PagerException(String message, RemoteException cause) { super(message, cause); }
-    public PagerException(RemoteException cause) { super(cause); }
-  }
-}
-

Copied: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/SetProxy.java (from rev 281, trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/SetProxy.java)

Deleted: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/ShortGlobalStatementSet.java
===================================================================
--- trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/ShortGlobalStatementSet.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/ShortGlobalStatementSet.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -1,87 +0,0 @@
-/*
- * The contents of this file are subject to the Open Software License
- * Version 3.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.opensource.org/licenses/osl-3.0.txt
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- */
-
-package org.mulgara.resolver.distributed.remote;
-
-import java.io.Serializable;
-import java.util.AbstractSet;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.jrdf.graph.ObjectNode;
-import org.jrdf.graph.PredicateNode;
-import org.jrdf.graph.SubjectNode;
-import org.jrdf.graph.Triple;
-import org.mulgara.query.TuplesException;
-import org.mulgara.query.rdf.TripleImpl;
-import org.mulgara.resolver.spi.GlobalizeException;
-import org.mulgara.resolver.spi.ResolverSession;
-import org.mulgara.resolver.spi.Statements;
-
-/**
- * Creates a small Set of statements that be be shipped across a network.
- *
- * @created 2007-04-23
- * @author <a href="mailto:gearon at users.sourceforge.net">Paul Gearon</a>
- * @copyright &copy; 2007 <a href="mailto:pgearon at users.sourceforge.net">Paul Gearon</a>
- * @licence <a href="{@docRoot}/../../LICENCE.txt">Open Software License v3.0</a>
- */
-public class ShortGlobalStatementSet extends AbstractSet<Triple> implements Serializable {
-  
-  /**
-   * Allow newer compiled version of the stub to operate when changes
-   * have not occurred with the class.
-   * NOTE : update this serialVersionUID when a method or a public member is
-   * deleted.
-   */
-  private static final long serialVersionUID = 896369800817370415L;
-  
-  
-  /** Internally, use a list as this has a shorter serialization. */
-  private ArrayList<Triple> data;
-  
-  
-  /**
-   * Builds the set of Triple data, containing globalized triples.
-   * @param statements Contains the data for the set.  This must not contain duplicates.
-   * @throws TuplesException There was an error accessing the statements.
-   * @throws GlobalizeException Some of the statements could not be globalized.
-   */
-  ShortGlobalStatementSet(Statements statements, ResolverSession session) throws TuplesException, GlobalizeException {
-    // build the array
-    long rowCount = statements.getRowCount();
-    assert rowCount < StatementSetFactory.WATER_MARK;
-    data = new ArrayList<Triple>((int)rowCount);
-    // populate the array
-    statements.beforeFirst();
-    int i = 0;
-    while (statements.next()) {
-      Triple t = new TripleImpl(
-          (SubjectNode)session.globalize(statements.getSubject()),
-          (PredicateNode)session.globalize(statements.getPredicate()),
-          (ObjectNode)session.globalize(statements.getObject())
-      );
-      data.set(i++, t);
-    }
-  }
-
-  @Override
-  public Iterator<Triple> iterator() {
-    return data.iterator();
-  }
-
-  @Override
-  public int size() {
-    return data.size();
-  }
-
-}

Copied: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/ShortGlobalStatementSet.java (from rev 281, trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/ShortGlobalStatementSet.java)

Deleted: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/StatementSetFactory.java
===================================================================
--- trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/StatementSetFactory.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/StatementSetFactory.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -1,49 +0,0 @@
-/*
- * The contents of this file are subject to the Open Software License
- * Version 3.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.opensource.org/licenses/osl-3.0.txt
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- */
-
-package org.mulgara.resolver.distributed.remote;
-
-import java.rmi.RemoteException;
-import java.util.Set;
-
-import org.jrdf.graph.Triple;
-import org.mulgara.query.TuplesException;
-import org.mulgara.resolver.spi.GlobalizeException;
-import org.mulgara.resolver.spi.ResolverSession;
-import org.mulgara.resolver.spi.Statements;
-
-/**
- * Creates a Set of statements that be be shipped across a network.
- *
- * @created 2007-04-23
- * @author <a href="mailto:gearon at users.sourceforge.net">Paul Gearon</a>
- * @copyright &copy; 2007 <a href="mailto:pgearon at users.sourceforge.net">Paul Gearon</a>
- * @licence <a href="{@docRoot}/../../LICENCE.txt">Open Software License v3.0</a>
- */
-public class StatementSetFactory {
-  
-  /** The size for transitioning between a serializable set and a remote set. */
-  static final long WATER_MARK = 2048L;
-
-  public static Set newStatementSet(Statements statements, ResolverSession session) throws TuplesException, GlobalizeException {
-    // make sure the WATER_MARK refers to a set that is indexable by integer
-    assert (long)(int)WATER_MARK == WATER_MARK;
-    if (statements.getRowUpperBound() < WATER_MARK) return new ShortGlobalStatementSet(statements, session);
-    try {
-      RemotePager<Triple> pager = new RemotePagerImpl<Triple>(Triple.class, new TripleSetAdaptor(statements, session));
-      return new SetProxy<Triple>(pager);
-    } catch (RemoteException re) {
-      throw new TuplesException("Error accessing remote data", re);
-    }
-  }
-}

Copied: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/StatementSetFactory.java (from rev 281, trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/StatementSetFactory.java)

Deleted: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/TripleSetAdaptor.java
===================================================================
--- trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/TripleSetAdaptor.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/TripleSetAdaptor.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -1,116 +0,0 @@
-/*
- * The contents of this file are subject to the Open Software License
- * Version 3.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.opensource.org/licenses/osl-3.0.txt
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- */
-
-package org.mulgara.resolver.distributed.remote;
-
-import java.util.AbstractSet;
-import java.util.Iterator;
-
-import org.jrdf.graph.ObjectNode;
-import org.jrdf.graph.PredicateNode;
-import org.jrdf.graph.SubjectNode;
-import org.jrdf.graph.Triple;
-import org.mulgara.query.TuplesException;
-import org.mulgara.query.rdf.TripleImpl;
-import org.mulgara.resolver.spi.GlobalizeException;
-import org.mulgara.resolver.spi.ResolverSession;
-import org.mulgara.resolver.spi.Statements;
-
-/**
- * Converts a StatementSet into a List of Triple.
- *
- * @created 2007-05-14
- * @author <a href="mailto:pgearon at users.sourceforge.net">Paul Gearon</a>
- * @copyright &copy; 2007 <a href="mailto:pgearon at users.sourceforge.net">Paul Gearon</a>
- * @licence <a href="{@docRoot}/../../LICENCE.txt">Open Software License v3.0</a>
- */
-public class TripleSetAdaptor extends AbstractSet<Triple> {
-
-  /** The underlying set of statements. */
-  private Statements statements;
-  
-  /** A ResolverSession for use in globalizing nodes. */
-  private ResolverSession session;
-  
-  /**
-   * Builds a new iterable List of Triple, based on a Statements.
-   * @param statements The statements to adapt to a List.
-   */
-  public TripleSetAdaptor(Statements statements, ResolverSession session) {
-    this.statements = statements;
-    this.session = session;
-  }
-  
-  
-  @Override
-  public int size() {
-    try {
-      long size = statements.getRowCount();
-      return (long)(int)size == size ? (int)size : Integer.MAX_VALUE;
-    } catch (TuplesException te) {
-      throw new RuntimeException("Unable to get result size", te);
-    }
-  }
-
-
-  @Override
-  public Iterator<Triple> iterator() {
-    return new TripleCursorIterator(statements);
-  }
-  
-  
-  /**
-   * An iterator class for Cursor objects.
-   */
-  public class TripleCursorIterator implements Iterator<Triple> {
-    
-    /** The cursor to iterate on. */
-    private Statements s;
-
-    /** A flag to indicate if there is more data. */
-    private boolean hasNext;
-    
-    TripleCursorIterator(Statements s) {
-      this.s = s;
-      try {
-        hasNext = s.getRowCardinality() != 0;
-      } catch (TuplesException te) {
-        throw new RuntimeException("Unable to access result size", te);
-      }
-    }
-
-    public boolean hasNext() {
-      return hasNext;
-    }
-
-    public Triple next() {
-      try {
-        hasNext = s.next();
-        return new TripleImpl(
-            (SubjectNode)session.globalize(statements.getSubject()),
-            (PredicateNode)session.globalize(statements.getPredicate()),
-            (ObjectNode)session.globalize(statements.getObject())
-        );
-      } catch (TuplesException te) {
-        throw new RuntimeException("Unable to access result data", te);
-      } catch (GlobalizeException ge) {
-        throw new RuntimeException("Unable to globalize result data", ge);
-      }
-    }
-
-    public void remove() {
-      throw new UnsupportedOperationException();
-    }
-  }
-  
-
-}

Copied: branches/mgr-58/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/TripleSetAdaptor.java (from rev 281, trunk/src/jar/resolver-distributed/java/org/mulgara/resolver/distributed/remote/TripleSetAdaptor.java)

Modified: branches/mgr-58/src/jar/resolver-filesystem/java/org/mulgara/resolver/filesystem/TestResolverSession.java
===================================================================
--- branches/mgr-58/src/jar/resolver-filesystem/java/org/mulgara/resolver/filesystem/TestResolverSession.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver-filesystem/java/org/mulgara/resolver/filesystem/TestResolverSession.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -137,6 +137,10 @@
     throw new LocalizeException(node, "Not implemented");
   }
 
+  public long newBlankNode() {
+    throw new UnsupportedOperationException("Not implemented");
+  }
+
   public Tuples findStringPoolRange(
       SPObject lowValue, boolean inclLowValue,
       SPObject highValue, boolean inclHighValue

Modified: branches/mgr-58/src/jar/resolver-memory/java/org/mulgara/resolver/memory/MemoryResolver.java
===================================================================
--- branches/mgr-58/src/jar/resolver-memory/java/org/mulgara/resolver/memory/MemoryResolver.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver-memory/java/org/mulgara/resolver/memory/MemoryResolver.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -42,6 +42,7 @@
 import org.mulgara.query.*;
 import org.mulgara.resolver.spi.*;
 import org.mulgara.store.nodepool.NodePool;
+import org.mulgara.store.nodepool.NodePoolException;
 import org.mulgara.store.statement.StatementStoreException;
 import org.mulgara.store.stringpool.SPObject;
 import org.mulgara.store.stringpool.SPObjectFactory;
@@ -63,8 +64,8 @@
  *      Software Pty Ltd</a>
  * @licence <a href="{@docRoot}/../../LICENCE">Mozilla Public License v1.1</a>
  */
-public class MemoryResolver implements SystemResolver
-{
+public class MemoryResolver implements SystemResolver {
+
   /**
    * Logger.
    */
@@ -112,8 +113,8 @@
                  long            systemModel,
                  URI             modelTypeURI,
                  Set             statingSet)
-    throws ResolverFactoryException
-  {
+      throws ResolverFactoryException {
+
     // Validate "modelType" parameter
     if (modelTypeURI == null) {
       throw new IllegalArgumentException("Model type can't be null");
@@ -133,8 +134,8 @@
                  URI               modelTypeURI,
                  Set               statingSet,
                  XAResolverSession resolverSession)
-    throws ResolverFactoryException
-  {
+      throws ResolverFactoryException {
+    
     // Validate "modelType" parameter
     if (modelTypeURI == null) {
       throw new IllegalArgumentException("Model type can't be null");
@@ -153,8 +154,7 @@
   // Methods implementing Resolver
   //
 
-  public XAResource getXAResource()
-  {
+  public XAResource getXAResource() {
     if (xaResolverSession != null) {
       return new MemoryXAResource(10, xaResolverSession);
     } else {
@@ -172,8 +172,7 @@
    * @param modelTypeURI  {@inheritDoc}.  The type must match the value of
    *   {@link #memoryModelTypeURI}.
    */
-  public void createModel(long model, URI modelTypeURI) throws ResolverException, LocalizeException
-  {
+  public void createModel(long model, URI modelTypeURI) throws ResolverException, LocalizeException {
     if (logger.isDebugEnabled()) {
       logger.debug("Create memory model " + model + " of type " + modelTypeURI);
     }
@@ -188,8 +187,7 @@
   }
 
   public void createSystemModel(long model, long modelType)
-      throws ResolverException, LocalizeException
-  {
+      throws ResolverException, LocalizeException {
     modifyModel(model,
         new SingletonStatements(model, rdfType, modelType),
         true);
@@ -202,16 +200,14 @@
   /**
    * @throws ResolverException always -- not yet implemented
    */
-  public void writeStringPool(Writer w) throws IOException, ResolverException
-  {
+  public void writeStringPool(Writer w) throws IOException, ResolverException {
     throw new ResolverException("Backup of string pool not implemented");
   }
 
   /**
    * Remove the cached model containing the contents of a URL.
    */
-  public void removeModel(long model) throws ResolverException
-  {
+  public void removeModel(long model) throws ResolverException {
     if (logger.isDebugEnabled()) {
       logger.debug("Remove memory model " + model);
     }
@@ -228,9 +224,7 @@
   /**
    * Insert or delete RDF statements in a model at a URL.
    */
-  public void modifyModel(long model, Statements statements, boolean occurs)
-    throws ResolverException
-  {
+  public void modifyModel(long model, Statements statements, boolean occurs) throws ResolverException {
     if (logger.isDebugEnabled()) {
       if (occurs) {
         logger.debug("Asserting " + statements + " in " + model);
@@ -283,8 +277,7 @@
   /**
    * Resolve a constraint against a model on the Java heap.
    */
-  public Resolution resolve(Constraint constraint) throws QueryException
-  {
+  public Resolution resolve(Constraint constraint) throws QueryException {
     if (logger.isDebugEnabled()) {
       logger.debug("Resolve " + constraint + " against " + statingSet);
     }
@@ -298,32 +291,32 @@
   //
 
 
-  public Node globalize(long node) throws GlobalizeException
-  {
+  public Node globalize(long node) throws GlobalizeException {
     return resolverSession.globalize(node);
   }
 
 
-  public long lookup(Node node) throws LocalizeException
-  {
+  public long lookup(Node node) throws LocalizeException {
     return resolverSession.lookup(node);
   }
 
-  public long lookupPersistent(Node node) throws LocalizeException
-  {
+  public long lookupPersistent(Node node) throws LocalizeException {
     return resolverSession.lookupPersistent(node);
   }
 
-  public long localize(Node node) throws LocalizeException
-  {
+  public long localize(Node node) throws LocalizeException {
     return resolverSession.localize(node);
   }
 
-  public long localizePersistent(Node node) throws LocalizeException
-  {
+  public long localizePersistent(Node node) throws LocalizeException {
     return resolverSession.localizePersistent(node);
   }
+  
+  public long newBlankNode() throws NodePoolException {
+    return resolverSession.newBlankNode();
+  }
 
+
   public Tuples findStringPoolRange(
       SPObject lowValue, boolean inclLowValue,
       SPObject highValue, boolean inclHighValue

Modified: branches/mgr-58/src/jar/resolver-spi/java/org/mulgara/resolver/spi/LocalizedTuples.java
===================================================================
--- branches/mgr-58/src/jar/resolver-spi/java/org/mulgara/resolver/spi/LocalizedTuples.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver-spi/java/org/mulgara/resolver/spi/LocalizedTuples.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -68,7 +68,7 @@
       Logger.getLogger(LocalizedTuples.class.getName());
 
   /** The session to localize into. */
-  private final ResolverSession session;
+  protected final ResolverSession session;
 
   /**
    * The wrapped {@link Answer} instance.

Modified: branches/mgr-58/src/jar/resolver-spi/java/org/mulgara/resolver/spi/ResolverSession.java
===================================================================
--- branches/mgr-58/src/jar/resolver-spi/java/org/mulgara/resolver/spi/ResolverSession.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver-spi/java/org/mulgara/resolver/spi/ResolverSession.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -36,6 +36,7 @@
 // Local packages
 import org.mulgara.store.StoreException;
 import org.mulgara.store.nodepool.NodePool;
+import org.mulgara.store.nodepool.NodePoolException;
 import org.mulgara.store.statement.StatementStore;
 import org.mulgara.store.stringpool.SPObject;
 import org.mulgara.store.stringpool.SPObjectFactory;
@@ -133,6 +134,15 @@
   public long localizePersistent(Node node) throws LocalizeException;
 
   /**
+   * Allocates a new blank node in a session.  Unlike localization, blank nodes
+   * do not need to be inserted into the string pool.
+   * 
+   * @return A new local node number for this session.
+   * @throws NodePoolException 
+   */
+  public long newBlankNode() throws NodePoolException;
+  
+  /**
    * Get a range of nodes from the string pools used in the current session.
    *
    * @param lowValue The low end of the range to select. Pass <code>null</code>

Modified: branches/mgr-58/src/jar/resolver-store/java/org/mulgara/resolver/store/StatementStoreResolver.java
===================================================================
--- branches/mgr-58/src/jar/resolver-store/java/org/mulgara/resolver/store/StatementStoreResolver.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver-store/java/org/mulgara/resolver/store/StatementStoreResolver.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -48,6 +48,7 @@
 import org.mulgara.query.rdf.URIReferenceImpl;
 import org.mulgara.resolver.spi.*;
 import org.mulgara.store.nodepool.NodePool;
+import org.mulgara.store.nodepool.NodePoolException;
 import org.mulgara.store.statement.StatementStore;
 import org.mulgara.store.statement.StatementStoreException;
 import org.mulgara.store.stringpool.SPObject;
@@ -459,6 +460,9 @@
     return resolverSession.localizePersistent(node);
   }
 
+  public long newBlankNode() throws NodePoolException {
+    return resolverSession.newBlankNode();
+  }
 
   public Tuples findStringPoolRange(
       SPObject lowValue, boolean inclLowValue,

Modified: branches/mgr-58/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/TestResolverSession.java
===================================================================
--- branches/mgr-58/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/TestResolverSession.java	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/TestResolverSession.java	2007-06-19 05:50:50 UTC (rev 282)
@@ -153,6 +153,10 @@
     return localize(node);
   }
 
+  public long newBlankNode() {
+    throw new UnsupportedOperationException("Not implemented");
+  }
+
   public Tuples findStringPoolRange(
       SPObject lowValue, boolean inclLowValue,
       SPObject highValue, boolean inclHighValue

Modified: branches/mgr-58/webdocs.xml
===================================================================
--- branches/mgr-58/webdocs.xml	2007-06-17 03:15:45 UTC (rev 281)
+++ branches/mgr-58/webdocs.xml	2007-06-19 05:50:50 UTC (rev 282)
@@ -52,7 +52,8 @@
 	<script type="text/javascript" src="/script/styleswitcher.js"></script>
 	<script type="text/javascript" src="/script/rollover.js"></script>
 	<link rel="stylesheet" type="text/css" href="/style/style.css"/>
-	<!--[if IE]><style type="text/css">@import url(/style/styleIE6.css);</style><![endif]-->
+	<!--[if lt IE 7]><style type="text/css">@import url(/style/styleIE6.css);</style><![endif]-->
+	<!--[if gte IE 7]><style type="text/css">@import url(/style/styleIE7.css);</style><![endif]-->
 	<link rel="stylesheet" type="text/css" href="/style/navIn.css" title="navIn" />
 	<link rel="alternate stylesheet" type="text/css" href="/style/navOut.css" title="navOut" />
 </head>
@@ -190,7 +191,7 @@
       <replacevalue><![CDATA[
 
 	<div id="footer">
-		Copyright 2006-2007 The Mulgara Project. Some rights reserved. <a href="/overview/legal.html">MORE</a>&gt;&gt;
+		Copyright 2006-2007 The Mulgara Project. Some rights reserved. <a href="/overview/legal.html">MORE&nbsp;&gt;</a>
 	</div>
 	<div id="validator">
 		<a href="http://validator.w3.org/check?uri=referer"><img src="/img-layout/w3xhtml10.gif" alt="Valid XHTML 1.0 Transitional" height="21" width="66" /></a>
@@ -512,50 +513,29 @@
 								<li><a href="/integration/jsptutorial.html#o995">Deploy the JSPs</a></li>
 								<li><a href="/integration/jsptutorial.html#o996">Open the Application</a></li>
 						</ul></li>
-						<li><a href="/jrdf/jrdftutorial.html">JRDF Tutorial</a></li>
-								@@jrdfTOC@@
-				</ul></li>]]></replacevalue>
+						<li><a href="/integration/jrdftutorial.html">JRDF Tutorial</a></li>
+						<li class="ulcontainer"><ul>
+								<li><a href="/integration/jrdfprereq.html">Prerequisites</a></li>
+								<li class="ulcontainer toc"><ul class="toc">
+										<li><a href="/integration/jrdfprereq.html#o2898">Obtaining a Session from a Mulgara Server</a></li>
+										<li><a href="/integration/jrdfprereq.html#o2899">Comparison of JRDF Graph Implementations</a></li>
+								</ul></li>
+								<li><a href="/integration/jrdfcreategraph.html">Creating the Graph</a></li>
+								<li class="ulcontainer toc"><ul class="toc">
+										<li><a href="/integration/jrdfcreategraph.html#o2901">JRDF Graph (Memory Graph)</a></li>
+										<li><a href="/integration/jrdfcreategraph.html#o3189">Server-side JRDF Graph (Server Graph)</a></li>
+										<li><a href="/integration/jrdfcreategraph.html#o2902">Server Backed JRDF Graph (Client Graph)</a></li>
+										<li><a href="/integration/jrdfcreategraph.html#o2903">Read Only iTQL Result JRDF Graph (iTQL Graph)</a></li>
+								</ul></li>
+								<li><a href="/integration/jrdfcreatenodes.html">Creating Nodes and Triples</a></li>
+								<li><a href="/integration/jrdfaddtriples.html">Adding Triples<span class="toc"> to the Graph</span></a></li>
+								<li><a href="/integration/searchgraph.html">Searching the Graph</a></li>
+								<li><a href="/integration/jrdfreify.html">Reify Triples</a></li>
+								<li><a href="/integration/jrdfremove.html">Removing Triples<span class="toc"> from the Graph</span></a></li>
+						</ul></li>
+					</ul></li>]]></replacevalue>
     </replace>
 
-
-
-    <replace dir="${src.docs.dir}" token="@@jrdfTOC@@" value="">
-      <exclude name="jrdf/*.html"/>
-      <exclude name="toc.html"/>
-    </replace>
-
-    <replace dir="${src.docs.dir}" token="@@jrdfTOC@@">
-      <include name="jrdf/*.html"/>
-      <include name="toc.html"/>
-      <replacevalue><![CDATA[	<li class="ulcontainer"><ul>
-				<li><a href="/jrdf/jrdfprereq.html">Prerequisites</a></li>
-				<li class="ulcontainer toc"><ul class="toc">
-						<li><a href="/jrdf/jrdfprereq.html#o2898">Obtaining a Session from a Mulgara Server</a></li>
-						<li><a href="/jrdf/jrdfprereq.html#o2899">Comparison of JRDF Graph Implementations</a></li>
-				</ul></li>
-				<li><a href="/jrdf/jrdfcreategraph.html">Creating the Graph</a></li>
-				<li class="ulcontainer toc"><ul class="toc">
-						<li><a href="/jrdf/jrdfcreategraph.html#o2901">JRDF Graph (Memory Graph)</a></li>
-						<li><a href="/jrdf/jrdfcreategraph.html#o3189">Server-side JRDF Graph (Server Graph)</a></li>
-						<li><a href="/jrdf/jrdfcreategraph.html#o2902">Server Backed JRDF Graph (Client Graph)</a></li>
-						<li><a href="/jrdf/jrdfcreategraph.html#o2903">Read Only iTQL Result JRDF Graph (iTQL Graph)</a></li>
-				</ul></li>
-				<li><a href="/jrdf/jrdfcreatenodes.html">Creating Nodes and Triples</a></li>
-				<li><a href="/jrdf/jrdfaddtriples.html">Adding Triples<span class="toc"> to the Graph</span></a></li>
-				<li><a href="/jrdf/searchgraph.html">Searching the Graph</a></li>
-				<li><a href="/jrdf/jrdfreify.html">Reify Triples</a></li>
-				<li><a href="/jrdf/jrdfremove.html">Removing Triples<span class="toc"> from the Graph</span></a></li>
-		</ul></li>]]></replacevalue>
-    </replace>
-
-
-
-
-
-
-
-
-
     <replace dir="${src.docs.dir}" token="@@itqlcommandsTOC@@" value="">
       <exclude name="itqlcommands/*.html"/>
       <exclude name="toc.html"/>




More information about the Mulgara-svn mailing list