正在加载图片...
9.6一个RM的分式应用的实 (1)定义远程接口 ·第一个接囗 ompute package comput compute import java rmi Remote; ngine 计 import java rmi RemoteException; public interface Compute extends remote Compute Task 机 i Object execute Task(Task t throws RemoteException; 3 execute Task execute 业 package compute 第二个接口:定义一个task类型, EF import java. io Serializable; 作为参数传给 execute Task方法, public interface Task extends规定了engn与它的任务之间的 Serializable 接口,以及如何启动它的任务它 i Object execute; 不是一个远程接口北 京 大 学 计 算 机 系 代 亚 非 7 9.6 一个RMI的分布式应用的实例 (1)定义远程接口 • 第一个接口:compute package compute; import java.rmi.Remote; import java.rmi.RemoteException; public interface Compute extends Remote { Object executeTask(Task t) throws RemoteException;} package compute; import java.io.Serializable; public interface Task extends Serializable { Object execute(); } 第二个接口:定义一个task类型, 作为参数传给executeTask方法, 规定了engin与它的任务之间的 接口,以及如何启动它的任务.它 不是一个远程接口 executeTask compute engine Compute execute Task
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有