正在加载图片...
Writing a Remote Interface import java.rmi.*; public interface Meeting extends Remote public String getDate ( throws RemoteException; public void setDate string date throws RemoteException public void scheduleIt() throws RemoteException; Here's the interface definition for a simple remote interface.Objects that implement this interface provide a three methods:one that returns a string. one that accepts a string as an argument,and one that accepts no arguments and returns nothing.As mentioned earlier,these methods must throw the RemoteException,which clients will catch if something goes wrong with the communication between the client and server. Note that the interface itself extends the Remote interface that's defined in the java.rmi package.The Remote interface itself defines no methods,but by extending it,we indicate that the interface can be called remotely.Writing a Remote Interface import java.rmi.*; public interface Meeting extends Remote { public String getDate () throws RemoteException; public void setDate ( String date ) throws RemoteException; public void scheduleIt() throws RemoteException; } Here's the interface definition for a simple remote interface. Objects that implement this interface provide a three methods: one that returns a string, one that accepts a string as an argument, and one that accepts no arguments and returns nothing. As mentioned earlier, these methods must throw the RemoteException, which clients will catch if something goes wrong with the communication between the client and server. Note that the interface itself extends the Remote interface that's defined in the java.rmi package. The Remote interface itself defines no methods, but by extending it, we indicate that the interface can be called remotely
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有