agentland.device.led
Class LEDManagerAgent

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.led.LEDManagerAgent
All Implemented Interfaces:
Agent, Good, LEDManager, Managed, MetagluePrimitives, Remote, Serializable, Spy

public class LEDManagerAgent
extends ManagedAgent
implements LEDManager

Describe class LEDManagerAgent here.

See Also:
ManagedAgent, LEDManager, TextObject, Serialized Form

Inner classes inherited from class metaglue.AgentAgent
AgentAgent.Attribute
 
Field Summary
protected  AgentID currentSource
          Currently displayed source
protected  TimerTask currentTask
           
protected  Queue queue
          Queue of all the sources contributing things to display (we have only one text per source but this text might change while the source is in the queue, this is why we are queueing sources and not actual text objects)
protected  AlphaLEDSign sign
           
protected  Timer timer
           
 
Fields inherited from class agentland.resource.ManagedAgent
rm, society
 
Fields inherited from class agentland.util.GoodAgent
alert, notifier
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Constructor Summary
LEDManagerAgent()
           
 
Method Summary
protected  void addNewItem(AgentID source, TextObject tObject, LEDProperties prop)
          Adds new text object and the associated info to all relevant date structures; if there already was something from the source, appropriate updates will take place.
 void clear(AgentID source)
          Removes the object associated with the source from the queue of stuff to be displayed
protected  void clearSign()
           
protected  void expireSource(AgentID source)
          Removes all info associated with the particular source from all data structures.
 void outputText(AgentID source, TextObject tObject)
           
 void outputText(AgentID source, TextObject tObject, LEDProperties prop)
           
protected  long showNextItem()
          Displays next item in the queue, if queue is non-empty
protected  void showText(TextObject tObject)
           
 void tick()
          The method called at every "heart-beat" of the system -- it makes the items change on the display
 
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, buildEHAFor, defrost, defrostAll, defrostBoolean, defrostInt, defrostString, fixAttribute, fixAttribute, freeze, freeze, freeze, freezeAll, freezeVar, getAgentID, getAttribute, getCatalog, getCatalogID, getDesignation, getFrozenVariables, getLogLevel, getMetaglueAgent, getMetaglueAgentID, getOccupation, getOldLogs, getProperties, getProxyHandlerClass, getSociety, installAPH, log, log, lookupClass, reliesOn, reliesOnSynch, removeAPHFromCatalog, removeFrozen, setFreezeName, setLogLevel, setLogName, shutdown, startAgent, startAgentOn, startAgentOn, startup, status, tiedTo, tiedTo, tiedTo, tiedTo, tieToDesignation, toString, whereAreYou
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface agentland.resource.Managed
getNeed, replace, replace, resources, yank, yank
 
Methods inherited from interface agentland.util.Good
getHistory, getHistoryElement, resetHistory
 
Methods inherited from interface metaglue.Agent
addMonitor, alive, getAgentID, getMetaglueAgentID, getOldLogs, shutdown, startup, whereAreYou
 
Methods inherited from interface agentland.util.Spy
tell
 

Field Detail

sign

protected AlphaLEDSign sign

queue

protected Queue queue
Queue of all the sources contributing things to display (we have only one text per source but this text might change while the source is in the queue, this is why we are queueing sources and not actual text objects)

currentSource

protected AgentID currentSource
Currently displayed source

timer

protected Timer timer

currentTask

protected TimerTask currentTask
Constructor Detail

LEDManagerAgent

public LEDManagerAgent()
                throws RemoteException
Method Detail

outputText

public void outputText(AgentID source,
                       TextObject tObject)
Specified by:
outputText in interface LEDManager

outputText

public void outputText(AgentID source,
                       TextObject tObject,
                       LEDProperties prop)
Specified by:
outputText in interface LEDManager

clear

public void clear(AgentID source)
           throws RemoteException
Removes the object associated with the source from the queue of stuff to be displayed
Specified by:
clear in interface LEDManager

showText

protected void showText(TextObject tObject)

clearSign

protected void clearSign()

addNewItem

protected void addNewItem(AgentID source,
                          TextObject tObject,
                          LEDProperties prop)
Adds new text object and the associated info to all relevant date structures; if there already was something from the source, appropriate updates will take place.

expireSource

protected void expireSource(AgentID source)
Removes all info associated with the particular source from all data structures.

showNextItem

protected long showNextItem()
Displays next item in the queue, if queue is non-empty
Returns:
the time this item should be displayed for (in miliseconds)

tick

public void tick()
The method called at every "heart-beat" of the system -- it makes the items change on the display