com.cassinidivision.oce.users
Class U_Lock

java.lang.Object
  extended bycom.webobjects.eocontrol.EOCustomObject
      extended bycom.webobjects.eocontrol.EOGenericRecord
          extended bycom.cassinidivision.oce.users.base._U_Lock
              extended bycom.cassinidivision.oce.users.U_Lock
All Implemented Interfaces:
_EOPrivateMemento, EODeferredFaulting, EOEnterpriseObject, EOFaulting, EOKeyValueCoding, EOKeyValueCoding._BestBindingCreation._ForwardingBindingCheck, EOKeyValueCoding._KeyBindingCreation, EOKeyValueCodingAdditions, EORelationshipManipulation, EOValidation, NSKeyValueCoding, NSKeyValueCoding._KeyBindingCreation, NSKeyValueCoding._ReflectionKeyBindingCreation.Callback, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation, Serializable

public class U_Lock
extends com.cassinidivision.oce.users.base._U_Lock

Provides database-independent locking mechanisms for single primary-keyed enterprise objects.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.webobjects.eocontrol.EOGenericRecord
EOGenericRecord._DictionaryBinding, EOGenericRecord._LazyDictionaryBinding
 
Nested classes inherited from class com.webobjects.eocontrol.EOCustomObject
EOCustomObject._BooleanFieldBinding, EOCustomObject._FieldBinding, EOCustomObject._LazyFieldBinding, EOCustomObject._NumberFieldBinding
 
Nested classes inherited from class com.webobjects.eocontrol.EOKeyValueCodingAdditions
EOKeyValueCodingAdditions.DefaultImplementation, EOKeyValueCodingAdditions.Utility
 
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCoding
NSKeyValueCoding._BooleanMethodBinding, NSKeyValueCoding._ForwardingBinding, NSKeyValueCoding._KeyBinding, NSKeyValueCoding._KeyBindingCreation, NSKeyValueCoding._MethodBinding, NSKeyValueCoding._NumberMethodBinding, NSKeyValueCoding._ReflectionKeyBindingCreation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.Null, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.ValueAccessor
 
Nested classes inherited from class com.webobjects.eocontrol.EOKeyValueCoding
EOKeyValueCoding._BestBindingCreation, EOKeyValueCoding._KeyBindingCreation, EOKeyValueCoding._StoredForwardingBinding
 
Nested classes inherited from class com.webobjects.foundation.NSValidation
NSValidation._MethodBinding, NSValidation._ValidationBinding, NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException
 
Nested classes inherited from class com.webobjects.eocontrol._EOPrivateMemento
_EOPrivateMemento.DefaultImplementation
 
Field Summary
 
Fields inherited from class com.webobjects.eocontrol.EOGenericRecord
_CLASS
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
_KeyPathSeparatorChar, KeyPathSeparator
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding
NullValue
 
Constructor Summary
U_Lock()
           
 
Method Summary
static boolean isLockable(EOEnterpriseObject anObject)
          Uncover if a particular enterprise object can be locked or not.
static boolean isLocked(EOEnterpriseObject anObject)
          Deduce whether an enterprise object is currently locked or not.
static NSDictionary lockedInfoForObject(EOEnterpriseObject anObject)
          Convenience method: return lock information regarding a particular object.
static U_Lock lockForObjectInEditingContext(EOEnterpriseObject anObject, EOEditingContext editingContext)
          Retrieve a lock for an enterprise object instance, if one exists.
static U_Lock newLockForObjectWithUserInEditingContext(EOEnterpriseObject anObject, U_Actor anActor, EOEditingContext editingContext)
          Create a new lock (in-memory, unsaved) for an enterprise object, registered to a particular actor/user.
 void unlock()
          Unlock the current instance (removes the lock instance from the database).
 
Methods inherited from class com.cassinidivision.oce.users.base._U_Lock
actor, className, dateSet, lock_ID, setActor, setClassName, setDateSet, setLock_ID
 
Methods inherited from class com.webobjects.eocontrol.EOGenericRecord
__setClassDescription, _keyGetBindingForKey, _keySetBindingForKey, _otherStorageBinding, _storedKeyGetBindingForKey, _storedKeySetBindingForKey, classDescription, usesDeferredFaultCreation
 
