Example #1
0
  protected static final ObjectContainer openMemoryFile1(MemoryFile memoryFile) {
    synchronized (Db4o.lock) {
      if (memoryFile == null) {
        memoryFile = new MemoryFile();
      }
      ObjectContainer oc = null;
      if (Deploy.debug) {
        System.out.println("db4o Debug is ON");
        oc = new YapMemoryFile(memoryFile);

        // intentionally no exception handling,
        // in order to follow uncaught errors
      } else {
        try {
          oc = new YapMemoryFile(memoryFile);
        } catch (Throwable t) {
          Messages.logErr(i_config, 4, "Memory File", t);
          return null;
        }
      }
      if (oc != null) {
        Platform4.postOpen(oc);
        Messages.logMsg(i_config, 5, "Memory File");
      }
      return oc;
    }
  }
Example #2
0
  /**
   * Search for slot that corresponds to class. <br>
   * If not found add it. <br>
   * Constrain it. <br>
   */
  public Constraint constrain(Object example) {
    synchronized (streamLock()) {
      ReflectClass claxx = reflectClassForClass(example);
      if (claxx != null) {
        return addClassConstraint(claxx);
      }

      QConEvaluation eval = Platform4.evaluationCreate(_trans, example);
      if (eval != null) {
        return addEvaluationToAllConstraints(eval);
      }

      Collection4 constraints = new Collection4();
      addConstraint(constraints, example);
      return toConstraint(constraints);
    }
  }
Example #3
0
 private static final Object initialize() {
   Platform4.getDefaultConfiguration(i_config);
   return new Object();
 }