ERD2WModel Class Reference

Inherits com::webobjects::directtoweb::D2WModel.

Collaboration diagram for ERD2WModel:

Collaboration graph
[legend]

List of all members.

Classes

class  _LhsKeysCallback

Public Member Functions

void _diagnoseCache ()
void addRule (Rule rule)
void addRules (NSArray rules)
void applicationDidFinishLaunching (NSNotification n)
void applicationWillDispatchRequest (NSNotification n)
NSArray availablePageConfigurations ()
NSArray availableTasks ()
NSArray canidateRuleSetForRHSInContext (String rhs, D2WContext context)
void clearD2WRuleCache (NSNotification n)
void clearD2WRuleCache ()
void dumpCache (String fileName)
 ERD2WModel (URL url)
Vector modelFilesInBundles ()
Vector modelFilesPathURLsInBundles ()
String nameForSet (NSSet set)
void prepareDataStructures ()
void removeRule (Rule rule)
void resetModel ()
void restoreCache (String fileName)
NSArray rules ()

Static Public Member Functions

static ERD2WModel erDefaultModel ()

Static Public Attributes

static final Logger log = Logger.getLogger(ERD2WModel.class)
static final String ModelWillReset = "ModelWillReset"
static final Logger ruleDecodeLog = Logger.getLogger("er.directtoweb.rules.decode")
static final Logger ruleTraceEnabledLog = Logger.getLogger("er.directtoweb.rules.ERD2WTraceRuleFiringEnabled")
static final String WillSortRules = "WillSortRules"

Protected Member Functions

void _addKeyToVector (String key, Vector vector)
NSSet _addKeyToVectorKeysToTakeLiterally ()
boolean _shouldUseCacheForFiringRuleForKeyPathInContext (final String keyPath, final D2WContext context)
EOAndQualifier andQualifierInCache (EOAndQualifier q)
Assignment assignmentContainedInVector (Assignment a1, Vector v)
Hashtable cacheFromBytes (byte[] bytes)
byte[] cacheToBytes (Hashtable cache)
File currentFile ()
Object decodeObject (Object o)
String descriptionForRule (Rule r)
String descriptionForRuleSet (NSArray set)
Object encodeObject (Object o)
 ERD2WModel (EOKeyValueUnarchiver unarchiver)
 ERD2WModel (File file)
 ERD2WModel (NSArray rules)
Object fireRuleForKeyPathInContext (String keyPath, D2WContext context)
Object fireSystemRuleForKeyPathInContext (String keyPath, D2WContext context)
void flushUniqueCache ()
void invalidateCaches ()
EOKeyValueQualifier keyValueQualifierInCache (EOKeyValueQualifier q)
void mergeFile (File modelFile)
void mergePathURL (URL modelURL)
EONotQualifier notQualifierInCache (EONotQualifier q)
EOOrQualifier orQualifierInCache (EOOrQualifier q)
EOQualifier qualifierContainedInEnumeration (EOQualifierEvaluation q1, Enumeration e)
EOQualifier qualifierInCache (EOQualifier q)
ERXMultiKey readEntry (Hashtable cache, ObjectInputStream in) throws IOException, ClassNotFoundException
void setCurrentFile (File currentFile)
void sortRules ()
void uniqueQualifiers (NSArray rules)
void uniqueRuleAssignments (NSArray rules)
boolean writeEntry (ERXMultiKey key, Object value, ObjectOutputStream out) throws IOException

Static Protected Member Functions

static NSDictionary dictionaryFromPathUrl (URL url)

Protected Attributes

File _currentFile
Hashtable _filePathRuleTraceCache
Hashtable _uniqueAndQualifiers = new Hashtable()
Hashtable _uniqueAssignments = new Hashtable()
Hashtable _uniqueKeyValueQualifiers = new Hashtable()
Hashtable _uniqueNotQualifiers = new Hashtable()
Hashtable _uniqueOrQualifiers = new Hashtable()
int totalQualifiers = 0
int uniquedQualifiers = 0

Static Protected Attributes

