Return-Path: X-Original-To: apmail-tuscany-commits-archive@www.apache.org Delivered-To: apmail-tuscany-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1187C7F7E for ; Tue, 13 Dec 2011 09:23:29 +0000 (UTC) Received: (qmail 43867 invoked by uid 500); 13 Dec 2011 09:23:29 -0000 Delivered-To: apmail-tuscany-commits-archive@tuscany.apache.org Received: (qmail 43846 invoked by uid 500); 13 Dec 2011 09:23:27 -0000 Mailing-List: contact commits-help@tuscany.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tuscany.apache.org Delivered-To: mailing list commits@tuscany.apache.org Received: (qmail 43839 invoked by uid 99); 13 Dec 2011 09:23:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Dec 2011 09:23:27 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Dec 2011 09:23:26 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 70B6123889D7 for ; Tue, 13 Dec 2011 09:23:05 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1213624 - /tuscany/sca-java-2.x/trunk/testing/itest/dynamicRefURI/src/main/java/org/apache/tuscany/sca/itest/HelloworldClient.java Date: Tue, 13 Dec 2011 09:23:05 -0000 To: commits@tuscany.apache.org From: antelder@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111213092305.70B6123889D7@eris.apache.org> Author: antelder Date: Tue Dec 13 09:23:05 2011 New Revision: 1213624 URL: http://svn.apache.org/viewvc?rev=1213624&view=rev Log: Update to use the new Tuscany ComponentContext and ServiceReference interfaces Modified: tuscany/sca-java-2.x/trunk/testing/itest/dynamicRefURI/src/main/java/org/apache/tuscany/sca/itest/HelloworldClient.java Modified: tuscany/sca-java-2.x/trunk/testing/itest/dynamicRefURI/src/main/java/org/apache/tuscany/sca/itest/HelloworldClient.java URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/dynamicRefURI/src/main/java/org/apache/tuscany/sca/itest/HelloworldClient.java?rev=1213624&r1=1213623&r2=1213624&view=diff ============================================================================== --- tuscany/sca-java-2.x/trunk/testing/itest/dynamicRefURI/src/main/java/org/apache/tuscany/sca/itest/HelloworldClient.java (original) +++ tuscany/sca-java-2.x/trunk/testing/itest/dynamicRefURI/src/main/java/org/apache/tuscany/sca/itest/HelloworldClient.java Tue Dec 13 09:23:05 2011 @@ -19,9 +19,9 @@ package org.apache.tuscany.sca.itest; -import org.apache.tuscany.sca.core.context.impl.ServiceReferenceImpl; +import org.apache.tuscany.sca.runtime.TuscanyComponentContext; +import org.apache.tuscany.sca.runtime.TuscanyServiceReference; import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.ServiceReference; import org.oasisopen.sca.annotation.Context; import org.oasisopen.sca.annotation.Reference; @@ -32,14 +32,21 @@ public class HelloworldClient implements @Context public ComponentContext componentContext; + + @Context + public TuscanyComponentContext tuscanyComponentContext; @Override public String sayHello(String name) { - ServiceReference sr = componentContext.getServiceReference(Helloworld.class, "helloworldService"); +// ServiceReference sr = componentContext.getServiceReference(Helloworld.class, "helloworldService"); +// ((ServiceReferenceImpl)sr).setBindingURI("http://localhost:8080/HelloworldService/Helloworld"); - ((ServiceReferenceImpl)sr).setBindingURI("http://localhost:8080/HelloworldService/Helloworld"); + TuscanyServiceReference tsr = tuscanyComponentContext.getServiceReference(Helloworld.class, "helloworldService"); +// TuscanyServiceReference tsr = (TuscanyServiceReference)componentContext.getServiceReference(Helloworld.class, "helloworldService"); + tsr.setBindingURI("http://localhost:8080/HelloworldService/Helloworld"); - return "client: " + sr.getService().sayHello(name); + + return "client: " + tsr.getService().sayHello(name); } }