Oracle Fusion Middleware Java API Reference for Oracle Business Rules
11g Release 1 (11.1.1.7)

E10663-11

oracle.rules.sdk2.dictionary
Class AbstractDictionaryFinder

java.lang.Object
  extended by oracle.rules.sdk2.dictionary.AbstractDictionaryFinder
All Implemented Interfaces:
java.io.Serializable, DictionaryFinder
Direct Known Subclasses:
DecisionPointDictionaryFinder

public abstract class AbstractDictionaryFinder
extends java.lang.Object
implements DictionaryFinder

The base implementation of the DictionaryFinder interface. Concrete DictionaryFinder implementations should extend this class and implement the findDictionaryWithThisFinder method.

A concrete implementation should also override the canDetectChanges, mustPollForChanges, getModificationTime methods as necessary to reflect the behavior of the finder. These methods define how the finder interacts with the DictionaryLoader class when that class is used to load dictionaries. If the finder can not detect changes in the dictionaries it finds, then DictionaryLoader ignores it when determining if a dictionary needs to be reloaded. If mustPollForChanges returns true, then DictionaryFinder will synchronously poll the finder to see if a dictionary it found has been updated by invoking getModificationTime. Such a finder must override the getModificationTime method. Otherwise, DictionaryLoader expects asynchronous notification of changes from the finder. The finder invokes the DictionaryLoader.setReloadNeeded(DictionaryFQN fqn) method to notify that a dictionary was updated (a reference to the DictionaryLoader instance is available in this class).

See Also:
DictionaryLoader, Serialized Form

Field Summary
 
Fields inherited from interface oracle.rules.sdk2.dictionary.DictionaryFinder
serialVersionUID
 
Method Summary
 boolean canDetectChanges()
          Indicates whether this finder is able to detect changes in the dictionaries that are found by this finder.
 RuleDictionary findDictionary(DictionaryFQN fqn)
          Finds a rule dictionary specified by its fully qualified name.
 RuleDictionary findDictionary(java.lang.String pkg, java.lang.String name)
          Finds a rule dictionary specified by the package and name.
abstract  RuleDictionary findDictionaryWithThisFinder(DictionaryFQN fqn)
          Finds a rule dictionary with this finder.
 AbstractDictionaryFinder getChild()
          Returns the child finder or null if this finder does not have a child.
 AbstractDictionaryFinder getLastChild()
          Returns the last (leaf) child finder or this finder if this finder does not have a child.
 long getModificationTime(DictionaryFQN fqn)
          Returns a time in milliseconds indicating when the dictionary indentified by the DictionaryFQN was last modified.
 AbstractDictionaryFinder getParent()
          Returns the parent finder or null if this finder does not have a parent.
 boolean mustPollForChanges()
          Indicates whether this finder must be polled to determine if a dictionary has been updated.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getParent

public AbstractDictionaryFinder getParent()
Returns the parent finder or null if this finder does not have a parent.

Returns:
the parent finder or null if this finder does not have a parent.

getChild

public AbstractDictionaryFinder getChild()
Returns the child finder or null if this finder does not have a child.

Returns:
the child finder or null if this finder does not have a child.

getLastChild

public AbstractDictionaryFinder getLastChild()
Returns the last (leaf) child finder or this finder if this finder does not have a child.

Returns:
the last (leaf) child finder or this finder if this finder does not have a child.

findDictionary

public RuleDictionary findDictionary(java.lang.String pkg,
                                     java.lang.String name)
Finds a rule dictionary specified by the package and name.

Specified by:
findDictionary in interface DictionaryFinder
Parameters:
pkg - fully qualified package name, e.g. foo.bar
name - unqualified name, e.g. MyDic
Returns:
the rule dictionary or null if the dictionary can not be found.

findDictionary

public RuleDictionary findDictionary(DictionaryFQN fqn)
Finds a rule dictionary specified by its fully qualified name.

Specified by:
findDictionary in interface DictionaryFinder
Parameters:
fqn - DictionaryFQN
Returns:
the rule dictionary or null if the dictionary can not be found.

findDictionaryWithThisFinder

public abstract RuleDictionary findDictionaryWithThisFinder(DictionaryFQN fqn)
Finds a rule dictionary with this finder. Returns the dictionary identified by the specified fully qualified name or null if the dictionary can not be found.

This method is implemented by each concrete DictionaryFinder implementation. This method should always return a new handle for the dictionary it finds.

Parameters:
fqn - the fully qualified name of the dictionary to find.
See Also:
RuleDictionary.createHandle()

canDetectChanges

public boolean canDetectChanges()
Indicates whether this finder is able to detect changes in the dictionaries that are found by this finder. The default is true, indicating that changes can be detected. This method should be overridden by if the finder is unable to detect changes. This method is invoked from DictionaryLoader.

Returns:
true if changes to dictionaries found by this finder can be detected.
See Also:
DictionaryLoader

mustPollForChanges

public boolean mustPollForChanges()
Indicates whether this finder must be polled to determine if a dictionary has been updated. The default is true, indicating that polling is required. This method should be overridden by a finder that can asynchronously notify that a dictionary has been updated. This method is invoked from DictionaryLoader.

Returns:
true if polling for dictionary updates is required.
See Also:
DictionaryLoader, DictionaryLoader.setReloadNeeded(oracle.rules.sdk2.repository.DictionaryFQN)

getModificationTime

public long getModificationTime(DictionaryFQN fqn)
Returns a time in milliseconds indicating when the dictionary indentified by the DictionaryFQN was last modified. The default value of 0 is returned. This method should be overridden by a finder that must be polled for changes. This method is invoked from DictionaryLoader.

Returns:
the time in milliseconds of the last update to the dictionary.
See Also:
DictionaryLoader

Oracle Fusion Middleware Java API Reference for Oracle Business Rules
11g Release 1 (11.1.1.7)

E10663-11

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.