incubator-photark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Subash Chaturanga <subash...@gmail.com>
Subject Re: How to Implement a custom Java Class which is capable of moving through Tuscany services.
Date Tue, 02 Aug 2011 05:45:20 GMT
Regarding my initial problem(discussion is under the subject "Problem with
interacting among two SCA services.") of having issues when using one
service by another, as a solution w.r.t this thread,

So I implemented a dummy Java bean class (with the intention, if  this works
I can refactor the service interface accordingly ) as you suggested, which
has two variables as information and no functioning methods . And replace
this with the org.face4j.Photo for testing purpose whether this PhotoP
object returns successfully from FaceRecognitionService to
FacebookFriendFinder service. But I got the same result where it terminates
at the same return point. Any idea ?

public class PhotoP {
    private String name;
    private String names;

    public PhotoP(String name){
     this.name=name;
    }

    public String getName(){
    return name;
    }

    @Property
    public void setName(String name){
      this.name = name;
    }

    public String getNames(){
    return names;
    }

    @Property
    public void setNames(String names){
      this.names = names;
    }

}


On Mon, Aug 1, 2011 at 7:47 AM, Luciano Resende <luckbr1975@gmail.com>wrote:

> On Sun, Jul 31, 2011 at 2:12 PM, Subash Chaturanga <subashsdm@gmail.com>
> wrote:
> > How to implement a custom Class which is capable of moving through
> Tuscany
> > services ? What are the  mandatory attributes it should have ? Does it
> need
> > to implement java Serializable interface explicitly? Does this class must
> > have only Java natives as its state such as (String, int, ..) ?
> >
>
> In general, you want to have Java beans [1] that represent pure data
> and have no behavior.  Having said that, this is really not a Tuscany
> question, but a general question depending on how you are going to
> serialize your class. Consider when you expose your service using a
> Tuscany JSON-RPC binding, which under the cover is going to use
> Jackson framework to serialize the object to json; in this case a Java
> bean would do it, but you could even take advantage of some JAXB
> annotations that are supported by Jackson. Now, if we consider
> exposing a service with Tuscany REST binding using XML wireformat, we
> need to understand some of the limitations we have when serializing
> XML, particularly where arrays need to be wrapped, etc.
>
> Well, hopefully this allows you to get going... if you want to discuss
> some proposals, I'm happy to review and provide any feedback.
>
>
>
> [1] http://en.wikipedia.org/wiki/JavaBean
>
>
>
> --
> Luciano Resende
> http://people.apache.org/~lresende
> http://twitter.com/lresende1975
> http://lresende.blogspot.com/
>



-- 
Subash Chaturanga
Department of Computer Science & Engineering
University of Moratuwa
Sri Lanka

Blog -  http://subashsdm.blogspot.com/
Twitter - http://twitter.com/subash89

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message