org.sakaiproject.cheftool
Class ControllerState

java.lang.Object
  extended byorg.sakaiproject.cheftool.ControllerState
All Implemented Interfaces:
Observer
Direct Known Subclasses:
AnnouncementActionState, CalendarActionState

public abstract class ControllerState
extends Object
implements Observer

ControllerState is the core base class for the CHEF Tool's state objects.

State objects are used to store controller state for a tool. Specific state object implement this interface.

To support creation of controller state objects, make sure to supply a void constructor.

To support pooling of objects, implement the recycle() method to release any resources and restore the object to initial conditions before reuse.

Version:
1.0
Author:
University of Michigan, CHEF Software Development Team
See Also:
org.chefproject.service.ControllerStateService

Constructor Summary
ControllerState()
           
 
Method Summary
 String getId()
           
 String getKey()
          Access a unique key for this state, combining the set id and the state id.
 String getSetId()
           
protected  void init()
          Init to startup values
 void recycle()
          Release any resources and restore the object to initial conditions to be reused.
 void setId(String id)
           
 void setSetId(String id)
           
 void update(Observable o, Object arg)
          This method is called whenever the observed object is changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControllerState

public ControllerState()
Method Detail

init

protected void init()
Init to startup values


recycle

public void recycle()
Release any resources and restore the object to initial conditions to be reused.


getId

public String getId()

setId

public void setId(String id)

getSetId

public String getSetId()

setSetId

public void setSetId(String id)

getKey

public String getKey()
Access a unique key for this state, combining the set id and the state id.

Returns:
A unique key for this state, combining the set id and the state id.

update

public void update(Observable o,
                   Object arg)
This method is called whenever the observed object is changed. An application calls an Observable object's notifyObservers method to have all the object's observers notified of the change. default implementation is to cause the courier service to deliver to the interface controlled by my controller. Extensions can override.

Specified by:
update in interface Observer
Parameters:
o - the observable object.
arg - an argument passed to the notifyObservers method.