In JDK1.1 the
public final synchronized Enumeration elements() {
return new VectorEnumerator(this);
}
returns a VectorEnumerator class that *is* serializable.
In JDK1.2, I was unable to find the VectorEnumerator class. In fact, the
Java2 Vector class returns an anonymous class from the elements() function
call.
Does this mean that all Finder methods (whether Container-managed or
Bean-managed) have to return java.util.Collection when using JDK1.2?
jim
----- Original Message -----
From: Alan Greenspan <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 22, 1999 10:30 AM
Subject: Enumerations as return param for mult-object finders
> The EJB spec (1.1 spec section 9.1.8.2), allows for java.util.Enumeration
to
> be the return type of multi-object finders. For the Enumeration to be
> returnable, it must also be Serializable. Does anyone know of a
java.util
> class that returns a Serializable Enumeration?
>
> Its sort of odd that for example, java.util.Vector, which is itself
> Serializable, does not return a Serializable Enumeration
(Vector.elements()
> returns a non-serializable Enumeration).
>
> The problem with this for EJB is that unless there is a core java class
> which can be used to return the Enumeration, then the Container must
provide
> such a class to the client. Though this can be accomplished via dynamic
> class loading by placing the Enumeration implementation into the same
> codebase used to find the EJBHome and EJBObject stubs, it seems pretty
ugly
> to have to do this just for a single class.
>
> BTW, the other option for multi-object finders is to return
> java.util.Collection. This does not have the problem that Enumeration has
> since the Java 2 collection classes all seem to be Serializable. The
> problem here is that beans which implement this option will only work with
> Java 2 clients.
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".