コード例 #1
0
  /**
   * Returns an instance of a class implementing CheckedActionFactory.
   *
   * <p>If there is no pre-instantiated instance set and classloading or instantiation fails, this
   * method will log appropriate warning and return null, not throw an exception.
   *
   * @return a CheckedActionFactory implementation instance, or null.
   */
  public CheckedActionFactory getCheckedActionFactory() {
    if (checkedActionFactory == null && checkedActionFactoryClassName != null) {
      synchronized (this) {
        if (checkedActionFactory == null && checkedActionFactoryClassName != null) {
          try {
            CheckedActionFactory instance =
                ClassloadingUtility.loadAndInstantiateClass(
                    CheckedActionFactory.class, checkedActionFactoryClassName, null);
            checkedActionFactory = instance;
          } catch (final java.lang.RuntimeException ex) // todo android
          {
            if (Utility.isAndroid()) checkedActionFactory = new CheckedActionFactoryImple();
            else throw ex;
          }
        }
      }
    }

    return checkedActionFactory;
  }
コード例 #2
0
    public static InetAddress getRecoveryManagerHost() throws UnknownHostException
    {
        String host = recoveryPropertyManager.getRecoveryEnvironmentBean().getRecoveryAddress();

        return Utility.hostNameToInetAddress(host);
    }