Hacking Java EE 5 is good for the environment!
GreenFire.dev.java.net is an opensource project which goal is to manage heating systems in convenient and efficient way. It is acually a bunch of ejb-jars (created with Netbeans 5.5, 5.5.1, and 6.0) which are
deployed as an EAR to Glassfish v2. GreenFire abstracts early from the proprietary vendor extensions - the whole management is heating system independent. GreenFire consists of the following building blocks:
Diagram created with Netbeans UML plugin.
GreenFire wakes up every 5 minutes (the archiver, actually the heartbeat - implemented by a timer bean) completes the following tasks:
- It gathers the data (heating + configuration, weather forecast) and passes it to the „brain“
- The brain is asked what to do (heating on/off, etc.)
- The decision is passed to the integration layer and executed
- All the data is stored in the Derby DB and can be used in reports.
The „brain“ dowloads a script from an URL (Glassfish as well). It has access to all the data (JPA entities) and can decide what to do.
The data in the JavaDB is used for reports and monitoring independently (it stores every 5 minutes all the data since about 2 years – and performs still very well -> no problems).
The Reporting-UI is accessing JavaDB to read the decisions and interesting data like external temperature, weather etc. – not directly the heating system (decoupling – the serial port seems not to be thread safe).
However the current data is broadcasted every five minutes using JMS internally (inside the application server) the shoal.dev.java.net / fishfarm.dev.java.net framework as well and can be accessed with every device (currently multi-media system, PCs, working on Java ME) over W-LAN. Even the following widget is updated by the JMS/Shoal heartbeat:
The rules for the heating should be changed without redeploying and especially recompiling the application.
For the implementation the Fluid Kernel, Persistent Anemic Objects, Lookup Utility etc.. pattern were used (see: http://p4j5.dev.java.net).
may i ask how you where able to collect data from your house; temperature, solar energy gain , etc? And also, how did you pass this data on to your JAVA program?
Posted by Aric Holland on May 02, 2008 at 04:31 AM CEST #
I'm in particular interested in the integration part where java meets the hardware.
What kind of electronics did you use ? Any hints/recommendations for further investigations ?
Posted by MM on September 09, 2009 at 08:20 PM CEST #