com.monad.homerun.objmgt
Interface DeviceHandler


public interface DeviceHandler

DeviceHandler is the most abstract interface for handler classes representing devices. SubInterfaces detail the communication API between the device and its handler.


Method Summary
 boolean addDevice(ObjectRuntime device)
          Add a device to the set serviced by this handler.
 void init(java.util.Properties props)
          Perform any initialization required to operate, possibly based on passed properties.
 boolean processCommand(java.lang.String deviceName, java.lang.String command, java.util.Map<java.lang.String,java.lang.Object> args)
          Process a device command
 void removeDevice(ObjectRuntime device)
          Remove a device being serviced by this handler.
 

Method Detail

init

void init(java.util.Properties props)
Perform any initialization required to operate, possibly based on passed properties. Note that if no properties are identified/required, 'props' may be empty. init() may be called repeatedly after the device has been instantiated, with calls after the first having the sense of a 'reset' operation. The mechanics of the initialization/reset are device-dependent.

Parameters:
props - handler properties, may be null

addDevice

boolean addDevice(ObjectRuntime device)
Add a device to the set serviced by this handler.

Parameters:
device - the runtime of device being handled

removeDevice

void removeDevice(ObjectRuntime device)
Remove a device being serviced by this handler.

Parameters:
device - the runtime of device to be removed

processCommand

boolean processCommand(java.lang.String deviceName,
                       java.lang.String command,
                       java.util.Map<java.lang.String,java.lang.Object> args)
                       throws java.io.IOException
Process a device command

Parameters:
deviceName - the name of the device
command - the command code
args - optional command arguments, may be null
Throws:
java.io.IOException


Copyright © 2006-2009 Richard Rodgers. All Rights Reserved.