[
https://issues.apache.org/jira/browse/AXIS2-5515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13644757#comment-13644757
]
Andreas Veithen commented on AXIS2-5515:
----------------------------------------
"There is no way to instantiate a non POJO in runtime."
The problem is that the object returned by ObjectSupplier must be POJO
(actually a JavaBean) and you cannot allow ObjectSupplier to create an
arbitrary object directly from the XML data. The reason is that this would
effectively create a custom deserializer, but then the code that generates the
XSD as well as the serialization code is no longer compatible with what this
custom deserializer does.
The sole purpose of ObjectSupplier is to allow using interfaces (instead of
concrete classes) as arguments and return types for POJO services (see
AXIS2-1346). Only the instantiation of the bean is delegated to ObjectSupplier,
but populating the bean must be done in BeanUtil to ensure consistency.
> ObjectSuplier doesn't provide a way to instantiate object in runtime which is
> not a POJO.
> ------------------------------------------------------------------------------------------
>
> Key: AXIS2-5515
> URL: https://issues.apache.org/jira/browse/AXIS2-5515
> Project: Axis2
> Issue Type: Improvement
> Components: kernel
> Affects Versions: 1.6.2, 1.7.0
> Reporter: Shameera Rathnayaka
> Assignee: Shameera Rathnayaka
> Fix For: 1.7.0
>
> Attachments: ObjectSupplier.patch
>
>
> Currently ObjectSupplier interface doesn't provide a way to instantiate
> Objects in runtime which doesn't has nullary constructor. it only define one
> method which takes
> only class object as method parameter. There is no way to instantiate a non
> POJO in runtime. Even we doesn't need to provide such a feature with
> DefaultObjectSupplier ,
> it is good to provide a API to do that. Then user can provide their own
> implementation this. Adding new method(Object getObject(Class clazz ,
> OMElement beanElement) throws AxisFault;)
> to ObjectSupplier would provide this. We don't need to implement this method
> in our DeafaultObjectSuppler.
> One use case for this is Java.util.UUID , this class doesn't has nullary
> constructor which only has UUID(long mostSigBits, long leastSigBits) , in
> such a case user can writer
> their own implementation of ObjectSupplier and use it.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]