Up
Authors
- Generated by ayers
-
- Declared in:
- EOControl/EOSharedEditingContext.h
Availability: OpenStep
Immutable Enterprise Objects can be shared among EOEditingContexts via EOSharedEditingContext. Normally EOs belong to a specific EOEditingContext and this editing context tracks the changes of this object. Yet sometimes immutable objects are often referenced by many objects and they would have to fetched and tracked within many EOEditingContexts. EOSharedEditingContext is intended to address this by supplying an shared context for immutable objects which can be shared among instances of EOEditingContext. An EO that is registered with an EOSharedEditingContext may not be contained in an other EOEditingContext which uses the EOSharedEditingContext.
The only valid way to modify an object that is contained in a shared context is by changing it in an unreladed EOEditingContext (i.e. one which does not use the EOSharedEditingContext), commit those changes to the object store which would post a EOObjectsChangedInStoreNotification which in turn will cause the EOSharedEditingContext to invalidate an subsequently refetch the values of the EO from its object store.
Objects are fetched with [-objectsWithFetchSpecification:]
or [-bindObjectsWithFetchSpecification:toName:]
into an EOSharedEditingContext. If the later method is used, the objects can be later retrieved via -objectsByEntityNameAndFetchSpecificationName
.
Instance Variables
Method summary
+ (
EOSharedEditingContext*)
defaultSharedEditingContext;
Availability: OpenStep
Returns the current default shared editing context. This method will create one if none currently exists. The first time this method implicitly creates a shared editing context it will post a EODefaultSharedEditingContextWasInitializedNotification
.
+ (void)
setDefaultSharedEditingContext: (
EOSharedEditingContext*)context;
Availability: OpenStep
Explicity sets the default shared editing context. If CONTEXT is not an EOSharedEditingContext this method raises an NSInternalInconsistency exception.
- (void)
bindObjectsWithFetchSpecification: (
EOFetchSpecification*)fetchSpec
toName: (NSString*)name;
Availability: OpenStep
- (void)
deleteObject: (id)object;
Availability: OpenStep
Raises an NSInternalInconsistencyException since a shared editing context may not delete objects.
- (NSArray*)
deletedObjects;
Availability: OpenStep
Returns an empty array since a shared editing context may not delete objects.
- (id)
faultForGlobalID: (
EOGlobalID*)globalID
editingContext: (
EOEditingContext*)context;
Availability: OpenStep
Returns the fault of the superclass implementation but insures that the returned object is valid in autoreleased in the current autorelease pool of the calling thread.
- (BOOL)
hasChanges;
Availability: OpenStep
Always returns NO
since a shared editing context may not have changes.
- (void)
insertObject: (id)object;
Availability: OpenStep
Raises an NSInternalInconsistencyException since a shared editing context may not delete objects.
- (NSArray*)
insertedObjects;
Availability: OpenStep
Returns an empty array since a shared editing context may not insert objects.
- (void)
lockForReading;
Availability: OpenStep
Increases the recievers lock count for reading.
- (id)
objectForGlobalID: (
EOGlobalID*)globalID;
Availability: OpenStep
Returns the object of the superclass implementation but insures that the returned object is valid in autoreleased in the current autorelease pool of the calling thread.
- (void)
objectWillChange: (id)object;
Availability: OpenStep
Raises an NSInternalInconsistencyException since objects in a shared editing context may not be modified.
- (NSDictionary*)
objectsByEntityName;
Availability: OpenStep
Returns all object currently maintained the the EOSharedEditingContext in an NSDictionary associated with the corresponding entity name.
- (NSDictionary*)
objectsByEntityNameAndFetchSpecificationName;
Availability: OpenStep
Returns all object currently maintained the the EOSharedEditingContext in an NSDictionary associated with the corresponding name supplied by previous
[-bindObjectsWithFetchSpecification:toName:]
each containing a dictionary in which the objects are assicated with the entity name.
- (void)
refaultObject: (id)object
withGlobalID: (
EOGlobalID*)globalID
editingContext: (
EOEditingContext*)context;
Availability: OpenStep
This method is invoked if the objects have been modified in an unrelated EOEditingContext and therefor needs to be invalidated and refetched here.
- (NSArray*)
registeredObjects;
Availability: OpenStep
Returns the registered objects of the superclass implementation but insures that that the returned objects are valid in autoreleased in the current autorelease pool of the calling thread.
- (void)
reset;
Availability: OpenStep
Overriden to do nothing.
- (void)
retrieveReaderLocks;
Availability: OpenStep
Retrieve suspended reader lock count.
- (void)
saveChanges;
Availability: OpenStep
Raises an NSInternalInconsistencyException since objects in a shared editing context may not be modified.
- (void)
setSharedEditingContext: (
EOSharedEditingContext*)sharedContext;
Availability: OpenStep
Raises an NSInternalInconsistencyException unless SHAREDCONTEXT is nil
.
- (void)
setUndoManager: (NSUndoManager*)undoManager;
Availability: OpenStep
Raises an NSInternalInconsistencyException unless SHAREDCONTEXT is nil
.
- (
EOSharedEditingContext*)
sharedEditingContext;
Availability: OpenStep
EOSharedEditingContexts cannot have shared editing contexts. This methos allways returns nil
.
- (void)
suspendReaderLocks;
Availability: OpenStep
Suspends the reader lock count until retrieveReaderLocks is called.
- (BOOL)
tryLockForReading;
Availability: OpenStep
Attempts to increases the recievers lock count for reading. Returns NO
if the lock cannot be retrieved.
- (void)
unlockForReading;
Availability: OpenStep
Decreases the recievers lock count for reading.
- (NSArray*)
updatedObjects;
Availability: OpenStep
Returns an empty array since a shared editing context may not insert objects.
- (void)
validateChangesForSave;
Availability: OpenStep
Overriden to do nothing.
Instance Variables for EOSharedEditingContext Class
@protected NSMutableArray* _initializedGlobalIDs;
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
@protected NSMutableDictionary* _objsByEntity;
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
@protected NSMutableDictionary* _objsByEntityFetchSpec;
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
@protected int _readerLockCount;
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
@protected int _readerLockCountSuspended;
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
@protected NSRecursiveLock* _sharedLock;
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Up