org.wcb.autohome
Class EventsHandler

java.lang.Object
  extended byorg.wcb.autohome.EventsHandler
All Implemented Interfaces:
java.lang.Runnable, X10DeviceConstants

public class EventsHandler
extends java.lang.Object
implements java.lang.Runnable, X10DeviceConstants

Filename: $Id: EventsHandler.java,v 1.11 2004/02/25 21:38:32 wbogaardt Exp $ Abstract: The EventsHandler is a threaded daemon that runs in the background and parses through a vector and runs various events one at a time. until the stop run is called. The event runs if it meets conditions of date and time. $Log: EventsHandler.java,v $ Revision 1.11 2004/02/25 21:38:32 wbogaardt added javadocs and fixed formating for checkstyle report Revision 1.10 2004/01/16 00:53:34 wbogaardt Fixed a very obscure bug with the Macro Panel that it didn't added new x10 devices to the drop down of available x10 device for the macro. Modified Macro triggers to change the events to integer verses strings cleaner this way. Revision 1.9 2003/12/22 20:51:29 wbogaardt refactored name assignments and formatted code for readability. Revision 1.8 2003/12/19 20:51:38 wbogaardt internationalization Revision 1.7 2003/12/13 05:36:50 wbogaardt fixed javadoc comments. Revision 1.6 2003/12/11 23:10:07 wbogaardt cleaned up exception handeling and logging of system.out messages Revision 1.5 2003/10/11 04:02:06 wbogaardt fixed event handler to work again Revision 1.4 2003/10/10 18:39:09 wbogaardt changed date time information from a string to a calendar object

Version:
1.0
Author:
wbogaardt

Field Summary
 
Fields inherited from interface org.wcb.autohome.interfaces.X10DeviceConstants
APPLIANCE_MODULE_OFF, APPLIANCE_MODULE_ON, BAUD, BAUD_RATE_ARRAY, BRIGHT_ACTION, BROWSER, CM11A_TRANSMITTER, CM17A_TRANSMITTER, CONNECT_ON_START, COUNTRY, DATA_BIT, DATA_BITS_ARRAY, DEVICE_ARRAY, DIM_ACTION, EMAIL_AUTHORIZE, EMAIL_FREQUENCY, EMAIL_FROM, EMAIL_PASSWORD, EMAIL_SMTP, EMAIL_TO, EMAIL_USERNAME, FALSE, HOUSE_CODES_ARRAY, INTERFACE_TYPE, LAMP_MODULE_OFF, LAMP_MODULE_ON, LANGUAGE, LAST_FILE, LOCALHOST, LOOK_AND_FEEL, MAC, METAL, MOTIF, OFF_ACTION, ON_ACTION, PARITY, PARITY_ARRAY, RECOVER_CM11A, RMI_HOST, SEPARATOR, SERIAL_PORT, SPEECH_ENGINE, STOP_BIT, STOP_BITS_ARRAY, TEST_TRANSMITTER, TIMER_EVENT, TRIGGER_EVENT, TRUE, USER_HOME, WINDOWS
 
Constructor Summary
EventsHandler(IHAGateway gateway)
          This creates an event handler and uses the passed in interface to know if the running events can be executed.
 
Method Summary
 java.util.Vector getModel()
          Gets the events that the daemon is running this vector gets parsed every minute to determin if certain elements in the vector meet the requirements if it meets the time requirements then the event is run appropriately.
 void run()
          This is the main run method for this thread.
 void setModel(java.util.Vector items)
          Sets the events into the daemon to run this vector gets parsed every minute to determin if certain elements in the vector meet the requirements if it meets the time requirements then the event is run appropriately.
 void start()
          This is a threaded object so it must implement start method calls.
 void stop()
          This is used to stop the thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventsHandler

public EventsHandler(IHAGateway gateway)
This creates an event handler and uses the passed in interface to know if the running events can be executed.

Parameters:
gateway - The Home automation gateway, which has status of serial port connection.
Method Detail

start

public void start()
This is a threaded object so it must implement start method calls.


run

public void run()
This is the main run method for this thread.

Specified by:
run in interface java.lang.Runnable

stop

public void stop()
This is used to stop the thread. When the user click on stop running.


setModel

public void setModel(java.util.Vector items)
Sets the events into the daemon to run this vector gets parsed every minute to determin if certain elements in the vector meet the requirements if it meets the time requirements then the event is run appropriately.

Parameters:
items - - List of items/events to run.

getModel

public java.util.Vector getModel()
Gets the events that the daemon is running this vector gets parsed every minute to determin if certain elements in the vector meet the requirements if it meets the time requirements then the event is run appropriately.

Returns:
Vector - List of items/events that are running.


Copyright © 1999-2004 Walter Bogaardt. All Rights Reserved.