Kyle,
It may be worth noting here that EJB Handle interface does extend Serializable. However, it is clearly noted that EJB Handles are considered "network references" and are only available to EJB clients of remote EJBs. In my opinion the term "handle" implies a network reference. Also, the asynchronous nature of the "event" use case for ControlHandle, in practical server topologies, demands a "network" aspect. For example, if someone wanted to create a Alarm Control which acted as a business delegate to an EJB Timer Service, its worth noting that the TimerHandle interface and the "info" property of Timer interface are both Serializable. If ControlHandle does not prescribe Serializable then a portable Alarm Control implementation would need to not only assert that a ControlHandle was available, but that it was Serializable as well.
If it is the intent of ControlHandle to be used for intra-VM coordination of async events then I can understand why it does not demand Serializable. In that case, there should be an API on ControlHandle or a documented convention (e.g. checking for serializable) which a control author can rely on to discern the capability/policy of the ControlHandle in support of portable implementations.
matt
Kyle Marvin wrote:
ControlHandle itself is just an interface... but you are 100% that concrete implementations of ControlHandle should mplement java.io.Serializable to enable them to be persisted, enqueued, passed over a wire, etc.
In general, it's probably not a good idea to have an interface implement Serializable and then have a corresponding impl pick it up via an 'implements' inheritance relationship. You generally want a class author to be thinking more explicitly about serialization in the design of class state.
I'll add something to the Javadoc for Control Handle that states "classes implementing this interface should be serializable". This will make it more explicit, less implied.
-- Kyle
On 4/27/05, Mridul Muralidharan <[EMAIL PROTECTED]> wrote:
Hi all,
Is there any particular reason why ControlHandle does not implement java.io.Serializable interface ? From what I read , I would guess it is envisioned to be used in situations which will need serialization/deserialization ...
Thanks and Regards Mridul
