diff options
author | Mark Spruiell <mes@zeroc.com> | 2005-01-06 18:39:53 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2005-01-06 18:39:53 +0000 |
commit | 678ab966455e646e1508d75763d83965dbca35a3 (patch) | |
tree | 934345bdec5d9f8ae6698444e2206812bbb80238 /java/src | |
parent | fix for interrupted system calls (diff) | |
download | ice-678ab966455e646e1508d75763d83965dbca35a3.tar.bz2 ice-678ab966455e646e1508d75763d83965dbca35a3.tar.xz ice-678ab966455e646e1508d75763d83965dbca35a3.zip |
adding ProtocolPluginFacade
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/Ice/Util.java | 6 | ||||
-rw-r--r-- | java/src/IceInternal/ProtocolPluginFacade.java | 35 | ||||
-rw-r--r-- | java/src/IceInternal/ProtocolPluginFacadeI.java | 66 |
3 files changed, 107 insertions, 0 deletions
diff --git a/java/src/Ice/Util.java b/java/src/Ice/Util.java index 630c68216a6..1deebd702c9 100644 --- a/java/src/Ice/Util.java +++ b/java/src/Ice/Util.java @@ -95,6 +95,12 @@ public final class Util return p.getInstance(); } + public static IceInternal.ProtocolPluginFacade + getProtocolPluginFacade(Communicator communicator) + { + return new IceInternal.ProtocolPluginFacadeI(communicator); + } + public static Identity stringToIdentity(String s) { diff --git a/java/src/IceInternal/ProtocolPluginFacade.java b/java/src/IceInternal/ProtocolPluginFacade.java new file mode 100644 index 00000000000..dd63892f21c --- /dev/null +++ b/java/src/IceInternal/ProtocolPluginFacade.java @@ -0,0 +1,35 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +package IceInternal; + +public interface ProtocolPluginFacade +{ + // + // Get the Communicator instance with which this facade is + // associated. + // + Ice.Communicator getCommunicator(); + + // + // Get the default hostname to be used in endpoints. + // + String getDefaultHost(); + + // + // Get the network trace level and category name. + // + int getNetworkTraceLevel(); + String getNetworkTraceCategory(); + + // + // Register an EndpointFactory. + // + void addEndpointFactory(EndpointFactory factory); +} diff --git a/java/src/IceInternal/ProtocolPluginFacadeI.java b/java/src/IceInternal/ProtocolPluginFacadeI.java new file mode 100644 index 00000000000..8ae33784dc0 --- /dev/null +++ b/java/src/IceInternal/ProtocolPluginFacadeI.java @@ -0,0 +1,66 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +package IceInternal; + +public class ProtocolPluginFacadeI implements ProtocolPluginFacade +{ + public + ProtocolPluginFacadeI(Ice.Communicator communicator) + { + _communicator = communicator; + _instance = Ice.Util.getInstance(communicator); + } + + // + // Get the Communicator instance with which this facade is + // associated. + // + public Ice.Communicator + getCommunicator() + { + return _communicator; + } + + // + // Get the default hostname to be used in endpoints. + // + public String + getDefaultHost() + { + return _instance.defaultsAndOverrides().defaultHost; + } + + // + // Get the network trace level and category name. + // + public int + getNetworkTraceLevel() + { + return _instance.traceLevels().network; + } + + public String + getNetworkTraceCategory() + { + return _instance.traceLevels().networkCat; + } + + // + // Register an EndpointFactory. + // + public void + addEndpointFactory(EndpointFactory factory) + { + _instance.endpointFactoryManager().add(factory); + } + + private Instance _instance; + private Ice.Communicator _communicator; +} |