From 3d3b8834b93b98cc7d7534e693e937179067eb58 Mon Sep 17 00:00:00 2001 From: antelder Date: Sat, 16 May 2009 08:44:44 +0000 Subject: Delete previous 1.5 branch thats now old and unused and will be replaced with the current 1.x trunk git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@775435 13f79535-47bb-0310-9956-ffa450edef68 --- .../demos/mortgage-loanapproval/README | 60 --------------- .../demos/mortgage-loanapproval/build.xml | 66 ---------------- .../mortgage-loanapproval/doc/credit_composite.jpg | Bin 73610 -> 0 bytes .../mortgage-loanapproval/doc/credit_composite.png | Bin 51153 -> 0 bytes .../mortgage-loanapproval/doc/loan_approval.jpg | Bin 162536 -> 0 bytes .../mortgage-loanapproval/doc/loan_approval.png | Bin 58247 -> 0 bytes .../doc/mortgage_assembly0.jpg | Bin 145053 -> 0 bytes .../doc/mortgage_assembly0.png | Bin 93773 -> 0 bytes .../doc/mortgage_assembly1.jpg | Bin 181317 -> 0 bytes .../doc/mortgage_assembly1.png | Bin 113404 -> 0 bytes .../doc/mortgage_assembly2.jpg | Bin 180240 -> 0 bytes .../doc/mortgage_assembly2.png | Bin 106656 -> 0 bytes .../doc/mortgage_composite.jpg | Bin 343699 -> 0 bytes .../doc/mortgage_composite.png | Bin 288351 -> 0 bytes .../doc/mortgage_diagrams.doc | Bin 81920 -> 0 bytes .../doc/mortgage_package1.jpg | Bin 181031 -> 0 bytes .../doc/mortgage_package1.png | Bin 34939 -> 0 bytes .../doc/mortgage_package2.jpg | Bin 110930 -> 0 bytes .../doc/mortgage_package2.png | Bin 58993 -> 0 bytes .../doc/mortgage_scenario.jpg | Bin 225690 -> 0 bytes .../doc/mortgage_scenario.png | Bin 106791 -> 0 bytes .../mortgage-loanapproval/mortgage_assembly.png | Bin 106656 -> 0 bytes .../demos/mortgage-loanapproval/pom.xml | 83 -------------------- .../src/main/java/mortgage/CreditCheck.java | 29 ------- .../src/main/java/mortgage/CreditCheckImpl.java | 34 --------- .../src/main/java/mortgage/Customer.java | 76 ------------------- .../src/main/java/mortgage/InterestRateQuote.java | 23 ------ .../main/java/mortgage/InterestRateQuoteImpl.java | 42 ----------- .../src/main/java/mortgage/LoanApproval.java | 27 ------- .../src/main/java/mortgage/LoanApprovalImpl.java | 84 --------------------- .../src/main/java/mortgage/MortgageCalculator.java | 29 ------- .../main/java/mortgage/MortgageCalculatorImpl.java | 38 ---------- .../src/main/java/mortgage/MortgageClient.java | 44 ----------- .../src/main/java/mortgage/RiskAssessment.java | 27 ------- .../src/main/java/mortgage/RiskAssessmentImpl.java | 38 ---------- .../src/main/resources/Mortgage.composite | 48 ------------ .../src/main/resources/Mortgage1.composite | 57 -------------- .../resources/MortgageCalculator.componentType | 27 ------- .../src/main/resources/MortgageCalculator.js | 25 ------ .../src/main/resources/wsdl/credit.wsdl | 81 -------------------- .../test/java/mortgage/MortgageClientTestCase.java | 56 -------------- 41 files changed, 994 deletions(-) delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/README delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/build.xml delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/doc/credit_composite.jpg delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/doc/credit_composite.png delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/doc/loan_approval.jpg delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/doc/loan_approval.png delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly0.jpg delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly0.png delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly1.jpg delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly1.png delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly2.jpg delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly2.png delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_composite.jpg delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_composite.png delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_diagrams.doc delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_package1.jpg delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_package1.png delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_package2.jpg delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_package2.png delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_scenario.jpg delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_scenario.png delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/mortgage_assembly.png delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/pom.xml delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheck.java delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheckImpl.java delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/Customer.java delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuote.java delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuoteImpl.java delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApproval.java delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApprovalImpl.java delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculator.java delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculatorImpl.java delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageClient.java delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessment.java delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessmentImpl.java delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/Mortgage.composite delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/Mortgage1.composite delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.componentType delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.js delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/wsdl/credit.wsdl delete mode 100644 branches/sca-java-1.5/demos/mortgage-loanapproval/src/test/java/mortgage/MortgageClientTestCase.java (limited to 'branches/sca-java-1.5/demos/mortgage-loanapproval') diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/README b/branches/sca-java-1.5/demos/mortgage-loanapproval/README deleted file mode 100644 index dbf3829a20..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/README +++ /dev/null @@ -1,60 +0,0 @@ -Mortgage Loan Approval Demo -=========================== - -This demo was used as an example in the java developer journal article: http://jdj.sys-con.com/read/325183.htm. - -The demo consists of two modules: - -mortgage-loanapproval: provides the business logic for loan approval. -mortgage-creditcheck: handles credit check requests. This is a java component exposed as a webservice running on the embedded Tomcat. - -Please check mortgage_assembly.png file that is located in this directory for a high level view of the demo. - -Here is what happens when you run the demo. A loan approval request for customer with id 111-222-3333 -gets initiated when mortgage-loanapproval application is run. Depending on what the 'imaginary' credit - status of this person is, the loan gets approved or diapproved. - -You would need two command windows to run mortgage loan approval composite. The order in which the -applications are run is important. Run mortgage-creditcheck first since mortgage-loanapproval is dependent on -it's service. - -In the first command window ---------------------------- -1) go to mortgage-creditcheck directory -2) ant compile -3) ant run -You should see the following displayed: -Buildfile: build.xml - -run: - [java] Starting the CreditCheck Service... - [java] 14-Jan-2008 14:14:20 org.apache.tuscany.sca.http.jetty.JettyServer a -ddServletMapping - [java] INFO: Added Servlet mapping: http://L3AW203:8085/CreditCheckServiceC -omponent - [java] Press Enter to Exit... - -In the second command window ----------------------------- -1) go to mortgage-loanapproval directory -2) ant compile -3) ant run - -If the loan is approved, you will see the following displayed in the command screen where -mortgage-loanapproval is run: - -Buildfile: build.xml -run: - [java] Interest rate for a 30-year loan of $200000.0 in CA: 6.5% - [java] Approved: John Smith[111-22-3333] - -If the loan is disapproved, you will see the following displayed in the command screen where -mortgage-loanapproval is run: - -Buildfile: build.xml -run: - [java] Credit score for 111-22-3333: 708 - [java] Interest rate for a 30-year loan of $200000.0 in CA: 6.5% - [java] Debt/Income ratio 0.2528272093971861 is too high. - [java] Rejected: John Smith[111-22-3333] - diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/build.xml b/branches/sca-java-1.5/demos/mortgage-loanapproval/build.xml deleted file mode 100644 index 9a0a83bf1d..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/build.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/credit_composite.jpg b/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/credit_composite.jpg deleted file mode 100644 index e28ed63cfb..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/credit_composite.jpg and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/credit_composite.png b/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/credit_composite.png deleted file mode 100644 index 0bfce0078d..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/credit_composite.png and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/loan_approval.jpg b/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/loan_approval.jpg deleted file mode 100644 index 3f00557c7f..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/loan_approval.jpg and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/loan_approval.png b/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/loan_approval.png deleted file mode 100644 index 9d5f829fe5..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/loan_approval.png and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly0.jpg b/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly0.jpg deleted file mode 100644 index 515b6ecde7..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly0.jpg and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly0.png b/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly0.png deleted file mode 100644 index 4b815a4b82..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly0.png and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly1.jpg b/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly1.jpg deleted file mode 100644 index 01a7c55a14..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly1.jpg and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly1.png b/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly1.png deleted file mode 100644 index 07422c4f45..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly1.png and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly2.jpg b/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly2.jpg deleted file mode 100644 index 992c048684..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly2.jpg and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly2.png b/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly2.png deleted file mode 100644 index 4667956ed0..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_assembly2.png and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_composite.jpg b/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_composite.jpg deleted file mode 100644 index 5021f6a317..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_composite.jpg and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_composite.png b/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_composite.png deleted file mode 100644 index 1398c50ded..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_composite.png and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_diagrams.doc b/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_diagrams.doc deleted file mode 100644 index 32a0b72907..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_diagrams.doc and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_package1.jpg b/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_package1.jpg deleted file mode 100644 index e91c5f1bbd..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_package1.jpg and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_package1.png b/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_package1.png deleted file mode 100644 index db304a4c28..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_package1.png and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_package2.jpg b/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_package2.jpg deleted file mode 100644 index e8c2865e4a..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_package2.jpg and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_package2.png b/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_package2.png deleted file mode 100644 index 502e538e94..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_package2.png and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_scenario.jpg b/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_scenario.jpg deleted file mode 100644 index fccf2e35c3..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_scenario.jpg and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_scenario.png b/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_scenario.png deleted file mode 100644 index b8f42ad318..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/doc/mortgage_scenario.png and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/mortgage_assembly.png b/branches/sca-java-1.5/demos/mortgage-loanapproval/mortgage_assembly.png deleted file mode 100644 index 4667956ed0..0000000000 Binary files a/branches/sca-java-1.5/demos/mortgage-loanapproval/mortgage_assembly.png and /dev/null differ diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/pom.xml b/branches/sca-java-1.5/demos/mortgage-loanapproval/pom.xml deleted file mode 100644 index 3f74134cbe..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-demos - 1.5-SNAPSHOT - ../pom.xml - - demo-mortgage-loanapproval - jar - Apache Tuscany SCA Demo Mortgage Loan Approval - A sample Mortgage application made of several SCA components wired together. - - - 1.5-SNAPSHOT - - - - - org.apache.tuscany.sca - tuscany-host-embedded - 1.5-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.5-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-ws-axis2 - 1.5-SNAPSHOT - runtime - - - org.apache.tuscany.sca - tuscany-implementation-script - 1.5-SNAPSHOT - runtime - - - - - - install - ${artifactId} - - - org.apache.maven.plugins - maven-jar-plugin - - - - mortgage.MortgageClient - - - - - - - diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheck.java b/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheck.java deleted file mode 100644 index c5787b7819..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheck.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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 mortgage; - -import org.osoa.sca.annotations.Remotable; - -/** - * CreditCheck interface - */ -@Remotable -public interface CreditCheck { - int getCreditScore(String ssn); -} diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheckImpl.java b/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheckImpl.java deleted file mode 100644 index dc803d9688..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/CreditCheckImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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 mortgage; - -import org.osoa.sca.annotations.Service; - -/** - * A pojo implementation of the CreditCheck service - */ -@Service(CreditCheck.class) -public class CreditCheckImpl implements CreditCheck { - - public int getCreditScore(String ssn) { - int score = (int)(700 + (Math.random() - 0.5) * 100); - System.out.println("Credit score for " + ssn + ": " + score); - return score; - } -} diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/Customer.java b/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/Customer.java deleted file mode 100644 index 66a486d516..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/Customer.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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 mortgage; - -/** - * A simple Customer object - */ -public class Customer { - private String ssn; - private String firstName; - private String lastName; - private double monthlyIncome; - private String state; - - public double getMonthlyIncome() { - return monthlyIncome; - } - - public void setMonthlyIncome(double monthlyIncome) { - this.monthlyIncome = monthlyIncome; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public String getSsn() { - return ssn; - } - - public void setSsn(String ssn) { - this.ssn = ssn; - } - - @Override - public String toString() { - return firstName + " " + lastName + "[" + ssn + "]"; - } -} diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuote.java b/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuote.java deleted file mode 100644 index b5bafeb204..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuote.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 mortgage; - -public interface InterestRateQuote { - public float getRate(String state, double loanAmount, int termInYears); -} diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuoteImpl.java b/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuoteImpl.java deleted file mode 100644 index 8c642667f1..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/InterestRateQuoteImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 mortgage; - -import org.osoa.sca.annotations.Service; - -@Service(InterestRateQuote.class) -public class InterestRateQuoteImpl implements InterestRateQuote { - public float getRate(String state, double loanAmount, int termInYears) { - float rate = 6.0f; - if (termInYears == 5) { - rate = 5.5f; - } else { - rate = 6.5f; - } - System.out.println("Interest rate for a " + termInYears - + "-year loan of $" - + loanAmount - + " in " - + state - + ": " - + rate - + "%"); - return rate; - } -} diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApproval.java b/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApproval.java deleted file mode 100644 index dcdad18496..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApproval.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 mortgage; - -/** - * Loan Approval interface - */ -public interface LoanApproval { - public boolean approve(Customer customer, double loanAmount, int years); -} diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApprovalImpl.java b/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApprovalImpl.java deleted file mode 100644 index 40bfdc4a1d..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/LoanApprovalImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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 mortgage; - -import org.osoa.sca.annotations.Property; -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Service; - -/** - * An implementation of the LoanApproval service. - */ -@Service(LoanApproval.class) -// Service declaration -public class LoanApprovalImpl implements LoanApproval { - private CreditCheck[] creditCheck; - private MortgageCalculator mortgageCalculator; - private InterestRateQuote interestRateQuote; - - // Reference declaration using a protected or public field - @Reference - public RiskAssessment riskAssessment; - - private int minimumCreditScore = 650; - - // Property declaration using a setter method - @Property(name = "minimumCreditScore") - public void setMinimumCreditScore(int minimumCreditScore) { - this.minimumCreditScore = minimumCreditScore; - } - - // Reference declaration using a setter method - @Reference - public void setCreditCheck(CreditCheck[] creditCheck) { - this.creditCheck = creditCheck; - } - - @Reference - public void setInterestRateQuote(InterestRateQuote interestRateQuote) { - this.interestRateQuote = interestRateQuote; - } - - @Reference - public void setMortgageCalculator(MortgageCalculator mortgageCalculator) { - this.mortgageCalculator = mortgageCalculator; - } - - public boolean approve(Customer customer, double loanAmount, int years) { - int score = 0; - for (int i = 0; i < creditCheck.length; i++) { - score += creditCheck[i].getCreditScore(customer.getSsn()); - } - if (score != 0) { - score = score / creditCheck.length; - } - if (score < minimumCreditScore) { - System.err.println("Credit score " + score + " is below the minimum " + minimumCreditScore + "."); - return false; - } - float rate = interestRateQuote.getRate(customer.getState(), loanAmount, years); - double monthlyPayment = mortgageCalculator.getMonthlyPayment(loanAmount, years, rate); - double ratio = monthlyPayment / customer.getMonthlyIncome(); - boolean approved = riskAssessment.assess(score, ratio); - if (!approved) { - System.err.println("Debt/Income ratio " + ratio + " is too high."); - } - return approved; - } -} diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculator.java b/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculator.java deleted file mode 100644 index cacd8694de..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculator.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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 mortgage; - -import org.osoa.sca.annotations.Remotable; - -/** - * The Mortgage Calculator service interface. - */ -@Remotable -public interface MortgageCalculator { - public double getMonthlyPayment(double principal, int years, float interestRate); -} diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculatorImpl.java b/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculatorImpl.java deleted file mode 100644 index 015f1bae98..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageCalculatorImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 mortgage; - -import org.osoa.sca.annotations.Service; - -/** - * An implementation of the Calculator service. - */ -@Service(MortgageCalculator.class) -public class MortgageCalculatorImpl implements MortgageCalculator { - - public double getMonthlyPayment(double principal, int years, float interestRate) { - double monthlyRate = interestRate / 12.0 / 100.0; - double p = Math.pow(1 + monthlyRate, years * 12); - double q = p / (p - 1); - double monthlyPayment = principal * monthlyRate * q; - System.out.println("Monthly payment for a " + years + "-year loan of $" + principal + ": " + monthlyPayment); - return monthlyPayment; - } - -} diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageClient.java b/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageClient.java deleted file mode 100644 index d69f0a1163..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/MortgageClient.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 mortgage; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -/** - * This client program to invoke the Mortgage LoanApproval service - */ -public class MortgageClient { - public static void main(String[] args) throws Exception { - - SCADomain domain = SCADomain.newInstance("Mortgage1.composite"); - LoanApproval loanApplication = domain.getService(LoanApproval.class, "LoanApprovalComponent"); - - // Create the customer - Customer customer = new Customer(); - customer.setSsn("111-22-3333"); - customer.setFirstName("John"); - customer.setLastName("Smith"); - customer.setMonthlyIncome(5000.0d); - customer.setState("CA"); - - // Invoke the service - boolean result = loanApplication.approve(customer, 200000d, 30); - System.out.println((result ? "Approved: " : "Rejected: ") + customer); - } -} diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessment.java b/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessment.java deleted file mode 100644 index 23c9589e85..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessment.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 mortgage; - -/** - * Risk Assessment interface - */ -public interface RiskAssessment { - public boolean assess(int creditScore, double ratio); -} diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessmentImpl.java b/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessmentImpl.java deleted file mode 100644 index c2116366ec..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/java/mortgage/RiskAssessmentImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 mortgage; - -import org.osoa.sca.annotations.Service; - -/** - * A pojo implementation of RiskAssessment service - */ -@Service(RiskAssessment.class) -public class RiskAssessmentImpl implements RiskAssessment { - public boolean assess(int creditScore, double ratio) { - if (creditScore >= 750) { - return ratio < 0.35; - } else if (creditScore >= 700) { - return ratio < 0.30; - } else { - return ratio < 0.25; - } - } -} diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/Mortgage.composite b/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/Mortgage.composite deleted file mode 100644 index d1128b9907..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/Mortgage.composite +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - 600 - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/Mortgage1.composite b/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/Mortgage1.composite deleted file mode 100644 index 4cad6c7223..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/Mortgage1.composite +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - 600 - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.componentType b/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.componentType deleted file mode 100644 index bf7b10e0f7..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.componentType +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.js b/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.js deleted file mode 100644 index b25af1d039..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/MortgageCalculator.js +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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. - */ -function getMonthlyPayment(principal, years, interestRate) { - var monthlyRate = interestRate / 12.0 / 100.0; - var p = Math.pow(1 + monthlyRate, years * 12); - var q = p / (p - 1); - var monthlyPayment = principal * monthlyRate * q; - return monthlyPayment; -} diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/wsdl/credit.wsdl b/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/wsdl/credit.wsdl deleted file mode 100644 index 9c2acc96d3..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/main/resources/wsdl/credit.wsdl +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/test/java/mortgage/MortgageClientTestCase.java b/branches/sca-java-1.5/demos/mortgage-loanapproval/src/test/java/mortgage/MortgageClientTestCase.java deleted file mode 100644 index 285cc72515..0000000000 --- a/branches/sca-java-1.5/demos/mortgage-loanapproval/src/test/java/mortgage/MortgageClientTestCase.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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 mortgage; - -import junit.framework.TestCase; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -/** - * This shows how to test the Calculator service component. - */ -public class MortgageClientTestCase extends TestCase { - private SCADomain domain; - private LoanApproval loanApproval; - - @Override - protected void setUp() throws Exception { - domain = SCADomain.newInstance("Mortgage.composite"); - loanApproval = domain.getService(LoanApproval.class, "LoanApprovalComponent"); - } - - @Override - protected void tearDown() throws Exception { - if (domain != null) { - domain.close(); - } - } - - public void testApprove() throws Exception { - Customer customer = new Customer(); - customer.setSsn("111-22-3333"); - customer.setFirstName("John"); - customer.setLastName("Smith"); - customer.setMonthlyIncome(5000.0d); - customer.setState("CA"); - - boolean approved = loanApproval.approve(customer, 200000d, 30); - System.out.println((approved ? "Approved: " : "Rejected: ") + customer); - } -} -- cgit v1.2.3