summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAudrius Meskauskas <audriusa@Bioinformatics.org>2005-06-28 14:23:30 +0000
committerAudrius Meskauskas <audriusa@Bioinformatics.org>2005-06-28 14:23:30 +0000
commit1ab5f4cc319c29fdbfff52b8d899df568bd6a60e (patch)
tree78fd3f74748df4ebeac660996118f36e4093e989
parent38c71d0520c4d56df61fdc634b99d9e24396bc8c (diff)
downloadclasspath-1ab5f4cc319c29fdbfff52b8d899df568bd6a60e.tar.gz
2005-06-28 Audrius Meskauskas <AudriusA@Bioinformatics.org>
* gnu/CORBA/gnuRequest.java (submit): If IOException is thrown while opening a socket, rethrow MARSHAL. * gnu/CORBA/NamingService/NamingServiceTransient.java (main): Fixed regression due that the service started on the wrong port.
-rw-r--r--ChangeLog7
-rw-r--r--gnu/CORBA/NamingService/NamingServiceTransient.java19
-rw-r--r--gnu/CORBA/gnuRequest.java13
3 files changed, 24 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 9aafd6ede..fe7f92626 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-06-28 Audrius Meskauskas <AudriusA@Bioinformatics.org>
+
+ * gnu/CORBA/gnuRequest.java (submit): If IOException is
+ thrown while opening a socket, rethrow MARSHAL.
+ * gnu/CORBA/NamingService/NamingServiceTransient.java (main):
+ Fixed regression due that the service started on the wrong port.
+
2005-06-28 Mark Wielaard <mark@klomp.org>
From Christian Thalinger
diff --git a/gnu/CORBA/NamingService/NamingServiceTransient.java b/gnu/CORBA/NamingService/NamingServiceTransient.java
index 5bd8c9dc9..f19155201 100644
--- a/gnu/CORBA/NamingService/NamingServiceTransient.java
+++ b/gnu/CORBA/NamingService/NamingServiceTransient.java
@@ -102,17 +102,9 @@ public class NamingServiceTransient
String iorf = null;
try
{
- Functional_ORB.setPort(PORT);
-
// Create and initialize the ORB
final Functional_ORB orb = new Functional_ORB();
- Functional_ORB.setPort(Functional_ORB.DEFAULT_INITIAL_PORT);
-
- // Create the servant and register it with the ORB
- NamingContextExt namer = new Ext(new TransientContext());
- orb.connect(namer, getDefaultKey());
-
if (args.length > 1)
for (int i = 0; i < args.length - 1; i++)
{
@@ -123,7 +115,11 @@ public class NamingServiceTransient
iorf = args [ i + 1 ];
}
- orb.setPort(port);
+ Functional_ORB.setPort(port);
+
+ // Create the servant and register it with the ORB
+ NamingContextExt namer = new Ext(new TransientContext());
+ orb.connect(namer, getDefaultKey());
// Storing the IOR reference.
String ior = orb.object_to_string(namer);
@@ -147,7 +143,7 @@ public class NamingServiceTransient
{
public void run()
{
- // wait for invocations from clients
+ // Wait for invocations from clients.
orb.run();
}
}.start();
@@ -157,5 +153,8 @@ public class NamingServiceTransient
System.err.println("ERROR: " + e);
e.printStackTrace(System.out);
}
+
+ // Restore the default value for allocating ports for the subsequent objects.
+ Functional_ORB.setPort(Functional_ORB.DEFAULT_INITIAL_PORT);
}
}
diff --git a/gnu/CORBA/gnuRequest.java b/gnu/CORBA/gnuRequest.java
index 2a2fa3a1e..4379321ce 100644
--- a/gnu/CORBA/gnuRequest.java
+++ b/gnu/CORBA/gnuRequest.java
@@ -667,7 +667,7 @@ public class gnuRequest
Socket socket = null;
- java.lang.Object key = ior.Internet.host+":"+ior.Internet.port;
+ java.lang.Object key = ior.Internet.host + ":" + ior.Internet.port;
synchronized (SocketRepository.class)
{
@@ -743,7 +743,12 @@ public class gnuRequest
}
catch (IOException io_ex)
{
- return null;
+ MARSHAL m =
+ new MARSHAL("Unable to open a socket at " + ior.Internet.host + ":" +
+ ior.Internet.port
+ );
+ m.initCause(io_ex);
+ throw m;
}
finally
{
@@ -752,9 +757,7 @@ public class gnuRequest
if (socket != null && !socket.isClosed())
{
socket.setSoTimeout(Functional_ORB.TANDEM_REQUESTS);
- SocketRepository.put_socket(key,
- socket
- );
+ SocketRepository.put_socket(key, socket);
}
}
catch (IOException scx)