Project Wonder 5.0

er.directtoweb
Class ERD2WModel

java.lang.Object
  extended by com.webobjects.directtoweb.D2WModel
      extended by er.directtoweb.ERD2WModel
All Implemented Interfaces:
com.webobjects.eocontrol.EOKeyValueArchiving

public class ERD2WModel
extends com.webobjects.directtoweb.D2WModel

Overhaul of the caching system.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.webobjects.eocontrol.EOKeyValueArchiving
com.webobjects.eocontrol.EOKeyValueArchiving._NullValueSupport, com.webobjects.eocontrol.EOKeyValueArchiving._NumberSupport, com.webobjects.eocontrol.EOKeyValueArchiving._TimestampSupport, com.webobjects.eocontrol.EOKeyValueArchiving.Awaking, com.webobjects.eocontrol.EOKeyValueArchiving.FinishInitialization, com.webobjects.eocontrol.EOKeyValueArchiving.Support
 
Field Summary
protected  java.io.File _currentFile
           
protected  java.util.Hashtable _filePathRuleTraceCache
           
protected  java.util.Hashtable _uniqueAndQualifiers
           
protected  java.util.Hashtable _uniqueAssignments
           
protected  java.util.Hashtable _uniqueKeyValueQualifiers
           
protected  java.util.Hashtable _uniqueNotQualifiers
           
protected  java.util.Hashtable _uniqueOrQualifiers
           
protected static java.lang.String ATTRIBUTE_PREFIX
           
protected static java.lang.String ENTITY_PREFIX
           
static org.apache.log4j.Logger log
          logging support
static java.lang.String ModelWillReset
           
protected static java.lang.String RELATIONSHIP_PREFIX
           
static org.apache.log4j.Logger ruleDecodeLog
          logs rules being decoded
static org.apache.log4j.Logger ruleTraceEnabledLog
          main category for enabling or disabling tracing of rules
protected  int totalQualifiers
           
protected  int uniquedQualifiers
           
static java.lang.String WillSortRules
           
 
Fields inherited from class com.webobjects.directtoweb.D2WModel
_PageWrapperNameKey, _tasks, ActionsKey, AllMarker, AllowCollapsingKey, AlternateRowColorKey, AttributeKey, AttributeTypeKey, BackgroundColorForPageKey, BackgroundColorForTableKey, BoldKey, ColorKey, ComponentAvailableKey, ComponentNameKey, ComponentsToShowAtEndKey, CustomTypeKey, DisplayNameForPropertyKey, DisplayPropertyKeysKey, DummyTrueKey, DynamicPageKey, EntityKey, FormatterKey, FrameKey, FramesActiveKey, IsGeneratingKey, ItalicKey, KeyPathTypeKey, KeyWhenRelationshipKey, LengthKey, LookKey, NoneMarker, One, PageAvailableKey, PageNameKey, PropertyIsKeyPathKey, PropertyKey, PropertyKeyKey, PropertyKeyPortionInModelKey, PropertyTypeKey, ReadOnlyEntityNamesKey, RelationshipKey, RelationshipTypeKey, RequiresEntityKey, SessionKey, ShowBannerKey, StartupEntityNameKey, StartupTaskKey, TargetKey, TaskKey, VisibleEntityNamesKey, WebAssistantPageNameKey, Zero
 
Fields inherited from interface com.webobjects.eocontrol.EOKeyValueArchiving
_CLASS
 
Constructor Summary
protected ERD2WModel(com.webobjects.eocontrol.EOKeyValueUnarchiver unarchiver)
           
protected ERD2WModel(java.io.File file)
           
protected ERD2WModel(com.webobjects.foundation.NSArray rules)
          Main constructor.
  ERD2WModel(java.net.URL url)
           
 
Method Summary
protected  void _addKeyToVector(java.lang.String key, java.util.Vector vector)
           
protected  com.webobjects.foundation.NSSet _addKeyToVectorKeysToTakeLiterally()
           
 void _diagnoseCache()
           
protected  boolean _shouldUseCacheForFiringRuleForKeyPathInContext(java.lang.String keyPath, com.webobjects.directtoweb.D2WContext context)
           
 void addRule(com.webobjects.directtoweb.Rule rule)
           
 void addRules(com.webobjects.foundation.NSArray rules)
           
protected  com.webobjects.eocontrol.EOAndQualifier andQualifierInCache(com.webobjects.eocontrol.EOAndQualifier q)
           
 void applicationDidFinishLaunching(com.webobjects.foundation.NSNotification n)
           
 void applicationWillDispatchRequest(com.webobjects.foundation.NSNotification n)
           
