diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/demo/Ice/callback/config | 10 | ||||
-rw-r--r-- | java/demo/Ice/hello/config | 6 | ||||
-rw-r--r-- | java/src/Ice/CommunicatorI.java | 15 | ||||
-rw-r--r-- | java/src/Ice/ObjectAdapterI.java | 7 | ||||
-rw-r--r-- | java/src/IceInternal/ObjectAdapterFactory.java | 4 | ||||
-rw-r--r-- | java/test/Ice/exceptions/AllTests.java | 13 |
6 files changed, 28 insertions, 27 deletions
diff --git a/java/demo/Ice/callback/config b/java/demo/Ice/callback/config index 0e18ea2f749..53a7ad10215 100644 --- a/java/demo/Ice/callback/config +++ b/java/demo/Ice/callback/config @@ -1,10 +1,10 @@ -Callback.Client.CallbackServer=callback:tcp -p 10000:udp -p 10000:ssl -p 10001 +Callback.Client.CallbackServer=callback:tcp -p 12000 Callback.Client.Endpoints=tcp:udp:ssl -Callback.Server.Endpoints=tcp -p 10000:udp -p 10000:ssl -p 10001 +Callback.Server.Endpoints=tcp -p 12000 -#Ice.Trace.Network=1 -#Ice.Trace.Protocol=1 -Ice.Warn.Connections=1 +Ice.Trace.Network=3 +Ice.Trace.Protocol=3 +Ice.Warn.Connections=3 # # SSL Configuration diff --git a/java/demo/Ice/hello/config b/java/demo/Ice/hello/config index ea81f74af15..449556359f1 100644 --- a/java/demo/Ice/hello/config +++ b/java/demo/Ice/hello/config @@ -14,7 +14,7 @@ Hello.Endpoints=tcp -p 10000:udp -p 10000:ssl -p 10001 # # Warn about connection exceptions # -Ice.Warn.Connections=1 +Ice.Warn.Connections=2 # # We want a faster ACM for this demo. @@ -30,7 +30,7 @@ Ice.ACM.Server=10 # 2 = like 1, but more detailed # 3 = like 2, but also trace data transfer # -Ice.Trace.Network=0 +Ice.Trace.Network=3 # # Protocol Tracing @@ -38,7 +38,7 @@ Ice.Trace.Network=0 # 0 = no protocol tracing # 1 = trace protocol messages # -Ice.Trace.Protocol=0 +Ice.Trace.Protocol=3 # # Security Tracing diff --git a/java/src/Ice/CommunicatorI.java b/java/src/Ice/CommunicatorI.java index d8d3c1c20a5..fddeecf9588 100644 --- a/java/src/Ice/CommunicatorI.java +++ b/java/src/Ice/CommunicatorI.java @@ -44,24 +44,13 @@ public final class CommunicatorI extends LocalObjectImpl implements Communicator public ObjectAdapter createObjectAdapter(String name) { - return _instance.objectAdapterFactory().createObjectAdapter(name); + return createObjectAdapterWithEndpoints(name, getProperties().getProperty(name + ".Endpoints")); } public ObjectAdapter createObjectAdapterWithEndpoints(String name, String endpoints) { - final String propertyKey = new String(name + ".Endpoints"); - final String originalValue = getProperties().getProperty(propertyKey); - try - { - getProperties().setProperty(propertyKey, endpoints); - return createObjectAdapter(name); - } - catch(AlreadyRegisteredException ex) - { - getProperties().setProperty(propertyKey, originalValue); - throw ex; - } + return _instance.objectAdapterFactory().createObjectAdapter(name, endpoints); } public void diff --git a/java/src/Ice/ObjectAdapterI.java b/java/src/Ice/ObjectAdapterI.java index 227255d1def..79edfa2c418 100644 --- a/java/src/Ice/ObjectAdapterI.java +++ b/java/src/Ice/ObjectAdapterI.java @@ -692,7 +692,7 @@ public final class ObjectAdapterI extends LocalObjectImpl implements ObjectAdapt // Only for use by IceInternal.ObjectAdapterFactory // public - ObjectAdapterI(IceInternal.Instance instance, Communicator communicator, String name) + ObjectAdapterI(IceInternal.Instance instance, Communicator communicator, String name, String endpointInfo) { _deactivated = false; _instance = instance; @@ -711,8 +711,7 @@ public final class ObjectAdapterI extends LocalObjectImpl implements ObjectAdapt // The connection factory might change it, for example, to // fill in the real port number. // - String endpts = _instance.properties().getProperty(name + ".Endpoints"); - java.util.ArrayList endpoints = parseEndpoints(endpts); + java.util.ArrayList endpoints = parseEndpoints(endpointInfo); for(int i = 0; i < endpoints.size(); ++i) { IceInternal.Endpoint endp = (IceInternal.Endpoint)endpoints.get(i); @@ -723,7 +722,7 @@ public final class ObjectAdapterI extends LocalObjectImpl implements ObjectAdapt // Parse published endpoints. These are used in proxies // instead of the connection factory endpoints. // - endpts = _instance.properties().getProperty(name + ".PublishedEndpoints"); + String endpts = _instance.properties().getProperty(name + ".PublishedEndpoints"); _publishedEndpoints = parseEndpoints(endpts); String router = _instance.properties().getProperty(name + ".Router"); diff --git a/java/src/IceInternal/ObjectAdapterFactory.java b/java/src/IceInternal/ObjectAdapterFactory.java index e31442cd122..743718ff61f 100644 --- a/java/src/IceInternal/ObjectAdapterFactory.java +++ b/java/src/IceInternal/ObjectAdapterFactory.java @@ -114,7 +114,7 @@ public final class ObjectAdapterFactory } public synchronized Ice.ObjectAdapter - createObjectAdapter(String name) + createObjectAdapter(String name, String endpoints) { if(_instance == null) { @@ -127,7 +127,7 @@ public final class ObjectAdapterFactory throw new Ice.AlreadyRegisteredException("object adapter", name); } - adapter = new Ice.ObjectAdapterI(_instance, _communicator, name); + adapter = new Ice.ObjectAdapterI(_instance, _communicator, name, endpoints); _adapters.put(name, adapter); return adapter; } diff --git a/java/test/Ice/exceptions/AllTests.java b/java/test/Ice/exceptions/AllTests.java index a222f8669f8..1b23f7637d5 100644 --- a/java/test/Ice/exceptions/AllTests.java +++ b/java/test/Ice/exceptions/AllTests.java @@ -698,6 +698,19 @@ public class AllTests { // Expected } + + communicator.getProperties().setProperty("TestAdapter0.Endpoints", ""); + try + { + Ice.ObjectAdapter second = + communicator.createObjectAdapterWithEndpoints("TestAdapter0", "ssl -h foo -p 12346 -t 10000"); + test(false); + } + catch(Ice.AlreadyRegisteredException ex) + { + // Expected + } + test(communicator.getProperties().getProperty("TestAdapter0.Endpoints").equals("")); first.deactivate(); System.out.println("ok"); } |