java.lang.Object
com.zeroc.Ice.Util
Utility methods for the Ice runtime.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EncodingVersion
The encoding version 1.0.static final EncodingVersion
The encoding version 1.1.static final ProtocolVersion
The protocol version 1.0. -
Method Summary
Modifier and TypeMethodDescriptionstatic Properties
Deprecated.static Properties
createProperties
(String[] args) Deprecated.UseProperties(String[])
instead.static Properties
createProperties
(String[] args, Properties defaults) Deprecated.UseProperties(String[], Properties)
instead.static Properties
createProperties
(String[] args, Properties defaults, List<String> remainingArgs) Deprecated.UseProperties(String[], Properties, java.util.List)
instead.static Properties
createProperties
(String[] args, List<String> remainingArgs) Deprecated.UseProperties(String[], java.util.List)
instead.static EncodingVersion
Returns the supported Slice encoding version.static ProtocolVersion
Returns the supported Ice protocol version.static String
Converts an encoding version to a string.static <T> InvocationFuture<T>
Downcasts aCompletableFuture<T>
to anInvocationFuture<T>
object.static Logger
Gets the per-process logger.static String
identityToString
(Identity ident) Converts an object identity to a string.static String
identityToString
(Identity ident, ToStringMode toStringMode) Converts an Identity into a string using the specified mode.static Communicator
Creates a new communicator with the default options.static Communicator
initialize
(InitializationData initData) Creates a new communicator.static Communicator
initialize
(String[] args) Creates a new communicator, using Ice properties parsed from command-line arguments.static Communicator
initialize
(String[] args, List<String> remainingArgs) Creates a new communicator, using Ice properties parsed from command-line arguments.static int
Returns the Ice version as an integer in the formAABBCC
, whereAA
indicates the major version,BB
indicates the minor version, andCC
indicates the patch level.static String
Converts a protocol version to a string.static int
proxyIdentityAndFacetCompare
(ObjectPrx lhs, ObjectPrx rhs) Compares the object identities and facets of two proxies.static int
proxyIdentityCompare
(ObjectPrx lhs, ObjectPrx rhs) Compares the object identities of two proxies.static void
setProcessLogger
(Logger logger) Sets the per-process logger.static EncodingVersion
stringToEncodingVersion
(String version) Converts a string to an encoding version.static Identity
Converts a stringified identity into an Identity.static ProtocolVersion
stringToProtocolVersion
(String version) Converts a string to a protocol version.static String
Returns the Ice version in the formA.B.C
, whereA
indicates the major version,B
indicates the minor version, andC
indicates the patch level.static String
typeIdToClass
(String id) Translates a Slice type id to a Java class name.
-
Field Details
-
Protocol_1_0
The protocol version 1.0. -
Encoding_1_0
The encoding version 1.0. -
Encoding_1_1
The encoding version 1.1.
-
-
Method Details
-
createProperties
Deprecated.UseProperties()
instead.Creates a new empty property set.- Returns:
- A new empty property set.
-
createProperties
Deprecated.UseProperties(String[])
instead.Creates a property set initialized from an argument vector.- Parameters:
args
- A command-line argument vector, possibly containing options to set properties. If the command-line options include a--Ice.Config
option, the corresponding configuration files are parsed. If the same property is set in a configuration file and in the argument vector, the argument vector takes precedence.- Returns:
- A new property set initialized with the property settings that were removed from the argument vector.
-
createProperties
Deprecated.UseProperties(String[], java.util.List)
instead.Creates a property set initialized from an argument vector and returns the remaining arguments.- Parameters:
args
- A command-line argument vector, possibly containing options to set properties. If the command-line options include a--Ice.Config
option, the corresponding configuration files are parsed. If the same property is set in a configuration file and in the argument vector, the argument vector takes precedence.remainingArgs
- If non null, the given list will contain on return the command-line arguments that were not used to set properties.- Returns:
- A new property set initialized with the property settings that were removed from the argument vector.
-
createProperties
Deprecated.UseProperties(String[], Properties)
instead.Creates a property set initialized from an argument vector.- Parameters:
args
- A command-line argument vector, possibly containing options to set properties. If the command-line options include a--Ice.Config
option, the corresponding configuration files are parsed. If the same property is set in a configuration file and in the argument vector, the argument vector takes precedence.defaults
- Default values for the property set. Settings in configuration files andargs
override these defaults.- Returns:
- A new property set initialized with the property settings that were removed from the argument vector.
-
createProperties
@Deprecated public static Properties createProperties(String[] args, Properties defaults, List<String> remainingArgs) Deprecated.UseProperties(String[], Properties, java.util.List)
instead.Creates a property set initialized from an argument vector and returns the remaining arguments.- Parameters:
args
- A command-line argument vector, possibly containing options to set properties. If the command-line options include a--Ice.Config
option, the corresponding configuration files are parsed. If the same property is set in a configuration file and in the argument vector, the argument vector takes precedence.defaults
- Default values for the property set. Settings in configuration files andargs
override these defaults.remainingArgs
- If non null, the given list will contain on return the command-line arguments that were not used to set properties.- Returns:
- A new property set initialized with the property settings that were removed from the argument vector.
-
initialize
Creates a new communicator.- Parameters:
initData
- Options for the new communicator.- Returns:
- The new communicator.
- See Also:
-
initialize
Creates a new communicator with the default options.- Returns:
- The new communicator.
-
initialize
Creates a new communicator, using Ice properties parsed from command-line arguments.- Parameters:
args
- A command-line argument vector. This method parses arguments starting with `--` and one of the reserved prefixes (Ice, IceSSL, etc.) as properties for the new communicator. If there is an argument starting with `--Ice.Config`, this method loads the specified configuration file. When the same property is set in a configuration file and through a command-line argument, the command-line setting takes precedence.remainingArgs
- If non-null, the given list will contain on return the command-line arguments that were not used to set properties.- Returns:
- The new communicator.
-
initialize
Creates a new communicator, using Ice properties parsed from command-line arguments.- Parameters:
args
- A command-line argument vector. This method parses arguments starting with `--` and one of the reserved prefixes (Ice, IceSSL, etc.) as properties for the new communicator. If there is an argument starting with `--Ice.Config`, this method loads the specified configuration file. When the same property is set in a configuration file and through a command-line argument, the command-line setting takes precedence.- Returns:
- The new communicator.
-
stringToIdentity
Converts a stringified identity into an Identity.- Parameters:
s
- The string to convert.- Returns:
- The converted object identity.
-
identityToString
Converts an Identity into a string using the specified mode.- Parameters:
ident
- The object identity to convert.toStringMode
- Specifies how to handle non-ASCII characters and non-printable ASCII characters.- Returns:
- the stringified identifier
-
identityToString
Converts an object identity to a string.- Parameters:
ident
- The object identity to convert.- Returns:
- The string representation of the object identity using the default mode (Unicode)
-
proxyIdentityCompare
Compares the object identities of two proxies.- Parameters:
lhs
- A proxy.rhs
- A proxy.- Returns:
- -1 if the identity in
lhs
compares less than the identity inrhs
; 0 if the identities compare equal; 1, otherwise. - See Also:
-
proxyIdentityAndFacetCompare
Compares the object identities and facets of two proxies.- Parameters:
lhs
- A proxy.rhs
- A proxy.- Returns:
- -1 if the identity and facet in
lhs
compare less than the identity and facet inrhs
; 0 if the identities and facets compare equal; 1, otherwise. - See Also:
-
getProcessLogger
Gets the per-process logger. This logger is used by all communicators that do not have their own specific logger configured at the time the communicator is created.- Returns:
- The current per-process logger instance.
-
setProcessLogger
Sets the per-process logger. This logger is used by all communicators that do not have their own specific logger configured at the time the communicator is created.- Parameters:
logger
- The new per-process logger instance.
-
stringVersion
Returns the Ice version in the formA.B.C
, whereA
indicates the major version,B
indicates the minor version, andC
indicates the patch level.- Returns:
- The Ice version.
-
intVersion
public static int intVersion()Returns the Ice version as an integer in the formAABBCC
, whereAA
indicates the major version,BB
indicates the minor version, andCC
indicates the patch level. For example, for Ice 3.8.1, the returned value is 30801.- Returns:
- The Ice version.
-
stringToProtocolVersion
Converts a string to a protocol version.- Parameters:
version
- The string to convert.- Returns:
- The converted protocol version.
-
stringToEncodingVersion
Converts a string to an encoding version.- Parameters:
version
- The string to convert.- Returns:
- The converted encoding version.
-
protocolVersionToString
Converts a protocol version to a string.- Parameters:
v
- The protocol version to convert.- Returns:
- The converted string.
-
encodingVersionToString
Converts an encoding version to a string.- Parameters:
v
- The encoding version to convert.- Returns:
- The converted string.
-
currentProtocol
Returns the supported Ice protocol version.- Returns:
- The Ice protocol version.
-
currentEncoding
Returns the supported Slice encoding version.- Returns:
- The Slice encoding version.
-
getInvocationFuture
Downcasts aCompletableFuture<T>
to anInvocationFuture<T>
object.- Type Parameters:
T
- The result type.- Parameters:
f
- The CompletableFuture returned by an asynchronous invocation.- Returns:
- f casted to an
InvocationFuture<T>
. - Throws:
ClassCastException
- if f is not anInvocationFuture<T>
.
-
typeIdToClass
Translates a Slice type id to a Java class name.- Parameters:
id
- The Slice type id, such as::Module::Type
.- Returns:
- The equivalent Java class name, or null if the type id is malformed.
-
Properties()
instead.