protected  com.webobjects.directtoweb.Assignment assignmentContainedInVector(com.webobjects.directtoweb.Assignment a1, java.util.Vector v)
           
 com.webobjects.foundation.NSArray availablePageConfigurations()
           
 com.webobjects.foundation.NSArray availableTasks()
           
protected  java.util.Hashtable cacheFromBytes(byte[] bytes)
           
protected  byte[] cacheToBytes(java.util.Hashtable cache)
           
 com.webobjects.foundation.NSArray canidateRuleSetForRHSInContext(java.lang.String rhs, com.webobjects.directtoweb.D2WContext context)
           
 void clearD2WRuleCache()
           
 void clearD2WRuleCache(com.webobjects.foundation.NSNotification n)
           
protected  java.io.File currentFile()
           
protected  java.lang.Object decodeObject(java.lang.Object o)
           
protected  java.lang.String descriptionForRule(com.webobjects.directtoweb.Rule r)
           
protected  java.lang.String descriptionForRuleSet(com.webobjects.foundation.NSArray set)
           
protected static com.webobjects.foundation.NSDictionary dictionaryFromPathUrl(java.net.URL url)
           
 void dumpCache(java.lang.String fileName)
          Means to dump the cache.
protected  java.lang.Object encodeObject(java.lang.Object o)
           
static ERD2WModel erDefaultModel()
          Gets the default D2W model cast as an ERD2WModel.
protected  java.lang.Object fireRuleForKeyPathInContext(java.lang.String keyPath, com.webobjects.directtoweb.D2WContext context)
           
protected  java.lang.Object fireSystemRuleForKeyPathInContext(java.lang.String keyPath, com.webobjects.directtoweb.D2WContext context)
           
protected  void flushUniqueCache()
           
protected  void invalidateCaches()
           
protected  com.webobjects.eocontrol.EOKeyValueQualifier keyValueQualifierInCache(com.webobjects.eocontrol.EOKeyValueQualifier q)
           
protected  void mergeFile(java.io.File modelFile)
           
protected  void mergePathURL(java.net.URL modelURL)
           
 java.util.Vector modelFilesInBundles()
           
 java.util.Vector modelFilesPathURLsInBundles()
          Overridden to support additional d2wmodel files.
 java.lang.String nameForSet(com.webobjects.foundation.NSSet set)
           
protected  com.webobjects.eocontrol.EONotQualifier notQualifierInCache(com.webobjects.eocontrol.EONotQualifier q)
           
protected  com.webobjects.eocontrol.EOOrQualifier orQualifierInCache(com.webobjects.eocontrol.EOOrQualifier q)
           
 void prepareDataStructures()
           
protected  com.webobjects.eocontrol.EOQualifier qualifierContainedInEnumeration(com.webobjects.eocontrol.EOQualifierEvaluation q1, java.util.Enumeration e)
           
protected  com.webobjects.eocontrol.EOQualifier qualifierInCache(com.webobjects.eocontrol.EOQualifier q)
           
protected  ERXMultiKey readEntry(java.util.Hashtable cache, java.io.ObjectInputStream in)
           
 void removeRule(com.webobjects.directtoweb.Rule rule)
           
 void resetModel()
           
 void restoreCache(java.lang.String fileName)
          Means to restore the cache.
 com.webobjects.foundation.NSArray rules()
           
protected  void setCurrentFile(java.io.File currentFile)
           
protected  void sortRules()
           
protected  void uniqueQualifiers(com.webobjects.foundation.NSArray rules)
           
protected  void uniqueRuleAssignments(com.webobjects.foundation.NSArray rules)
           
protected  boolean writeEntry(ERXMultiKey key, java.lang.Object value, java.io.ObjectOutputStream out)
           
 
Methods inherited from class com.webobjects.directtoweb.D2WModel
_fireRule, addRuleToItsBucket, addRuleTrace, candidates, canSaveUserModel, checkPossibilityToSaveUserModel, checkRules, clientConfiguration, clientConfigurationFilesInBundles, clientConfigurationFilesPathURLsInBundles, componentDefinitions, createWebAssistantRulesWithSettings, dataTypesInvolved, defaultModel, dirty, dynamicPages, editors, encodeWebAssistantRulesWithKeyValueArchiver, encodeWithKeyValueArchiver, fireAllRulesForKeyPathInContext, inferrableKeys, initializeClientConfiguration, isPageStatic, loadRules, nameFromFrameworkBundle, newSettings, pageRuleKeysForPage, pageRuleKeysFromClientConfiguration, propertyRuleKeysForComponents, propertyRuleKeysFromClientConfiguration, removeAllWebAssistantRules, removeDynamicPage, removeWebAssistantRulesWithSameContextAsSettings, revertWebAssistantRules, saveWebAssistantRulesIntoUsedModelFile, setDefaultModel, setDirty, setRules, tasks, taskVector, toFile, toString, typeForRuleKey, updateUserSettingsForNewPageAvailableRule, userClientConfigurationFile, userClientConfigurationFilePathURL, userModelFile, userModelFilePathURL, webAssistantRulesForSave
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

