Defining the Remote InterfaceListing 13.1 LazyInterface.javaimport java.rmi.*; //remote interface public interface LazyInterface extends Remote { //method called by clients public String sayHello() throws RemoteException; } The LazyInterface declares a method that returns "Hello World" to the caller.
Implementation of Remote InterfaceAn activatable object is defined by:
If an object is not active and a method is invoked, the activation system activates the object using the activation protocol. After the object has been activated, the method invocation takes place and the result is marshaled to the client. In this example, the server class (LazyServerImpl) will implement the remote interface (LazyInterface) and extend Activatable. Figure 13.1
|
||
|
||
Copyright © 2001 www.universalteacher.com |
||