From d9e0a73826902ae27d9757427b56a90276878e4c Mon Sep 17 00:00:00 2001 From: fmoga Date: Thu, 9 Jun 2011 08:37:15 +0000 Subject: Minor modifications to the comet samples. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1133716 13f79535-47bb-0310-9956-ffa450edef68 --- .../binding-comet/pubsub-webapp/src/main/webapp/index.html | 3 +-- .../apache/tuscany/sca/sample/comet/CountryRepository.java | 2 +- .../tuscany/sca/sample/comet/CountryRepositoryImpl.java | 7 +------ .../apache/tuscany/sca/sample/comet/CountryServiceImpl.java | 12 ++++++------ 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/sca-java-2.x/contrib/samples/learning-more/binding-comet/pubsub-webapp/src/main/webapp/index.html b/sca-java-2.x/contrib/samples/learning-more/binding-comet/pubsub-webapp/src/main/webapp/index.html index ea217ac35d..e7b6354ac9 100644 --- a/sca-java-2.x/contrib/samples/learning-more/binding-comet/pubsub-webapp/src/main/webapp/index.html +++ b/sca-java-2.x/contrib/samples/learning-more/binding-comet/pubsub-webapp/src/main/webapp/index.html @@ -35,8 +35,7 @@ document.getElementById('connect').onclick = function(event) { /* transport can be : long-polling or streaming */ SCA.TuscanyComet.connect(document.getElementById('transport').value); - document.getElementById('connect').disabled = true; - document.getElementById('transport').disabled = true; + document.getElementById('connect').value = 'Switch'; } diff --git a/sca-java-2.x/contrib/samples/learning-more/binding-comet/single-response-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/CountryRepository.java b/sca-java-2.x/contrib/samples/learning-more/binding-comet/single-response-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/CountryRepository.java index ca16142bf5..12cdfb4235 100644 --- a/sca-java-2.x/contrib/samples/learning-more/binding-comet/single-response-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/CountryRepository.java +++ b/sca-java-2.x/contrib/samples/learning-more/binding-comet/single-response-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/CountryRepository.java @@ -25,6 +25,6 @@ import org.oasisopen.sca.annotation.Remotable; @Remotable public interface CountryRepository { - List getStartingWith(String text); + List findStartingWith(String text); } diff --git a/sca-java-2.x/contrib/samples/learning-more/binding-comet/single-response-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/CountryRepositoryImpl.java b/sca-java-2.x/contrib/samples/learning-more/binding-comet/single-response-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/CountryRepositoryImpl.java index 65ac77723e..8be65c9147 100644 --- a/sca-java-2.x/contrib/samples/learning-more/binding-comet/single-response-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/CountryRepositoryImpl.java +++ b/sca-java-2.x/contrib/samples/learning-more/binding-comet/single-response-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/CountryRepositoryImpl.java @@ -25,9 +25,7 @@ import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; -import org.oasisopen.sca.ComponentContext; import org.oasisopen.sca.annotation.Constructor; -import org.oasisopen.sca.annotation.Context; import org.oasisopen.sca.annotation.EagerInit; import org.oasisopen.sca.annotation.Init; import org.oasisopen.sca.annotation.Property; @@ -39,9 +37,6 @@ import org.oasisopen.sca.annotation.Service; @Service(CountryRepository.class) public class CountryRepositoryImpl implements CountryRepository { - @Context - protected ComponentContext context; - private String fileName; private List countries; @@ -70,7 +65,7 @@ public class CountryRepositoryImpl implements CountryRepository { } @Override - public List getStartingWith(String text) { + public List findStartingWith(String text) { List result = new ArrayList(); for (Country c : countries) { if (c.getName().toLowerCase().startsWith(text.toLowerCase())) { diff --git a/sca-java-2.x/contrib/samples/learning-more/binding-comet/single-response-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/CountryServiceImpl.java b/sca-java-2.x/contrib/samples/learning-more/binding-comet/single-response-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/CountryServiceImpl.java index 2a9321db1d..ad0786be59 100644 --- a/sca-java-2.x/contrib/samples/learning-more/binding-comet/single-response-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/CountryServiceImpl.java +++ b/sca-java-2.x/contrib/samples/learning-more/binding-comet/single-response-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/CountryServiceImpl.java @@ -26,11 +26,11 @@ import org.oasisopen.sca.annotation.Service; @Service(CountryService.class) public class CountryServiceImpl implements CountryService { - @Reference - protected CountryRepository repository; + @Reference + protected CountryRepository repository; - @Override - public List getCountriesStartingWith(String text) { - return repository.getStartingWith(text); - } + @Override + public List getCountriesStartingWith(String text) { + return repository.findStartingWith(text); + } } -- cgit v1.2.3