java.lang.Object
com.zeroc.Ice.Util
Utility methods for the Ice runtime.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EncodingVersionThe encoding version 1.0.static final EncodingVersionThe encoding version 1.1. -
Method Summary
Modifier and TypeMethodDescriptionstatic PropertiesCreates a new empty property set.static PropertiescreateProperties(String[] args) Creates a property set initialized from command-line arguments.static PropertiescreateProperties(String[] args, Properties defaults) Creates a property set initialized from command-line arguments and default properties.static PropertiescreateProperties(String[] args, Properties defaults, List<String> remainingArgs) Creates a property set initialized from command-line arguments and default properties.static PropertiescreateProperties(String[] args, List<String> remainingArgs) Creates a property set initialized from command-line arguments.static <T> InvocationFuture<T>Downcasts aCompletableFuture<T>to anInvocationFuture<T>object.static LoggerGets the per-process logger.static StringidentityToString(Identity ident) Converts an object identity to a string.static StringidentityToString(Identity ident, ToStringMode toStringMode) Converts an Identity into a string using the specified mode.static CommunicatorCreates a new communicator with the default options.static Communicatorinitialize(InitializationData initData) Creates a new communicator.static Communicatorinitialize(String[] args) Creates a new communicator, using Ice properties parsed from command-line arguments.static Communicatorinitialize(String[] args, List<String> remainingArgs) Creates a new communicator, using Ice properties parsed from command-line arguments.static intReturns the Ice version as an integer in the formAABBCC, whereAAindicates the major version,BBindicates the minor version, andCCindicates the patch level.static intproxyIdentityAndFacetCompare(ObjectPrx lhs, ObjectPrx rhs) Compares the object identities and facets of two proxies.static intproxyIdentityCompare(ObjectPrx lhs, ObjectPrx rhs) Compares the object identities of two proxies.static voidsetProcessLogger(Logger logger) Sets the per-process logger.static IdentityConverts a stringified identity into an Identity.static StringReturns the Ice version in the formA.B.C, whereAindicates the major version,Bindicates the minor version, andCindicates the patch level.static StringtypeIdToClass(String id) Translates a Slice type id to a Java class name.
-
Field Details
-
Encoding_1_0
The encoding version 1.0. -
Encoding_1_1
The encoding version 1.1.
-
-
Method Details
-
createProperties
Creates a new empty property set. This method is provided for backwards compatibility. New code should call theProperties()constructor directly.- Returns:
- A new empty property set.
-
createProperties
Creates a property set initialized from command-line arguments. This method is provided for backwards compatibility. New code should call theProperties(String[])constructor directly.- Parameters:
args- The command-line arguments.- Returns:
- A new property set.
-
createProperties
Creates a property set initialized from command-line arguments. This method is provided for backwards compatibility. New code should call theProperties(String[], java.util.List)constructor directly.- Parameters:
args- The command-line arguments.remainingArgs- If non-null, the command-line arguments that remain after parsing Ice properties out ofargs.- Returns:
- A new property set.
-
createProperties
Creates a property set initialized from command-line arguments and default properties. This method is provided for backwards compatibility. New code should call theProperties(String[], Properties)constructor directly.- Parameters:
args- The command-line arguments.defaults- Default values for the property set. Settings in configuration files andargsoverride these defaults.- Returns:
- A new property set.
-
createProperties
public static Properties createProperties(String[] args, Properties defaults, List<String> remainingArgs) Creates a property set initialized from command-line arguments and default properties. This method is provided for backwards compatibility. New code should call theProperties(String[], Properties, java.util.List)constructor directly.- Parameters:
args- The command-line arguments.defaults- Default values for the property set. Settings in configuration files andargsoverride these defaults.remainingArgs- If non-null, the command-line arguments that remain after parsing Ice properties out ofargs.- Returns:
- A new property set.
-
initialize
Creates a new communicator. This method is provided for backwards compatibility. New code should call theCommunicator(InitializationData)constructor directly.- Parameters:
initData- options for the new communicator- Returns:
- the new communicator
- See Also:
-
initialize
Creates a new communicator with the default options. This method is provided for backwards compatibility. New code should call theCommunicator()constructor directly.- Returns:
- the new communicator
-
initialize
Creates a new communicator, using Ice properties parsed from command-line arguments. This method is provided for backwards compatibility. New code should call theCommunicator(String[], java.util.List)constructor directly.- Parameters:
args- the command-line argumentsremainingArgs- if non-null, the remaining command-line arguments after parsing Ice properties- Returns:
- the new communicator
-
initialize
Creates a new communicator, using Ice properties parsed from command-line arguments. This method is provided for backwards compatibility. New code should call theCommunicator(String[])constructor directly.- Parameters:
args- the command-line arguments- 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
lhscompares 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
lhscompare 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, whereAindicates the major version,Bindicates the minor version, andCindicates the patch level.- Returns:
- The Ice version.
-
intVersion
public static int intVersion()Returns the Ice version as an integer in the formAABBCC, whereAAindicates the major version,BBindicates the minor version, andCCindicates the patch level. For example, for Ice 3.8.1, the returned value is 30801.- Returns:
- The Ice 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.
-