Package org.apache.openjpa.lib.conf

Examples of org.apache.openjpa.lib.conf.Value


            ("TransactionMode", props);
        boolean managed;
        if (str == null)
            managed = conf.isTransactionModeManaged();
        else {
            Value val = conf.getValue("TransactionMode");
            managed = Boolean.parseBoolean(val.unalias(str));
        }

        Object obj = Configurations.removeProperty("ConnectionRetainMode",
            props);
        int retainMode;
        if (obj instanceof Number)
            retainMode = ((Number) obj).intValue();
        else if (obj == null)
            retainMode = conf.getConnectionRetainModeConstant();
        else {
            Value val = conf.getValue("ConnectionRetainMode");
            try {
                retainMode = Integer.parseInt(val.unalias((String) obj));
            } catch (Exception e) {
                throw new ArgumentException(_loc.get("bad-em-prop",
                    "openjpa.ConnectionRetainMode", obj),
                    new Throwable[]{ e }, obj, true);
            }
View Full Code Here


        String str = (String) Configurations.removeProperty("TransactionMode", props);
        boolean managed;
        if (str == null)
            managed = conf.isTransactionModeManaged();
        else {
            Value val = conf.getValue("TransactionMode");
            managed = Boolean.parseBoolean(val.unalias(str));
        }

        Object obj = Configurations.removeProperty("ConnectionRetainMode", props);
        int retainMode;
        if (obj instanceof Number) {
            retainMode = ((Number) obj).intValue();
        } else if (obj == null) {
            retainMode = conf.getConnectionRetainModeConstant();
        } else {
            Value val = conf.getValue("ConnectionRetainMode");
            try {
                retainMode = Integer.parseInt(val.unalias((String) obj));
            } catch (Exception e) {
                throw new ArgumentException(_loc.get("bad-em-prop", "openjpa.ConnectionRetainMode", obj),
                    new Throwable[]{ e }, obj, true);
            }
        }
View Full Code Here

   
    public void registerForValueUpdate(String...values) {
      if (values == null)
        return;
      for (String key : values) {
        Value value = getRepository().getConfiguration()
          .getValue(key);
        if (value != null)
          value.addListener(this);
      }
    }
View Full Code Here

   
    public void registerForValueUpdate(String...values) {
      if (values == null)
        return;
      for (String key : values) {
        Value value = getRepository().getConfiguration()
          .getValue(key);
        if (value != null)
          value.addListener(this);
      }
    }
View Full Code Here

   
    public void registerForValueUpdate(String...values) {
      if (values == null)
        return;
      for (String key : values) {
        Value value = getRepository().getConfiguration()
          .getValue(key);
        if (value != null)
          value.addListener(this);
      }
    }
View Full Code Here

     * Aliases such as <code>"concurrent"</code> is also recognized.
     *
     * @throws Exception if the given type is not resolvable to a loadable type.
     */
    public void setPartitionType(String type) throws Exception {
        Value value = conf.getValue("DataCache");
        ClassLoader ctxLoader = AccessController.doPrivileged(J2DoPrivHelper.getContextClassLoaderAction());
        ClassLoader loader = conf.getClassResolverInstance().getClassLoader(null, ctxLoader);
        _type = (Class<? extends DataCache>) AccessController.doPrivileged(
                J2DoPrivHelper.getForNameAction(value.unalias(type), true, loader));
    }
View Full Code Here

   
    public void registerForValueUpdate(String...values) {
      if (values == null)
        return;
      for (String key : values) {
        Value value = getRepository().getConfiguration()
          .getValue(key);
        if (value != null)
          value.addListener(this);
      }
    }
View Full Code Here

  }

  public void testDynamicValuesAreCorrectlySet() {
    OpenJPAConfiguration conf = emf.getConfiguration();
   
    Value lockTimeoutValue = conf.getValue("LockTimeout");
    assertNotNull(lockTimeoutValue);
    assertTrue(lockTimeoutValue.isDynamic());
   
    Value connectionURLValue = conf.getValue("ConnectionURL");
    assertNotNull(connectionURLValue);
    assertFalse(connectionURLValue.isDynamic());
  }
View Full Code Here

        String str = (String) Configurations.removeProperty("TransactionMode", props);
        boolean managed;
        if (str == null)
            managed = conf.isTransactionModeManaged();
        else {
            Value val = conf.getValue("TransactionMode");
            managed = Boolean.parseBoolean(val.unalias(str));
        }

        Object obj = Configurations.removeProperty("ConnectionRetainMode", props);
        int retainMode;
        if (obj instanceof Number) {
            retainMode = ((Number) obj).intValue();
        } else if (obj == null) {
            retainMode = conf.getConnectionRetainModeConstant();
        } else {
            Value val = conf.getValue("ConnectionRetainMode");
            try {
                retainMode = Integer.parseInt(val.unalias((String) obj));
            } catch (Exception e) {
                throw new ArgumentException(_loc.get("bad-em-prop", "openjpa.ConnectionRetainMode", obj),
                    new Throwable[]{ e }, obj, true);
            }
        }
View Full Code Here

        String str = (String) Configurations.removeProperty("TransactionMode", props);
        boolean managed;
        if (str == null)
            managed = conf.isTransactionModeManaged();
        else {
            Value val = conf.getValue("TransactionMode");
            managed = Boolean.parseBoolean(val.unalias(str));
        }

        Object obj = Configurations.removeProperty("ConnectionRetainMode", props);
        int retainMode;
        if (obj instanceof Number) {
            retainMode = ((Number) obj).intValue();
        } else if (obj == null) {
            retainMode = conf.getConnectionRetainModeConstant();
        } else {
            Value val = conf.getValue("ConnectionRetainMode");
            try {
                retainMode = Integer.parseInt(val.unalias((String) obj));
            } catch (Exception e) {
                throw new ArgumentException(_loc.get("bad-em-prop", "openjpa.ConnectionRetainMode", obj),
                    new Throwable[]{ e }, obj, true);
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.lib.conf.Value

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.