|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The listener interface for receiving events that might change the user's score.
You don't have to register listeners on the several ConsensusFoundation modules,
but only a single ScoringListener
on the IncentiveManager
.
You can distinguish different event types with the ScoringEvent.getId()
method.
To register a scoring listener, create an instance of an imlementing class and register
it with IncentiveManager.addScoringListener()
anytime after the IncentiveManager
has been set up successfully (e.g. in a custom IncentiveManager
implementation at the end of an
overwritten init()
or initCompleted()
method).
The easiest way to register scoring listeners is to add the "cf.scoringlistener
" key
to the ConsensusFoundation.properties
configuration file and list all required listener classes
as its value (a comma separated list):
cf.scoringlistener=mypackage1.MyFirstScoringListenerImpl,mypackage2.MySecondScoringListenerImpl,...
These listeners will be loaded by IncentiveManager.initCompleted()
. Instantiation will only be
successful if one of the following constructors is available (the first one that matches will be used):
MyScoringListener(Properties config, ConsensusFoundationManager cfm)
MyScoringListener(ConsensusFoundationManager cfm)
MyScoringListener()
Properties
parameter contains all entries from ConsensusFoundation.properties
.
IncentiveManager
,
ScoringEvent.getId()
,
ConsensusFoundation.CF_SCORING_KEY
,
ConsensusFoundationManager
Method Summary | |
void |
score(ScoringEvent event)
In this method a ScoringListener can change the user's score. |
void |
scored(ScoringEvent event)
This method is called after all listener's score() methods have been called for this ScoringEvent. |
Method Detail |
public void score(ScoringEvent event)
User.getScore()
,
User.setScore(double)
public void scored(ScoringEvent event)
This method is called after all listener's score()
methods have been called for this ScoringEvent.
Do not change the user's score here! This method is intended to be used for calculations based upon the finished scoring for this ScoringEvent, e.g. calculating the user's roles/rights.
User.getScore()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |