Package com.zeroc.Ice

Class Util

java.lang.Object
com.zeroc.Ice.Util

public final class Util extends Object
Utility methods for the Ice runtime.
  • Field Details

    • Encoding_1_0

      public static final EncodingVersion Encoding_1_0
      The encoding version 1.0.
    • Encoding_1_1

      public static final EncodingVersion Encoding_1_1
      The encoding version 1.1.
  • Method Details

    • createProperties

      public static Properties createProperties()
      Creates a new empty property set. This method is provided for backwards compatibility. New code should call the Properties() constructor directly.
      Returns:
      A new empty property set.
    • createProperties

      public static Properties createProperties(String[] args)
      Creates a property set initialized from command-line arguments. This method is provided for backwards compatibility. New code should call the Properties(String[]) constructor directly.
      Parameters:
      args - The command-line arguments.
      Returns:
      A new property set.
    • createProperties

      public static Properties createProperties(String[] args, List<String> remainingArgs)
      Creates a property set initialized from command-line arguments. This method is provided for backwards compatibility. New code should call the Properties(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 of args.
      Returns:
      A new property set.
    • createProperties

      public static Properties createProperties(String[] args, Properties defaults)
      Creates a property set initialized from command-line arguments and default properties. This method is provided for backwards compatibility. New code should call the Properties(String[], Properties) constructor directly.
      Parameters:
      args - The command-line arguments.
      defaults - Default values for the property set. Settings in configuration files and args override 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 the Properties(String[], Properties, java.util.List) constructor directly.
      Parameters:
      args - The command-line arguments.
      defaults - Default values for the property set. Settings in configuration files and args override these defaults.
      remainingArgs - If non-null, the command-line arguments that remain after parsing Ice properties out of args.
      Returns:
      A new property set.
    • initialize

      public static Communicator initialize(InitializationData initData)
      Creates a new communicator. This method is provided for backwards compatibility. New code should call the Communicator(InitializationData) constructor directly.
      Parameters:
      initData - options for the new communicator
      Returns:
      the new communicator
      See Also:
    • initialize

      public static Communicator initialize()
      Creates a new communicator with the default options. This method is provided for backwards compatibility. New code should call the Communicator() constructor directly.
      Returns:
      the new communicator
    • initialize

      public static Communicator initialize(String[] args, List<String> remainingArgs)
      Creates a new communicator, using Ice properties parsed from command-line arguments. This method is provided for backwards compatibility. New code should call the Communicator(String[], java.util.List) constructor directly.
      Parameters:
      args - the command-line arguments
      remainingArgs - if non-null, the remaining command-line arguments after parsing Ice properties
      Returns:
      the new communicator
    • initialize

      public static Communicator initialize(String[] args)
      Creates a new communicator, using Ice properties parsed from command-line arguments. This method is provided for backwards compatibility. New code should call the Communicator(String[]) constructor directly.
      Parameters:
      args - the command-line arguments
      Returns:
      the new communicator
    • stringToIdentity

      public static Identity stringToIdentity(String s)
      Converts a stringified identity into an Identity.
      Parameters:
      s - The string to convert.
      Returns:
      The converted object identity.
    • identityToString

      public static String identityToString(Identity ident, ToStringMode toStringMode)
      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

      public static String identityToString(Identity ident)
      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

      public static int proxyIdentityCompare(ObjectPrx lhs, ObjectPrx rhs)
      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 in rhs; 0 if the identities compare equal; 1, otherwise.
      See Also:
    • proxyIdentityAndFacetCompare

      public static int proxyIdentityAndFacetCompare(ObjectPrx lhs, ObjectPrx rhs)
      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 in rhs; 0 if the identities and facets compare equal; 1, otherwise.
      See Also:
    • getProcessLogger

      public static Logger 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

      public static void setProcessLogger(Logger logger)
      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

      public static String stringVersion()
      Returns the Ice version in the form A.B.C, where A indicates the major version, B indicates the minor version, and C indicates the patch level.
      Returns:
      The Ice version.
    • intVersion

      public static int intVersion()
      Returns the Ice version as an integer in the form AABBCC, where AA indicates the major version, BB indicates the minor version, and CC indicates the patch level. For example, for Ice 3.8.1, the returned value is 30801.
      Returns:
      The Ice version.
    • getInvocationFuture

      public static <T> InvocationFuture<T> getInvocationFuture(CompletableFuture<T> f)
      Downcasts a CompletableFuture<T> to an InvocationFuture<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 an InvocationFuture<T>.
    • typeIdToClass

      public static String typeIdToClass(String id)
      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.