summaryrefslogtreecommitdiff
path: root/java/src
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-06-27 21:02:54 +0000
committerMarc Laukien <marc@zeroc.com>2002-06-27 21:02:54 +0000
commite6b02c9be09773e58cbaec175fb180d58b8c4984 (patch)
tree5a4bf4277e5f8af1aea0ec10fe23b58c11b8de4e /java/src
parentfile IcePackAdmin.py was initially added on branch location. (diff)
downloadice-e6b02c9be09773e58cbaec175fb180d58b8c4984.tar.bz2
ice-e6b02c9be09773e58cbaec175fb180d58b8c4984.tar.xz
ice-e6b02c9be09773e58cbaec175fb180d58b8c4984.zip
started with connection verification
Diffstat (limited to 'java/src')
-rw-r--r--java/src/IceInternal/Connection.java45
-rw-r--r--java/src/IceInternal/EventHandler.java7
2 files changed, 37 insertions, 15 deletions
diff --git a/java/src/IceInternal/Connection.java b/java/src/IceInternal/Connection.java
index e4812e28f3e..f3bb30097e1 100644
--- a/java/src/IceInternal/Connection.java
+++ b/java/src/IceInternal/Connection.java
@@ -144,7 +144,8 @@ public final class Connection extends EventHandler
catch(Ice.LocalException ex)
{
setState(StateClosed, ex);
- throw ex;
+ assert(_exception != null);
+ throw _exception;
}
//
@@ -257,7 +258,8 @@ public final class Connection extends EventHandler
catch(Ice.LocalException ex)
{
setState(StateClosed, ex);
- throw ex;
+ assert(_exception != null);
+ throw _exception;
}
}
finally
@@ -699,6 +701,25 @@ public final class Connection extends EventHandler
_state = StateHolding;
_warn = _instance.properties().getPropertyAsInt("Ice.ConnectionWarnings") > 0 ? true : false;
_registeredWithPool = false;
+
+ if(_adapter != null)
+ {
+ //
+ // Incoming connections are always implicitly validated.
+ //
+ _connectionValidated = true;
+ }
+ else
+ {
+ //
+ // Outoging datagram connections are always validated
+ // implicitly. Outgoing non-datagram connections must receive a
+ // message from the server for connection validation.
+ //
+ //_connectionValidated = _endpoint.datagram();
+ _connectionValidated = true; // TODO: Not finished yet.
+ }
+
}
protected void
@@ -764,19 +785,26 @@ public final class Connection extends EventHandler
if(_exception == null)
{
- _exception = ex;
+ if(_connectionValidated)
+ {
+ _exception = ex;
+ }
+ else
+ {
+ _exception = new Ice.CloseConnectionException();
+ }
if(_warn)
{
//
// Don't warn about certain expected exceptions.
//
- if(!(ex instanceof Ice.CloseConnectionException ||
- ex instanceof Ice.CommunicatorDestroyedException ||
- ex instanceof Ice.ObjectAdapterDeactivatedException ||
- (ex instanceof Ice.ConnectionLostException && _state == StateClosing)))
+ if(!(_exception instanceof Ice.CloseConnectionException ||
+ _exception instanceof Ice.CommunicatorDestroyedException ||
+ _exception instanceof Ice.ObjectAdapterDeactivatedException ||
+ (_exception instanceof Ice.ConnectionLostException && _state == StateClosing)))
{
- warning("connection exception", ex);
+ warning("connection exception", _exception);
}
}
}
@@ -1001,6 +1029,7 @@ public final class Connection extends EventHandler
private int _state;
private boolean _warn;
private boolean _registeredWithPool;
+ private boolean _connectionValidated;
private RecursiveMutex _mutex = new RecursiveMutex();
private Incoming _incomingCache;
}
diff --git a/java/src/IceInternal/EventHandler.java b/java/src/IceInternal/EventHandler.java
index 6d8080caef1..3d0328a9271 100644
--- a/java/src/IceInternal/EventHandler.java
+++ b/java/src/IceInternal/EventHandler.java
@@ -47,13 +47,6 @@ abstract class EventHandler
//
abstract void exception(Ice.LocalException ex);
- //
- // Try to destroy the event handler. Returns false if the event
- // handler cannot be destroyed because it is in use, or true
- // otherwise.
- //
-// abstract boolean tryDestroy(ThreadPool threadPool);
-
protected
EventHandler(Instance instance)
{