|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object x10.CM17ASerialController
CM17ASerialController is an X10 Controller that bridges x10 hardware
and software by communicating via a SerialPort with the x10
"Firecracker" module.
This class requires the javax.comm package from Sun Microsystems.
Constructor Summary | |
CM17ASerialController(java.lang.String comport)
CM17ASerialController constructs and starts the Controller on the specified comport. |
Method Summary | |
void |
addCommand(Command command)
addCommand adds a command to the queue to be dispatched. |
void |
addUnitListener(UnitListener listener)
addUnitListener registers the UnitListener for events. |
protected void |
finalize()
finalize disconnects the serial port connection and closes the Controller. |
void |
removeUnitListener(UnitListener listener)
removeUnitListener unregisters the UnitListener for events. |
void |
run()
run is the thread loop that constantly blocks and writes events to the serial port to the "Firecracker" module. |
void |
shutdown(long millis)
shutdown tells the controller to finish all commands in the queue and then gracefully disconnects the serial port connection. |
void |
shutdownNow()
shutdownNow shuts down the controller and closes the serial port immediately. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CM17ASerialController(java.lang.String comport) throws java.io.IOException
comport
- the communications port in which the "Firecracker"
module is connected.
java.io.IOException
- if an error occurs while trying to connect
to the specified Communications Port.Method Detail |
public void addUnitListener(UnitListener listener)
addUnitListener
in interface Controller
listener
- the listener to register for events.UnitEvent
public void removeUnitListener(UnitListener listener)
removeUnitListener
in interface Controller
listener
- the listener to remove.public void addCommand(Command command)
addCommand
in interface Controller
command
- the Command to be dispatched.protected void finalize()
public void shutdown(long millis) throws OperationTimedOutException, java.lang.InterruptedException
millis
- the number of milliseconds to wait for a graceful shutdown.
OperationTimedOutException
- thrown if the Controller has not
completely shutdown in the amount of time specified.
java.lang.InterruptedException
- thrown if the thread is unexpectedly interruptedpublic void shutdownNow()
public void run()
run
in interface java.lang.Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |