Index
of example programs
Below, you can find a collection of example programs.
examples.simple ( DisplayAglet.java
) |
DisplayAglet is a very simple aglet. It shows its classname
in the Tahiti window.
examples.hello ( HelloAglet.java
) |
HelloAglet is a mobile aglet that goes to a remote host to
say "Hello World" and then returns home and dies after diplaying a message.
examples.events ( MobilityEvents.java
) |
MobilityEvents is a mobile aglet that records MobilityEvents
and its current URL as string. Send "dialog" message by selecting it on
Tahiti and push "dialog" button on Tahiti, history will be displayed on
the stardard output. If you are not familiar with aglets methods like onArrival(),
onDispatch(), etc., please refere this sample program.
examples.itinerary ( CirculateAglet.java,
MessengerAglet.java,
VisitingAglet.java, StationaryAglet.java ) |
CirculateAglet is an aglet that moves around the servers defined
by the SeqPlanItinerary class. This illustrates how to use the SeqPlanItinerary
class.
-
You need to select an aglet and then click the "dialog" button on Tahiti.
examples.talk ( TalkMaster.java,
TalkSlave.java, TalkWindow.java ) |
TalkMaster is an aglet-based implementation of the "talk"
application in Unix. The TalkSlave class is sent to a remote server.
This package is an example of meeting pattern.
examples.mdispatcher (
HelloAglet.java, MethodDispatcher.java ) |
HelloAglet is a revised version of examples.hello.HelloAglet,
which uses MethodDispatcher class to handle incoming messages.
MethodDispatcher class binds a message and a corresponding method.
All methods, which have a signature method(Message msg), are bound
and invoked when it receives the corresponding message.
-
Create "examples.mdispatcher.HelloAglet" and select it. Then click "dialog"
button.
This may be incorporated into MessageManager in the future.
examples.server ( ServerApp.java
) |
The ServerApp example illustrates how to embed the AgletsServer facility
into an application program. Because this program creates a named context,
please specify its name ("test" in this case) as a part of the URL. You
can get the information about options for ServerApp by executing
"runnit -help" on the command line. (It is possible to assign any port
number for this aglet server by specifying its option.)
This example will help those who want to imbed an aglet server into
one of their own applications written in Java.
examples.client ( WatcherClient.java
) |
Sorry, currently we do not support this sample program on ASDK1.1
beta.
The WatcherClient example illustrates how to use an aglet from a client
application. With this API, you can create an aglet in a remote server,
dispatch it, send a message, and receive a result from it. To run this
example, you need a server and a WatcherSlave aglet.
examples.watcher ( ProxyWatcher.java,
WatcherSlave.java ) |
ProxyWatcher is an aglet that dispatches a WatcherSlave
aglet and monitors proxies of the remote context. This example uses the
following features of Aglets:
-
remote messaging
-
delegation event model
-
concurrency control by waitMessage()/notifyMessage()
-
persistency
-
activation by message
-
remote control of an aglet.
examples.http ( WebServerAglet.java
) |
WebServerAglet is an aglet that behaves like WebServer. Please enable
the HTTP messaging feature in the configuration panel Options -> Network
Configuration -> Others. If the aglet is successfully created, please try
to access
http://aglet.server:434/aglets/default/test/index.html
by using a web browser. The port number must be same as the port number
on which the aglet server is running (434 or 4434 by default).