public static final org.apache.log4j.Logger log
logging support


ruleDecodeLog

public static final org.apache.log4j.Logger ruleDecodeLog
logs rules being decoded


ruleTraceEnabledLog

public static final org.apache.log4j.Logger ruleTraceEnabledLog
main category for enabling or disabling tracing of rules


WillSortRules

public static final java.lang.String WillSortRules
See Also:
Constant Field Values

ModelWillReset

public static final java.lang.String ModelWillReset
See Also:
Constant Field Values

_filePathRuleTraceCache

protected java.util.Hashtable _filePathRuleTraceCache

_currentFile

protected java.io.File _currentFile

_uniqueAssignments

protected java.util.Hashtable _uniqueAssignments

uniquedQualifiers

protected int uniquedQualifiers

totalQualifiers

protected int totalQualifiers

_uniqueAndQualifiers

protected java.util.Hashtable _uniqueAndQualifiers

_uniqueOrQualifiers

protected java.util.Hashtable _uniqueOrQualifiers

_uniqueNotQualifiers

protected java.util.Hashtable _uniqueNotQualifiers

_uniqueKeyValueQualifiers

protected java.util.Hashtable _uniqueKeyValueQualifiers

ENTITY_PREFIX

protected static final java.lang.String ENTITY_PREFIX
See Also:
Constant Field Values

RELATIONSHIP_PREFIX

protected static final java.lang.String RELATIONSHIP_PREFIX
See Also:
Constant Field Values

ATTRIBUTE_PREFIX

protected static final java.lang.String ATTRIBUTE_PREFIX
See Also:
Constant Field Values
Constructor Detail

ERD2WModel

protected ERD2WModel(com.webobjects.foundation.NSArray rules)
Main constructor. Builds a model for a given set of rules.

Parameters:
rules - array of rules

ERD2WModel

protected ERD2WModel(java.io.File file)

ERD2WModel

public ERD2WModel(java.net.URL url)

ERD2WModel

protected ERD2WModel(com.webobjects.eocontrol.EOKeyValueUnarchiver unarchiver)
Method Detail

erDefaultModel

public static ERD2WModel erDefaultModel()
Gets the default D2W model cast as an ERD2WModel.

Returns:
the default ERD2Model

clearD2WRuleCache

public void clearD2WRuleCache()

availableTasks

public com.webobjects.foundation.NSArray availableTasks()

availablePageConfigurations

public com.webobjects.foundation.NSArray availablePageConfigurations()

sortRules

protected void sortRules()
Overrides:
sortRules in class com.webobjects.directtoweb.D2WModel

applicationWillDispatchRequest

public void applicationWillDispatchRequest(com.webobjects.foundation.NSNotification n)

applicationDidFinishLaunching

public void applicationDidFinishLaunching(com.webobjects.foundation.NSNotification n)

clearD2WRuleCache

public void clearD2WRuleCache(com.webobjects.foundation.NSNotification n)

rules

public com.webobjects.foundation.NSArray rules()
Overrides:
rules in class com.webobjects.directtoweb.D2WModel

addRule

public void addRule(com.webobjects.directtoweb.Rule rule)
Overrides:
addRule in class com.webobjects.directtoweb.D2WModel

removeRule

public void removeRule(com.webobjects.directtoweb.Rule rule)
Overrides:
removeRule in class com.webobjects.directtoweb.D2WModel

descriptionForRuleSet

protected java.lang.String descriptionForRuleSet(com.webobjects.foundation.NSArray set)

descriptionForRule

protected java.lang.String descriptionForRule(com.webobjects.directtoweb.Rule r)

addRules

public void addRules(com.webobjects.foundation.NSArray rules)
Overrides:
addRules in class com.webobjects.directtoweb.D2WModel

fireSystemRuleForKeyPathInContext

protected java.lang.Object fireSystemRuleForKeyPathInContext(java.lang.String keyPath,
                                                             com.webobjects.directtoweb.D2WContext context)
Overrides:
fireSystemRuleForKeyPathInContext in class com.webobjects.directtoweb.D2WModel

fireRuleForKeyPathInContext

protected java.lang.Object fireRuleForKeyPathInContext(java.lang.String keyPath,
                                                       com.webobjects.directtoweb.D2WContext context)
Overrides:
fireRuleForKeyPathInContext in class com.webobjects.directtoweb.D2WModel

