Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Examples of ILLEGAL RMI-IIOP Types

 
Arthur Orange
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I must have read these through the specs a million times :
"If the business method corresponds to a method of the entity bean�s REMOTE interface, the method argument and return value types MUST be legal types for RMI-IIOP."

What are examples of legal and illegal RMI IIOP types? I read in HFEJB they should be one of the following:
- Primitives
- Serializable Objects
- Array or collections of primitives or serializable objects.
- A remote object

Now what would be an illegal type? let me guess: Boolean, Integer wrapper types?

The same goes for serializable objects. Which objects are serializable and which are not? HFEJB mentions that String is not serializable. What other illegal types? Why is string considered non serializable?
 
Fernando Matias Valadao
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>>What are examples of legal and illegal RMI IIOP types? I read in HFEJB >>they
>>should be one of the following:
>>- Primitives
>>- Serializable Objects
>>- Array or collections of primitives or serializable objects.
>>- A remote object
>>
>>Now what would be an illegal type? let me guess: Boolean, Integer wrapper >>types?

Illegal types are the objects that do not fit to any of the rules you enumerated
Strings, boolean, integer and all Wrapper types ARE serializable objects, because they implement the Serializable marker interface (check the J2SDK doc for each class).
You define a serializable class when it implements the Serializable marker interface (yes, it's that simple), and its attributes must be serializable, too.
Some classes that are not serializable: java.net.Socket, java.sql.DriverManager. They're not either RMI-IIOP compliant objects.
That's my R$0.02.
 
Yorck Zhou
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
transient type data is not serializable.
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.jguru.com/faq/view.jsp?EID=349856 says:

A legal value type for RMI is an object that implements the java.io.Serializable interface and is, in fact, serializable (An object that implements the Serializable interface will not actually be serializable if the classes of one or more of its member variables are non-serializable).
Interestingly, it is a violation of the J2EE specification to pass or return a parameter of type java.lang.Object from an EJB method because the Object class does not implement Serializable. Some EJB 1.1 compliant application servers (the J2EE reference server itself for example!) will allow the deployment and use of EJB's that violate this constraint if at runtime the bean methods actually pass and return sub-types of Object that are serializable. However, if you run the Verifier tool that comes with the J2EE reference server, you will be informed that the bean method parameters do not conform to the RMI-IIOP value type guidelines.
For a more detailed explanation of legal RMI types, read section 2.6 of the RMI specification at: http://java.sun.com/j2se/1.3/docs/guide/rmi/spec/rmiTOC.html


Regards,
Dan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic