Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

set SiamSocketFactory for RMI so remote connections are successful (O…

…OIION-63)
  • Loading branch information...
commit ab070211300e0461cf182da201d90b855091a739 1 parent 54978c1
@carueda carueda authored
Showing with 10 additions and 4 deletions.
  1. +4 −0 ChangeLog.txt
  2. +6 −4 src/main/java/siam/Siam.java
View
4 ChangeLog.txt
@@ -1,6 +1,10 @@
SIAM-CI Integration Prototype change log
Carlos Rueda - MBARI
+2011-07-07
+ - While investigating RMI connection problem with external SIAM node, I realized that
+ the SiamSocketFactory was not set up for RMI, see Siam._getNode(String host).
+
2011-06-23
- SiamUtils.getRbnbHost: now the name of the property indicating the associated
RBNB host is "rbnbServer" (previously, "publisherHost").
View
10 src/main/java/siam/Siam.java
@@ -1,10 +1,10 @@
package siam;
+import java.io.IOException;
import java.io.PrintWriter;
-import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
-import java.rmi.RemoteException;
+import java.rmi.server.RMISocketFactory;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
@@ -24,6 +24,7 @@
import org.mbari.siam.distributed.SensorDataPacket;
import org.mbari.siam.distributed.PacketParser.Field;
import org.mbari.siam.utils.PrintUtils;
+import org.mbari.siam.utils.SiamSocketFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -65,10 +66,11 @@ else if (input.startsWith("//")) {
}
}
- private static Node _getNode(String host) throws MalformedURLException,
- RemoteException, NotBoundException {
+ private static Node _getNode(String host) throws NotBoundException, IOException {
String nodeURL = getNodeURL(host);
+ RMISocketFactory.setSocketFactory(new SiamSocketFactory(host));
+
log.info("Looking up '" + nodeURL + "' to connect with SIAM node ...");
Node node = (Node) Naming.lookup(nodeURL.toString());
log.info("Connected to SIAM node. (" +node.getClass().getName()+ ")");
Please sign in to comment.
Something went wrong with that request. Please try again.