Re: Plugable JAXBContext

2009-01-28 Thread Paul Austin
Jerome,

Thanks, when I get back from my vacation I'll start the discussion on  
the dev list.

Paul

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1063257


RE: Plugable JAXBContext

2009-01-27 Thread Jerome Louvel
Hi Paul,
 
Thanks for the suggestion. At first sight that seems pretty useful, so I've 
entered a new RFE:
 
Plugable JAXBContext
http://restlet.tigris.org/issues/show_bug.cgi?id=721
 
See my comment directly in the RFE. If needed we can start a new thread in the 
developers' list to discuss technical details.
 
Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~  http://www.restlet.org/ 
http://www.restlet.org
Noelios Technologies ~ Co-founder ~  http://www.noelios.com/ 
http://www.noelios.com
 

  _  

De : Paul Austin [mailto:mail-li...@revolsys.com] 
Envoye : vendredi 23 janvier 2009 16:21
A : discuss@restlet.tigris.org
Objet : Plugable JAXBContext


Would it be possible to modify the JaxbRepresentation to support passing the a 
JAXB_CONTEXT_FACTORY property with the name of the
factory to create the context. That class must have the following method.

public static JAXBContext createContext(String, ClassLoader) throws 
JAXBException;

This way you can easily plug-in say Jersey's JSONJAXContext to get Object-JSON 
mapping.

Behind the scenes you would need to modify the getContext methods to maintain a 
separate cache for each context factory.

Another alternate method would be to modify the class to have a static method 
to set the context factory to be used for a specific
MIME type. With this approach when you use the MimeType, Object constructor it 
would use the appropriate JaxbContext factory for
that mime type.

Paul

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1060308

Plugable JAXBContext

2009-01-23 Thread Paul Austin
Would it be possible to modify the JaxbRepresentation to support passing the
a JAXB_CONTEXT_FACTORY property with the name of the factory to create the
context. That class must have the following method.

public static JAXBContext createContext(String, ClassLoader) throws
JAXBException;

This way you can easily plug-in say Jersey's JSONJAXContext to get
Object-JSON mapping.

Behind the scenes you would need to modify the getContext methods to
maintain a separate cache for each context factory.

Another alternate method would be to modify the class to have a static
method to set the context factory to be used for a specific MIME type. With
this approach when you use the MimeType, Object constructor it would use the
appropriate JaxbContext factory for that mime type.

Paul

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1044973