Methods inherited from class com.webobjects.eocontrol.EOCustomObject
__classDescription, __clearPendingChanges, __editingContext, __globalID, __hasAuxillaryObservers, __hasPendingChanges, __hasPendingUpdate, __isInitialized, __isPendingDeletion, __isPendingInsertion, __isShared, __lastSnapshot, __originalSnapshot, __retainCount, __setAuxillaryObservers, __setEditingContext, __setGlobalID, __setInitialized, __setLastSnapshot, __setOriginalSnapshot, __setPendingDeletion, __setPendingInsertion, __setPendingUpdate, __setRetainCount, __setShared, _createKeyGetBindingForKey, _createKeySetBindingForKey, _createStoredKeyGetBindingForKey, _createStoredKeySetBindingForKey, _fieldKeyBinding, _forwardingBindingNeededForClass, _methodKeyGetBinding, _methodKeySetBinding, addObjectToBothSidesOfRelationshipWithKey, addObjectToPropertyWithKey, allPropertyKeys, attributeKeys, awakeFromClientUpdate, awakeFromFetch, awakeFromInsertion, canAccessFieldsDirectly, changesFromSnapshot, classDescriptionForDestinationKey, clearFault, clearProperties, deleteRuleForRelationshipKey, editingContext, entityName, eoDescription, eoShallowDescription, equals, faultHandler, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hashCode, inverseForRelationshipKey, invokeRemoteMethod, isFault, isToManyKey, opaqueState, ownsDestinationObjectsForRelationshipKey, prepareValuesForClient, propagateDeleteWithEditingContext, reapplyChangesFromDictionary, removeObjectFromBothSidesOfRelationshipWithKey, removeObjectFromPropertyWithKey, shouldUseStoredAccessors, snapshot, storedValueForKey, takeStoredValueForKey, takeValueForKey, takeValueForKeyPath, takeValuesFromDictionary, takeValuesFromDictionaryWithMapping, toManyRelationshipKeys, toOneRelationshipKeys, toString, turnIntoFault, unableToSetNullForKey, updateFromSnapshot, userPresentableDescription, validateClientUpdate, validateForDelete, validateForInsert, validateForSave, validateForUpdate, validateTakeValueForKeyPath, validateValueForKey, valueForKey, valueForKeyPath, valuesForKeys, valuesForKeysWithMapping, willChange, willRead, willReadRelationship
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

U_Lock

public U_Lock()
Method Detail

lockForObjectInEditingContext

public static U_Lock lockForObjectInEditingContext(EOEnterpriseObject anObject,
                                                   EOEditingContext editingContext)
Retrieve a lock for an enterprise object instance, if one exists.

Parameters:
anObject - The enterprise object in question.
editingContext - The editing context in which the lock will be fetched.
Returns:
The lock for the EO, or null if there is no such lock.

newLockForObjectWithUserInEditingContext

public static U_Lock newLockForObjectWithUserInEditingContext(EOEnterpriseObject anObject,
                                                              U_Actor anActor,
                                                              EOEditingContext editingContext)
Create a new lock (in-memory, unsaved) for an enterprise object, registered to a particular actor/user.

Parameters:
anObject - The enterprise object in question.
anActor - The actor the lock will be associated with.
editingContext - The editing context the new lock instance will be registered in.
Returns:
The newly created lock, or null if the EO is not lockable, or any other problem occurred.

isLockable

public static boolean isLockable(EOEnterpriseObject anObject)
Uncover if a particular enterprise object can be locked or not.

Parameters:
anObject - The enterprise object in question.
Returns:
true if a lock can be created for the EO, false otherwise.

isLocked

public static boolean isLocked(EOEnterpriseObject anObject)
Deduce whether an enterprise object is currently locked or not.

Parameters:
anObject - The enterprise object in question.
Returns:
true if the EO is locked, false otherwise.

lockedInfoForObject

public static NSDictionary lockedInfoForObject(EOEnterpriseObject anObject)
Convenience method: return lock information regarding a particular object.

The following key-value pairs may be returned in the info dictionary:

Parameters:
anObject -
Returns:
The lock information dictionary, or null if the object is not locked.

unlock

public void unlock()
Unlock the current instance (removes the lock instance from the database).