net.sf.blunder
Class RelationResolver
java.lang.Object
net.sf.blunder.RelationResolver
public class RelationResolver
- extends Object
This is where magic happens, this class is responsible for dealing
with errors.
This class is for internal use of Blunder.
- Author:
- Ambrosi Lucas
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RelationResolver
public RelationResolver()
lookupRelation
public ExceptionRelation lookupRelation(Blunder blunder)
- Seeks the object representing the relationship for the
chained exception.
The search in the knowledge base is done through the following
algorithm. At each step, if it doesn't find any results that
match the current context error, continue with the next step.
-
Tries to find a context with the three main elements, Leaf, Root and Business.
-
If no match is found or doesn't meet the conditions, then try to find a
context with the components, Leaf and Root.
-
Then, it tries to find a context with the components Leaf and Business.
-
Then tries to find a context with the compoent Leaf.
-
Then tries to find a context with the compoent Root.
-
And finally if none of those steps could solve the context, then it resolves
with the default context. It is the one with the ID 0 (zero).
Always is verified the expression in CONDITIONS and the availability of the
context in runtime (MATCH_AT_RUNTIME='true').
The main idea behind this series of steps is the generalization. Start with
a search as specific as possible and go generalizing step by step. For example
it is not necessary that all fields match the current situation; so we could
take as rule that every chained exception that was originally generated by a
SocketException
is a comunication problem, therefore we would
like to address as a server error and suggest to the user to retry again in a
few minutes. For this, we should specify a context with only this exception as
root and all others learned contexts with SocketException
as
Root should be marked as MATCH_AT_RUNTIME='false'.
- Returns:
- The
ExceptionRelation
that matches the current chained exception. - See Also:
ExceptionRelation
getBlunderPersistenceService
public BlunderPersistenceService getBlunderPersistenceService()
setBlunderPersistenceService
public void setBlunderPersistenceService(BlunderPersistenceService blunderPersistenceService)
Copyright © 2009 Blunder. All Rights Reserved.