diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-21 07:55:20 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-11-21 07:55:20 +0000 |
commit | 36436b71b9977d6b5940cb6285d5335708ef9bfa (patch) | |
tree | b218a104f180c67690a6ae2ad097cd9306a8f203 /sca-java-1.x/tags/java-stable-20060304/samples/bigbank | |
parent | d5be76c0b31df9b5d203295b146b13d2205243de (diff) |
Moving 1.x tags
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@882851 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-1.x/tags/java-stable-20060304/samples/bigbank')
100 files changed, 2890 insertions, 0 deletions
diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/pom.xml b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/pom.xml new file mode 100644 index 0000000000..d1a385145f --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/pom.xml @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + --> +<project> + <parent> + <groupId>org.apache.tuscany.samples.bigbank</groupId> + <artifactId>bigbank-samples</artifactId> + <version>SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>account</artifactId> + <packaging>war</packaging> + <name>Tuscany sample BigBank account</name> + <description>BigBank sample - account module</description> + <version>SNAPSHOT</version> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany</groupId> + <artifactId>tuscany-core</artifactId> + <version>${pom.version}</version> + <scope>provided</scope> <!-- use provided so tuscany infrastructue is not inc. in the war--> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.tuscany</groupId> + <artifactId>tuscany-sdo-plugin</artifactId> + <executions> + <execution> + <configuration> + <schemaFile>${basedir}/src/main/resources/wsdl/AccountService.wsdl</schemaFile> + <noNotification>true</noNotification> + <noContainer>true</noContainer> + <noInterfaces>true</noInterfaces> + <noUnsettable>true</noUnsettable> + </configuration> + <goals> + <goal>generate</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.tuscany</groupId> + <artifactId>tuscany-sca-plugin</artifactId> + <executions> + <execution> + <configuration> + <wsdlFile>${basedir}/src/main/resources/wsdl/AccountService.wsdl</wsdlFile> + <javaPackage>org.apache.tuscany.samples.bigbank.account.services.account</javaPackage> + </configuration> + <goals> + <goal>generate</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project> diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/account/AccountServiceImpl.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/account/AccountServiceImpl.java new file mode 100644 index 0000000000..4552615227 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/account/AccountServiceImpl.java @@ -0,0 +1,91 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.account.services.account; + +import java.util.List; + +import org.apache.tuscany.samples.bigbank.account.AccountFactory; +import org.apache.tuscany.samples.bigbank.account.AccountReport; +import org.apache.tuscany.samples.bigbank.account.AccountSummary; +import org.apache.tuscany.samples.bigbank.account.services.accountdata.AccountDataService; +import org.apache.tuscany.samples.bigbank.account.services.accountdata.CheckingAccount; +import org.apache.tuscany.samples.bigbank.account.services.accountdata.SavingsAccount; +import org.apache.tuscany.samples.bigbank.account.services.accountdata.StockAccount; +import org.apache.tuscany.samples.bigbank.account.services.stockquote.StockQuoteService; +import org.apache.tuscany.sdo.util.SDOUtil; +import org.osoa.sca.annotations.Property; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +@Service(interfaces=AccountService.class) +public class AccountServiceImpl implements AccountService { + + static { + SDOUtil.registerStaticTypes(AccountFactory.class); + } + + @Property + private String currency = "USD"; + + @Reference + private AccountDataService accountDataService; + @Reference + private StockQuoteService stockQuoteService; + + public AccountServiceImpl() { + } + + public AccountReport getAccountReport(String customerID) { + + AccountFactory accountFactory=new AccountFactory(); + + AccountReport accountReport = accountFactory.createAccountReport(); + List accountSummaries = accountReport.getAccountSummaries(); + + CheckingAccount checkingAccount = accountDataService.getCheckingAccount(customerID); + AccountSummary checkingAccountSummary = accountFactory.createAccountSummary(); + checkingAccountSummary.setAccountNumber(checkingAccount.getAccountNumber()); + checkingAccountSummary.setAccountType("checking"); + checkingAccountSummary.setBalance(fromUSDollarToCurrency(checkingAccount.getBalance())); + accountSummaries.add(checkingAccountSummary); + + SavingsAccount savingsAccount = accountDataService.getSavingsAccount(customerID); + AccountSummary savingsAccountSummary = accountFactory.createAccountSummary(); + savingsAccountSummary.setAccountNumber(savingsAccount.getAccountNumber()); + savingsAccountSummary.setAccountType("savings"); + savingsAccountSummary.setBalance(fromUSDollarToCurrency(savingsAccount.getBalance())); + accountSummaries.add(savingsAccountSummary); + + StockAccount stockAccount = accountDataService.getStockAccount(customerID); + AccountSummary stockAccountSummary = accountFactory.createAccountSummary(); + stockAccountSummary.setAccountNumber(stockAccount.getAccountNumber()); + stockAccountSummary.setAccountType("stock"); + float balance = (stockQuoteService.getQuote(stockAccount.getSymbol())) * stockAccount.getQuantity(); + stockAccountSummary.setBalance(fromUSDollarToCurrency(balance)); + accountSummaries.add(stockAccountSummary); + + return accountReport; + } + + private float fromUSDollarToCurrency(float value) { + + if (currency.equals("USD")) return value; + else if (currency.equals("EURO")) return value * 0.8f; + else + return 0.0f; + } +} diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataService.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataService.java new file mode 100644 index 0000000000..b0d07ed3e7 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataService.java @@ -0,0 +1,26 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.account.services.accountdata; + +public interface AccountDataService { + + CheckingAccount getCheckingAccount(String customerID); + + SavingsAccount getSavingsAccount(String customerID); + + StockAccount getStockAccount(String customerID); +} diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataServiceImpl.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataServiceImpl.java new file mode 100644 index 0000000000..963277ee76 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/AccountDataServiceImpl.java @@ -0,0 +1,51 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.account.services.accountdata; + +import org.osoa.sca.annotations.Service; + +@Service(AccountDataService.class) +public class AccountDataServiceImpl implements AccountDataService { + + public CheckingAccount getCheckingAccount(String customerID) { + + CheckingAccount checkingAccount = new CheckingAccount(); + checkingAccount.setAccountNumber(customerID + "_" + "CHA12345"); + checkingAccount.setBalance(1500.0f); + + return checkingAccount; + } + + public SavingsAccount getSavingsAccount(String customerID) { + + SavingsAccount savingsAccount = new SavingsAccount(); + savingsAccount.setAccountNumber(customerID + "_" + "SAA12345"); + savingsAccount.setBalance(1500.0f); + + return savingsAccount; + } + + public StockAccount getStockAccount(String customerID) { + + StockAccount stockAccount = new StockAccount(); + stockAccount.setAccountNumber(customerID + "_" + "STA12345"); + stockAccount.setSymbol("IBM"); + stockAccount.setQuantity(100); + + return stockAccount; + } +} diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/CheckingAccount.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/CheckingAccount.java new file mode 100644 index 0000000000..b3dd6185e1 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/CheckingAccount.java @@ -0,0 +1,39 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.account.services.accountdata; + +public class CheckingAccount { + + private String accountNumber; + private float balance; + + public String getAccountNumber() { + return accountNumber; + } + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + public float getBalance() { + return balance; + } + + public void setBalance(float balance) { + this.balance = balance; + } +} diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/SavingsAccount.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/SavingsAccount.java new file mode 100644 index 0000000000..0b7f2e0fd5 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/SavingsAccount.java @@ -0,0 +1,39 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.account.services.accountdata; + +public class SavingsAccount { + + private String accountNumber; + private float balance; + + public String getAccountNumber() { + return accountNumber; + } + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + public float getBalance() { + return balance; + } + + public void setBalance(float balance) { + this.balance = balance; + } +} diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/StockAccount.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/StockAccount.java new file mode 100644 index 0000000000..f6b90259b3 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/accountdata/StockAccount.java @@ -0,0 +1,48 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.account.services.accountdata; + +public class StockAccount { + + private String accountNumber; + private String symbol; + private int quantity; + + public String getAccountNumber() { + return accountNumber; + } + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + public int getQuantity() { + return quantity; + } + + public void setQuantity(int quantity) { + this.quantity = quantity; + } + + public String getSymbol() { + return symbol; + } + + public void setSymbol(String symbol) { + this.symbol = symbol; + } +} diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteService.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteService.java new file mode 100644 index 0000000000..80ac8d58be --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteService.java @@ -0,0 +1,27 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.account.services.stockquote; + +import org.osoa.sca.annotations.Remotable; + +@Remotable +public interface StockQuoteService { + + public float getQuote(String symbol); +} + +
\ No newline at end of file diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteServiceImpl.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteServiceImpl.java new file mode 100644 index 0000000000..ff4878b10c --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/java/org/apache/tuscany/samples/bigbank/account/services/stockquote/StockQuoteServiceImpl.java @@ -0,0 +1,28 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.account.services.stockquote; + +/* Dummy'd up StockQuoteService, override webservice for now */ + +public class StockQuoteServiceImpl implements StockQuoteService { + + public float getQuote(String symbol) { + // Just hardcode for now + return 83.00f; + } + +}
\ No newline at end of file diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/sca.module b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/sca.module new file mode 100644 index 0000000000..b13d844609 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/sca.module @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="ASCII"?>
+<!--
+ Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+ Licensed 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.
+ -->
+<module xmlns="http://www.osoa.org/xmlns/sca/0.9" xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9"
+
+ name="tuscany.samples.bigbank.account">
+
+ <entryPoint name="AccountService">
+ <interface.java interface="org.apache.tuscany.samples.bigbank.account.services.account.AccountService"/>
+ <binding.ws port="http://www.bigbank.com/Account/#AccountServiceSOAP"/>
+ <reference>AccountServiceComponent/AccountService</reference>
+ </entryPoint>
+
+ <component name="AccountServiceComponent">
+ <implementation.java class="org.apache.tuscany.samples.bigbank.account.services.account.AccountServiceImpl"/>
+ <properties>
+ <v:currency>EURO</v:currency>
+ </properties>
+ <references>
+ <v:accountDataService>AccountDataServiceComponent</v:accountDataService>
+ <v:stockQuoteService>StockQuoteService</v:stockQuoteService>
+ </references>
+ </component>
+
+ <component name="AccountDataServiceComponent">
+ <implementation.java class="org.apache.tuscany.samples.bigbank.account.services.accountdata.AccountDataServiceImpl"/>
+ </component>
+
+ <component name="StockQuoteService">
+ <implementation.java class="org.apache.tuscany.samples.bigbank.account.services.stockquote.StockQuoteServiceImpl"/>
+ </component>
+
+ <!--
+ <externalService name="StockQuoteService">
+ <interface.java interface="org.apache.tuscany.samples.bigbank.account.services.stockquote"/>
+ <binding.ws port="http://www.quickstockquote.com/StockQuoteService#StockQuoteServiceSOAP"/>
+ </externalService>
+ -->
+
+ <import.wsdl + location="wsdl/AccountService.wsdl" + namespace="http://www.bigbank.com/Account/"/> + <import.wsdl + location="wsdl/StockQuoteWebService.wsdl" + namespace="http://webservice.stockquote"/> + +</module>
+
diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/sca.subsystem b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/sca.subsystem new file mode 100644 index 0000000000..b15fa2bc5c --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/sca.subsystem @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="ASCII"?>
+<!--
+ Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+ Licensed 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.
+ -->
+<subsystem xmlns="http://www.osoa.org/xmlns/sca/0.9"
+
+ name="tuscany.runtime.bigbank.account">
+
+ <moduleComponent name="tuscany-samples-bigbank-account" module="tuscany.samples.bigbank.account"/>
+
+</subsystem>
+
diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/wsdl/AccountService.wsdl b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/wsdl/AccountService.wsdl new file mode 100644 index 0000000000..5d087530dd --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/wsdl/AccountService.wsdl @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+ Licensed 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.
+ -->
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://www.bigbank.com/Account/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:account="http://www.bigbank.com/Account/"
+ targetNamespace="http://www.bigbank.com/Account/" + name="AccountService">
+
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://www.bigbank.com/Account/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:account="http://www.bigbank.com/Account/" + xmlns:sdojava="commonj.sdo/java" + sdojava:package="org.apache.tuscany.samples.bigbank.account">
+
+ <xsd:element name="getAccountReport"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="customerID" type="xsd:string"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element>
+ <xsd:element name="getAccountReportResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="accountReport" type="account:AccountReport"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> +
+ <xsd:complexType name="AccountReport">
+ <xsd:sequence>
+ <xsd:element name="accountSummaries" type="account:AccountSummary" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="AccountSummary">
+ <xsd:attribute name="accountNumber" type="xsd:string"/>
+ <xsd:attribute name="accountType" type="xsd:string"/>
+ <xsd:attribute name="balance" type="xsd:float"/>
+ </xsd:complexType>
+
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="getAccountReportRequest">
+ <wsdl:part element="account:getAccountReport" name="getAccountReportRequest"/>
+ </wsdl:message>
+ <wsdl:message name="getAccountReportResponse">
+ <wsdl:part element="account:getAccountReportResponse" name="getAccountReportResponse"/>
+ </wsdl:message>
+ <wsdl:portType name="AccountService">
+ <wsdl:operation name="getAccountReport">
+ <wsdl:input message="tns:getAccountReportRequest"/>
+ <wsdl:output message="tns:getAccountReportResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="AccountServiceSOAP" type="tns:AccountService">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="getAccountReport">
+ <soap:operation
+ soapAction="http://www.bigbank.com/Account/getAccountReport"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="AccountService">
+ <wsdl:port binding="tns:AccountServiceSOAP"
+ name="AccountServiceSOAP">
+ <soap:address location="http://localhost:8080/account-SNAPSHOT/services/AccountService"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/wsdl/StockQuoteWebService.wsdl b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/wsdl/StockQuoteWebService.wsdl new file mode 100644 index 0000000000..9678d9d6ea --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/resources/wsdl/StockQuoteWebService.wsdl @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+ Licensed 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.
+ -->
+<wsdl:definitions targetNamespace="http://webservice.stockquote" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://webservice.stockquote" xmlns:intf="http://webservice.stockquote" xmlns:tns1="http://stockquote" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="">
+ <!--WSDL created by Apache Axis version: 1.2.1
+Built on Jun 14, 2005 (09:15:57 EDT)-->
+ <wsdl:types>
+ <schema elementFormDefault="qualified" targetNamespace="http://stockquote" xmlns="http://www.w3.org/2001/XMLSchema">
+ <complexType name="GetQuoteRequest">
+ <sequence>
+ <element name="symbol" nillable="true" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ <complexType name="GetQuoteResponse">
+ <sequence>
+ <element name="price" type="xsd:float"/>
+ </sequence>
+ </complexType>
+ </schema>
+ <schema elementFormDefault="qualified" targetNamespace="http://webservice.stockquote" xmlns="http://www.w3.org/2001/XMLSchema">
+ <import namespace="http://stockquote"/>
+ <element name="request" type="tns1:GetQuoteRequest"/>
+ <element name="getQuoteReturn" type="tns1:GetQuoteResponse"/>
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="getQuoteResponse">
+
+ <wsdl:part element="impl:getQuoteReturn" name="getQuoteReturn"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="getQuoteRequest">
+
+ <wsdl:part element="impl:request" name="request"/>
+
+ </wsdl:message>
+
+ <wsdl:portType name="StockQuoteWebService">
+
+ <wsdl:operation name="getQuote" parameterOrder="request">
+
+ <wsdl:input message="impl:getQuoteRequest" name="getQuoteRequest"/>
+
+ <wsdl:output message="impl:getQuoteResponse" name="getQuoteResponse"/>
+
+ </wsdl:operation>
+
+ </wsdl:portType>
+
+ <wsdl:binding name="StockQuoteWebServiceSoapBinding" type="impl:StockQuoteWebService">
+
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <wsdl:operation name="getQuote">
+
+ <wsdlsoap:operation soapAction=""/>
+
+ <wsdl:input name="getQuoteRequest">
+
+ <wsdlsoap:body use="literal"/>
+
+ </wsdl:input>
+
+ <wsdl:output name="getQuoteResponse">
+
+ <wsdlsoap:body use="literal"/>
+
+ </wsdl:output>
+
+ </wsdl:operation>
+
+ </wsdl:binding>
+
+ <wsdl:service name="StockQuoteWebServiceService">
+
+ <wsdl:port binding="impl:StockQuoteWebServiceSoapBinding" name="StockQuoteWebService">
+
+ <wsdlsoap:address location="http://localhost:8123/StockQuoteWebService/services/StockQuoteWebService"/>
+
+ </wsdl:port>
+
+ </wsdl:service>
+
+</wsdl:definitions>
diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/webapp/WEB-INF/axis2.xml b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/webapp/WEB-INF/axis2.xml new file mode 100644 index 0000000000..a38cf9864a --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/webapp/WEB-INF/axis2.xml @@ -0,0 +1,167 @@ +<axisconfig name="AxisJava2.0"> + <!-- ================================================= --> + <!-- Parameters --> + <!-- ================================================= --> + <parameter name="hotdeployment" locked="false">false</parameter> + <parameter name="hotupdate" locked="false">false</parameter> + <parameter name="enableMTOM" locked="false">false</parameter> + <!-- Uncomment this to enable REST support --> + <!-- <parameter name="enableREST" locked="false">true</parameter>--> + + + <parameter name="userName" locked="false">admin</parameter> + <parameter name="password" locked="false">axis2</parameter> + + <parameter name="seralizeLocation" locked="false">.</parameter> + <hostConfiguration> + <ip>127.0.0.1</ip> + <port>5555</port> + </hostConfiguration> + + + <!--if you want to extract the service archive file and work with that please uncomment this--> + <!--else , it wont extract archive file or does not take into consideration if someone drop--> + <!--exploded directory into /service directory--> + <!--<parameter name="extractServiceArchive" locked="false">true</parameter>--> + + + <!-- The way of adding listener to the system--> + <!-- <listener class="org.apache.axis2.ObserverIMPL">--> + <!-- <parameter name="RSS_URL" locked="false">http://127.0.0.1/rss</parameter>--> + <!-- </listener>--> + + <!-- ================================================= --> + <!-- Message Receivers --> + <!-- ================================================= --> + <!--This is the Deafult Message Receiver for the system , if you want to have MessageReceivers for --> + <!--all the other MEP implement it and add the correct entry to here , so that you can refer from--> + <!--any operation --> + <!--Note : You can ovride this for particular service by adding the same element with your requirement--> + <messageReceivers> + <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" + class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/> + <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" + class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/> + </messageReceivers> + <!-- ================================================= --> + <!-- Transport Ins --> + <!-- ================================================= --> + <transportReceiver name="http" class="org.apache.axis2.transport.http.SimpleHTTPServer"> + <parameter name="port" locked="false">6060</parameter> + </transportReceiver> + + <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver + <transportReceiver name="mail" class="org.apache.axis2.transport.mail.SimpleMailListener"> + <parameter name="transport.mail.pop3.host" locked="false">127.0.0.1</parameter> + <parameter name="transport.mail.pop3.user" locked="false">axis2</parameter> + <parameter name="transport.mail.pop3.password" locked="false">axis2</parameter> + <parameter name="transport.mail.pop3.port" locked="false">110</parameter> + <parameter name="transport.mail.replyToAddress" locked="false">axis2@127.0.0.1</parameter> + </transportReceiver> --> + + <!--REMOVED FOR TUSCANY transportReceiver name="tcp" class="org.apache.axis2.transport.tcp.TCPServer"> + <parameter name="port" locked="false">6060</parameter> + </transportReceiver --> + + <!--REMOVED FOR TUSCANY transportReceiver name="jms" class="org.apache.axis2.transport.jms.SimpleJMSListener"> + <parameter name="transport.jms.Destination" locked="false">dynamicQueues/FOO</parameter> + <parameter name="java.naming.factory.initial" locked="false"> + org.activemq.jndi.ActiveMQInitialContextFactory</parameter> + <parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter> + </transportReceiver> + --> + + <!-- ================================================= --> + <!-- Transport Outs --> + <!-- ================================================= --> + + <!--REMOVED FOR TUSCANY transportSender name="tcp" class="org.apache.axis2.transport.tcp.TCPTransportSender"/> --> + <transportSender name="local" class="org.apache.axis2.transport.local.LocalTransportSender"/> + <!--REMOVED FOR TUSCANY transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/> --> + <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"> + <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter> + <parameter name="Transfer-Encoding" locked="false">chunked</parameter> + </transportSender> + <transportSender name="https" + class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"> + <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter> + <parameter name="Transfer-Encoding" locked="false">chunked</parameter> + </transportSender> + + <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver + <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender"> + <parameter name="transport.mail.smtp.host" locked="false">127.0.0.1</parameter> + <parameter name="transport.mail.smtp.user" locked="false">axis2</parameter> + <parameter name="transport.mail.smtp.password" locked="false">axis2</parameter> + <parameter name="transport.mail.smtp.port" locked="false">25</parameter> + </transportSender> + --> + + <!-- ================================================= --> + <!-- Global Modules --> + <!-- ================================================= --> + <!-- Comment this to disable Addressing --> + <!--REMOVED FOR TUSCANY module ref="addressing"/> --> + + + <!--Configuring module , providing parameters for modules whether they refer or not--> + <!--<moduleConfig name="addressing">--> + <!--<parameter name="addressingPara" locked="false">N/A</parameter>--> + <!--</moduleConfig>--> + + <!-- ================================================= --> + <!-- Phases --> + <!-- ================================================= --> + <phaseOrder type="inflow"> + <!-- System pre defined phases --> + <phase name="TransportIn"/> + <phase name="PreDispatch"/> + <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase"> + <handler name="AddressingBasedDispatcher" + class="org.apache.axis2.engine.AddressingBasedDispatcher"> + <order phase="Dispatch"/> + </handler> + + <handler name="RequestURIBasedDispatcher" + class="org.apache.axis2.engine.RequestURIBasedDispatcher"> + <order phase="Dispatch"/> + </handler> + + <handler name="SOAPActionBasedDispatcher" + class="org.apache.axis2.engine.SOAPActionBasedDispatcher"> + <order phase="Dispatch"/> + </handler> + + <handler name="SOAPMessageBodyBasedDispatcher" + class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher"> + <order phase="Dispatch"/> + </handler> + <handler name="InstanceDispatcher" + class="org.apache.axis2.engine.InstanceDispatcher"> + <order phase="PostDispatch"/> + </handler> + </phase> + <!-- System pre defined phases --> + <!-- After Postdispatch phase module author or or service author can add any phase he want --> + <phase name="userphase1"/> + </phaseOrder> + <phaseOrder type="outflow"> + <!-- user can add his own phases to this area --> + <phase name="userphase1"/> + <!--system predefined phase--> + <!--these phase will run irrespective of the service--> + <phase name="PolicyDetermination"/> + <phase name="MessageOut"/> + </phaseOrder> + <phaseOrder type="INfaultflow"> + <!-- user can add his own phases to this area --> + <phase name="userphase1"/> + </phaseOrder> + <phaseOrder type="Outfaultflow"> + <!-- user can add his own phases to this area --> + <phase name="userphase1"/> + <phase name="PolicyDetermination"/> + <phase name="MessageOut"/> + </phaseOrder> +</axisconfig> + diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/webapp/WEB-INF/web.xml b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..46bed8f4fe --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable. + + Licensed 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. + --> +<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> + + <display-name>Tuscany Bigbank Account sample</display-name> + +</web-app> diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/test/java/org/apache/tuscany/samples/bigbank/account/client/AccountClient.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/test/java/org/apache/tuscany/samples/bigbank/account/client/AccountClient.java new file mode 100644 index 0000000000..b9bf5351c0 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/account/src/test/java/org/apache/tuscany/samples/bigbank/account/client/AccountClient.java @@ -0,0 +1,56 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.account.client; + +import java.util.Iterator; + +import org.apache.tuscany.core.client.TuscanyRuntime; +import org.apache.tuscany.samples.bigbank.account.AccountReport; +import org.apache.tuscany.samples.bigbank.account.AccountSummary; +import org.apache.tuscany.samples.bigbank.account.services.account.AccountService; +import org.osoa.sca.CurrentModuleContext; +import org.osoa.sca.ModuleContext; +import org.osoa.sca.SCA; + +public class AccountClient extends SCA { + + public void start() { + } + + public void stop() { + } + + public static void main(String[] args) throws Exception { + TuscanyRuntime tuscany = new TuscanyRuntime("bigbank.account.testclient", null); + tuscany.start(); + ModuleContext moduleContext = CurrentModuleContext.getContext(); + + AccountService accountService = (AccountService) moduleContext.locateService("AccountServiceComponent"); + + AccountReport accountReport = accountService.getAccountReport("12345"); + + for (Iterator i = accountReport.getAccountSummaries().iterator(); i.hasNext();) { + AccountSummary accountSummary = (AccountSummary) i.next(); + + System.out.println(accountSummary.getAccountNumber()); + System.out.println(accountSummary.getAccountType()); + System.out.println(accountSummary.getBalance()); + } + + } + +} diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/META-INF/MANIFEST.MF b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..ac6c17f07e --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/META-INF/MANIFEST.MF @@ -0,0 +1,7 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: sample +Bundle-SymbolicName: sample +Bundle-Version: 1.0.0 +Bundle-Localization: plugin +Require-Bundle: org.eclipse.emf.ecore.sdo diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/pom.xml b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/pom.xml new file mode 100644 index 0000000000..a96cfa328f --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/pom.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + --> +<project> + <parent> + <groupId>org.apache.tuscany.samples.bigbank</groupId> + <artifactId>bigbank-samples</artifactId> + <version>SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>customers</artifactId> + <packaging>war</packaging> + <name>Tuscany sample BigBank customer</name> + <description>DAS example with JSP</description> + <version>SNAPSHOT</version> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.das</groupId> + <artifactId>tuscany-das-rdb</artifactId> + <version>${pom.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.osoa</groupId> + <artifactId>sca-api</artifactId> + <version>${pom.version}</version> + <scope>provided</scope> + </dependency> + </dependencies> +</project> diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/readme.htm b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/readme.htm new file mode 100644 index 0000000000..b4c4a8cbad --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/readme.htm @@ -0,0 +1,190 @@ +<!--
+ Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+ Licensed 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.
+ -->
+<html><head>
+
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <title>Tuscany Customers</title><!-- LINK rel="stylesheet" href="ait.css" type="text/css" --></head>
+
+<body>
+
+<h2>Tuscany Customer Sample</h2>
+
+<h3>Overview</h3>
+
+<p>This sample employs the Tuscany runtime in collaboration with the RDB DAS to demonstrate a simple read of a customer
+record from a relational database in the context of a web application. The user provides a customer
+ID and the application responds with the corresponding customer record </p>
+
+
+<h3>Setup</h3>Run the Maven 'acceptance' task as described in the <a href="../readme.htm#Tomcat_Setup" target="_blank">Tomcat
+ Setup</a>. Running this task will configure and start a Tomcat server and deploy the sample application along with a
+canned Derby database for use by the example. Instructions will be posted soon for manually deploying the
+sample to an existing Tomcat install.<br>
+
+
+<ol>
+
+</ol>
+
+<h3>Running</h3>
+
+As mentioned above, running the Maven acceptance task deploys and runs the sample as part of the Tuscany acceptance testing. After the task has completed
+you can manually run the sample by pointing a browser to: <a href="http://localhost:8080/tuscany-samples-customerWEB/">http://localhost:8080/tuscany-samples-customerWEB/</a>.
+A page is displayed that prompts the user for a customer id. Submit an integer from 1 to 3.
+
+<h3>Results</h3>
+
+<p>Submitting an integer from 1 to 3 will result in the display of the corresponding employee record<br>
+
+<h3>Code Overview</h3>
+
+The following illustrates the structure of the sample application components:
+
+<table style="text-align: left; width: 100%;" border="1" cellpadding="2" cellspacing="2">
+
+ <tbody>
+
+ <tr>
+
+ <td>main<br>
+
+ +---java<br>
+
+ ¦ ¦
+ sca.module<br>
+
+ ¦ ¦<br>
+
+ ¦ +---org<br>
+
+ ¦
+
+ +---apache<br>
+
+ ¦
+ +---tuscany<br>
+
+ ¦
+ +---samples<br>
+
+ ¦
+
+ +---customers<br>
+ ¦
+ CustomerClient.java<br>
+ ¦
+ CustomerServiceComponent.java<br>
+ ¦
+ CustomerServiceComponentImpl.java<br>
+
+ ¦<br>
+
+ +---webapp<br>
+
+ ¦
+ Customer.jsp<br>
+
+ ¦<br>
+
+ +---customerdb<br>
+
+ ¦
+ <!--service.properties<br> -->
+
+
+ ¦ <br>
+
+ <!-- ¦<br> -->
+ ¦<br>
+
+ +---WEB-INF<br>
+   web.xml
+
+
+ <br><br><br>
+
+ </td>
+
+ </tr>
+
+ </tbody>
+</table>
+
+
+<br>
+
+<table style="text-align: left; width: 879px; height: 154px;" border="2" cellpadding="4" cellspacing="4">
+
+ <tbody>
+
+ <tr>
+
+ <td >sca.module</td>
+
+ <td> Defines the SCA module and component. Defines for the CustomerServiceComponent.</td>
+
+ </tr>
+
+ <tr>
+
+ <td >CustomerClient.java</td>
+
+ <td> Wraps the get customer service to provide a clean "getCustomer()" API.</td>
+
+ </tr>
+
+ <tr>
+
+ <td >CustomerServiceComponent.java</td>
+
+ <td> Defines the interface of the service.</td>
+
+ </tr>
+
+ <tr>
+
+ <td >Customer.jsp</td>
+
+ <td> Handles Web form input. Instantiates a CustomerClient instance and calls getCustomer()</td>
+
+ </tr>
+
+ <tr>
+
+ <td >customerdb</td>
+
+ <td> The canned Derby database with Customer records </td>
+
+ </tr>
+
+ <tr>
+
+ <td >web.xml </td>
+
+ <td>Standard J2EE web application web.xml</td>
+
+ </tr>
+
+
+
+ </tbody>
+</table>
+
+
+
+</body></html>
diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerClient.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerClient.java new file mode 100644 index 0000000000..54603c94d6 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerClient.java @@ -0,0 +1,41 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.customers; + +import commonj.sdo.DataObject; +import org.osoa.sca.CurrentModuleContext; +import org.osoa.sca.ModuleContext; + +/** + * + */ +public class CustomerClient { + + public final DataObject getCustomer(String id) throws Exception { + + ModuleContext moduleContext = CurrentModuleContext.getContext(); + assert moduleContext != null : "CurrentModuleContext.getContext() returned null!"; + + CustomerServiceComponent customerService = (CustomerServiceComponent) moduleContext + .locateService("CustomerServiceComponent"); + assert null != customerService : "SCA locate of CustomerServiceComponent returned null."; + DataObject value = customerService.getCustomer(id); + + return value; + } + +} diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponent.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponent.java new file mode 100644 index 0000000000..431b10b0e1 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponent.java @@ -0,0 +1,29 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.customers; + +import commonj.sdo.DataObject; + +/** + * + */ + +public interface CustomerServiceComponent { + + public DataObject getCustomer(String id); + +} diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponentImpl.componentType b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponentImpl.componentType new file mode 100644 index 0000000000..09535eb86b --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponentImpl.componentType @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="ASCII"?>
+<!--
+ Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+ Licensed 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.
+ -->
+<componentType xmlns="http://www.osoa.org/xmlns/sca/0.9">
+ <service name="CustomerService">
+ <interface.java interface="org.apache.tuscany.samples.customers.CustomerServiceComponent"/>
+ </service>
+</componentType>
\ No newline at end of file diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponentImpl.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponentImpl.java new file mode 100644 index 0000000000..d78a5429c1 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/org/apache/tuscany/samples/customers/CustomerServiceComponentImpl.java @@ -0,0 +1,76 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.customers; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.util.List; + +import commonj.sdo.DataObject; +import org.osoa.sca.annotations.Service; + +import org.apache.tuscany.das.rdb.Command; + +/** + * + */ +@Service(CustomerServiceComponent.class) +public class CustomerServiceComponentImpl implements CustomerServiceComponent { + + private static final String driverName = "org.apache.derby.jdbc.EmbeddedDriver"; + + private static final String databaseURL = "jdbc:derby:../webapps/tuscany-samples-customerWEB/customerdb"; + + /* + * (non-Javadoc) + * + * @see org.apache.tuscany.samples.helloworldweb.HelloWorldServiceComponent#getGreetings() + */ + public DataObject getCustomer(String id) { + // Create and initialize command to read customers + Command readCustomers = Command.FACTORY + .createCommand("select * from CUSTOMER where ID = :ID"); + readCustomers.setConnection(getConnection()); + readCustomers.setParameterValue("ID", new Integer(id)); + + // Read + DataObject root = readCustomers.executeQuery(); + + readCustomers.close(); + + List customers = root.getList("CUSTOMER"); + if (customers.size() > 0) + return (DataObject) customers.get(0); + else + return null; + + } + + private Connection getConnection() { + try { + + Class.forName(driverName).newInstance(); + Connection connection = DriverManager.getConnection(databaseURL); + connection.setAutoCommit(false); + return connection; + } catch (Exception ex) { + throw new RuntimeException(ex); + } + + } + +} diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/sca.module b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/sca.module new file mode 100644 index 0000000000..64ff9341f2 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/java/sca.module @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+ Licensed 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.
+ -->
+<module xmlns="http://www.osoa.org/xmlns/sca/0.9" xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9"
+ name="sampleCustomer">
+
+ <component name="CustomerServiceComponent">
+ <implementation.java class="org.apache.tuscany.samples.customers.CustomerServiceComponentImpl"/>
+ </component>
+</module>
diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/Customer.jsp b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/Customer.jsp new file mode 100644 index 0000000000..8906a54f99 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/Customer.jsp @@ -0,0 +1,94 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<%--
+ * Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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.
+ --%>
+
+<HTML>
+<HEAD>
+ <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+ pageEncoding="ISO-8859-1" session="true" autoFlush="true"
+ isThreadSafe="true" isErrorPage="false"
+ import="org.apache.tuscany.samples.customers.CustomerClient"
+ import="java.io.PrintWriter"
+ import="java.io.StringWriter"
+ import="java.util.Iterator"
+ import="commonj.sdo.*"
+ %>
+ <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <META name="GENERATOR" content="IBM Software Development Platform">
+ <TITLE>Tuscany HelloWorld WEB Example</TITLE>
+ <%
+ String id = request.getParameter("id");
+ %>
+</HEAD>
+
+<BODY>
+<H2>Tuscany CustomerDB WEB Example</H2>
+
+<P> </P>
+
+<form action="Customer.jsp" method="get">ID
+ please: <INPUT type="text" id="i1" name="id"
+ size="40" maxlength="220" value="<%= null == id ? "1" : id %>"> <BR>
+ <BR>
+ <INPUT type="submit" name="submit" value="Submit"></FORM>
+<BR>
+
+<%
+ try {
+ if (null != id) {
+%>
+<HR>
+
+<P>
+
+ <% DataObject obj = (new CustomerClient()).getCustomer(id);
+ if ( obj == null ) {%>
+
+<p>Customer <%= id%> not found</p>
+<%} else {%>
+
+
+<table id="table1" border=5><tr><TH>ID</TH><TH>First Name</TH><TH>Last Name</TH></TR><TR>
+ <%Iterator iter = obj.getType().getProperties().iterator();
+ while (iter.hasNext()) {
+ Property p = (Property) iter.next();%>
+ <td><%= obj.get(p)%></td>
+ <%
+ }
+ %>
+</tr></table>
+<%
+ }
+ }
+} catch (Exception e) {
+ e.printStackTrace();
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+
+ e.printStackTrace(pw);
+ pw.flush();
+
+%>
+Whoops!<BR clear="all">
+<PRE>
+ Exception "<%=e.getClass().getName()%>" Exception message: "<%=e.getMessage()%>"<BR clear="all">
+ <%=sw.toString() %>
+</PRE>
+<%
+
+ }%>
+</BODY>
+</HTML>
\ No newline at end of file diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/WEB-INF/web.xml b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..9c377a7f05 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable. + + Licensed 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. + --> + +<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web +Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> + +<web-app> + <display-name>Tuscany sample Customers WEB</display-name> + + <mime-mapping> + <extension>wsdl</extension> + <mime-type>text/xml</mime-type> + </mime-mapping> + + <mime-mapping> + <extension>xsd</extension> + <mime-type>text/xml</mime-type> + </mime-mapping> + + <welcome-file-list id="WelcomeFileList"> + <welcome-file>Customer.jsp</welcome-file> + </welcome-file-list> + +</web-app> diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/log.ctrl b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/log.ctrl Binary files differnew file mode 100644 index 0000000000..07b131b33d --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/log.ctrl diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/log1.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/log1.dat Binary files differnew file mode 100644 index 0000000000..a2b39d02ad --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/log1.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/logmirror.ctrl b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/logmirror.ctrl Binary files differnew file mode 100644 index 0000000000..07b131b33d --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/log/logmirror.ctrl diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c10.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c10.dat Binary files differnew file mode 100644 index 0000000000..ec5247397b --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c10.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c101.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c101.dat Binary files differnew file mode 100644 index 0000000000..56f1d60c9b --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c101.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c111.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c111.dat Binary files differnew file mode 100644 index 0000000000..d3b8b6f5e1 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c111.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c121.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c121.dat Binary files differnew file mode 100644 index 0000000000..3a207dc135 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c121.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c130.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c130.dat Binary files differnew file mode 100644 index 0000000000..62e5dfb863 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c130.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c141.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c141.dat Binary files differnew file mode 100644 index 0000000000..f695f44cd9 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c141.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c150.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c150.dat Binary files differnew file mode 100644 index 0000000000..2c1e232161 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c150.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c161.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c161.dat Binary files differnew file mode 100644 index 0000000000..9983bb5ba4 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c161.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c171.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c171.dat Binary files differnew file mode 100644 index 0000000000..25800bbf47 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c171.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c180.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c180.dat Binary files differnew file mode 100644 index 0000000000..8f4b0f0b5d --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c180.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c191.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c191.dat Binary files differnew file mode 100644 index 0000000000..b2d149a0f3 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c191.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1a1.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1a1.dat Binary files differnew file mode 100644 index 0000000000..9a15a565ca --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1a1.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1b1.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1b1.dat Binary files differnew file mode 100644 index 0000000000..468738fdf3 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1b1.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1c0.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1c0.dat Binary files differnew file mode 100644 index 0000000000..359525a31a --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1c0.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1d1.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1d1.dat Binary files differnew file mode 100644 index 0000000000..9f257df932 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1d1.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1e0.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1e0.dat Binary files differnew file mode 100644 index 0000000000..e43e52fb7f --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1e0.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1f1.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1f1.dat Binary files differnew file mode 100644 index 0000000000..7e6ee3b1e0 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c1f1.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c20.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c20.dat Binary files differnew file mode 100644 index 0000000000..1acd3470bd --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c20.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c200.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c200.dat Binary files differnew file mode 100644 index 0000000000..cae919d022 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c200.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c211.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c211.dat Binary files differnew file mode 100644 index 0000000000..c7e311b00e --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c211.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c221.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c221.dat Binary files differnew file mode 100644 index 0000000000..28e89367ce --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c221.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c230.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c230.dat Binary files differnew file mode 100644 index 0000000000..505d1595c5 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c230.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c241.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c241.dat Binary files differnew file mode 100644 index 0000000000..e1de638de2 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c241.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c251.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c251.dat Binary files differnew file mode 100644 index 0000000000..d3d6adf4fb --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c251.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c260.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c260.dat Binary files differnew file mode 100644 index 0000000000..8d7333df7d --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c260.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c271.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c271.dat Binary files differnew file mode 100644 index 0000000000..af722f7d73 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c271.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c281.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c281.dat Binary files differnew file mode 100644 index 0000000000..3972983c2e --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c281.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c290.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c290.dat Binary files differnew file mode 100644 index 0000000000..31577b8124 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c290.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2a1.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2a1.dat Binary files differnew file mode 100644 index 0000000000..0f700d13a7 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2a1.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2b1.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2b1.dat Binary files differnew file mode 100644 index 0000000000..1d6382fb3d --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2b1.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2c1.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2c1.dat Binary files differnew file mode 100644 index 0000000000..3bc60d886b --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2c1.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2d0.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2d0.dat Binary files differnew file mode 100644 index 0000000000..c542d3c91c --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2d0.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2e1.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2e1.dat Binary files differnew file mode 100644 index 0000000000..16abd20b5f --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2e1.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2f0.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2f0.dat Binary files differnew file mode 100644 index 0000000000..eb26be5932 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c2f0.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c300.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c300.dat Binary files differnew file mode 100644 index 0000000000..f3a3c65388 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c300.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c31.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c31.dat Binary files differnew file mode 100644 index 0000000000..73d5c7fae4 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c31.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c311.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c311.dat Binary files differnew file mode 100644 index 0000000000..f6a7e4f417 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c311.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c41.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c41.dat Binary files differnew file mode 100644 index 0000000000..eb58d83e26 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c41.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c51.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c51.dat Binary files differnew file mode 100644 index 0000000000..7d0eec8334 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c51.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c60.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c60.dat Binary files differnew file mode 100644 index 0000000000..5e3d16c18a --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c60.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c71.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c71.dat Binary files differnew file mode 100644 index 0000000000..9ca2ca97d1 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c71.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c81.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c81.dat Binary files differnew file mode 100644 index 0000000000..434cd610e1 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c81.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c90.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c90.dat Binary files differnew file mode 100644 index 0000000000..a7d7c228fa --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/c90.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/ca1.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/ca1.dat Binary files differnew file mode 100644 index 0000000000..bd89820d88 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/ca1.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cb1.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cb1.dat Binary files differnew file mode 100644 index 0000000000..3fcb1cc026 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cb1.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cc0.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cc0.dat Binary files differnew file mode 100644 index 0000000000..5126021a83 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cc0.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cd1.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cd1.dat Binary files differnew file mode 100644 index 0000000000..2e135b64ab --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cd1.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/ce1.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/ce1.dat Binary files differnew file mode 100644 index 0000000000..076423c10a --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/ce1.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cf0.dat b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cf0.dat Binary files differnew file mode 100644 index 0000000000..b2ab11309b --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/seg0/cf0.dat diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/service.properties b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/service.properties new file mode 100644 index 0000000000..6a0ce30db7 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/customers/src/main/webapp/customerdb/service.properties @@ -0,0 +1,22 @@ +#C:\ossoa\trunk\samples\customers\src\webapp\customerdb +# ******************************************************************** +# *** Please do NOT edit this file. *** +# *** CHANGING THE CONTENT OF THIS FILE MAY CAUSE DATA CORRUPTION. *** +# ******************************************************************** +#Tue Nov 01 17:28:38 EST 2005 +SysschemasIndex2Identifier=225 +SyscolumnsIdentifier=144 +SysconglomeratesIndex1Identifier=49 +SysconglomeratesIdentifier=32 +SyscolumnsIndex2Identifier=177 +SysschemasIndex1Identifier=209 +SysconglomeratesIndex3Identifier=81 +SystablesIndex2Identifier=129 +SyscolumnsIndex1Identifier=161 +derby.serviceProtocol=org.apache.derby.database.Database +SysschemasIdentifier=192 +derby.storage.propertiesId=16 +SysconglomeratesIndex2Identifier=65 +derby.serviceLocale=en_US +SystablesIdentifier=96 +SystablesIndex1Identifier=113 diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/pom.xml b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/pom.xml new file mode 100644 index 0000000000..0ec1824e0c --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/pom.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + --> +<project> + <parent> + <groupId>org.apache.tuscany.samples</groupId> + <artifactId>tuscany-samples</artifactId> + <version>SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.tuscany.samples.bigbank</groupId> + <artifactId>bigbank-samples</artifactId> + <packaging>pom</packaging> + <name>Tuscany BigBank Samples</name> + <version>SNAPSHOT</version> + + <modules> + <module>customers</module> + <module>account</module> + <module>webclient</module> + </modules> +</project> diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/pom.xml b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/pom.xml new file mode 100644 index 0000000000..7503f83246 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/pom.xml @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Copyright (c) 2005-2006 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + --> +<project> + <parent> + <groupId>org.apache.tuscany.samples.bigbank</groupId> + <artifactId>bigbank-samples</artifactId> + <version>SNAPSHOT</version> + </parent> + <modelVersion>4.0.0</modelVersion> + <artifactId>webclient</artifactId> + <packaging>war</packaging> + <name>Tuscany sample BigBank webclient</name> + <description>BigBank sample - webclient module</description> + <version>SNAPSHOT</version> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany</groupId> + <artifactId>tuscany-core</artifactId> + <version>${pom.version}</version> + <scope>provided</scope> <!-- use provided so tuscany infrastructue is not inc. in the war--> + </dependency> + + <dependency> + <groupId>tomcat</groupId> + <artifactId>servlet-api</artifactId> + <version>5.0.18</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>tomcat</groupId> + <artifactId>jsp-api</artifactId> + <version>5.0.18</version> + <scope>provided</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.tuscany</groupId> + <artifactId>tuscany-sdo-plugin</artifactId> + <executions> + <execution> + <configuration> + <schemaFile>${basedir}/src/main/resources/wsdl/AccountService.wsdl</schemaFile> + <noNotification>true</noNotification> + <noContainer>true</noContainer> + <noInterfaces>true</noInterfaces> + <noUnsettable>true</noUnsettable> + </configuration> + <goals> + <goal>generate</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.tuscany</groupId> + <artifactId>tuscany-sca-plugin</artifactId> + <executions> + <execution> + <configuration> + <wsdlFile>${basedir}/src/main/resources/wsdl/AccountService.wsdl</wsdlFile> + <javaPackage>org.apache.tuscany.samples.bigbank.account.services.account</javaPackage> </configuration> + <goals> + <goal>generate</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project> diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/account/AccountServiceComponentImpl.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/account/AccountServiceComponentImpl.java new file mode 100644 index 0000000000..3a9e7a4e60 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/account/AccountServiceComponentImpl.java @@ -0,0 +1,57 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.webclient.services.account; + +import org.apache.tuscany.samples.bigbank.account.AccountFactory; +import org.apache.tuscany.samples.bigbank.account.AccountReport; +import org.apache.tuscany.samples.bigbank.account.services.account.AccountService; +import org.apache.tuscany.sdo.util.SDOUtil; +import org.osoa.sca.ServiceUnavailableException; +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +/** + */ +@Service(AccountService.class) +public class AccountServiceComponentImpl implements AccountService { + + static { + SDOUtil.registerStaticTypes(AccountFactory.class); + } + + @Reference + public AccountService accountService; + + /** + * + */ + public AccountServiceComponentImpl() { + super(); + } + + /** + * @see org.apache.tuscany.samples.bigbank.webclient.services.account.AccountService#getAccountReport(java.lang.String) + */ + public AccountReport getAccountReport(String customerID) { + try { + return accountService.getAccountReport(customerID); + } catch (Exception e) { + throw new ServiceUnavailableException(e); + } + } + +} diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/LoginService.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/LoginService.java new file mode 100644 index 0000000000..7bb660082d --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/LoginService.java @@ -0,0 +1,27 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.webclient.services.profile; + +public interface LoginService { + + public static final int SUCCESS = 1; + public static final int INVALID_LOGIN = -1; + public static final int INVALID_PASSWORD = -2; + + public int login(String userName, String password); +} + diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/ProfileService.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/ProfileService.java new file mode 100644 index 0000000000..affbfe9700 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/ProfileService.java @@ -0,0 +1,36 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.webclient.services.profile; + +public interface ProfileService { + + public String getFirstName(); + + public void setFirstName(String pName); + + public String getLastName(); + + public void setLastName(String pName); + + public boolean isLoggedIn(); + + public void setLoggedIn(boolean pStatus); + + public String getId(); + + public void setId(String pId); +} diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/ProfileServiceImpl.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/ProfileServiceImpl.java new file mode 100644 index 0000000000..7d572154c6 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/ProfileServiceImpl.java @@ -0,0 +1,68 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.webclient.services.profile; + +import org.osoa.sca.annotations.Property; +import org.osoa.sca.annotations.Scope; +import org.osoa.sca.annotations.Service; + +@Service(ProfileService.class) +@Scope("session") +public class ProfileServiceImpl implements ProfileService { + + @Property + private String firstName; + + public String getFirstName() { + return firstName; + } + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + private String lastName; + + public String getLastName() { + return lastName; + } + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + private boolean loggedIn; + + public boolean isLoggedIn() { + return loggedIn; + } + + public void setLoggedIn(boolean status) { + loggedIn = status; + } + + private String id; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } +} + diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/SimpleLoginServiceImpl.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/SimpleLoginServiceImpl.java new file mode 100644 index 0000000000..2689dc7020 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/services/profile/SimpleLoginServiceImpl.java @@ -0,0 +1,45 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.webclient.services.profile; + +import org.osoa.sca.annotations.Reference; +import org.osoa.sca.annotations.Service; + +@Service(LoginService.class) +public class SimpleLoginServiceImpl implements LoginService { + + @Reference + public ProfileService profileService; + + public int login(String userName, String password) { + + if (!"test".equals(userName)) { + return INVALID_LOGIN; + } + + if (!"password".equals(password)) { + return INVALID_PASSWORD; + } + + profileService.setLoggedIn(true); + profileService.setFirstName("John"); + profileService.setLastName("Doe"); + profileService.setId("12345"); + + return SUCCESS; + } +} diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/account/AccountStatusTag.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/account/AccountStatusTag.java new file mode 100644 index 0000000000..ecdb0c49b4 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/account/AccountStatusTag.java @@ -0,0 +1,125 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.webclient.tags.account; + +import java.util.Iterator; +import java.util.List; + +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.tagext.TagSupport; + +import org.apache.tuscany.samples.bigbank.account.services.account.AccountService; +import org.apache.tuscany.samples.bigbank.webclient.services.profile.ProfileService; +import org.osoa.sca.CurrentModuleContext; +import org.osoa.sca.ModuleContext; + +/** + * Retrieves and iterates over account summary information for the current + * profile by accessing the remotable account service component + */ + +public class AccountStatusTag extends TagSupport { + + // ---------------------------------- + // Constructors + // ---------------------------------- + + public AccountStatusTag() { + super(); + } + + // ---------------------------------- + // Methods + // ---------------------------------- + + private String mAccountService; + + public String getAccountService() { + return mAccountService; + } + + public void setAccountService(String pAccountService) { + mAccountService = pAccountService; + } + + private String mProfileService; + + public String getProfileService() { + return mProfileService; + } + + public void setProfileService(String pProfileService) { + mProfileService = pProfileService; + } + + private String mId; + + public String getId() { + return mId; + } + + public void setId(String pId) { + mId = pId; + } + + private Iterator mIterator; + + public int doStartTag() throws JspException { + ModuleContext moduleContext = CurrentModuleContext.getContext(); + ProfileService profile = (ProfileService) moduleContext + .locateService(mProfileService); + if (profile == null) { + throw new JspException("Profile [" + mProfileService + + "] not found in current module context"); + } + + AccountService service = (AccountService) moduleContext + .locateService(mAccountService); + if (service == null) { + throw new JspException("Service [" + mAccountService + + "] not found in current module context"); + } + List summaries; + try { + summaries = service.getAccountReport(profile.getId()).getAccountSummaries(); + } catch (Exception e) { + throw new JspException(e); + } + mIterator = summaries.iterator(); + if (mIterator.hasNext()) { + pageContext.setAttribute(mId, mIterator.next()); + return EVAL_BODY_INCLUDE; + } else { + return SKIP_BODY; + } + } + + public int doAfterBody() { + if (mIterator.hasNext()) { + pageContext.setAttribute(mId, mIterator.next()); + return EVAL_BODY_AGAIN; + } else { + return SKIP_BODY; + } + } + + public void release() { + super.release(); + mId = null; + mIterator = null; + } +}
\ No newline at end of file diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/LoginBarrierTag.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/LoginBarrierTag.java new file mode 100644 index 0000000000..31fa27fa6f --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/LoginBarrierTag.java @@ -0,0 +1,87 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.webclient.tags.sca; + +import java.io.IOException; +import javax.servlet.ServletException; +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.tagext.TagSupport; + +import org.osoa.sca.CurrentModuleContext; +import org.osoa.sca.ModuleContext; + +import org.apache.tuscany.samples.bigbank.webclient.services.profile.ProfileService; + +public class LoginBarrierTag extends TagSupport { + + public LoginBarrierTag() { + super(); + } + + private String mProfile; + + public String getProfile() { + return mProfile; + } + + public void setProfile(String pProfile) { + mProfile = pProfile; + } + + private String mUrl; + + public String getUrl() { + return mUrl; + } + + public void setUrl(String pUrl) { + mUrl = pUrl; + } + + public int doStartTag() throws JspException { + if (mProfile == null || mProfile.length() < 1) { + throw new JspException("Invalid profile location specified"); + } + + ModuleContext moduleContext = CurrentModuleContext.getContext(); + ProfileService profile = (ProfileService) moduleContext.locateService(mProfile); + if (profile == null) { + throw new JspException("Profile [" + mProfile + "] not found in current module context"); + } + if (profile.isLoggedIn()) { + return EVAL_BODY_INCLUDE; + } else { + try { + pageContext.forward(mUrl); + return SKIP_BODY; + } catch (ServletException e) { + throw new JspException("Unable to forward to [" + mUrl + "]"); + } catch (IOException e) { + throw new JspException("Unable to forward to [" + mUrl + "]"); + } + } + } + + public int doEndTag() throws JspException { + return EVAL_PAGE; + } + + public void release() { + super.release(); + } + +} diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/ServiceTag.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/ServiceTag.java new file mode 100644 index 0000000000..df5697c11f --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/tags/sca/ServiceTag.java @@ -0,0 +1,100 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.webclient.tags.sca; + +import javax.servlet.jsp.JspException; +import javax.servlet.jsp.tagext.TagSupport; + +import org.osoa.sca.CurrentModuleContext; +import org.osoa.sca.ModuleContext; + + +/** + * Places an SCA service in the JSP page context, making it available to other + * tags corresponding to its id value. + */ + +public class ServiceTag extends TagSupport { + + // ---------------------------------- + // Constructors + // ---------------------------------- + + public ServiceTag() { + super(); + } + + // ---------------------------------- + // Methods + // ---------------------------------- + + private String mName; + + /** + * Returns the name of the SCA service to import into the page context. + */ + public String getName() { + return mName; + } + + /** + * Sets name of the SCA service to import into the page context. + */ + public void setName(String pName) { + mName = pName; + } + + private String mId; + + /** + * Returns the id of the service in the page context + */ + public String getId() { + return mId; + } + + /** + * Sets the id of the service for the page context + */ + + public void setId(String pId) { + mId = pId; + } + + public int doStartTag() throws JspException { + ModuleContext moduleContext = CurrentModuleContext.getContext(); + Object service = moduleContext.locateService(mName); + if (service == null) { + throw new JspException("Service [" + mName + "] not found in current module context"); + } + if (mId == null) { + // if the Id name was not specified, default to the basic name of the + // service + mId = mName; + } + pageContext.setAttribute(mId, service); + return EVAL_BODY_INCLUDE; + } + + public int doEndTag() throws JspException { + return EVAL_PAGE; + } + + public void release() { + super.release(); + } +}
\ No newline at end of file diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/ui/LoginServlet.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/ui/LoginServlet.java new file mode 100644 index 0000000000..78bedbe4f7 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/java/org/apache/tuscany/samples/bigbank/webclient/ui/LoginServlet.java @@ -0,0 +1,67 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.webclient.ui; + +import java.io.IOException; + +import javax.servlet.ServletConfig; +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.tuscany.samples.bigbank.webclient.services.profile.LoginService; +import org.osoa.sca.CurrentModuleContext; +import org.osoa.sca.ModuleContext; + + +public class LoginServlet extends HttpServlet { + + private ServletContext mContext; + + public void init(ServletConfig pCfg) throws ServletException { + mContext = pCfg.getServletContext(); + } + + public void doPost(HttpServletRequest pReq, HttpServletResponse pResp) throws ServletException { + + ModuleContext moduleContext = CurrentModuleContext.getContext(); + LoginService loginMgr = (LoginService) + moduleContext.locateService("LoginServiceComponent"); + + if (loginMgr == null) { + throw new ServletException("LoginManager not found"); + } + + String login = pReq.getParameter("login"); + String password = pReq.getParameter("password"); + try { + if (login == null || password == null) { + pResp.sendRedirect("summary.jsp"); + } + int resp = loginMgr.login(login, password); + if (resp == LoginService.SUCCESS) { + mContext.getRequestDispatcher("/summary.jsp").forward(pReq, pResp); + } else { + mContext.getRequestDispatcher("/login.html").forward(pReq, pResp); + } + } catch (IOException e) { + throw new ServletException(e); + } + } +} diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/sca.module b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/sca.module new file mode 100644 index 0000000000..6b4b17c6a7 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/sca.module @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="ASCII"?>
+<!--
+ Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+ Licensed 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.
+ -->
+<module xmlns="http://www.osoa.org/xmlns/sca/0.9" xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9"
+
+ name="tuscany.samples.bigbank.webclient">
+
+ <component name="LoginServiceComponent">
+ <implementation.java class="org.apache.tuscany.samples.bigbank.webclient.services.profile.SimpleLoginServiceImpl"/>
+ <references>
+ <v:profileService>ProfileServiceComponent</v:profileService>
+ </references>
+ </component>
+
+ <component name="ProfileServiceComponent">
+ <implementation.java class="org.apache.tuscany.samples.bigbank.webclient.services.profile.ProfileServiceImpl"/>
+ <properties>
+ <v:firstName>Anonymous</v:firstName>
+ </properties>
+ </component>
+
+ <component name="AccountServiceComponent">
+ <implementation.java class="org.apache.tuscany.samples.bigbank.webclient.services.account.AccountServiceComponentImpl"/>
+ <references>
+ <v:accountService>AccountService</v:accountService>
+ </references>
+ </component>
+
+ <externalService name="AccountService">
+ <interface.wsdl interface="http://www.bigbank.com/Account/#AccountService"/>
+ <!--
+ <interface.java interface="org.apache.tuscany.samples.bigbank.webclient.services.account.AccountService"/>
+ -->
+ <binding.ws port="http://www.bigbank.com/Account/#AccountServiceSOAP"/>
+ </externalService>
+
+ <import.wsdl + location="wsdl/AccountService.wsdl" + namespace="http://www.bigbank.com/Account/"/> + +</module>
+
diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/sca.subsystem b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/sca.subsystem new file mode 100644 index 0000000000..1c12f340c8 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/sca.subsystem @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="ASCII"?>
+<!--
+ Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+ Licensed 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.
+ -->
+<subsystem xmlns="http://www.osoa.org/xmlns/sca/0.9" xmlns:v="http://www.osoa.org/xmlns/sca/values/0.9"
+
+ name="tuscany.samples.bigbank.webclient">
+
+ <moduleComponent name="WebClientModuleComponent" module="tuscany.samples.bigbank.webclient">
+ <references>
+ <v:AccountService>bigbank.accountsunbsystem/AccountModuleComponent/AccountService</v:AccountService>
+ </references>
+ </moduleComponent>
+
+</subsystem>
+
diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl new file mode 100644 index 0000000000..5d087530dd --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/resources/wsdl/AccountService.wsdl @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+ Licensed 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.
+ -->
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://www.bigbank.com/Account/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:account="http://www.bigbank.com/Account/"
+ targetNamespace="http://www.bigbank.com/Account/" + name="AccountService">
+
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://www.bigbank.com/Account/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:account="http://www.bigbank.com/Account/" + xmlns:sdojava="commonj.sdo/java" + sdojava:package="org.apache.tuscany.samples.bigbank.account">
+
+ <xsd:element name="getAccountReport"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="customerID" type="xsd:string"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element>
+ <xsd:element name="getAccountReportResponse"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="accountReport" type="account:AccountReport"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> +
+ <xsd:complexType name="AccountReport">
+ <xsd:sequence>
+ <xsd:element name="accountSummaries" type="account:AccountSummary" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="AccountSummary">
+ <xsd:attribute name="accountNumber" type="xsd:string"/>
+ <xsd:attribute name="accountType" type="xsd:string"/>
+ <xsd:attribute name="balance" type="xsd:float"/>
+ </xsd:complexType>
+
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="getAccountReportRequest">
+ <wsdl:part element="account:getAccountReport" name="getAccountReportRequest"/>
+ </wsdl:message>
+ <wsdl:message name="getAccountReportResponse">
+ <wsdl:part element="account:getAccountReportResponse" name="getAccountReportResponse"/>
+ </wsdl:message>
+ <wsdl:portType name="AccountService">
+ <wsdl:operation name="getAccountReport">
+ <wsdl:input message="tns:getAccountReportRequest"/>
+ <wsdl:output message="tns:getAccountReportResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="AccountServiceSOAP" type="tns:AccountService">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="getAccountReport">
+ <soap:operation
+ soapAction="http://www.bigbank.com/Account/getAccountReport"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="AccountService">
+ <wsdl:port binding="tns:AccountServiceSOAP"
+ name="AccountServiceSOAP">
+ <soap:address location="http://localhost:8080/account-SNAPSHOT/services/AccountService"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/axis2.xml b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/axis2.xml new file mode 100644 index 0000000000..a38cf9864a --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/axis2.xml @@ -0,0 +1,167 @@ +<axisconfig name="AxisJava2.0"> + <!-- ================================================= --> + <!-- Parameters --> + <!-- ================================================= --> + <parameter name="hotdeployment" locked="false">false</parameter> + <parameter name="hotupdate" locked="false">false</parameter> + <parameter name="enableMTOM" locked="false">false</parameter> + <!-- Uncomment this to enable REST support --> + <!-- <parameter name="enableREST" locked="false">true</parameter>--> + + + <parameter name="userName" locked="false">admin</parameter> + <parameter name="password" locked="false">axis2</parameter> + + <parameter name="seralizeLocation" locked="false">.</parameter> + <hostConfiguration> + <ip>127.0.0.1</ip> + <port>5555</port> + </hostConfiguration> + + + <!--if you want to extract the service archive file and work with that please uncomment this--> + <!--else , it wont extract archive file or does not take into consideration if someone drop--> + <!--exploded directory into /service directory--> + <!--<parameter name="extractServiceArchive" locked="false">true</parameter>--> + + + <!-- The way of adding listener to the system--> + <!-- <listener class="org.apache.axis2.ObserverIMPL">--> + <!-- <parameter name="RSS_URL" locked="false">http://127.0.0.1/rss</parameter>--> + <!-- </listener>--> + + <!-- ================================================= --> + <!-- Message Receivers --> + <!-- ================================================= --> + <!--This is the Deafult Message Receiver for the system , if you want to have MessageReceivers for --> + <!--all the other MEP implement it and add the correct entry to here , so that you can refer from--> + <!--any operation --> + <!--Note : You can ovride this for particular service by adding the same element with your requirement--> + <messageReceivers> + <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" + class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/> + <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" + class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/> + </messageReceivers> + <!-- ================================================= --> + <!-- Transport Ins --> + <!-- ================================================= --> + <transportReceiver name="http" class="org.apache.axis2.transport.http.SimpleHTTPServer"> + <parameter name="port" locked="false">6060</parameter> + </transportReceiver> + + <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver + <transportReceiver name="mail" class="org.apache.axis2.transport.mail.SimpleMailListener"> + <parameter name="transport.mail.pop3.host" locked="false">127.0.0.1</parameter> + <parameter name="transport.mail.pop3.user" locked="false">axis2</parameter> + <parameter name="transport.mail.pop3.password" locked="false">axis2</parameter> + <parameter name="transport.mail.pop3.port" locked="false">110</parameter> + <parameter name="transport.mail.replyToAddress" locked="false">axis2@127.0.0.1</parameter> + </transportReceiver> --> + + <!--REMOVED FOR TUSCANY transportReceiver name="tcp" class="org.apache.axis2.transport.tcp.TCPServer"> + <parameter name="port" locked="false">6060</parameter> + </transportReceiver --> + + <!--REMOVED FOR TUSCANY transportReceiver name="jms" class="org.apache.axis2.transport.jms.SimpleJMSListener"> + <parameter name="transport.jms.Destination" locked="false">dynamicQueues/FOO</parameter> + <parameter name="java.naming.factory.initial" locked="false"> + org.activemq.jndi.ActiveMQInitialContextFactory</parameter> + <parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter> + </transportReceiver> + --> + + <!-- ================================================= --> + <!-- Transport Outs --> + <!-- ================================================= --> + + <!--REMOVED FOR TUSCANY transportSender name="tcp" class="org.apache.axis2.transport.tcp.TCPTransportSender"/> --> + <transportSender name="local" class="org.apache.axis2.transport.local.LocalTransportSender"/> + <!--REMOVED FOR TUSCANY transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/> --> + <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"> + <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter> + <parameter name="Transfer-Encoding" locked="false">chunked</parameter> + </transportSender> + <transportSender name="https" + class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"> + <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter> + <parameter name="Transfer-Encoding" locked="false">chunked</parameter> + </transportSender> + + <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver + <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender"> + <parameter name="transport.mail.smtp.host" locked="false">127.0.0.1</parameter> + <parameter name="transport.mail.smtp.user" locked="false">axis2</parameter> + <parameter name="transport.mail.smtp.password" locked="false">axis2</parameter> + <parameter name="transport.mail.smtp.port" locked="false">25</parameter> + </transportSender> + --> + + <!-- ================================================= --> + <!-- Global Modules --> + <!-- ================================================= --> + <!-- Comment this to disable Addressing --> + <!--REMOVED FOR TUSCANY module ref="addressing"/> --> + + + <!--Configuring module , providing parameters for modules whether they refer or not--> + <!--<moduleConfig name="addressing">--> + <!--<parameter name="addressingPara" locked="false">N/A</parameter>--> + <!--</moduleConfig>--> + + <!-- ================================================= --> + <!-- Phases --> + <!-- ================================================= --> + <phaseOrder type="inflow"> + <!-- System pre defined phases --> + <phase name="TransportIn"/> + <phase name="PreDispatch"/> + <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase"> + <handler name="AddressingBasedDispatcher" + class="org.apache.axis2.engine.AddressingBasedDispatcher"> + <order phase="Dispatch"/> + </handler> + + <handler name="RequestURIBasedDispatcher" + class="org.apache.axis2.engine.RequestURIBasedDispatcher"> + <order phase="Dispatch"/> + </handler> + + <handler name="SOAPActionBasedDispatcher" + class="org.apache.axis2.engine.SOAPActionBasedDispatcher"> + <order phase="Dispatch"/> + </handler> + + <handler name="SOAPMessageBodyBasedDispatcher" + class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher"> + <order phase="Dispatch"/> + </handler> + <handler name="InstanceDispatcher" + class="org.apache.axis2.engine.InstanceDispatcher"> + <order phase="PostDispatch"/> + </handler> + </phase> + <!-- System pre defined phases --> + <!-- After Postdispatch phase module author or or service author can add any phase he want --> + <phase name="userphase1"/> + </phaseOrder> + <phaseOrder type="outflow"> + <!-- user can add his own phases to this area --> + <phase name="userphase1"/> + <!--system predefined phase--> + <!--these phase will run irrespective of the service--> + <phase name="PolicyDetermination"/> + <phase name="MessageOut"/> + </phaseOrder> + <phaseOrder type="INfaultflow"> + <!-- user can add his own phases to this area --> + <phase name="userphase1"/> + </phaseOrder> + <phaseOrder type="Outfaultflow"> + <!-- user can add his own phases to this area --> + <phase name="userphase1"/> + <phase name="PolicyDetermination"/> + <phase name="MessageOut"/> + </phaseOrder> +</axisconfig> + diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld new file mode 100644 index 0000000000..c8a4451691 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/bigbank-tags.tld @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+ Licensed 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.
+ -->
+<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" version="2.0">
+ <tlibversion>1.0</tlibversion>
+ <jspversion>2.0</jspversion>
+ <shortname>BigBank Tags</shortname>
+ <info>Tag library containing BigBank tags</info>
+ <tag>
+ <name>service</name>
+ <tagclass>org.apache.tuscany.samples.bigbank.webclient.tags.sca.ServiceTag</tagclass>
+ <bodycontent>JSP</bodycontent>
+ <info>Places a reference to an SCA Service in the page context</info>
+ <attribute>
+ <name>id</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>name</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ </tag>
+ <tag>
+ <name>login</name>
+ <tagclass>org.apache.tuscany.samples.bigbank.webclient.tags.sca.LoginBarrierTag</tagclass>
+ <bodycontent>JSP</bodycontent>
+ <info>Redirects if user is not logged in</info>
+ <attribute>
+ <name>profile</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>url</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+
+ </tag>
+ <tag>
+ <name>accountStatus</name>
+ <tagclass>org.apache.tuscany.samples.bigbank.webclient.tags.account.AccountStatusTag</tagclass>
+ <bodycontent>JSP</bodycontent>
+ <info>Accesses and iterates the account service</info>
+ <attribute>
+ <name>id</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>accountService</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>profileService</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ </tag>
+
+</taglib>
diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/web.xml b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000..859fb927af --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable. + + Licensed 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. + --> +<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> + + <display-name>Tuscany Bigbank Web UI sample</display-name> + <welcome-file-list id="WelcomeFileList"> + <welcome-file>login.html</welcome-file> + </welcome-file-list> + + <servlet> + <servlet-name>LoginServlet</servlet-name> + <servlet-class>org.apache.tuscany.samples.bigbank.webclient.ui.LoginServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + + <servlet-mapping> + <servlet-name>LoginServlet</servlet-name> + <url-pattern>/loginAction/*</url-pattern> + </servlet-mapping> + +</web-app> diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/login.html b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/login.html new file mode 100644 index 0000000000..72b180a29c --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/login.html @@ -0,0 +1,24 @@ +<html> +<title>Welcome to Big Bank</title> + +<body> +<form action="loginAction" method="post"> + <table> + <tr> + <td colspan="2">Please login in to access your account</td> + </tr> + </table> + <table> + <tr> + <td>Login</td> + <td><input type="text" name="login"/></td> + </tr> + <tr> + <td>Password</td> + <td><input type="password" name="password"/></td> + </tr> + <tr><td></td><td align="right"><input type="submit"/></td></tr> + </table> +</form> +</body> +</html> diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/summary.jsp b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/summary.jsp new file mode 100644 index 0000000000..be56e2547c --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/main/webapp/summary.jsp @@ -0,0 +1,48 @@ +<%--
+ Copyright (c) 2005 The Apache Software Foundation or its licensors, as applicable.
+
+ Licensed 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.
+ --%>
+<%@ taglib uri="/WEB-INF/bigbank-tags.tld" prefix="sca" %>
+<sca:login profile="ProfileServiceComponent" url="login.html">
+ <sca:service id="profile" name="ProfileServiceComponent"/>
+
+ <html>
+ <title>BigBank Account Summary</title>
+
+ <body>
+
+ Account Information for
+ <jsp:getProperty name='profile' property='firstName'/>
+ <jsp:getProperty name='profile' property='lastName'/>
+ <br>
+
+ <table>
+ <sca:accountStatus accountService="AccountServiceComponent" profileService="ProfileServiceComponent" id="account">
+ <tr>
+ <td><strong>Account</strong></td>
+ <td><strong>Balance</strong></td>
+ </tr>
+ <tr>
+ <td>
+ <jsp:getProperty name="account" property="accountNumber"/>
+ </td>
+ <td>
+ <jsp:getProperty name="account" property="balance"/>
+ </td>
+ </tr>
+ </sca:accountStatus>
+ <table>
+ </body>
+ </html>
+</sca:login>
diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/test/java/org/apache/tuscany/samples/bigbank/webclient/client/TestAccountService.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/test/java/org/apache/tuscany/samples/bigbank/webclient/client/TestAccountService.java new file mode 100644 index 0000000000..de18ee0db2 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/test/java/org/apache/tuscany/samples/bigbank/webclient/client/TestAccountService.java @@ -0,0 +1,51 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.webclient.client; + +import java.util.List; + +import org.apache.tuscany.core.client.TuscanyRuntime; +import org.apache.tuscany.samples.bigbank.account.AccountReport; +import org.apache.tuscany.samples.bigbank.account.services.account.AccountService; +import org.osoa.sca.CurrentModuleContext; +import org.osoa.sca.ModuleContext; +import org.osoa.sca.SCA; + + +public class TestAccountService extends SCA { + + public void start() { + } + + public void stop() { + } + + public static void main(String[] args) throws Exception { + TuscanyRuntime tuscany = new TuscanyRuntime("bigbank.webclient.testclient", null); + tuscany.start(); + ModuleContext moduleContext = CurrentModuleContext.getContext(); + + AccountService accountService = (AccountService) moduleContext.locateService("AccountServiceComponent"); + + AccountReport report = accountService.getAccountReport("12345"); + List summaries = report.getAccountSummaries(); + + System.out.println("retrieved " + summaries.size() + " summaries"); + + tuscany.stop(); + } +} diff --git a/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/test/java/org/apache/tuscany/samples/bigbank/webclient/client/TestLoginService.java b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/test/java/org/apache/tuscany/samples/bigbank/webclient/client/TestLoginService.java new file mode 100644 index 0000000000..ac16890127 --- /dev/null +++ b/sca-java-1.x/tags/java-stable-20060304/samples/bigbank/webclient/src/test/java/org/apache/tuscany/samples/bigbank/webclient/client/TestLoginService.java @@ -0,0 +1,49 @@ +/** + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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 org.apache.tuscany.samples.bigbank.webclient.client; + +import org.osoa.sca.CurrentModuleContext; +import org.osoa.sca.ModuleContext; +import org.osoa.sca.SCA; + +import org.apache.tuscany.core.client.TuscanyRuntime; +import org.apache.tuscany.samples.bigbank.webclient.services.profile.LoginService; + + +public class TestLoginService extends SCA { + + public void start() { + } + + public void stop() { + } + + public static void main(String[] args) throws Exception { + + + TuscanyRuntime tuscany = new TuscanyRuntime("bigbank.webclient.testclient", null); + tuscany.start(); + ModuleContext moduleContext = CurrentModuleContext.getContext(); + LoginService loginService = (LoginService) + moduleContext.locateService("LoginServiceComponent"); + + if (loginService.login("test", "password") == LoginService.SUCCESS) + System.out.println("Success"); + else + System.out.println("Failure"); + } +} |