instructional as our
Hello example has been in
demonstrating how to use XML-RPC with Java, it isn’t very
realistic. In addition to being a trivial example, the server is not
very flexible and the handler itself doesn’t give any
indication of how a practical XML-RPC handler might operate. Here we
try to give examples of using XML-RPC in a production environment by
increasing the usefulness of the handler and the usability of the
server. These, while still not code you might want to immediately add
to your current project, should at least begin to demonstrate to you
how XML-RPC might be of use in your future projects, and how to build
applications that can use XML-RPC but are not limited by it.
HelloHandler class was simple but useless in a
practical application. Remember that we said most XML-RPC uses relate
to letting events occur on a server that is more suited for complex
tasks, while allowing a thin client to request procedures be executed
and use the returned results. In addition, it is possible that part
or even all of the computations needed to respond to a request can be
done in advance; in other words, the handler class may be running
tasks and ensuring that results are already available when a method
call comes in. As a Java coder, threads and shared instance data
should leap to your mind. Here we take a look at a very simple
class to illustrate these principles.
Our scheduler should allow clients to add ...