From photark-dev-return-1425-apmail-incubator-photark-dev-archive=incubator.apache.org@incubator.apache.org Tue Aug 2 05:46:05 2011 Return-Path: X-Original-To: apmail-incubator-photark-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-photark-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C3A236B84 for ; Tue, 2 Aug 2011 05:46:05 +0000 (UTC) Received: (qmail 60742 invoked by uid 500); 2 Aug 2011 05:46:05 -0000 Delivered-To: apmail-incubator-photark-dev-archive@incubator.apache.org Received: (qmail 60702 invoked by uid 500); 2 Aug 2011 05:45:57 -0000 Mailing-List: contact photark-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: photark-dev@incubator.apache.org Delivered-To: mailing list photark-dev@incubator.apache.org Received: (qmail 60666 invoked by uid 99); 2 Aug 2011 05:45:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Aug 2011 05:45:52 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of subashsdm@gmail.com designates 209.85.216.182 as permitted sender) Received: from [209.85.216.182] (HELO mail-qy0-f182.google.com) (209.85.216.182) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Aug 2011 05:45:41 +0000 Received: by qyk38 with SMTP id 38so4589490qyk.6 for ; Mon, 01 Aug 2011 22:45:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=sX0KuCzAxM6FMRW7H7/rTRkGXcCnt5L2Vdpadr0FUCQ=; b=MUT/Hy07jHQD9gMk4ldBYaeUMKW2vZ4o28MU3FEFUmmw4kDro5ZeAMnkVWnyUZCMcb NaqP10ghxEL2V0kl16j0q/iuEDvletw501KjXXVRWdYiOJ/HOvjqZ9qjpwJZ4uv5Pco7 a4Qf4RL6W1e/8b1yVTG5XwDnpQN9pnTBPhV6c= MIME-Version: 1.0 Received: by 10.229.97.129 with SMTP id l1mr971550qcn.289.1312263921029; Mon, 01 Aug 2011 22:45:21 -0700 (PDT) Received: by 10.229.81.204 with HTTP; Mon, 1 Aug 2011 22:45:20 -0700 (PDT) In-Reply-To: References: Date: Tue, 2 Aug 2011 11:15:20 +0530 Message-ID: Subject: Re: How to Implement a custom Java Class which is capable of moving through Tuscany services. From: Subash Chaturanga To: photark-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=0016364eeeacdd524a04a97f402f X-Virus-Checked: Checked by ClamAV on apache.org --0016364eeeacdd524a04a97f402f Content-Type: text/plain; charset=ISO-8859-1 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 wrote: > On Sun, Jul 31, 2011 at 2:12 PM, Subash Chaturanga > 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 --0016364eeeacdd524a04a97f402f--