Package org.powertac.samplebroker
Class ContextManagerService
java.lang.Object
org.powertac.samplebroker.ContextManagerService
- All Implemented Interfaces:
org.powertac.samplebroker.interfaces.Initializable
@Service public class ContextManagerService extends Object implements org.powertac.samplebroker.interfaces.Initializable
Handles incoming context and bank messages with example behaviors.
- Author:
- John Collins
-
Constructor Summary
Constructors Constructor Description ContextManagerService() -
Method Summary
Modifier and Type Method Description voidhandleMessage(Properties serverProps)Receives the server configuration properties.voidhandleMessage(org.powertac.common.BankTransaction btx)BankTransaction represents an interest payment.voidhandleMessage(org.powertac.common.CashPosition cp)CashPosition updates our current bank balance.voidhandleMessage(org.powertac.common.Competition comp)Handles the Competition instance that arrives at beginning of game.voidhandleMessage(org.powertac.common.msg.DistributionReport dr)DistributionReport gives total consumption and production for the timeslot, summed across all brokers.voidinitialize(org.powertac.samplebroker.interfaces.BrokerContext broker)
-
Constructor Details
-
ContextManagerService
public ContextManagerService()
-
-
Method Details
-
initialize
public void initialize(org.powertac.samplebroker.interfaces.BrokerContext broker)- Specified by:
initializein interfaceorg.powertac.samplebroker.interfaces.Initializable
-
handleMessage
public void handleMessage(org.powertac.common.BankTransaction btx)BankTransaction represents an interest payment. Value is positive for credit, negative for debit. -
handleMessage
public void handleMessage(org.powertac.common.CashPosition cp)CashPosition updates our current bank balance. -
handleMessage
public void handleMessage(org.powertac.common.msg.DistributionReport dr)DistributionReport gives total consumption and production for the timeslot, summed across all brokers. -
handleMessage
public void handleMessage(org.powertac.common.Competition comp)Handles the Competition instance that arrives at beginning of game. Here we capture all the customer records so we can keep track of their subscriptions and usage profiles. -
handleMessage
Receives the server configuration properties.
-