0 votes
in JAVA by
What is the purpose of stub and skeleton?

1 Answer

0 votes
by

Below are the difference between the Stub and Sekeleton

Stub

The stub is an object, acts as a gateway for the client side. All the outgoing requests are routed through it. It resides at the client side and represents the remote object. When the caller invokes the method on the stub object, it does the following tasks:

  • It initiates a connection with remote Virtual Machine (JVM).
  • It writes and transmits (marshals) the parameters to the remote Virtual Machine (JVM).
  • It waits for the result.
  • It reads (unmarshals) the return value or exception.
  • It finally, returns the value to the caller.

Skeleton

The skeleton is an object, acts as a gateway for the server side object. All the incoming requests are routed through it. When the skeleton receives the incoming request, it does the following tasks:

  • It reads the parameter for the remote method.
  • It invokes the method on the actual remote object.
  • It writes and transmits (marshals) the result to the caller.

Related questions

+1 vote
asked May 12, 2021 in JAVA by rajeshsharma
+3 votes
asked May 13, 2021 in JAVA by rajeshsharma
...