You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Shameera Rathnayaka <sh...@gmail.com> on 2013/04/25 20:40:22 UTC

ObjectSupplier Limited to create object instance with nullary Constructor.

Hi devs,

According to my inspection,
There is no way to create a new instance from a class, which hasn't nullary
constructor by an ObjectSupplier. see the getObject method declaration.

Object getObject(Class clazz) throws AxisFault; This is an limitation.

adding anothe abstact method getObject(Class clazz , Class[] parameters ,
Object[] initargs) throw AxisFault; to ObjectSupplier would be the
solution. DefaultObjectSupplier is the one and only concrete class of this
interface.It will implement the logic.

Other than that, If we see the services.xsd there is no way to define
custom ObjectSuppliers in services.xml but in ServiceBuilder it check for
ObjectSupplier in sevice discription this alway return null.

String objectSupplierValue = (String) service
.getParameterValue(TAG_OBJECT_SUPPLIER);

we can define a new element for objectSupplier as last child of  service
element to fix this.

If everyone ok with this , i will open an issue and proceed with this.

Thanks,
Shameera.


-- 
Best Regards,
Shameera Rathnayaka.

email: shameera AT apache.org , shameerainfo AT gmail.com
Blog : http://shameerarathnayaka.blogspot.com/

Re: ObjectSupplier Limited to create object instance with nullary Constructor.

Posted by Shameera Rathnayaka <sh...@gmail.com>.
Hi Martin ,

On Fri, Apr 26, 2013 at 3:32 PM, Martin Gainty <mg...@hotmail.com> wrote:

> Just so we're on the same page..please create the JIRA and the format of
> the new ObjectSupplier element to services.xml
>

I was wrong, we don't need to change the services.xsd file, we can provide
ObjectSupliers as a parameter of particular service element.


> Also when the Object Supplier is missing it would seem "The lack
> of ObjectSupplier exception" should be handled better than a stacktrace
> perhaps with an informative user-friendly message
>
+1, will work on this.

Cheers,
Shameera.



>
> Thanks,
> Martin
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
>
>
>
>
>  ------------------------------
> From: shameerainfo@gmail.com
> Date: Fri, 26 Apr 2013 00:10:22 +0530
> Subject: ObjectSupplier Limited to create object instance with nullary
> Constructor.
> To: java-dev@axis.apache.org
>
>
>  Hi devs,
>
> According to my inspection,
>  There is no way to create a new instance from a class, which hasn't
> nullary constructor by an ObjectSupplier. see the getObject method
> declaration.
>
> Object getObject(Class clazz) throws AxisFault; This is an limitation.
>
> adding anothe abstact method getObject(Class clazz , Class[] parameters ,
> Object[] initargs) throw AxisFault; to ObjectSupplier would be the
> solution. DefaultObjectSupplier is the one and only concrete class of this
> interface.It will implement the logic.
>
> Other than that, If we see the services.xsd there is no way to define
> custom ObjectSuppliers in services.xml but in ServiceBuilder it check for
> ObjectSupplier in sevice discription this alway return null.
>
>  String objectSupplierValue = (String) service
> .getParameterValue(TAG_OBJECT_SUPPLIER);
>
>  we can define a new element for objectSupplier as last child of  service
> element to fix this.
>
> If everyone ok with this , i will open an issue and proceed with this.
>
> Thanks,
> Shameera.
>
>
> --
>  Best Regards,
> Shameera Rathnayaka.
>
> email: shameera AT apache.org , shameerainfo AT gmail.com
> Blog : http://shameerarathnayaka.blogspot.com/
>



-- 
Best Regards,
Shameera Rathnayaka.

email: shameera AT apache.org , shameerainfo AT gmail.com
Blog : http://shameerarathnayaka.blogspot.com/

RE: ObjectSupplier Limited to create object instance with nullary Constructor.

Posted by Martin Gainty <mg...@hotmail.com>.
Just so we're on the same page..please create the JIRA and the format of the new ObjectSupplier element to services.xml 
 
Also when the Object Supplier is missing it would seem "The lack of ObjectSupplier exception" should be handled better than a stacktrace perhaps with an informative user-friendly message
 
Thanks,
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

  




From: shameerainfo@gmail.com
Date: Fri, 26 Apr 2013 00:10:22 +0530
Subject: ObjectSupplier Limited to create object instance with nullary Constructor.
To: java-dev@axis.apache.org



Hi devs,


According to my inspection, 


There is no way to create a new instance from a class, which hasn't nullary constructor by an ObjectSupplier. see the getObject method declaration. 


Object getObject(Class clazz) throws AxisFault; This is an limitation.


adding anothe abstact method getObject(Class clazz , Class[] parameters , Object[] initargs) throw AxisFault; to ObjectSupplier would be the solution. DefaultObjectSupplier is the one and only concrete class of this interface.It will implement the logic. 


