[Mulgara-svn] r1421 - trunk/src/jar/query/java/org/mulgara/query/operation

pag at mulgara.org pag at mulgara.org
Tue Dec 16 09:13:03 UTC 2008


Author: pag
Date: 2008-12-16 01:13:02 -0800 (Tue, 16 Dec 2008)
New Revision: 1421

Modified:
   trunk/src/jar/query/java/org/mulgara/query/operation/DataInputTx.java
Log:
sendMarshalledData now tests if it needs to wrap an InputStream in a RemoteInputStream. Also updated getLocalInputStream to protected to allow Load to access it

Modified: trunk/src/jar/query/java/org/mulgara/query/operation/DataInputTx.java
===================================================================
--- trunk/src/jar/query/java/org/mulgara/query/operation/DataInputTx.java	2008-12-16 09:08:28 UTC (rev 1420)
+++ trunk/src/jar/query/java/org/mulgara/query/operation/DataInputTx.java	2008-12-16 09:13:02 UTC (rev 1421)
@@ -96,12 +96,14 @@
   protected long sendMarshalledData(Connection conn, boolean compressable) throws QueryException, IOException {
     if (logger.isInfoEnabled()) logger.info("Sending local resource : " + getSource());
 
+    InputStream inputStream = getLocalInputStream(compressable);
+
+    // If the connection is local, then no need to wrap
+    if (!conn.isRemote()) return doTx(conn, inputStream);
+
     RemoteInputStreamSrvImpl srv = null;
     RemoteInputStream remoteInputStream = null;
     try {
-
-      InputStream inputStream = getLocalInputStream(compressable);
-
       // open and wrap the inputstream
       srv = new RemoteInputStreamSrvImpl(inputStream);
       Rmi.export(srv);
@@ -134,7 +136,7 @@
    * @throws QueryException If no valid data source was set.
    * @throws IOException If an error occurred opening the local source.
    */
-  private InputStream getLocalInputStream(boolean compressable) throws QueryException, IOException {
+  protected InputStream getLocalInputStream(boolean compressable) throws QueryException, IOException {
     // Use provided input stream if there is one.
     InputStream stream = overrideInputStream;
     




More information about the Mulgara-svn mailing list