Package org.apache.openjpa.lib.conf

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


  }

  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


   
    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

        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

        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

            ("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 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

  }

  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

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.