Stub & Skeleton Layer - Function,Properties - RMI

Q.  In RMI Architecture which layer Intercepts method calls made by the client/redirects these calls to a remote RMI service?
- Published on 19 Oct 15

a. Stub & Skeleton Layer
b. Application Layer
c. Remote Reference Layer
d. Transport Layer

ANSWER: Stub & Skeleton Layer
 

    Discussion

  • Nirja Shah   -Posted on 14 Dec 15
    - The stub and skeleton layer of RMI lie just beneath the view of the Java developer.

    - In this layer, RMI uses the Proxy design pattern.

    - In the Proxy pattern, an object in one context is represented by another (the proxy) in a separate context. The proxy knows how to forward method calls between the participating objects.

    - In RMI's use of the Proxy pattern, the stub class plays the role of the proxy, and the remote service implementation class plays the role of the RealSubject.

    - A skeleton is a helper class that is generated for RMI to use.

    - The skeleton understands how to communicate with the stub across the RMI link. The skeleton carries on a conversation with the stub; it reads the parameters for the method call from the link, makes the call to the remote service implementation object, accepts the return value, and then writes the return value back to the stub.

    - In the Java 2 SDK implementation of RMI, the new wire protocol has made skeleton classes obsolete. RMI uses reflection to make the connection to the remote service object. You only have to worry about skeleton classes and objects in JDK 1.1 and JDK 1.1 compatible system implementations.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)