Package com.zeroc.Ice
Class Util
java.lang.Object
com.zeroc.Ice.Util
Utility methods for the Ice run time.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EncodingVersionstatic final EncodingVersionstatic final ProtocolVersion -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PropertiesCreates a new empty property set.static PropertiescreateProperties(String[] args) Creates a property set initialized from an argument vector.static PropertiescreateProperties(String[] args, Properties defaults) Creates a property set initialized from an argument vector.static PropertiescreateProperties(String[] args, Properties defaults, List<String> remainingArgs) Creates a property set initialized from an argument vector and return the remaining arguments.static PropertiescreateProperties(String[] args, List<String> remainingArgs) Creates a property set initialized from an argument vector and return the remaining arguments.static EncodingVersionReturns the supported Ice encoding version.static ProtocolVersionReturns the supported Ice protocol version.static StringConverts an encoding version to a string.static <T> InvocationFuture<T>Returns the InvocationFuture equivalent of the given CompletableFuture.static LoggerReturns the process-wide logger.static StringidentityToString(Identity ident) Converts an object identity to a string.static StringidentityToString(Identity ident, ToStringMode toStringMode) Converts an object identity to a string.static CommunicatorCreates a communicator using a default configuration.static Communicatorinitialize(InitializationData initData) Creates a communicator.static Communicatorinitialize(String[] args) Creates a communicator.static Communicatorinitialize(String[] args, InitializationData initData) Creates a communicator.static Communicatorinitialize(String[] args, InitializationData initData, List<String> remainingArgs) Creates a communicator.static Communicatorinitialize(String[] args, String configFile) Creates a communicator.static Communicatorinitialize(String[] args, String configFile, List<String> remainingArgs) Creates a communicator.static Communicatorinitialize(String[] args, List<String> remainingArgs) Creates a communicator.static intReturns the Ice version as an integer in the formA.BB.CC, whereAindicates the major version,BBindicates the minor version, andCCindicates the patch level.static StringConverts a protocol version to a string.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) Changes the process-wide logger.static EncodingVersionstringToEncodingVersion(String version) Converts a string to an encoding version.static IdentityConverts a string to an object identity.static ProtocolVersionstringToProtocolVersion(String version) Converts a string to a protocol version.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
-
Protocol_1_0
-
Encoding_1_0
-
Encoding_1_1
-
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
createProperties
Creates a new empty property set.- Returns:
- A new empty property set.
-
createProperties
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.Configoption, 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
Creates a property set initialized from an argument vector and return the remaining arguments.- Parameters:
args- A command-line argument vector, possibly containing options to set properties. If the command-line options include a--Ice.Configoption, 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
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.Configoption, 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 andargsoverride these defaults.- Returns:
- A new property set initialized with the property settings that were removed from the argument vector.
-
createProperties
public static Properties createProperties(String[] args, Properties defaults, List<String> remainingArgs) Creates a property set initialized from an argument vector and return the remaining arguments.- Parameters:
args- A command-line argument vector, possibly containing options to set properties. If the command-line options include a--Ice.Configoption, 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 andargsoverride 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 communicator using a default configuration.- Returns:
- A new communicator instance.
-
initialize
Creates a communicator.- Parameters:
args- A command-line argument vector. Any Ice-related options in this vector are used to initialize the communicator.- Returns:
- The new communicator.
-
initialize
Creates a communicator.- Parameters:
args- A command-line argument vector. Any Ice-related options in this vector are used to initialize the communicator.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 communicator.- Parameters:
initData- Additional initialization data.- Returns:
- The new communicator.
-
initialize
Creates a communicator.- Parameters:
args- A command-line argument vector. Any Ice-related options in this vector are used to initialize the communicator.initData- Additional initialization data.- Returns:
- The new communicator.
-
initialize
Creates a communicator.- Parameters:
args- A command-line argument vector. Any Ice-related options in this vector are used to initialize the communicator.configFile- Path to a config file that sets the new communicator's default properties.- Returns:
- The new communicator.
-
initialize
public static Communicator initialize(String[] args, InitializationData initData, List<String> remainingArgs) Creates a communicator.- Parameters:
args- A command-line argument vector. Any Ice-related options in this vector are used to initialize the communicator.initData- Additional initialization data. Property settings inargsoverride property settings ininitData.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.
- See Also:
-
initialize
Creates a communicator.- Parameters:
args- A command-line argument vector. Any Ice-related options in this vector are used to initialize the communicator.configFile- Path to a config file that sets the new communicator's default properties.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.
-
stringToIdentity
Converts a string to an object identity.- Parameters:
s- The string to convert.- Returns:
- The converted object identity.
-
identityToString
Converts an object identity to a string.- Parameters:
ident- The object identity to convert.toStringMode- Specifies if and how non-printable ASCII characters are escaped in the result.- Returns:
- The string representation of the object identity.
-
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
Returns the process-wide logger.- Returns:
- The process-wide logger.
-
setProcessLogger
Changes the process-wide logger.- Parameters:
logger- The new process-wide logger.
-
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 formA.BB.CC, whereAindicates the major version,BBindicates the minor version, andCCindicates the patch level. For example, for Ice 3.3.1, the returned value is 30301.- 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 Ice encoding version.- Returns:
- The Ice encoding version.
-
getInvocationFuture
Returns the InvocationFuture equivalent of the given CompletableFuture.- Type Parameters:
T- The result type.- Parameters:
f- The CompletableFuture returned by an asynchronous Ice proxy invocation.- Returns:
- The InvocationFuture object.
-
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.
-