Other than that, If we see the services.xsd there is no way to define custom ObjectSuppliers in services.xml but in ServiceBuilder it check for ObjectSupplier in sevice discription this alway return null. 




String objectSupplierValue = (String) service
.getParameterValue(TAG_OBJECT_SUPPLIER);



we can define a new element for objectSupplier as last child of  service element to fix this.


If everyone ok with this , i will open an issue and proceed with this. 


Thanks,
Shameera.


-- 


Best Regards,Shameera Rathnayaka. 



email: shameera AT apache.org , shameerainfo AT gmail.comBlog : http://shameerarathnayaka.blogspot.com/
 		 	   		  

Re: ObjectSupplier Limited to create object instance with nullary Constructor.

Posted by Shameera Rathnayaka <sh...@gmail.com>.
H
i Sagara,


On Fri, Apr 26, 2013 at 4:54 PM, Sagara Gunathunga <
sagara.gunathunga@gmail.com> wrote:

>
> I'm not sure whether we are having duplicate features here, usually we can
> provide custom objects using "ServiceObjectSupplier" [1] parameter within
> services.xml file. This is how we supported to Spring[2] and i used same
> concept to support Guice [2] too. Cant we simply use ServiceObjectSupplier
> in your requirement ?
>

I think ServiceObjectSupplier is a special suppler which provide service
objects but ObjectSupplier is more generic one. And in above case, getting
an Object with AxisService is like do the same thing again, as we have
already come far deep and we have filtered out many resources with
AxisService.

I think ServiceObjectSupplier should be inherited from ObjectSupplier isn't
it?

Cheers.
Shameera.


>
> [1] -
> http://axis.apache.org/axis2/java/core/api/org/apache/axis2/ServiceObjectSupplier.html
> [2] - http://axis.apache.org/axis2/java/core/docs/spring.html
> [3] - http://ssagara.blogspot.de/2009/05/guice-axis2-integration.html
>
> Thanks !
>
>>
>> Thanks,
>> Shameera.
>>
>>
>> --
>> Best Regards,
>> Shameera Rathnayaka.
>>
>> email: shameera AT apache.org , shameerainfo AT gmail.com
>> Blog : http://shameerarathnayaka.blogspot.com/
>>
>
>
>
> --
> Sagara Gunathunga
>
> Blog      - http://ssagara.blogspot.com
> Web      - http://people.apache.org/~sagara/
> LinkedIn - http://www.linkedin.com/in/ssagara




-- 
Best Regards,
Shameera Rathnayaka.

email: shameera AT apache.org , shameerainfo AT gmail.com
Blog : http://shameerarathnayaka.blogspot.com/

Re: ObjectSupplier Limited to create object instance with nullary Constructor.

Posted by Sagara Gunathunga <sa...@gmail.com>.
On Fri, Apr 26, 2013 at 12:10 AM, Shameera Rathnayaka <
shameerainfo@gmail.com> wrote:

> Hi devs,
>
> According to my inspection,
> There is no way to create a new instance from a class, which hasn't
> nullary constructor by an ObjectSupplier. see the getObject method
> declaration.
>
> Object getObject(Class clazz) throws AxisFault; This is an limitation.
>
> adding anothe abstact method getObject(Class clazz , Class[] parameters ,
> Object[] initargs) throw AxisFault; to ObjectSupplier would be the
> solution. DefaultObjectSupplier is the one and only concrete class of this
> interface.It will implement the logic.
>
> Other than that, If we see the services.xsd there is no way to define
> custom ObjectSuppliers in services.xml but in ServiceBuilder it check for
> ObjectSupplier in sevice discription this alway return null.
>
> String objectSupplierValue = (String) service
> .getParameterValue(TAG_OBJECT_SUPPLIER);
>
> we can define a new element for objectSupplier as last child of  service
> element to fix this.
>
> If everyone ok with this , i will open an issue and proceed with this.
>

I'm not sure whether we are having duplicate features here, usually we can
provide custom objects using "ServiceObjectSupplier" [1] parameter within
services.xml file. This is how we supported to Spring[2] and i used same
concept to support Guice [2] too. Cant we simply use ServiceObjectSupplier
in your requirement ?

[1] -
http://axis.apache.org/axis2/java/core/api/org/apache/axis2/ServiceObjectSupplier.html
[2] - http://axis.apache.org/axis2/java/core/docs/spring.html
[3] - http://ssagara.blogspot.de/2009/05/guice-axis2-integration.html

Thanks !

>
> Thanks,
> Shameera.
>
>
> --
> Best Regards,
> Shameera Rathnayaka.
>
> email: shameera AT apache.org , shameerainfo AT gmail.com
> Blog : http://shameerarathnayaka.blogspot.com/
>



-- 
Sagara Gunathunga

Blog      - http://ssagara.blogspot.com
Web      - http://people.apache.org/~sagara/
LinkedIn - http://www.linkedin.com/in/ssagara