static final String ATTRIBUTE_PREFIX = "::ATTRIBUTE::"
static final String ENTITY_PREFIX = "::ENTITY::"
static final String RELATIONSHIP_PREFIX = "::RELATIONSHIP::"

Static Package Functions

 [static initializer]

Static Package Attributes

static NSMutableArray BACKSTOP_KEYS = new NSMutableArray(new Object[] { "pageConfiguration", "entity", "task" })

Private Member Functions

NSArray< StringadditionalModelNames ()
NSArray< URL > additionalModelURLs ()
Object fireRuleForKeyPathInContext (Map cache, String keyPath, D2WContext context)

Static Private Member Functions

static NSArray ruleSortOrderingKeyArray ()

Private Attributes

Hashtable _cache = new Hashtable(10000)
boolean _hasAddedExtraModelFiles = false
Hashtable _significantKeysPerKey = new Hashtable(500)
Hashtable _systemCache = new Hashtable(10000)

Static Private Attributes

static final NSSet _addKeyToVectorDefaultKeysToTakeLiterally = new NSSet(new Object[] { "object", "session" })
static D2WModel _defaultModel
static final EOSortOrdering _descriptionSortOrdering = new EOSortOrdering("toString",EOSortOrdering.CompareDescending)
static final EOSortOrdering _prioritySortOrdering = new EOSortOrdering("priority",EOSortOrdering.CompareDescending)
static final Object NULL_VALUE = "<NULL>"


Detailed Description

Overhaul of the caching system.

Constructor & Destructor Documentation

ERD2WModel ( NSArray  rules  )  [protected]

Main constructor. Builds a model for a given set of rules.

Parameters:
rules array of rules

ERD2WModel ( File  file  )  [protected]

ERD2WModel ( URL  url  ) 

ERD2WModel ( EOKeyValueUnarchiver  unarchiver  )  [protected]


Member Function Documentation

[static initializer] (  )  [static, package]

void _addKeyToVector ( String  key,
Vector  vector 
) [protected]

NSSet _addKeyToVectorKeysToTakeLiterally (  )  [protected]

void _diagnoseCache (  ) 

boolean _shouldUseCacheForFiringRuleForKeyPathInContext ( final String  keyPath,
final D2WContext  context 
) [protected]

NSArray<String> additionalModelNames (  )  [private]

NSArray<URL> additionalModelURLs (  )  [private]

void addRule ( Rule  rule  ) 

void addRules ( NSArray  rules  ) 

EOAndQualifier andQualifierInCache ( EOAndQualifier  q  )  [protected]

void applicationDidFinishLaunching ( NSNotification  n  ) 

void applicationWillDispatchRequest ( NSNotification  n  ) 

Assignment assignmentContainedInVector ( Assignment  a1,
Vector  v 
) [protected]

NSArray availablePageConfigurations (  ) 

NSArray availableTasks (  ) 

Hashtable cacheFromBytes ( byte[]  bytes  )  [protected]

byte [] cacheToBytes ( Hashtable  cache  )  [protected]

NSArray canidateRuleSetForRHSInContext ( String  rhs,
D2WContext  context 
)

void clearD2WRuleCache ( NSNotification  n  ) 

void clearD2WRuleCache (  ) 

File currentFile (  )  [protected]

Object decodeObject ( Object  o  )  [protected]

String descriptionForRule ( Rule  r  )  [protected]

String descriptionForRuleSet ( NSArray  set  )  [protected]

static NSDictionary dictionaryFromPathUrl ( URL  url  )  [static, protected]

void dumpCache ( String  fileName  ) 

Means to dump the cache. You shouldn't use this unless you know what you are doing.

Object encodeObject ( Object  o  )  [protected]

static ERD2WModel erDefaultModel (  )  [static]

Gets the default D2W model cast as an ERD2WModel.

Returns:
the default ERD2Model

Object fireRuleForKeyPathInContext ( Map  cache,
String  keyPath,
D2WContext  context 
) [private]

Object fireRuleForKeyPathInContext ( String  keyPath,
D2WContext  context 
) [protected]

Object fireSystemRuleForKeyPathInContext ( String  keyPath,
D2WContext  context 
) [protected]

