Inheritance diagram for edu.cmu.hcii.calo.engine.WizardOfOzEngine:
This half actually performs the tasks as forwarded by the WizardOfOzFrontEnd.
Public Member Functions | |
synchronized void | onMessageReceived (Observable sender, Message msg) |
Handles messages from various managers that are going to let it know that some changes went down. | |
void | reset () |
Resets this engine back to the way it was when it was first created. | |
void | startInputReadingLoop () |
Loops to read from the input stream until done is set to true. | |
Static Public Member Functions | |
static WizardOfOzEngine | getEngine () |
Returns the singleton instance of this engine. | |
static void | main (String[] args) |
Runs a the Wizard of Oz engine. | |
Private Member Functions | |
WizardOfOzEngine () | |
Constructs the WizardOfOzEngine instance. | |
void | buildSocket () |
Builds the server socket and gets a client. | |
void | addNotification (Notification notification) |
Adds a notification to the notification manager. | |
void | deleteNotification (Notification notification) |
Removes a notification from the notification manager. | |
void | addTasklikeObject (TasklikeObject tasklikeObject) |
Adds a tasklike object to the task manager. | |
void | deleteTasklikeObject (TasklikeObject task) |
Removes a tasklike object from the task manager. | |
Iterator< Notification > | getNotificationIterator () |
A getter for an iterator over the notification manager's notifications. | |
Iterator< TasklikeObject > | getTaskIterator () |
A getter for an iterator over the notification manager's notifications. | |
synchronized void | onInputReceived (Object o) throws IOException |
Takes input from off of the input stream and determines what to do with the messages received. | |
void | readObject (java.io.ObjectInputStream in) throws IOException, ClassNotFoundException |
Reads in a serialized engine. | |
void | setNotificationName (Notification notification, String newName) |
Determines and sets the name of a notification. | |
void | setNotificationPerson (Notification notification, Person newPerson) |
Determines and sets the person for a notification. | |
void | setNotificationPriority (Notification notification, double newPriority) |
Determines and sets the priority of a notification. | |
void | setNotificationText (Notification notification, String newText) |
Determines and sets the text of a notification. | |
void | setTaskCompleted (Task task, boolean newCompleted) |
Determines and sets the completed status of a task. | |
void | setTaskPending (Task task, PendingState newPending) |
Determines and sets the pending state of a task. | |
void | setTaskPriority (Task task, double newPriority) |
Determines and sets the priority of a task. | |
void | writeObject (java.io.ObjectOutputStream out) throws IOException |
Writes this engine to stream. | |
Private Attributes | |
ObjectInputStream | input |
The stream of serialized object that this engine reads to allow the front end to communicate to it. | |
ObjectOutputStream | output |
The stream of serialized objects that this engine writes to to allow the front end to communicate to it. | |
ServerSocket | serverSocket = null |
The socket this engine will listen on. | |
boolean | done |
Tracks if the engine should still be running. | |
Static Private Attributes | |
static final long | serialVersionUID = -2476562601562287691L |
Prevent serialization collisons. | |
static WizardOfOzEngine | uniqueInstance = null |
The singleton instance of the engine. |
edu.cmu.hcii.calo.engine.WizardOfOzEngine.WizardOfOzEngine | ( | ) | [private] |
Constructs the WizardOfOzEngine instance.
Private because this is a singleton.
static WizardOfOzEngine edu.cmu.hcii.calo.engine.WizardOfOzEngine.getEngine | ( | ) | [static] |
Returns the singleton instance of this engine.
static void edu.cmu.hcii.calo.engine.WizardOfOzEngine.main | ( | String[] | args | ) | [static] |
Runs a the Wizard of Oz engine.
This is a server; run it first.
args | command-line args; don't bother passing any |
void edu.cmu.hcii.calo.engine.WizardOfOzEngine.buildSocket | ( | ) | [private] |
Builds the server socket and gets a client.
Also attaches listeners when everything is kosher.
void edu.cmu.hcii.calo.engine.WizardOfOzEngine.addNotification | ( | Notification | notification | ) | [private] |
Adds a notification to the notification manager.
notification | the notification to add |
void edu.cmu.hcii.calo.engine.WizardOfOzEngine.deleteNotification | ( | Notification | notification | ) | [private] |
Removes a notification from the notification manager.
notification | the notification to remove |
void edu.cmu.hcii.calo.engine.WizardOfOzEngine.addTasklikeObject | ( | TasklikeObject | tasklikeObject | ) | [private] |
Adds a tasklike object to the task manager.
tasklikeObject | the tasklike object to add |
void edu.cmu.hcii.calo.engine.WizardOfOzEngine.deleteTasklikeObject | ( | TasklikeObject | task | ) | [private] |
Removes a tasklike object from the task manager.
task | the tasklike object to remove |
Iterator<Notification> edu.cmu.hcii.calo.engine.WizardOfOzEngine.getNotificationIterator | ( | ) | [private] |
A getter for an iterator over the notification manager's notifications.
Iterator<TasklikeObject> edu.cmu.hcii.calo.engine.WizardOfOzEngine.getTaskIterator | ( | ) | [private] |
A getter for an iterator over the notification manager's notifications.
synchronized void edu.cmu.hcii.calo.engine.WizardOfOzEngine.onInputReceived | ( | Object | o | ) | throws IOException [private] |
Takes input from off of the input stream and determines what to do with the messages received.
It ignores things that it can't translate.
o | the object sent across the socket |
IOException |
synchronized void edu.cmu.hcii.calo.engine.WizardOfOzEngine.onMessageReceived | ( | Observable | sender, | |
Message | msg | |||
) | [virtual] |
Handles messages from various managers that are going to let it know that some changes went down.
sender | The manager that sent this message | |
msg | The message to handle |
Implements edu.cmu.hcii.calo.messagePassing.MessageTarget.
void edu.cmu.hcii.calo.engine.WizardOfOzEngine.readObject | ( | java.io.ObjectInputStream | in | ) | throws IOException, ClassNotFoundException [private] |
Reads in a serialized engine.
Just checks against the serialVersionUID since this is a singleton.
in | the input stream to read from |
IOException | ||
ClassNotFoundException |
void edu.cmu.hcii.calo.engine.WizardOfOzEngine.reset | ( | ) |
Resets this engine back to the way it was when it was first created.
void edu.cmu.hcii.calo.engine.WizardOfOzEngine.setNotificationName | ( | Notification | notification, | |
String | newName | |||
) | [private] |
Determines and sets the name of a notification.
notification | the notification whose name will be updated | |
newName | the new name |
void edu.cmu.hcii.calo.engine.WizardOfOzEngine.setNotificationPerson | ( | Notification | notification, | |
Person | newPerson | |||
) | [private] |
Determines and sets the person for a notification.
notification | the notification whose person will be updated | |
newPerson | the new person |
void edu.cmu.hcii.calo.engine.WizardOfOzEngine.setNotificationPriority | ( | Notification | notification, | |
double | newPriority | |||
) | [private] |
Determines and sets the priority of a notification.
notification | the notification whose priority will be updated | |
newPriority | the new priority |
void edu.cmu.hcii.calo.engine.WizardOfOzEngine.setNotificationText | ( | Notification | notification, | |
String | newText | |||
) | [private] |
Determines and sets the text of a notification.
notification | the notification whose text will be updated | |
newText | the new text | |
newText | the new text with which to update |
void edu.cmu.hcii.calo.engine.WizardOfOzEngine.setTaskCompleted | ( | Task | task, | |
boolean | newCompleted | |||
) | [private] |
Determines and sets the completed status of a task.
task | the task whose completion will be updated | |
newCompleted | the completed state to update to |
void edu.cmu.hcii.calo.engine.WizardOfOzEngine.setTaskPending | ( | Task | task, | |
PendingState | newPending | |||
) | [private] |
Determines and sets the pending state of a task.
task | the task whose pending state will be updated | |
newPending | the pending state to update to |
void edu.cmu.hcii.calo.engine.WizardOfOzEngine.setTaskPriority | ( | Task | task, | |
double | newPriority | |||
) | [private] |
Determines and sets the priority of a task.
task | the task whose priority will be updated | |
newPriority | the priority to update to |
void edu.cmu.hcii.calo.engine.WizardOfOzEngine.startInputReadingLoop | ( | ) |
Loops to read from the input stream until done is set to true.
void edu.cmu.hcii.calo.engine.WizardOfOzEngine.writeObject | ( | java.io.ObjectOutputStream | out | ) | throws IOException [private] |
Writes this engine to stream.
Since I don't want to deal with everything below this manager being serialized and it is a singleton, I just write the ID for error checking.
out | the output stream to write to |
IOException |
final long edu.cmu.hcii.calo.engine.WizardOfOzEngine.serialVersionUID = -2476562601562287691L [static, private] |
Prevent serialization collisons.
WizardOfOzEngine edu.cmu.hcii.calo.engine.WizardOfOzEngine.uniqueInstance = null [static, private] |
The singleton instance of the engine.
ObjectInputStream edu.cmu.hcii.calo.engine.WizardOfOzEngine.input [private] |
The stream of serialized object that this engine reads to allow the front end to communicate to it.
ObjectOutputStream edu.cmu.hcii.calo.engine.WizardOfOzEngine.output [private] |
The stream of serialized objects that this engine writes to to allow the front end to communicate to it.
ServerSocket edu.cmu.hcii.calo.engine.WizardOfOzEngine.serverSocket = null [private] |
The socket this engine will listen on.
boolean edu.cmu.hcii.calo.engine.WizardOfOzEngine.done [private] |
Tracks if the engine should still be running.