dk.deepthought.sidious.goalhandler
Class GoalHandlerEngine

java.lang.Object
  extended by dk.deepthought.sidious.util.SidiousQueue<SuperLinkID>
      extended by dk.deepthought.sidious.goalhandler.GoalHandlerEngine
All Implemented Interfaces:
GoalHandler

public class GoalHandlerEngine
extends SidiousQueue<SuperLinkID>
implements GoalHandler

This class prioritizes goals and chooses which are to be sent to the BlackBoard.

The class extends the sidious queue and process goals asynchronously.

Author:
Deepthought

Field Summary
private static GoalHandler INSTANCE
          Private Singleton instance.
private static org.apache.commons.logging.Log logger
          Logger for this class
 
Constructor Summary
private GoalHandlerEngine()
          Private constructor to facilitate singleton property.
 
Method Summary
static GoalHandler getInstance()
          Returns the singleton instance of this goal handler.
 Goal getTopPriorityGoal(SuperLinkID id)
          This method retrieves the top goal for a given SuperLinkID.
protected  void process(SuperLinkID item)
          The processing of an item.
 void request(SuperLinkID id)
          Request a goal to be extracted from requester with specified id.
 
Methods inherited from class dk.deepthought.sidious.util.SidiousQueue
enqueue, interrupt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final org.apache.commons.logging.Log logger
Logger for this class


INSTANCE

private static final GoalHandler INSTANCE
Private Singleton instance.

Constructor Detail

GoalHandlerEngine

private GoalHandlerEngine()
Private constructor to facilitate singleton property.

Method Detail

getTopPriorityGoal

public Goal getTopPriorityGoal(SuperLinkID id)
Description copied from interface: GoalHandler
This method retrieves the top goal for a given SuperLinkID.

Specified by:
getTopPriorityGoal in interface GoalHandler
Parameters:
id - the id to retrieve the top goal for
Returns:
the top goal

getInstance

public static GoalHandler getInstance()
Returns the singleton instance of this goal handler.

Returns:
the singleton instance

request

public final void request(SuperLinkID id)
Description copied from interface: GoalHandler
Request a goal to be extracted from requester with specified id. This request is added to the requester queue.

Specified by:
request in interface GoalHandler
Parameters:
id - the id of the requester

process

protected void process(SuperLinkID item)
Description copied from class: SidiousQueue
The processing of an item.

Specified by:
process in class SidiousQueue<SuperLinkID>
Parameters:
item - the item to be processed.


Copyright © Deepthought Development - All Rights Reserved.