de.uka.ipd.consensus.foundation.scoring
Interface ScoringListener

All Superinterfaces:
EventListener
All Known Implementing Classes:
DynamicRightsManagerImpl, ScoringAdapter, ScoringListenerImpl

public interface ScoringListener
extends EventListener

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):

The Properties parameter contains all entries from ConsensusFoundation.properties.

Version:
2006-06-14
Author:
Thomas Much
See Also:
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

score

public void score(ScoringEvent event)
In this method a ScoringListener can change the user's score. It is called by the IncentiveManager.

See Also:
User.getScore(), User.setScore(double)

scored

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.

See Also:
User.getScore()