Client asks for stub.class to Rmiregistry or Rmiregistry sends it automatically ?
Neither. Either the client already has the class in its CLASSPATH or it downloads it from the codebase server if there is one. The Registry has nothing to do with it either way.
Using codebase property Can I force Client to download stub.class from a my webserver?
Well, that's what it's for. It's the only thing it's for. Note that it has to be set at the RMI server JVM.
It seems like if I generate stub file with rmic , then client tries to download them, if I don't use rmic client doesn't download stub, but my program works.
If you satisfy the conditions outlined in the class description in the Javadoc for UnicastRemoteObject you don't need to generate stubs at all.