|
BEA Systems, Inc. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.beasys.commerce.axiom.reasoning.rules.service.ContextWrapper
Implements a wrapper for vendor-specific contexts
| Field Summary | |
protected long |
creationTime
The creation time |
protected long |
expirationAge
The expiration Age |
protected int |
expirationPolicy
The expiration policy |
protected long |
expirationUseCount
The use count limit |
static int |
EXPIRE_CONTEXT_AT_AGE
The code for the "age-limit-reached" context expiration policy |
static int |
EXPIRE_CONTEXT_AT_USE_COUNT
The code for the "use-limit-reached" context expiration policy |
static int |
EXPIRE_CONTEXT_NEVER
The code for the "never" context expiration policy |
protected long |
useCount
The use count |
protected com.beasys.commerce.axiom.reasoning.rules.serviceProvider.Context |
wrappedContext
The wrapped context |
| Constructor Summary | |
ContextWrapper()
Constructor |
|
| Method Summary | |
void |
addObject(java.lang.Object object)
Adds an object to the context's working memory. |
int |
fireAllRules()
Fires all of the rules which are active for the context. |
int |
fireRules(int maxRules)
Fires rules until there are no more to fire or until maxRules rules have been fired. |
boolean |
getExpired()
Gets the expired property |
java.util.Set |
getObjects(java.lang.Class filter)
Gets a filtered list of objects from the context |
long |
getUseCount()
Gets the use count |
void |
halt()
Halts firing of rules. |
void |
incrementUseCount()
Increments the usage count |
void |
initialize()
Initializes the context. |
void |
release()
Release the context and any resources it might be using. |
void |
removeAllObjects()
Removes all objects from the context's working memory. |
void |
resetUseCount()
Resets the use count to zero |
void |
setCreationTime()
Sets the creation time |
void |
setExpirationAge(long expirationAge)
Sets the expiration age |
void |
setExpirationPolicy(int expirationPolicy)
Sets the expiration policy |
void |
setExpirationUseCount(long expirationUseCount)
Sets the expiration use count |
void |
setWrappedContext(com.beasys.commerce.axiom.reasoning.rules.serviceProvider.Context wrappedContext)
Sets the wrapped context |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int EXPIRE_CONTEXT_NEVER
public static final int EXPIRE_CONTEXT_AT_AGE
public static final int EXPIRE_CONTEXT_AT_USE_COUNT
protected long creationTime
protected long expirationAge
protected int expirationPolicy
protected long expirationUseCount
protected long useCount
protected com.beasys.commerce.axiom.reasoning.rules.serviceProvider.Context wrappedContext
| Constructor Detail |
public ContextWrapper()
| Method Detail |
public void addObject(java.lang.Object object)
throws java.lang.IllegalArgumentException,
RulesServiceException
object - The object to be added.java.lang.IllegalArgumentException - Thrown if object is nullRulesServiceException - Thrown if unable to add the object
public int fireAllRules()
throws RulesServiceException
RulesServiceException - Thrown if unable to fire all of the rules.
public int fireRules(int maxRules)
throws java.lang.IllegalArgumentException,
RulesServiceException
maxRules - The maximum number of rules to firejava.lang.IllegalArgumentException - Thrown if maxRules is negativeRulesServiceException - Thrown if unable to fire the rulespublic boolean getExpired()
public java.util.Set getObjects(java.lang.Class filter)
throws java.lang.IllegalArgumentException,
RulesServiceException
clsFilter - the list of Classes which describe what type of
objects to return from the working memory.java.lang.IllegalArgumentException - Thrown if filter is nullRulesServiceException - Thrown if unable to get objectspublic long getUseCount()
public void halt()
throws RulesServiceException
RulesServiceException - Thrown if unable to halt
(e.g. the context does not support 'halts')public void incrementUseCount()
public void initialize()
throws RulesServiceException
RulesServiceException - Thrown if unable to initialize.
public void release()
throws RulesServiceException
RulesServiceException - thrown if an error occurs during the release
public void removeAllObjects()
throws RulesServiceException
RulesServiceException - Thrown if unable to remove all objectspublic void resetUseCount()
public void setCreationTime()
public void setExpirationAge(long expirationAge)
throws java.lang.IllegalArgumentException
expirationAge - The expiration agejava.lang.IllegalArgumentException - Thrown if expirationAge is negative
public void setExpirationPolicy(int expirationPolicy)
throws java.lang.IllegalArgumentException
expirationPolicy - The expiration policyjava.lang.IllegalArgumentException - Thrown if expirationPolicy is invalid
public void setExpirationUseCount(long expirationUseCount)
throws java.lang.IllegalArgumentException
expirationUseCount - The expiration use countjava.lang.IllegalArgumentException - Thrown if expirationUseCount is negative
public void setWrappedContext(com.beasys.commerce.axiom.reasoning.rules.serviceProvider.Context wrappedContext)
throws java.lang.IllegalArgumentException
wrappedContext - The wrapped contextjava.lang.IllegalArgumentException - Thrown if wrappedContext is null
|
BEA Systems, Inc. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||