Java RMI
lecture 4
Features
- Integrate with Java language and libraries
- Security, write once run anywhere, multithreaded
- Object oriented
- Can pass "behavior"
- Mobile code
- Not possible in CORBA, traditional RPC systems
- Distributed garbage collection
- Remoteness of objects intentionally not transparent
- Good for handling failures
Remote Interfaces, Objects, and Methods
- Object becomes remote by implementing a remote interface
- A remote interface extends the interface java.rmi.Remote
- Each method of the interface declares java.rmi.RemoteException in its throws clause in addition to any application-specific clauses
Creating distributed applications using RMI
- Define the remote interfaces
- Implement the remote objects and server
- Implement the client
- Compile the remote interface, server and client
- Generate the stub and skeleton using rmic
- Start the RMI registry
- Start the server
- Run the client
No comments:
Post a Comment