|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecter.extensions.eof.ERXEnterpriseObjectChangeListener<T>
public abstract class ERXEnterpriseObjectChangeListener<T extends com.webobjects.eocontrol.EOEnterpriseObject>
Listens to EOEditingContextDidSaveChanges notifications to track changes on a given entity and calls the entitiesChanged method when the entity changes.
Field Summary | |
---|---|
static java.lang.String |
ClearCacheNotification
|
Constructor Summary | |
---|---|
ERXEnterpriseObjectChangeListener(java.lang.Class c,
boolean trackAllChanges,
boolean deep)
Constructs an ERXEnterpriseChangeListener. |
|
ERXEnterpriseObjectChangeListener(java.lang.String entityName,
boolean trackAllChanges,
boolean deep)
Constructs an ERXEnterpriseChangeListener. |
Method Summary | |
---|---|
abstract void |
clearCache()
Called when a clear cache request has been received. |
void |
clearCache(com.webobjects.foundation.NSNotification n)
Handler for the clearCaches notification. |
void |
editingContextDidSaveChanges(com.webobjects.foundation.NSNotification n)
Handler for the editingContextDidSaveChanges notification. |
abstract void |
entitiesChanged(com.webobjects.foundation.NSArray<T> entitiesInserted,
com.webobjects.foundation.NSArray<T> entitiesUpdated,
com.webobjects.foundation.NSArray<T> entitiesDeleted)
Called when the entity being listened to changes. |
protected java.lang.String |
entityName()
Returns the name of the entity this cache is watching. |
protected boolean |
isRelevant(com.webobjects.eocontrol.EOEditingContext editingContext,
java.lang.String changedEntityName)
Returns true if the changed entity name matches the watched entity name, or if this change listener is "deep," if the changed entity name is a |
protected void |
registerForNotifications()
|
protected com.webobjects.foundation.NSArray<T> |
relevantChanges(com.webobjects.eocontrol.EOEditingContext editingContext,
com.webobjects.foundation.NSDictionary dict,
java.lang.String key)
Helper to check if an array of EOs contains the handled entity or its subclasses (if deep). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String ClearCacheNotification
Constructor Detail |
---|
public ERXEnterpriseObjectChangeListener(java.lang.Class c, boolean trackAllChanges, boolean deep)
c
- the class name of the entity to watch for changestrackAllChanges
- if true, entitiesChanged will pass the array of all changed
EO's (slightly slower)deep
- if true, subentities of the given entity will be considered
relevent to this change listenerpublic ERXEnterpriseObjectChangeListener(java.lang.String entityName, boolean trackAllChanges, boolean deep)
entityName
- the entity name to watch for changestrackAllChanges
- if true, entitiesChanged will pass the array of all changed
EO's (slightly slower)deep
- if true, subentities of the given entity will be considered
relevent to this change listenerMethod Detail |
---|
protected void registerForNotifications()
protected com.webobjects.foundation.NSArray<T> relevantChanges(com.webobjects.eocontrol.EOEditingContext editingContext, com.webobjects.foundation.NSDictionary dict, java.lang.String key)
editingContext
- the editingContext containing the changesdict
- the notification's userInfo dictionarykey
- the inserted/updated/deleted key
protected boolean isRelevant(com.webobjects.eocontrol.EOEditingContext editingContext, java.lang.String changedEntityName)
editingContext
- the editing context containing the changeschangedEntityName
- the name of the changed entity
public void editingContextDidSaveChanges(com.webobjects.foundation.NSNotification n)
n
- public void clearCache(com.webobjects.foundation.NSNotification n)
n
- protected java.lang.String entityName()
public abstract void entitiesChanged(com.webobjects.foundation.NSArray<T> entitiesInserted, com.webobjects.foundation.NSArray<T> entitiesUpdated, com.webobjects.foundation.NSArray<T> entitiesDeleted)
entitiesInserted
- entities of this type were inserted, if null, it was not
checkedentitiesUpdated
- entities of this type were updated, if null, it was not
checkedentitiesDeleted
- entities of this type were deleted, if null, it was not
checkedpublic abstract void clearCache()
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |