title: RMI's dynamic proxy stub implementation
body: <p>I want to understand how the dynamic proxy stub implementation is actually done behind the scene.  According to what I read, by the time a remote object is exported if no pre-generated stub class is found, the RMI runtime would generate a dynamic proxy to act as the stub.  That stub is then bound to the RMI Registry and later accessible by some RMI client.  </p>
  
  <p>The question is: since the stub is actually a dynamically generated proxy, its class definition would not be available on the client side, then how come the client is still able to retrieve the stub from the RMI Registry?  Is there some kind of dynamic class-loading happening behind the scene or does RMI use another technique to work-around this?</p>