Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOObjectStoreCoordinator


        String className = ERXProperties.stringForKeyWithDefault("EOSharedEditingContext.defaultSharedEditingContextClassName", EOSharedEditingContext.class.getName()); //should really be "...defaultDefault..."
        try {
            Constructor<? extends EOSharedEditingContext> sharedEditingContextConstructor = Class.forName(className).asSubclass(EOSharedEditingContext.class).getConstructor(EOObjectStore.class);
            for (int i = 0; i < _maxObjectStoreCoordinators; i++) {
                EOObjectStoreCoordinator os = ERXObjectStoreCoordinator.create();
                _objectStores.add(os);
                _sharedEditingContexts.add(sharedEditingContextConstructor.newInstance(os));
            }
            if(_maxObjectStoreCoordinators > 0) {
                EOObjectStoreCoordinator.setDefaultCoordinator(_objectStores.get(0));
View Full Code Here


  public void modelRemoved(NSNotification n) {
    modelCache.remove(n.object());
  }
 
  public void storeCoordinatorAdded(NSNotification n) {
    EOObjectStoreCoordinator osc = (EOObjectStoreCoordinator) n.object();
    oscCache.put(osc, EOModelGroup.modelGroupForObjectStoreCoordinator(osc));
  }
View Full Code Here

    EOModelGroup modelGroup = model.modelGroup();
    modelGroup.removeModel(model);
    modelGroup.addModel(newModel);
    for (Map.Entry<EOObjectStoreCoordinator, EOModelGroup> entry : oscCache.entrySet()) {
      if (modelGroup == entry.getValue()) {
        EOObjectStoreCoordinator osc = entry.getKey();
        for (Object obj : osc.cooperatingObjectStores()) {
          EOCooperatingObjectStore store = (EOCooperatingObjectStore) obj;
           osc.removeCooperatingObjectStore(store);
        }
        osc.invalidateAllObjects();
      }
    }
  }
View Full Code Here

   * <li> the relationship is a fault.
   * <li> pre-existing fresh-enough snapshot exists in the EOF stack
   */
  public void testObjectCountForToManyRelationship_Snapshot() {
    // Make no assumptions about state of stack or if OSC pool active
    EOObjectStoreCoordinator osc = new EOObjectStoreCoordinator();
    // Setup
    EOGlobalID cGid = ERXTestUtilities.createCompanyAnd3Employees();
    EOGlobalID cGid0 = ERXTestUtilities.createCompanyAndNoEmployees();
   
    EOEditingContext ec1 = ERXEC.newEditingContext(osc);
View Full Code Here

  public void testObjectCountForToManyRelationship_DatabaseCount() {
    // Setup
    EOGlobalID cGid = ERXTestUtilities.createCompanyAnd3Employees();

    // Virgin OSC with no snapshots
    EOObjectStoreCoordinator osc = new EOObjectStoreCoordinator();
    EOEditingContext ec1 = ERXEC.newEditingContext(osc);
    ec1.lock();
    try {
      Company c = (Company) ec1.faultForGlobalID(cGid, ec1);
      // We expect relationship to be a fault
View Full Code Here

TOP

Related Classes of com.webobjects.eocontrol.EOObjectStoreCoordinator

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.