Introduction
This project provides a core broker agent platform for Power TAC based on publish-subscribe pattern. The platform allows a developer to start building its agent from higher point of view since all low level communications with a competition server are abstracted to events (from server) and messages (to server).
Contents
The BrokerEE platform consists of 3 modules:
- BrokerEE Core – platform core;
- BrokerEE GUI – platform GUI;
- BrokerEE Agent – simple sample implementation of BrokerEE Core that uses BrokerEE GUI.
Current framework supports Power TAC Server version 0.4.
Dependencies
BrokerEE platform depends on these libraries (available as ZIP or Ivy dependencies):
- Apache Active MQ (tested with version 5.5.0): activemq-all-5.5.0.jar, camel-core-2.7.0.jar, log4j-1.2.14.jar, slf4j-log4j12-1.5.11.jar, spring-beans-3.0.3.RELEASE.jar;
- Jersey (tested with version 1.3): jackson-core-asl-1.1.1.jar, jaxb-api.jar, jersey-client-1.3.jar, jersey-core-1.3.jar, jersey-json-1.3.jar, jersey-multipart-1.3.jar, jersey-server-1.3.jar, jersey-spring-1.3.jar, jettison-1.1.jar, jsr173_api.jar, activation.jar, asm-3.1.jar, mimepull-1.4.jar, oauth-client-1.3.jar, oauth-signature-1.3.jar, jersey-core.jar;
- XStream (tested with version 1.3.1): xstream-1.3.1.jar;
- Joda-Time (tested with version 1.6.2): joda-time-1.6.2.jar;
- Hibername-validator (tested with version 4.2.0): hibernate-validator-4.2.0.Final.jar, hibernate-validator-annotation-processor-4.2.0.Final.jar, slf4j-api-1.6.1.jar, validation-api-1.0.0.GA.jar.
Quick start
Broker execution lifecycle
BrokerEE platform is based on publish-subscribe architectural style. Messages received from the Power TAC servet are turned into Events. Events are then distributed to EventListeners. In order for events to be distributed to listeners they must be registered at ServerMessageListener. Similarly, broker creates messages to be sent to server. Messages are sent using ConnectionManager.
Sample broker lifecycle scenario:
- Register custom EventListeners at ServerMessageListener to listen to competition events;
- Use ConnectionManager to connect to Power TAC server;
- Use competition data and functions provided by default managers: AbstractAccountManager, AbstractCustomerManager, AbstractTariffManager, AbstractWeatherManager and AbstractShoutManager;
- Handle competition Events received by EventListeners.
- Raise custom broker Events with ServerMessageListener;
- Send messages to PowerTAC server with ConnectionManager;
- Use ConnectionManager to disconnect from Power TAC server.
Custom implementation
The main class of the platform is AbstractBroker that contains all the default event listeners and managers. See sample implementation.
Suggested broker implementation scenario:
- Provide custom implementations for default listerers and managers: AbstractAccountManager, AbstractCustomerManager, AbstractTariffManager, AbstractWeatherManager and AbstractShoutManager;
- Provide custom implementation for AbstractBroker that uses own implementations defined above;
- Create other custom listeners and register them with AbstractBroker.BrokerContext.ConnectionManager.ServerMessageListener.addEventListener(EventListener eventListener) method;
- Create other custom Events and publish them with AbstractBroker.BrokerContext.ConnectionManager.ServerMessageListener.onEvent(Event event) method;
- Send messages to server with AbstractBroker.BrokerContext.ConnectionManager.sendMessage(javax.jms.Message message) or any other convenience method.