void flushUniqueCache (  )  [protected]

void invalidateCaches (  )  [protected]

EOKeyValueQualifier keyValueQualifierInCache ( EOKeyValueQualifier  q  )  [protected]

void mergeFile ( File  modelFile  )  [protected]

void mergePathURL ( URL  modelURL  )  [protected]

Vector modelFilesInBundles (  ) 

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.

String nameForSet ( NSSet  set  ) 

EONotQualifier notQualifierInCache ( EONotQualifier  q  )  [protected]

EOOrQualifier orQualifierInCache ( EOOrQualifier  q  )  [protected]

void prepareDataStructures (  ) 

EOQualifier qualifierContainedInEnumeration ( EOQualifierEvaluation  q1,
Enumeration  e 
) [protected]

EOQualifier qualifierInCache ( EOQualifier  q  )  [protected]

ERXMultiKey readEntry ( Hashtable  cache,
ObjectInputStream  in 
) throws IOException, ClassNotFoundException [protected]

void removeRule ( Rule  rule  ) 

void resetModel (  ) 

void restoreCache ( String  fileName  ) 

Means to restore the cache. You shouldn't use this unless you know what you are doing.

NSArray rules (  ) 

static NSArray ruleSortOrderingKeyArray (  )  [static, private]

void setCurrentFile ( File  currentFile  )  [protected]

void sortRules (  )  [protected]

void uniqueQualifiers ( NSArray  rules  )  [protected]

void uniqueRuleAssignments ( NSArray  rules  )  [protected]

boolean writeEntry ( ERXMultiKey  key,
Object  value,
ObjectOutputStream  out 
) throws IOException [protected]


Member Data Documentation

final NSSet _addKeyToVectorDefaultKeysToTakeLiterally = new NSSet(new Object[] { "object", "session" }) [static, private]

Hashtable _cache = new Hashtable(10000) [private]

File _currentFile [protected]

D2WModel _defaultModel [static, private]

final EOSortOrdering _descriptionSortOrdering = new EOSortOrdering("toString",EOSortOrdering.CompareDescending) [static, private]

Hashtable _filePathRuleTraceCache [protected]

boolean _hasAddedExtraModelFiles = false [private]

final EOSortOrdering _prioritySortOrdering = new EOSortOrdering("priority",EOSortOrdering.CompareDescending) [static, private]

Hashtable _significantKeysPerKey = new Hashtable(500) [private]

Hashtable _systemCache = new Hashtable(10000) [private]

Hashtable _uniqueAndQualifiers = new Hashtable() [protected]

Hashtable _uniqueAssignments = new Hashtable() [protected]

Hashtable _uniqueKeyValueQualifiers = new Hashtable() [protected]

Hashtable _uniqueNotQualifiers = new Hashtable() [protected]

Hashtable _uniqueOrQualifiers = new Hashtable() [protected]

final String ATTRIBUTE_PREFIX = "::ATTRIBUTE::" [static, protected]

NSMutableArray BACKSTOP_KEYS = new NSMutableArray(new Object[] { "pageConfiguration", "entity", "task" }) [static, package]

final String ENTITY_PREFIX = "::ENTITY::" [static, protected]

final Logger log = Logger.getLogger(ERD2WModel.class) [static]

logging support

final String ModelWillReset = "ModelWillReset" [static]

final Object NULL_VALUE = "<NULL>" [static, private]

null refernced used to represent null in the caching system

final String RELATIONSHIP_PREFIX = "::RELATIONSHIP::" [static, protected]

final Logger ruleDecodeLog = Logger.getLogger("er.directtoweb.rules.decode") [static]

logs rules being decoded

final Logger ruleTraceEnabledLog = Logger.getLogger("er.directtoweb.rules.ERD2WTraceRuleFiringEnabled") [static]

main category for enabling or disabling tracing of rules

int totalQualifiers = 0 [protected]

int uniquedQualifiers = 0 [protected]

final String WillSortRules = "WillSortRules" [static]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:42:48 2012 for Project Wonder by  doxygen 1.5.8