_shouldUseCacheForFiringRuleForKeyPathInContext

protected boolean _shouldUseCacheForFiringRuleForKeyPathInContext(java.lang.String keyPath,
                                                                  com.webobjects.directtoweb.D2WContext context)

dumpCache

public void dumpCache(java.lang.String fileName)
Means to dump the cache. You shouldn't use this unless you know what you are doing.


restoreCache

public void restoreCache(java.lang.String fileName)
Means to restore the cache. You shouldn't use this unless you know what you are doing.


canidateRuleSetForRHSInContext

public com.webobjects.foundation.NSArray canidateRuleSetForRHSInContext(java.lang.String rhs,
                                                                        com.webobjects.directtoweb.D2WContext context)

_addKeyToVectorKeysToTakeLiterally

protected com.webobjects.foundation.NSSet _addKeyToVectorKeysToTakeLiterally()

_addKeyToVector

protected void _addKeyToVector(java.lang.String key,
                               java.util.Vector vector)

prepareDataStructures

public void prepareDataStructures()

invalidateCaches

protected void invalidateCaches()
Overrides:
invalidateCaches in class com.webobjects.directtoweb.D2WModel

resetModel

public void resetModel()

setCurrentFile

protected void setCurrentFile(java.io.File currentFile)

currentFile

protected java.io.File currentFile()

dictionaryFromPathUrl

protected static com.webobjects.foundation.NSDictionary dictionaryFromPathUrl(java.net.URL url)

mergePathURL

protected void mergePathURL(java.net.URL modelURL)
Overrides:
mergePathURL in class com.webobjects.directtoweb.D2WModel

mergeFile

protected void mergeFile(java.io.File modelFile)
Overrides:
mergeFile in class com.webobjects.directtoweb.D2WModel

uniqueRuleAssignments

protected void uniqueRuleAssignments(com.webobjects.foundation.NSArray rules)

assignmentContainedInVector

protected com.webobjects.directtoweb.Assignment assignmentContainedInVector(com.webobjects.directtoweb.Assignment a1,
                                                                            java.util.Vector v)

uniqueQualifiers

protected void uniqueQualifiers(com.webobjects.foundation.NSArray rules)

modelFilesInBundles

public java.util.Vector modelFilesInBundles()
Overrides:
modelFilesInBundles in class com.webobjects.directtoweb.D2WModel

modelFilesPathURLsInBundles

public java.util.Vector modelFilesPathURLsInBundles()
Overridden to support additional d2wmodel files. Provide an array of filenames (including extension) in the property 'er.directtoweb.ERD2WModel.additionalModelNames', these files should get loaded and added to the rules set during application startup.

Overrides:
modelFilesPathURLsInBundles in class com.webobjects.directtoweb.D2WModel

qualifierContainedInEnumeration

protected com.webobjects.eocontrol.EOQualifier qualifierContainedInEnumeration(com.webobjects.eocontrol.EOQualifierEvaluation q1,
                                                                               java.util.Enumeration e)

qualifierInCache

protected com.webobjects.eocontrol.EOQualifier qualifierInCache(com.webobjects.eocontrol.EOQualifier q)

andQualifierInCache

protected com.webobjects.eocontrol.EOAndQualifier andQualifierInCache(com.webobjects.eocontrol.EOAndQualifier q)

orQualifierInCache

protected com.webobjects.eocontrol.EOOrQualifier orQualifierInCache(com.webobjects.eocontrol.EOOrQualifier q)

notQualifierInCache

protected com.webobjects.eocontrol.EONotQualifier notQualifierInCache(com.webobjects.eocontrol.EONotQualifier q)

keyValueQualifierInCache

protected com.webobjects.eocontrol.EOKeyValueQualifier keyValueQualifierInCache(com.webobjects.eocontrol.EOKeyValueQualifier q)

flushUniqueCache

protected void flushUniqueCache()

nameForSet

public java.lang.String nameForSet(com.webobjects.foundation.NSSet set)

encodeObject

protected java.lang.Object encodeObject(java.lang.Object o)

decodeObject

protected java.lang.Object decodeObject(java.lang.Object o)

writeEntry

protected boolean writeEntry(ERXMultiKey key,
                             java.lang.Object value,
                             java.io.ObjectOutputStream out)
                      throws java.io.IOException
Throws:
java.io.IOException

readEntry

protected ERXMultiKey readEntry(java.util.Hashtable cache,
                                java.io.ObjectInputStream in)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

cacheToBytes

protected byte[] cacheToBytes(java.util.Hashtable cache)

cacheFromBytes

protected java.util.Hashtable cacheFromBytes(byte[] bytes)

_diagnoseCache

public void _diagnoseCache()

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.