Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI & Stubs

 
Sean Keane
Ranch Hand
Posts: 582
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As of Java 5 there is no longer a need to generate stubs using rmic.

The release notes for Java 5 tell us the following:
When an application exports a remote object (using the constructors or static exportObject methods1 of the classes java.rmi.server.UnicastRemoteObject or java.rmi.activation.Activatable) and a pregenerated stub class for the remote object's class cannot be loaded, the remote object's stub will be a java.lang.reflect.Proxy instance (whose class is dynamically generated) with a java.rmi.server.RemoteObjectInvocationHandler as its invocation handler.


What I was wondering was: when you do not generate stubs using rmic, is this process that occurs (as described in the quote above) regarded as dynamic class loading?
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11855
186
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, and we received confirmation from Sun back when Java 5 came out (and I also asked Sun about this for the SCJD book) that you needed to create stubs - using the auto generation / dynamic class loading feature was not allowed for the SCJD exam.

Since then many candidates have passed without generating stubs.
 
Sean Keane
Ranch Hand
Posts: 582
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cheers for the reply Andrew. That clears it up.

I wonder from the candidates who did not generate stubs whether they explicitly mentioned this decision in the choices.txt. I would be in two minds (1) mentioning it highlights it and the assessor may delve into this issue (2) not mentioning it may result in the assessor thinking you didn't understand what you were doing.

I know Roberto told us that he mentioned the fact that he did not generate stubs in his choices.txt.

I guess the safest thing to do is generate stubs. With Oracle requiring everyone to take a course after the 1st Oct, I guess it would be unwise to give them any reason to fail you, which a skeptic may say they would deliberately do in order to gain further revenue (even though they have set a precedent as we have seen from Roberto).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic