agentland.device
Class UniversalDeviceAgent
java.lang.Object
|
+--java.rmi.server.RemoteObject
|
+--java.rmi.server.RemoteServer
|
+--java.rmi.server.UnicastRemoteObject
|
+--metaglue.AgentAgent
|
+--agentland.util.GoodAgent
|
+--agentland.resource.ManagedAgent
|
+--agentland.device.DeviceAgent
|
+--agentland.device.UniversalDeviceAgent
- All Implemented Interfaces:
- Agent, Device, Good, Managed, MetagluePrimitives, Remote, Serializable, Spy, UniversalDevice
- public class UniversalDeviceAgent
- extends DeviceAgent
- implements UniversalDevice
This class should be the superclass of all Universal device
controllers. Universal device controllers do not do any work by
themselves but delegate it to the appropirate controller. What
controller is doing the actual work is decided by the value of the
attribute "device". Why is it useful? Just look: in Michael's
office the VCR is controlled over IR. In the new conference room it
will probably be controlled over RS232. Instead of hardcoding what
controller to rely on in each case, you always rely on UniversalVCR
and this will grab whatever controller is supposed to do the work
in a given space.
- See Also:
DeviceAgent
,
UniversalDevice
, Serialized Form
Method Summary |
protected boolean |
checkMulti(String devName)
A little tool for subclasses -- should be called by subclasses that implement both UniversalDevice and MultiDevice in cases where a named call is made. |
AgentID |
getActualDevice()
|
boolean |
startSpeech()
If possible, this method should load appropriate speech control
for the device. |
Methods inherited from class agentland.device.DeviceAgent |
addName, createStateChangeNotification, ensureState, getDefaultNames, getDefaultStateName, getName, getNames, getState, getState, getStateNames, hasName, quietException, resetAllStates, resetName, resetState, resetState, setDefaultStateName, setName, setState, throwException, updateState, updateState, updateState, updateState, updateState, updateState, updateState, updateState |
Methods inherited from class agentland.resource.ManagedAgent |
connect, getAlert, getNeed, isAvailable, isAvailable, reliesOn, reliesOn, replace, replace, request, request, request, requestAgent, requestAgent, resources, resourcesByAgentID, setNeed, tiedTo, yank, yank, yank |
Methods inherited from class agentland.util.GoodAgent |
addSpy, addSpy, alert, alertString, beep, error, getHistory, getHistoryElement, getPersistentMap, log, notify, removeSpy, removeSpy, resetHistory, safeRely, safeRely, safeRely, setNiceLogName, tell |
Methods inherited from class metaglue.AgentAgent |
addMonitor, alive, defrost, defrostAll, defrostBoolean, defrostInt, defrostString, fixAttribute, fixAttribute, freeze, freeze, freeze, freezeAll, freezeVar, getAgentID, getAttribute, getCatalog, getCatalogID, getDesignation, getFrozenVariables, getLogLevel, getMetaglueAgent, getMetaglueAgentID, getOccupation, getProperties, getSociety, log, log, lookupClass, obtainMetaglueAgent, obtainMetaglueAgent, obtainMetaglueAgentByName, reliesOn, reliesOnSynch, removeFrozen, replaceExceptionHandler, setFreezeName, setLogLevel, setLogName, shutdown, startAgent, startAgentOn, startAgentOn, startup, status, tiedTo, tiedTo, tiedTo, tiedTo, tieToDesignation, whereAreYou |
Methods inherited from interface agentland.device.Device |
addName, getName, getNames, getState, getState, getStateNames, hasName, resetAllStates, resetName, resetState, resetState, setName, setState |
Methods inherited from interface agentland.util.Spy |
tell |
actualDeviceID
protected AgentID actualDeviceID
actualDevice
protected Device actualDevice
UniversalDeviceAgent
public UniversalDeviceAgent()
throws RemoteException
checkMulti
protected boolean checkMulti(String devName)
- A little tool for subclasses -- should be called by subclasses that implement both UniversalDevice and MultiDevice in cases where a named call is made. This method will check if the actual device is a multi device contorller. If not, it will log a complaint messate.
- Parameters:
devName
- name of the device. right now used only for logging.- Returns:
- true if actualdevice is a multi device, false otherwise
getActualDevice
public AgentID getActualDevice()
throws RemoteException
- Specified by:
getActualDevice
in interface UniversalDevice
- Returns:
- AgentID of the actual device that is doing the job
startSpeech
public boolean startSpeech()
throws RemoteException
- Description copied from interface:
UniversalDevice
- If possible, this method should load appropriate speech control
for the device.
- Specified by:
startSpeech
in interface UniversalDevice
- Following copied from interface:
agentland.device.UniversalDevice
- Returns:
- true if speech was started, false otherwise