From d64d4281ec5636ffc7511cc94fcc3171f34bb805 Mon Sep 17 00:00:00 2001 From: antelder Date: Thu, 10 Feb 2011 08:38:40 +0000 Subject: Rename these old samples in contrib git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1069273 13f79535-47bb-0310-9956-ffa450edef68 --- .../very-old-samples/simple-bigbank-spring/README | 148 +++++++++++ .../simple-bigbank-spring/build-dojo.xml | 92 +++++++ .../simple-bigbank-spring/build.xml | 72 ++++++ .../very-old-samples/simple-bigbank-spring/pom.xml | 277 +++++++++++++++++++++ .../simple-bigbank-spring.png | Bin 0 -> 10202 bytes .../simple-bigbank-spring.svg | 200 +++++++++++++++ .../main/java/bigbank/account/AccountReport.java | 43 ++++ .../main/java/bigbank/account/AccountService.java | 26 ++ .../java/bigbank/account/AccountServiceImpl.java | 145 +++++++++++ .../account/checking/CheckingAccountDetails.java | 45 ++++ .../account/checking/CheckingAccountService.java | 34 +++ .../java/bigbank/account/feed/AccountFeedImpl.java | 71 ++++++ .../account/savings/SavingsAccountDetails.java | 47 ++++ .../account/savings/SavingsAccountService.java | 32 +++ .../account/savings/SavingsAccountServiceImpl.java | 62 +++++ .../bigbank/account/stock/StockAccountDetails.java | 63 +++++ .../bigbank/account/stock/StockAccountService.java | 33 +++ .../account/stock/StockAccountServiceImpl.java | 56 +++++ .../java/bigbank/calculator/CalculatorService.java | 34 +++ .../main/java/bigbank/client/BigBankClient.java | 46 ++++ .../main/java/bigbank/server/BigBankServer.java | 54 ++++ .../java/bigbank/stockquote/StockQuoteService.java | 31 +++ .../src/main/resources/BigBank.composite | 88 +++++++ .../src/main/resources/SavingsAccount.composite | 32 +++ .../src/main/resources/StockAccount.composite | 32 +++ .../spring-context/Account-spring-context.xml | 53 ++++ .../spring-context/SavingsAccount-context.xml | 33 +++ .../StockAccount/META-INF/MANIFEST.MF | 4 + .../META-INF/spring/StockAccount-context.xml | 33 +++ .../src/main/resources/web/style.css | 22 ++ .../src/test/java/bigbank/BigBankTestCase.java | 34 +++ 31 files changed, 1942 insertions(+) create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/README create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/build-dojo.xml create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/build.xml create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/pom.xml create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/simple-bigbank-spring.png create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/simple-bigbank-spring.svg create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/AccountReport.java create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/AccountService.java create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/AccountServiceImpl.java create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/checking/CheckingAccountDetails.java create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/checking/CheckingAccountService.java create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/feed/AccountFeedImpl.java create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/savings/SavingsAccountDetails.java create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/savings/SavingsAccountService.java create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/savings/SavingsAccountServiceImpl.java create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/stock/StockAccountDetails.java create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/stock/StockAccountService.java create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/stock/StockAccountServiceImpl.java create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/calculator/CalculatorService.java create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/client/BigBankClient.java create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/server/BigBankServer.java create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/stockquote/StockQuoteService.java create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/BigBank.composite create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/SavingsAccount.composite create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/StockAccount.composite create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/spring-context/Account-spring-context.xml create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/spring-context/SavingsAccount-context.xml create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/spring-context/StockAccount/META-INF/MANIFEST.MF create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/spring-context/StockAccount/META-INF/spring/StockAccount-context.xml create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/web/style.css create mode 100644 sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/test/java/bigbank/BigBankTestCase.java (limited to 'sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring') diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/README b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/README new file mode 100644 index 0000000000..bb44d63719 --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/README @@ -0,0 +1,148 @@ +Spring Bigbank Sample +====================== +This sample is made of 3 modules that represent the different aspects of a fictitious banking application. + +To run the simple-bigbank-spring sample you need to first run spring-bigbank-calculator, spring-bigbank-checkaccount and spring-bigbank-stockquote composites. +This will bring up Tuscany runtime and load the three applications and make them available as services. +Bigbank-Spring is dependent on these services. + +This demo uses ant. This is just one way of running this demo. + +Start Spring-Bigbank-calculator Composite +----------------------------------------- + +Spring-Bigbank-calculator is a calculator application which handles add, subtract, multiply and divide operations. Each of these operations is implemented in a different language, including JavaScript, groovy, Ruby and Python. + +To run the spring-bigbank-calculator composite and make it available as a service for this demo do the following: + +cd spring-bigbank-calculator +ant compile +ant run + +.. Leave the server running + +Note that 'ant compile' needs to be done the first time you run this demo out of the binary distribution. No need to do 'ant compile' from there on. + +Start Spring-Bigbank-checkaccount Composite +------------------------------------------- + +This contains all artifacts that deal with the account management within the bigbank. The services offered by the bigbank-account module are used by the bigbank. + +cd spring-bigbank-checkaccount +ant compile +ant run + +.. Leave the server running + +Note that 'ant compile' needs to be done the first time you run this demo out of the binary distribution. No need to do 'ant compile' from there on. + +Start Spring-Bigbank-stockquote Composite +----------------------------------------- + +A very simple web services based stock quote application which returns random +stock quotes on request. Please note that the stockquote service is not live and is implemented instead to allow for this application to always run without dependency on the availability of a webservice. + +cd spring-bigbank-stockquote +ant compile +ant run + +.. Leave the server running + +Start Spring Bigbank +-------------------- +This contains all artifacts that make up the bigbank application. This is the application that the end user interacts with + +Start spring-bigbank in the following way: + +i ) Compile the spring-bigbank as follows : + + cd simple-bigbank-spring + ant compile + +ii) Now start the bigbank service as follows : + + cd bigbank + ant compile + ant run + + .. Leave the server running + +Note that 'ant compile' needs to be done the first time you run this demo out ofthe binary distribution. +No need to do 'ant compile' from there on. + +Sample Overview +--------------- +This sample demonstrates a simple bank summary transaction using Spring for one of the components. + +A request to the AccountComponent results in a request to the AccountDataComponent to get account data +which is based on a random stock quote price. Therefore result for this sample will vary on each run. + + +simple-bigbank-spring/ + src/ + main/ + java/ + bigbank/ + account/ - AccountComponent implementation using Spring + accountdata/ - AccountDataComponent implementation using Spring + sockquote/ - stockquote implementation using Java + client/ - starts the SCA Runtime and + deploys the BigBank.composite. + It then calls the deployed AccountService + resources/ + Account.composite - SCA assembly for this sample + BigBank.composite - SCA assembly for this sample + StockQuote.composite - SCA assembly for this sample + test/ + java/ + bigbank/ + BigBankTestCase.java - JUnit test case + simple-bigbank-spring.png - a pictorial representation of the sample + .composite file + build.xml - the Ant build file + pom.xml - the Maven build file + +Building And Running The Sample Using Ant +----------------------------------------- +With the binary distribution the sample can be built and run using Ant as +follows + +cd simple-bigbank-spring +ant compile +ant run + +You should see the following output. +** Please note that balance amount will vary depending on the random stock value. + +run: + [java] Spring parent context - getBean called for name: stockQuoteService + [java] Getting stock quote for: IBM, value: 104.97 + [java] Account summary: currency: USD, [ID:Foo_CHA12345, balance:1500.0, ID +:Foo_SAA12345, balance:1500.0, ID:Foo_STA12345, symbol:IBM, quantity:100, balance:10497.0] + + +Building And Running The Sample Using Maven +------------------------------------------- +With either the binary or source distributions the sample can be built and run +using Maven as follows. + +cd simple-bigbank-spring +mvn + +You should see the following output from the test phase. +** Please note that balance amount will vary depending on the random stock value. + +------------------------------------------------------- + T E S T S +------------------------------------------------------- +Running bigbank.BigBankTestCase +Getting stock quote for: IBM, value: 104.02 +Account summary: currency: USD, [ID:Foo_CHA12345, balance:1500.0, ID:Foo_SAA1234 +5, balance:1500.0, ID:Foo_STA12345, symbol:IBM, quantity:100, balance:10402.0] +Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.502 sec + +Results : + +Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 + +This shows that the Junit test cases have run successfully. diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/build-dojo.xml b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/build-dojo.xml new file mode 100644 index 0000000000..9d282c2dd2 --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/build-dojo.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/build.xml b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/build.xml new file mode 100644 index 0000000000..ecc2596d71 --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/build.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/pom.xml b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/pom.xml new file mode 100644 index 0000000000..5e71de9a6b --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/pom.xml @@ -0,0 +1,277 @@ + + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 2.0-SNAPSHOT + ../../pom.xml + + sample-simple-bigbank-spring + Apache Tuscany SCA Spring-Based Simplified BigBank Sample + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tuscany-node-api + 2.0-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-node-impl + 2.0-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-embedded + 2.0-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-core-spi + 2.0-SNAPSHOT + + + + org.apache.ws.security + wss4j + 1.5.3 + + + + commons-httpclient + commons-httpclient + 3.0.1 + + + + commons-logging + commons-logging + 1.1 + + + javax.servlet + servlet-api + + + + + + org.apache.tuscany.sca + tuscany-data-api + 2.0-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 2.0-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-spring + 2.0-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-rmi-runtime + 2.0-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-ws-axis2 + 2.0-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jms-runtime + 2.0-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-atom-abdera + 2.0-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-rss-rome + 2.0-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-resource-runtime + 2.0-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + sample-spring-bigbank-checkaccount + 2.0-SNAPSHOT + test + + + + org.apache.tuscany.sca + tuscany-binding-jsonrpc-runtime + 2.0-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-http-runtime + 2.0-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-jetty + 2.0-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-tomcat + 2.0-SNAPSHOT + runtime + + + + org.springframework + spring-core + 2.5.5 + + + + org.springframework + spring-beans + 2.5.5 + + + + org.springframework + spring-context + 2.5.5 + + + + junit + junit + 4.5 + test + + + + + + ${artifactId} + + + org.apache.maven.plugins + maven-antrun-plugin + + + + ant + ant-trax + 1.6.5 + + + + + + install-dojo + validate + + run + + + + + + + + + + + copy-dojo-files + generate-resources + + run + + + + + + + + + + + + clean-dojo-files + clean + + run + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/simple-bigbank-spring.png b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/simple-bigbank-spring.png new file mode 100644 index 0000000000..593c047f6a Binary files /dev/null and b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/simple-bigbank-spring.png differ diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/simple-bigbank-spring.svg b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/simple-bigbank-spring.svg new file mode 100644 index 0000000000..c64f6de6b9 --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/simple-bigbank-spring.svg @@ -0,0 +1,200 @@ + + + + + + + + + + image/svg+xml + + + + + + + + BigBank + + AccountServiceComponent + + + + + AccountDataServiceComponent + + + currency AccountService + diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/AccountReport.java b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/AccountReport.java new file mode 100644 index 0000000000..1625ff5b65 --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/AccountReport.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package bigbank.account; + +import java.util.List; + +/** + */ +public class AccountReport { + private List summaries; + private String currency; + + public AccountReport(String currency, List summaries) { + this.currency = currency; + this.summaries = summaries; + } + + public List getAccountSummaries() { return summaries; } + + public String getCurrency() { return currency; } + + @Override + public String toString() { + return "currency: "+ currency + ", " + summaries; + } + +} diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/AccountService.java b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/AccountService.java new file mode 100644 index 0000000000..7c9082b944 --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/AccountService.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package bigbank.account; + +/** + * Interface for a account service + */ +public interface AccountService { + public AccountReport getAccountReport(String customerID); +} diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/AccountServiceImpl.java b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/AccountServiceImpl.java new file mode 100644 index 0000000000..6252697ffe --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/AccountServiceImpl.java @@ -0,0 +1,145 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package bigbank.account; + +import java.util.ArrayList; +import java.util.List; + +import org.oasisopen.sca.annotation.Service; + +import bigbank.account.checking.CheckingAccountDetails; +import bigbank.account.checking.CheckingAccountService; +import bigbank.account.savings.SavingsAccountDetails; +import bigbank.account.savings.SavingsAccountService; +import bigbank.account.stock.StockAccountDetails; +import bigbank.account.stock.StockAccountService; +import bigbank.stockquote.StockQuoteService; +import bigbank.calculator.CalculatorService; + +/** + * Account service implementation + */ +@Service(AccountService.class) +public class AccountServiceImpl implements AccountService { + + private SavingsAccountService savingsAccountService; + + private CheckingAccountService checkingAccountService; + + private StockAccountService stockAccountService; + + private CalculatorService calculatorService; + + private StockQuoteService stockQuoteService; + + private String currency; + + public AccountReport getAccountReport(String customerID) { + + // Get the checking, savings and stock accounts from the AccountData + // service component + CheckingAccountDetails checking = null; + List summaries = new ArrayList(); + try { + checking = checkingAccountService.getAccountDetails(customerID); + System.out.println("Checking account: " + checking); + summaries.add(checking.toString()); + + SavingsAccountDetails savings = savingsAccountService.getAccountDetails(customerID); + System.out.println("Savings account: " + savings); + summaries.add(savings.toString()); + + StockAccountDetails stock = stockAccountService.getAccountDetails(customerID); + System.out.println("Stock account: " + stock); + summaries.add(stock.toString()); + + // Get the stock price in USD + double price = stockQuoteService.getQuote(stock.getSymbol()); + System.out.println("Stock price for " + stock.getSymbol() + ": " + price); + + // Convert to the configured currency + if (currency.equals("EURO")) { + + // Use our fancy calculator service to convert to the target currency + price = calculatorService.multiply(price, 0.70); + + System.out.println("Converted to " + currency + ": " + price); + } + + // Calculate the value of the stock account + double stockValue = price * stock.getQuantity(); + summaries.add(stock.toString()); + + AccountReport report = new AccountReport(currency, summaries); + + return report; + } catch ( Throwable e ) { + e.printStackTrace(); + return null; + } + } + + public SavingsAccountService getSavingsAccountService() { + return savingsAccountService; + } + + public void setSavingsAccountService(SavingsAccountService savingsAccountService) { + this.savingsAccountService = savingsAccountService; + } + + public CheckingAccountService getCheckingAccountService() { + return checkingAccountService; + } + + public void setCheckingAccountService(CheckingAccountService checkingAccountService) { + this.checkingAccountService = checkingAccountService; + } + + public StockAccountService getStockAccountService() { + return stockAccountService; + } + + public void setStockAccountService(StockAccountService stockAccountService) { + this.stockAccountService = stockAccountService; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency; + } + + public CalculatorService getCalculatorService() { + return calculatorService; + } + + public void setCalculatorService(CalculatorService calculatorService) { + this.calculatorService = calculatorService; + } + + public StockQuoteService getStockQuoteService() { + return stockQuoteService; + } + + public void setStockQuoteService(StockQuoteService stockQuoteService) { + this.stockQuoteService = stockQuoteService; + } +} diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/checking/CheckingAccountDetails.java b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/checking/CheckingAccountDetails.java new file mode 100644 index 0000000000..3f81f48fb9 --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/checking/CheckingAccountDetails.java @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package bigbank.account.checking; + +public class CheckingAccountDetails { + private String accountNumber; + private double balance; + + public String getAccountNumber() { + return accountNumber; + } + + public void setAccountNumber(String n) { + this.accountNumber = n; + } + + public double getBalance() { + return balance; + } + + public void setBalance(double b) { + this.balance = b; + } + + @Override + public String toString() { + return accountNumber + ", balance:" + balance; + } +} diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/checking/CheckingAccountService.java b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/checking/CheckingAccountService.java new file mode 100644 index 0000000000..8596181d7f --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/checking/CheckingAccountService.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package bigbank.account.checking; + +import org.oasisopen.sca.annotation.Remotable; +import org.oasisopen.sca.annotation.Service; + +@Service +@Remotable +public interface CheckingAccountService { + + public CheckingAccountDetails getAccountDetails(String customerID); + + public double deposit(String accountNo, double depositAmt); + + public double withdraw(String accountNo, double withdrawalAmount); + +} diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/feed/AccountFeedImpl.java b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/feed/AccountFeedImpl.java new file mode 100644 index 0000000000..2b086ec467 --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/feed/AccountFeedImpl.java @@ -0,0 +1,71 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package bigbank.account.feed; + +import org.apache.tuscany.sca.data.collection.Collection; +import org.apache.tuscany.sca.data.collection.Entry; +import org.apache.tuscany.sca.data.collection.NotFoundException; +import org.oasisopen.sca.annotation.Reference; +import org.oasisopen.sca.annotation.Service; + +import bigbank.account.AccountService; +import bigbank.account.AccountReport; + +/** + * @version $$Rev$$ $$Date$$ + */ + +@Service(Collection.class) +public class AccountFeedImpl implements Collection { + + @Reference + protected AccountService accountService; + + public Entry[] getAll() { + + // Add the Account report entry + String report = get("1234"); + Entry entry = new Entry("1234", report); + + return new Entry[] { entry } ; + } + + public String get(String id) { + + // Get the account report for the specified customer ID + AccountReport accreport = accountService.getAccountReport(id); + String report = accreport.getCurrency(); + + return report; + } + + public void delete(String key) throws NotFoundException { + } + + public String post(String key, String item) { + return null; + } + + public void put(String key, String item) throws NotFoundException { + } + + public Entry[] query(String queryString) { + return null; + } +} diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/savings/SavingsAccountDetails.java b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/savings/SavingsAccountDetails.java new file mode 100644 index 0000000000..bcac678cd7 --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/savings/SavingsAccountDetails.java @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package bigbank.account.savings; + +import java.io.Serializable; + +public class SavingsAccountDetails implements Serializable { + private String accountNumber; + private double balance; + + public String getAccountNumber() { + return accountNumber; + } + + public void setAccountNumber(String n) { + this.accountNumber = n; + } + + public double getBalance() { + return balance; + } + + public void setBalance(double b) { + this.balance = b; + } + + @Override + public String toString() { + return accountNumber + ", balance:" + balance; + } +} diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/savings/SavingsAccountService.java b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/savings/SavingsAccountService.java new file mode 100644 index 0000000000..070cfe12db --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/savings/SavingsAccountService.java @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package bigbank.account.savings; + +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface SavingsAccountService { + + public SavingsAccountDetails getAccountDetails(String customerID); + + public double deposit(String accountNo, double depositAmt); + + public double withdraw(String accountNo, double withdrawalAmount); + +} diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/savings/SavingsAccountServiceImpl.java b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/savings/SavingsAccountServiceImpl.java new file mode 100644 index 0000000000..7682b729c3 --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/savings/SavingsAccountServiceImpl.java @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package bigbank.account.savings; + +import java.util.HashMap; +import java.util.Map; + +import org.oasisopen.sca.annotation.Service; + +@Service(SavingsAccountService.class) +public class SavingsAccountServiceImpl implements SavingsAccountService { + private Map custAcctMap = new HashMap(); + private Map savingsAccts = new HashMap(); + + public SavingsAccountServiceImpl() { + custAcctMap.put("Customer_01", "SVA_Customer_01"); + custAcctMap.put("Customer_02", "SVA_Customer_02"); + custAcctMap.put("Customer_03", "SVA_Customer_03"); + + savingsAccts.put("SVA_Customer_01", new Double(1000)); + savingsAccts.put("SVA_Customer_02", new Double(1500)); + savingsAccts.put("SVA_Customer_03", new Double(2000)); + } + + public double deposit(String accountNo, double depositAmt) { + savingsAccts.put(accountNo, new Double(savingsAccts.get(accountNo).doubleValue() + depositAmt)); + return savingsAccts.get(accountNo).doubleValue(); + } + + public SavingsAccountDetails getAccountDetails(String customerID) { + SavingsAccountDetails savingsAccount = new SavingsAccountDetails(); + savingsAccount.setAccountNumber(custAcctMap.get(customerID)); + savingsAccount.setBalance(savingsAccts.get(savingsAccount.getAccountNumber()).doubleValue()); + + return savingsAccount; + } + + public double withdraw(String accountNo, double withdrawalAmount) { + double balance = savingsAccts.get(accountNo).doubleValue(); + if ( balance - withdrawalAmount > 0 ) { + balance = balance - withdrawalAmount; + savingsAccts.put(accountNo, balance); + } + return balance; + } +} diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/stock/StockAccountDetails.java b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/stock/StockAccountDetails.java new file mode 100644 index 0000000000..9f06a71bae --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/stock/StockAccountDetails.java @@ -0,0 +1,63 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package bigbank.account.stock; + +public class StockAccountDetails { + private String accountNumber; + private String symbol; + private int quantity; + + public StockAccountDetails() { + } + + public StockAccountDetails(String acNo, String symbol, int qty) { + this.accountNumber = acNo; + this.symbol = symbol; + this.quantity = qty; + } + + public String getAccountNumber() { + return accountNumber; + } + + public void setAccountNumber(String n) { + this.accountNumber = n; + } + + public int getQuantity() { + return quantity; + } + + public void setQuantity(int a) { + this.quantity = a; + } + + public String getSymbol() { + return symbol; + } + + public void setSymbol(String s) { + this.symbol = s; + } + + @Override + public String toString() { + return accountNumber + ", symbol:" + symbol + ", quantity:" + quantity; + } +} diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/stock/StockAccountService.java b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/stock/StockAccountService.java new file mode 100644 index 0000000000..f86fda7c0f --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/stock/StockAccountService.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package bigbank.account.stock; + +import org.oasisopen.sca.annotation.Remotable; + +@Remotable +public interface StockAccountService { + + public StockAccountDetails getAccountDetails(String customerID); + + public StockAccountDetails buy(String accountNo, String symbol, int quantity); + + public StockAccountDetails sell(String accountNo, String symbol, int quantity); + + +} diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/stock/StockAccountServiceImpl.java b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/stock/StockAccountServiceImpl.java new file mode 100644 index 0000000000..488146ebeb --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/account/stock/StockAccountServiceImpl.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package bigbank.account.stock; + +import java.util.HashMap; +import java.util.Map; + +import org.oasisopen.sca.annotation.Service; + +@Service(StockAccountService.class) +public class StockAccountServiceImpl implements StockAccountService { + private Map custAcctMap = new HashMap(); + private Map stockAccts = new HashMap(); + + public StockAccountServiceImpl() { + custAcctMap.put("Customer_01", "STA_Customer_01"); + custAcctMap.put("Customer_02", "STA_Customer_02"); + custAcctMap.put("Customer_03", "STA_Customer_03"); + + stockAccts.put("STA_Customer_01", new StockAccountDetails("STA_Customer_01", "IBM", 100)); + stockAccts.put("STA_Customer_02", new StockAccountDetails("STA_Customer_02", "IBM", 200)); + stockAccts.put("STA_Customer_03", new StockAccountDetails("STA_Customer_03", "SYM_3", 125)); + } + + + public StockAccountDetails buy(String accountNo, String symbol, int quantity) { + return null; + } + + public StockAccountDetails getAccountDetails(String customerID) { + return stockAccts.get(custAcctMap.get(customerID)); + } + + public StockAccountDetails sell(String accountNo, String symbol, int quantity) { + return null; + } + + + +} diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/calculator/CalculatorService.java b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/calculator/CalculatorService.java new file mode 100644 index 0000000000..66a0ba0e63 --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/calculator/CalculatorService.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package bigbank.calculator; + +/** + * The Calculator service interface. + */ +public interface CalculatorService { + + double add(double n1, double n2); + + double subtract(double n1, double n2); + + double multiply(double n1, double n2); + + double divide(double n1, double n2); + +} diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/client/BigBankClient.java b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/client/BigBankClient.java new file mode 100644 index 0000000000..f7b940f873 --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/client/BigBankClient.java @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package bigbank.client; + +import org.apache.tuscany.sca.node.SCAClient; +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +import bigbank.account.AccountService; + +/** + * This client program shows how to create an SCA runtime, start it, + * and locate and invoke a SCA component + */ +public class BigBankClient { + public static void main(String[] args) throws Exception { + + SCANodeFactory factory = SCANodeFactory.newInstance(); + SCANode node = factory.createSCANodeFromClassLoader("BigBank.composite", BigBankClient.class.getClassLoader()); + node.start(); + + AccountService accountService = ((SCAClient)node).getService(AccountService.class, "AccountServiceComponent"); + + System.out.println("Account summary: " + accountService.getAccountReport("Customer_01") ); + + node.stop(); + } + +} diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/server/BigBankServer.java b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/server/BigBankServer.java new file mode 100644 index 0000000000..241347e417 --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/server/BigBankServer.java @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package bigbank.server; + +import org.apache.tuscany.sca.node.SCANode; +import org.apache.tuscany.sca.node.SCANodeFactory; + +/** + * This client program shows how to create an SCA runtime, start it, + * and locate and invoke a SCA component + */ +public class BigBankServer { + + public static void main(String[] args) throws Exception { + long timeout = -1L; + if (args.length > 0) { + timeout = Long.parseLong(args[0]); + } + + System.out.println("Starting the Sample SCA Spring BigBank server..."); + + SCANodeFactory factory = SCANodeFactory.newInstance(); + SCANode node = factory.createSCANodeFromClassLoader("BigBank.composite", BigBankServer.class.getClassLoader()); + node.start(); + + if (timeout < 0) { + System.out.println("Press Enter to Exit..."); + System.in.read(); + } else { + Thread.sleep(timeout); + } + + node.stop(); + + System.out.println("Bye"); + } +} diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/stockquote/StockQuoteService.java b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/stockquote/StockQuoteService.java new file mode 100644 index 0000000000..be86627882 --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/java/bigbank/stockquote/StockQuoteService.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package bigbank.stockquote; + +import org.oasisopen.sca.annotation.Remotable; + +/** + * This is the business interface of the StockQuote service. + */ +@Remotable +public interface StockQuoteService { + + public double getQuote(String symbol); +} + diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/BigBank.composite b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/BigBank.composite new file mode 100644 index 0000000000..ea2dbc7e1c --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/BigBank.composite @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/SavingsAccount.composite b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/SavingsAccount.composite new file mode 100644 index 0000000000..4bb2ce61ef --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/SavingsAccount.composite @@ -0,0 +1,32 @@ + + + + + + + + + + + diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/StockAccount.composite b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/StockAccount.composite new file mode 100644 index 0000000000..97dff499ba --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/StockAccount.composite @@ -0,0 +1,32 @@ + + + + + + + + + + + diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/spring-context/Account-spring-context.xml b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/spring-context/Account-spring-context.xml new file mode 100644 index 0000000000..899d8d7d62 --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/spring-context/Account-spring-context.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/spring-context/SavingsAccount-context.xml b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/spring-context/SavingsAccount-context.xml new file mode 100644 index 0000000000..b9e26bf81b --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/spring-context/SavingsAccount-context.xml @@ -0,0 +1,33 @@ + + + + + + + + + + diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/spring-context/StockAccount/META-INF/MANIFEST.MF b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/spring-context/StockAccount/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..32fa070ffb --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/spring-context/StockAccount/META-INF/MANIFEST.MF @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +Spring-Context: META-INF/spring/StockAccount-context.xml + + diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/spring-context/StockAccount/META-INF/spring/StockAccount-context.xml b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/spring-context/StockAccount/META-INF/spring/StockAccount-context.xml new file mode 100644 index 0000000000..b30f821f7e --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/spring-context/StockAccount/META-INF/spring/StockAccount-context.xml @@ -0,0 +1,33 @@ + + + + + + + + + + \ No newline at end of file diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/web/style.css b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/web/style.css new file mode 100644 index 0000000000..1071583264 --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/main/resources/web/style.css @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +* { font-family: arial; } + +table, th, td { border: 2px solid blue; border-collapse: collapse; } +th { color: white; background-color: blue; } diff --git a/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/test/java/bigbank/BigBankTestCase.java b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/test/java/bigbank/BigBankTestCase.java new file mode 100644 index 0000000000..d82e383e46 --- /dev/null +++ b/sca-java-2.x/contrib/very-old-samples/simple-bigbank-spring/src/test/java/bigbank/BigBankTestCase.java @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package bigbank; + +import junit.framework.TestCase; + +import bigbank.server.BigBankServer; + +/** + * Tests out the big bank service + * + */ +public class BigBankTestCase extends TestCase { + + public void testServer() throws Exception { + BigBankServer.main(new String[] {"1000"}); + } +} -- cgit v1.2.3