[Remoterengine-commits] r201 - pkg/RemoteREngine/inst/java_src/src/server/org/rosuda/REngine/remote/server
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Oct 3 05:52:51 CEST 2009
Author: ian_long
Date: 2009-10-03 05:52:50 +0200 (Sat, 03 Oct 2009)
New Revision: 201
Modified:
pkg/RemoteREngine/inst/java_src/src/server/org/rosuda/REngine/remote/server/RemoteREngine_Server.java
Log:
Ensure all file transfers also happen over the service port defined for the server (instead of random RMI allocated port)
Modified: pkg/RemoteREngine/inst/java_src/src/server/org/rosuda/REngine/remote/server/RemoteREngine_Server.java
===================================================================
--- pkg/RemoteREngine/inst/java_src/src/server/org/rosuda/REngine/remote/server/RemoteREngine_Server.java 2009-10-02 07:10:45 UTC (rev 200)
+++ pkg/RemoteREngine/inst/java_src/src/server/org/rosuda/REngine/remote/server/RemoteREngine_Server.java 2009-10-03 03:52:50 UTC (rev 201)
@@ -21,11 +21,7 @@
package org.rosuda.REngine.remote.server;
import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
import java.io.IOException;
-import java.io.InputStream;
-import java.lang.management.ManagementFactory;
import java.rmi.AccessException;
import java.rmi.AlreadyBoundException;
import java.rmi.NoSuchObjectException;
@@ -35,7 +31,6 @@
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;
import java.util.Calendar;
-import java.util.StringTokenizer;
import java.util.Vector;
import org.rosuda.JRI.Rengine;
@@ -122,6 +117,11 @@
private int registryPort ;
/**
+ * Port of the services.
+ */
+ private int servicePort;
+
+ /**
* The console thread associated with this engine
*/
private ConsoleThread consoleThread ;
@@ -157,6 +157,7 @@
super();
this.name = name ;
this.registryPort = registryPort ;
+ this.servicePort = servicePort;
/* inform the clients that the jvm of the server is dying */
shutdownHook = new RemoteREngineServerShutdownHook() ;
@@ -656,7 +657,7 @@
public RemoteFileInputStream openFile( String filename) throws ServerSideIOException, RemoteException{
try {
RemoteFileInputStream_Server stream = new RemoteFileInputStream_Server( filename ) ;
- RemoteFileInputStream stub = (RemoteFileInputStream) UnicastRemoteObject.exportObject(stream);
+ RemoteFileInputStream stub = (RemoteFileInputStream) UnicastRemoteObject.exportObject(stream, servicePort);
return stub ;
} catch (ServerSideIOException e) {
logger.error("ServerSideIOException",e);
@@ -686,7 +687,7 @@
}
}
RemoteFileOutputStream_Server stream = new RemoteFileOutputStream_Server( filename ) ;
- RemoteFileOutputStream stub = (RemoteFileOutputStream)UnicastRemoteObject.exportObject( stream ) ;
+ RemoteFileOutputStream stub = (RemoteFileOutputStream)UnicastRemoteObject.exportObject( stream, servicePort ) ;
return stub ;
} catch (FileAlreadyExistsException e) {
logger.error("FileAlreadyExistsException: " +
More information about the Remoterengine-commits
mailing list