readme
来自「JAVA分布式程序学习的课件(全英文)」· 代码 · 共 33 行
TXT
33 行
Mobile Agent Sample
M. Liu 1/8/2000
_______________________________________________________________________
This set of files illustrates the use of a transportable object
(a mobile agent) on one computer only.
The files in this directory are:
- ServerInterface.java The agent server interface file
- AgentInterface.java The agent interface file
- Client.java The client for launching the agent
on the originating host
- Server.java The agent server for hosting a visiting
agent
- Agent.java The mobile agent source file.
To run:
1. Copy all the files in this sample to a directory named "agent".
2. Use the "compile" file to compile the source files:
%compile
3. Run the reg.bat batch file to start a RMIRegistry at port 12345:
%rmiregistry 12345
4. Launch three servers in three separate window - the servers
will run at different ports:
%run1
%run2
%run3
5. Open a fourth window and run the cient which launches a mobile agent:
% runClient
If all goes well, you should see the same message displayed on each
server screen, generated by the mobile agent as it visits each
host in turn.
6. Stop your servers by entering CTRL-C in each server window.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?