
When the actuator for
DumPad is
called, it sends the command in string form to a specific port number.
If the server for the program is listening, it invokes a method of the
front-end program, which subsequently calls the functions of the
application itself. This allows any program that can send messages to a
socket to invoke the application's functions. In our example, the
dumpad actuator currently recognizes and saves 6 commands: save, open,
exit, cut, copy, and paste.
Exact changes made to incorporate
DumPad into Chimera:
1. Program is written (DumPad.java).
2. Front-end thread is written
(Editor.java): a few simple methods and the DumPad object.
3. Server is written (PKServer.java):
initiates the front-end upon construction.
4. The file dManager.cpp is modified:
added an extra else-if statement matching the command 'dumpad', wrote
includes for dumpad_actuator.cpp.
5. The actuator for DumPad is written
(dumpad_actuator.h & dumpad_actuator.cpp): written as a child class
of Abstract_Actuator, where the most important code is in the function
void activate().
6. DumPad grammar is added to the
Phoenix grammar files (DumPad.gra).
7. DumPad commands are added to the
Sphinx dictionary via corpus (test.corpus).
To implement another Java application
into Chimera, the program itself must be wrapped in a front-end that
implements Runnable and kept as a member of the server program.
However, to integrate that application fully into Chimera's system, the
Sphinx dictionary, and Phoenix grammars must both be updated with new
vocabulary, and the dialogue manager must be updated to be able to
recognize a new command. A simple individual actuator file that will be
invoked by the dialogue manager actually sends the message to the
particular socket.
In the future, Chimera will
streamline this process of adding support for applications. First of
all, the process of modifying Phoenix, Sphinx, and dManager files will
be automated. Second of all, There will be a 'master server' (MS) which
will be running at a specific, known port. If an application wishes to
"plug-in" to Chimera, it will communicate this request to the MS. The
MS will then respond with a negative (if max capacity of programs is
reached, etc.) or a port number. The application will then assign
itself this number and begin listening to that port. Meanwhile, the MS
will keep a list of all ports that are being taken, identifying each
port by program name. When the dialogue manager needs to know the port
number assigned to a certain application, it will simply request a
search through the MS, and then send it to the returned port number.
This will remove the annoyances of remembering specific predetermined
ports for various programs.
Back
to Extentions
Back
to the Main Page