summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/test/store-java/store/FruitsCatalogImpl.java
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-02-22 06:08:34 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-02-22 06:08:34 +0000
commit8c771c8ecd9bdc6b3ef0d5417db9bb9917b65fa9 (patch)
treea3671bc719d351a822b3728323e6456f163af2c3 /sca-cpp/trunk/test/store-java/store/FruitsCatalogImpl.java
parentd11cbfda813c7c6b32c06ddb33242fe3c82514eb (diff)
Moved component start calls from HTTPD postConfig to childInit, to give components an opportunity to start and setup connections and resources in each HTTPD child process. Adjusted utility components and test cases to this change. Minor code cleanup of Java components and integration tests.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@912491 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/test/store-java/store/FruitsCatalogImpl.java')
-rw-r--r--sca-cpp/trunk/test/store-java/store/FruitsCatalogImpl.java25
1 files changed, 12 insertions, 13 deletions
diff --git a/sca-cpp/trunk/test/store-java/store/FruitsCatalogImpl.java b/sca-cpp/trunk/test/store-java/store/FruitsCatalogImpl.java
index bb75926b1f..2904bbd8a1 100644
--- a/sca-cpp/trunk/test/store-java/store/FruitsCatalogImpl.java
+++ b/sca-cpp/trunk/test/store-java/store/FruitsCatalogImpl.java
@@ -19,34 +19,33 @@
package store;
+import static org.apache.tuscany.IterableUtil.*;
+
import org.apache.tuscany.Service;
-import static org.apache.tuscany.IterableUtil.list;
/**
* Catalog component implementation.
*/
public class FruitsCatalogImpl {
-
+
/**
* Returns the catalog.
*/
public Iterable<?> get(final CurrencyConverter converter, final Service currencyCode) {
final String code = currencyCode.eval();
-
+
class Converter {
- Double convert(Double price) {
+ Double convert(final Double price) {
return converter.convert(code, "USD", price);
}
- };
+ }
- Converter c = new Converter();
- String symbol = converter.symbol(code);
-
- return list(
- list(list("'javaClass", "services.Item"), list("'name", "Apple"), list("'currencyCode", code), list("'currencySymbol", symbol), list("'price", c.convert(2.99))),
+ final Converter c = new Converter();
+ final String symbol = converter.symbol(code);
+
+ return list(list(list("'javaClass", "services.Item"), list("'name", "Apple"), list("'currencyCode", code), list("'currencySymbol", symbol), list("'price", c.convert(2.99))),
list(list("'javaClass", "services.Item"), list("'name", "Orange"), list("'currencyCode", code), list("'currencySymbol", symbol), list("'price", c.convert(3.55))),
- list(list("'javaClass", "services.Item"), list("'name", "Pear"), list("'currencyCode", code), list("'currencySymbol", symbol), list("'price", c.convert(1.55)))
- );
+ list(list("'javaClass", "services.Item"), list("'name", "Pear"), list("'currencyCode", code), list("'currencySymbol", symbol), list("'price", c.convert(1.55))));
}
/**
@@ -55,5 +54,5 @@ public class FruitsCatalogImpl {
public Iterable<?> listMethods(final CurrencyConverter converter, final Service currencyCode) {
return list("Service.get");
}
-
+
}