Term
Give an example of the use of Remote Object References in Java RMI |
|
Definition
What we have to say on client:
remoteObject = ObjectBroker.lookup("global name");
result = remoteObject.method(parameter);
What we have to say on server:
remoteObject = new RemoteObject();
ObjectBroker.register("global name", remoteObject); |
|
|
Term
Show a diagram sumarizing RMI architecture |
|
Definition
|
|
Term
What are some basics of Java RMI? |
|
Definition
- A server application is responsible for containing instances of remote objects
- The server uses a naming service to publish means of access to its remotely accessible objects
- Java RMI has a simple naming service called rmiregistry
- The compiler for stubs and skeletons is called rmic. Stubs and skelletons are generated automatically in later versions
|
|
|
Term
What are some principles of remote interfaces in java RMI? |
|
Definition
- Has same syntax as local method invocation but different semantics
- Objects to be made remote must have an interface derived from the Remote interface
- All methods declared by the interface must throw RemoteException
- These methods can use both ordinary and remote objects as arguments/results
|
|
|
Term
Give an example of a remote interface in java rmi |
|
Definition
public interface RemoteThingInterface extends Remote {
public String method() throws RemoteException;
} |
|
|
Term
Give an example of a Remote Object in Java RMI |
|
Definition
Class of a remote object must extend UnicastRemoteObject or another subclass of RemoteObejct
public class RemoteThing extends UnicastRemoteObject
implements RemoteThingInterface {
public RemoteThing() throws RemoteException {
super(); }
...
} |
|
|
Term
What are some principles for server objects in Java RMI? |
|
Definition
- The binder for JavaRMI is called RMIregistry
- an instance of RMIregistry normally runs on every Servery machine
- Methods of the Naming class (bind, rebind, unbind lookup) used to access the RMIregistry
|
|
|
Term
Give an example of a server application in Java RMI |
|
Definition
public class RemoteTHingServer {
public static void main (String [] args) {
try { RemoteThing remoteThing = new RemoteThing();
Naming.rebind("remoteThing", remoteThing);
} catch
...
} |
|
|
Term
Show an example of a Java RMI client application |
|
Definition
public class RemoteThingClient {
public static void main(String[] args) {
try {
RemoteThingInterface = remoteThing =
(RemoteThingInterface) Naming.lookup(
"rmi://localhost/remoteThing");
... |
|
|
Term
What are some principles of Java RMI parameter passing? |
|
Definition
- Both ordinary and remote objects used as method arguments/results
- remote interface used to declare argument/result type
- Serialization used for marshaling arguments and results
- Remote objects are passed as remote object references
- non-remote objects are copied and passed by value
|
|
|
Term
What are some fundamentals of Java Object Serialization? |
|
Definition
- Information about the class (name, version number) of each object included
- Values of primitive types are converted into binary format
- Remote objects are serialized by copying their remote reference
- Serializing objects involves serializing all objects they refer to
- Must implement serializable interface
|
|
|
Term
What are the characteristics of Activation in JavaRMI? |
|
Definition
- It is possible to organise that a server is activated only when an object for which it is responsible is accessed
- The object will then be reconstructed from a file
- Java RMI supports this (Through the Activatable class), but this is beyond the scope of this module
|
|
|
Term
What is persistance and what characteristics does it have? |
|
Definition
Storing objects in databases in order to avoid state loss of remote objects if the server goes down
Objects stored in persistent object store will be activated when their methods are invoked by other objects |
|
|
Term
What are some characteristics of Distributed Garbage Collection? |
|
Definition
- Will remove objects from memory once no other object in the system holds a reference to it
- Java's based on reference counting
- References to proxies of a remote object are counted on each client process
- Server processes maintain a list of client processes holding references to its remote objects
- Clients inform server of changes
|
|
|
Term
How does java distributed reference counting? |
|
Definition
- Used for distributed garbage collection
- References to proxies of a remote object are counted on each client process
- Server processes maintain a list of client processes holding references to its remote objects
- Clients inform server of changes
|
|
|