OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

sdo message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: AW: [sdo] Groups - HelperContext Creation - Version 2 (HelperContextCreation-v2.zip) uploaded


Hi Blaise, Everyone,

I believe we need a method HelperContextFactory.getHelperContext(ClassLoader).  I believe that there is consensus that in a JEE world we probably have a HelperContext associated with each application.  In this case, the classloader is a useful key to identify and manage the HelperContexts.  For JEE applications, getDefaultHelperContext() is probably enough.  For frameworks and OSGi bundles, I think it's useful to be able to get the "default" helper context associated which each ClassLoader.  To be clear, I think a common implementation for getDefaultHelperContext() will be to call getHelperContext(Thread.currentThread().getContextClassLoader()).

In last week's meeting, the discussion centered around deserialization, and in particular, how the correct HelperContext would be found if there are multiple SDO implementation in the VM.

The idea was floated to have the implementation class name (or the class itself?) on the byte stream.  This has the consequence that serialized objects can only be read by the implementation that created the stream.  If the whole point of specifying a serialization format is to allow interoperability, this is (to me) a fatal flaw.

The alternative seems to be to add the method getHelperContext(String id) to the SDO class.  I have nothing against having this method in our API, but I think the management of HelperContexts is something better left to the implementations.  For instance, I wouldn't want to decide in our TC whether the implementation of the SDO class that we deliver should contain weak references to the HelperContexts or how or when HelperContexts should be cleaned up.

It seems to me that ImplementationResolver can be extended to solve this.  That is, we can add the method getHelperContext(String) to both SDO and to ImplementationResolver, and let the implementation in SDO delegate to the currently defined resolver.  The DefaultImplementationResolver maintains anyway a map of all HelperContextFactories known to it, and is shouldn't be a problem to add an implementation of getHelperContext(String) that iterates over this list looking for a match.

As I noted above, we probably neeed getHelperContext(ClassLoader) in addition to getHelperContext(String) in SDO and ImplementationResolver.  If the serialization stream contains a null instead of a HelperContext identifier, then we look up the HelperContext associated with the Thread.currentThread().getContextClassLoader().

Best Regards,
Ron


-----Ursprüngliche Nachricht-----
Von: blaise.doughan@oracle.com [mailto:blaise.doughan@oracle.com] 
Gesendet: Montag, 23. März 2009 15:23
An: sdo@lists.oasis-open.org
Betreff: [sdo] Groups - HelperContext Creation - Version 2 (HelperContextCreation-v2.zip) uploaded

The attached version of HelperContext creation APIs move
ImplementationResolver and DefaultImplementationResolver into the
commonj.sdo.impl package based on feedback from Frank.

 -- Mr. Blaise Doughan

The document revision named HelperContext Creation - Version 2
(HelperContextCreation-v2.zip) has been submitted by Mr. Blaise Doughan to
the OASIS Service Data Objects (SDO) TC document repository.  This document
is revision #1 of HelperContextCreation.zip.

Document Description:
Moved ImplementationResolver and DefaultImplementationResolver into the
commonj.sdo.impl based on Frank's review comments.

View Document Details:
http://www.oasis-open.org/committees/document.php?document_id=31787

Download Document:  
http://www.oasis-open.org/committees/download.php/31787/HelperContextCreation-v2.zip

Revision:
This document is revision #1 of HelperContextCreation.zip.  The document
details page referenced above will show the complete revision history.


PLEASE NOTE:  If the above links do not work for you, your email application
may be breaking the link into two pieces.  You may be able to copy and paste
the entire link address into the address field of your web browser.

-OASIS Open Administration


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]