From 396008440c7bcdb1cbb7a3c5d6270814dfb0e341 Mon Sep 17 00:00:00 2001 From: antelder Date: Tue, 30 Nov 2010 19:00:47 +0000 Subject: delete the beta2 branch as i'd not seen raymonds mail when i made it and we might as well wait till he's got his changes in before creating the beta2 branch git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1040700 13f79535-47bb-0310-9956-ffa450edef68 --- sca-java-2.x/branches/2.0-Beta2/samples/README | 154 - .../logging-scribe/helloworld-scribe/README | 51 - .../logging-scribe/helloworld-scribe/pom.xml | 96 - .../com/facebook/fb303/FacebookService.java | 6823 -------------------- .../generated/com/facebook/fb303/fb_status.java | 68 - .../java/generated/scribe/thrift/LogEntry.java | 411 -- .../java/generated/scribe/thrift/ResultCode.java | 61 - .../main/java/generated/scribe/thrift/scribe.java | 772 --- .../src/main/java/sample/HelloWorld.java | 28 - .../src/main/java/sample/HelloWorldImpl.java | 33 - .../src/main/java/sample/Logger.java | 28 - .../src/main/java/sample/ScribeLoggerImpl.java | 76 - .../main/resources/META-INF/sca-contribution.xml | 23 - .../src/main/resources/fb303.thrift | 112 - .../src/main/resources/scribe.composite | 36 - .../src/main/resources/scribe.thrift | 38 - .../src/test/java/sample/LoggingTest.java | 39 - .../samples/applications/logging-scribe/pom.xml | 43 - .../2.0-Beta2/samples/applications/pom.xml | 46 - .../samples/applications/store-webapp/README | 28 - .../samples/applications/store-webapp/pom.xml | 120 - .../store-webapp/src/main/java/services/Cart.java | 28 - .../src/main/java/services/Catalog.java | 27 - .../src/main/java/services/CurrencyConverter.java | 29 - .../main/java/services/CurrencyConverterImpl.java | 38 - .../src/main/java/services/FruitsCatalogImpl.java | 52 - .../store-webapp/src/main/java/services/Item.java | 51 - .../src/main/java/services/ShoppingCartImpl.java | 112 - .../store-webapp/src/main/java/services/Total.java | 29 - .../src/main/resources/store.composite | 55 - .../src/main/webapp/META-INF/sca-contribution.xml | 23 - .../src/main/webapp/WEB-INF/geronimo-web.xml | 50 - .../store-webapp/src/main/webapp/WEB-INF/web.xml | 36 - .../store-webapp/src/main/webapp/store.html | 163 - .../samples/applications/store-webapp/store.png | Bin 15670 -> 0 bytes .../samples/applications/store-webapp/store.svg | 304 - .../2.0-Beta2/samples/applications/store/README | 28 - .../2.0-Beta2/samples/applications/store/build.xml | 82 - .../2.0-Beta2/samples/applications/store/pom.xml | 112 - .../store/src/main/java/launch/Launch.java | 39 - .../store/src/main/java/services/Cart.java | 28 - .../store/src/main/java/services/Catalog.java | 27 - .../src/main/java/services/CurrencyConverter.java | 29 - .../main/java/services/CurrencyConverterImpl.java | 38 - .../src/main/java/services/FruitsCatalogImpl.java | 52 - .../store/src/main/java/services/Item.java | 54 - .../src/main/java/services/ShoppingCartImpl.java | 112 - .../store/src/main/java/services/Total.java | 29 - .../store/src/main/resources/store.composite | 58 - .../store/src/main/resources/uiservices/store.html | 162 - .../store/src/test/java/client/Shopper.java | 29 - .../store/src/test/java/client/ShopperImpl.java | 64 - .../store/src/test/java/store/StoreTestCase.java | 117 - .../src/test/resources/store-client.composite | 38 - .../2.0-Beta2/samples/applications/store/store.png | Bin 15670 -> 0 bytes .../2.0-Beta2/samples/applications/store/store.svg | 304 - .../binding-sample/META-INF/MANIFEST.MF | 17 - .../extending-tuscany/binding-sample/README | 8 - .../extending-tuscany/binding-sample/pom.xml | 92 - .../main/java/sample/binding/SampleBinding.java | 49 - .../java/sample/binding/SampleBindingFactory.java | 32 - .../runtime/SampleBindingProviderFactory.java | 47 - .../runtime/SampleReferenceBindingProvider.java | 55 - .../binding/runtime/SampleReferenceInvoker.java | 53 - .../runtime/SampleServiceBindingProvider.java | 57 - .../binding/runtime/SampleServiceInvoker.java | 40 - .../java/sample/binding/runtime/SampleStash.java | 44 - ...ca.contribution.processor.StAXArtifactProcessor | 20 - ...any.sca.contribution.processor.ValidationSchema | 19 - ...che.tuscany.sca.provider.BindingProviderFactory | 20 - .../services/sample.binding.SampleBindingFactory | 20 - .../src/main/resources/binding-sample.xsd | 37 - .../src/test/java/helloworld/HelloWorldClient.java | 33 - .../src/test/java/helloworld/HelloWorldImpl.java | 28 - .../test/java/helloworld/HelloWorldService.java | 28 - .../src/test/java/test/SampleBindingTestCase.java | 52 - .../src/test/resources/helloworld.composite | 39 - .../extending-tuscany/implementation-sample/README | 8 - .../implementation-sample/pom.xml | 63 - .../src/main/java/sample/api/Java.java | 34 - .../src/main/java/sample/api/WSDL.java | 34 - .../src/main/java/sample/api/WSDLReference.java | 28 - .../src/main/java/sample/impl/EmbedUtil.java | 311 - .../src/main/java/sample/impl/ImplUtil.java | 148 - .../java/sample/impl/SampleImplementation.java | 41 - .../sample/impl/SampleImplementationProcessor.java | 174 - .../main/java/sample/impl/SampleJavaInvoker.java | 52 - .../src/main/java/sample/impl/SampleProvider.java | 91 - .../java/sample/impl/SampleProviderFactory.java | 48 - .../main/java/sample/impl/SampleWSDLInvoker.java | 56 - .../src/main/java/sample/impl/SampleWSDLProxy.java | 57 - ...ca.contribution.processor.StAXArtifactProcessor | 20 - ...any.sca.contribution.processor.ValidationSchema | 18 - ...cany.sca.provider.ImplementationProviderFactory | 20 - .../src/main/resources/sample/impl/sample.xsd | 38 - .../src/test/java/sample/Client.java | 35 - .../src/test/java/sample/ClientTest.java | 65 - .../src/test/java/sample/Hello.java | 33 - .../src/test/java/sample/JelloTest.java | 40 - .../src/test/java/sample/Upper.java | 33 - .../src/test/java/sample/UpperTest.java | 37 - .../src/test/java/sample/WelloTest.java | 59 - .../src/test/java/sample/Xutil.java | 225 - .../src/test/java/sample/impl/EmbedTestCase.java | 151 - .../test/java/sample/impl/ReadWriteTestCase.java | 84 - .../src/test/java/sample/impl/RunTestCase.java | 75 - .../src/test/java/sample/impl/RunWSTestCase.java | 120 - .../src/test/java/sample/impl/TestUtil.java | 31 - .../src/test/resources/Hello.wsdl | 62 - .../src/test/resources/Upper.wsdl | 62 - .../src/test/resources/test.composite | 60 - .../2.0-Beta2/samples/extending-tuscany/pom.xml | 46 - .../samples/getting-started/callback-api/pom.xml | 51 - .../src/main/java/sample/CallBack.java | 33 - .../callback-api/src/main/java/sample/Client.java | 28 - .../src/main/java/sample/ClientImpl.java | 108 - .../src/main/java/sample/Launcher.java | 60 - .../callback-api/src/main/java/sample/Service.java | 36 - .../src/main/java/sample/ServiceImpl.java | 96 - .../src/main/resources/CallBackApi.composite | 33 - .../main/resources/META-INF/sca-contribution.xml | 23 - .../samples/getting-started/files/helloworld.cmds | 19 - .../samples/getting-started/files/helloworld.xml | 27 - .../getting-started/files/new-sca-contribution.xml | 27 - .../samples/getting-started/files/scdl-include.xml | 28 - .../samples/getting-started/files/wsClient.html | 143 - .../getting-started/helloworld-contribution/README | 7 - .../helloworld-contribution/pom.xml | 57 - .../src/main/java/sample/Helloworld.java | 28 - .../src/main/java/sample/HelloworldImpl.java | 37 - .../main/resources/META-INF/sca-contribution.xml | 26 - .../src/main/resources/helloworld.composite | 29 - .../src/main/resources/helloworldws.composite | 32 - .../src/test/java/sample/HelloworldTestCase.java | 48 - .../getting-started/helloworld-webapp/README | 7 - .../getting-started/helloworld-webapp/pom.xml | 118 - .../src/main/webapp/WEB-INF/web.xml | 49 - .../helloworld-webapp/src/main/webapp/hello.html | 32 - .../src/test/java/itest/Helloworld.java | 27 - .../test/java/itest/HelloworldTestCaseFIXME.java | 44 - .../src/test/resources/test-web.xml | 30 - .../2.0-Beta2/samples/getting-started/pom.xml | 48 - .../samples/getting-started/sca-scopes/pom.xml | 51 - .../sca-scopes/src/main/java/sample/Client.java | 25 - .../src/main/java/sample/ClientImpl.java | 54 - .../src/main/java/sample/CompositeService.java | 27 - .../src/main/java/sample/CompositeServiceImpl.java | 38 - .../sca-scopes/src/main/java/sample/Launcher.java | 56 - .../src/main/java/sample/StatelessService.java | 28 - .../src/main/java/sample/StatelessServiceImpl.java | 37 - .../sca-scopes/src/main/resources/scopes.composite | 38 - .../scdl-include-contribution/README | 7 - .../scdl-include-contribution/pom.xml | 76 - .../main/resources/META-INF/sca-contribution.xml | 26 - .../src/main/resources/scdl-include.composite | 30 - .../async/calculator-contribution/README | 7 - .../async/calculator-contribution/build.xml | 57 - .../async/calculator-contribution/pom.xml | 57 - .../java/calculator/CalculateReferenceAsync.java | 57 - .../java/calculator/CalculatorAsyncHandler.java | 36 - .../src/main/java/calculator/CalculatorClient.java | 52 - .../calculator/CalculatorPrintAsyncHandler.java | 36 - .../java/calculator/CalculatorServiceAsync.java | 36 - .../calculator/CalculatorServiceAsyncImpl.java | 44 - .../calculator/CalculatorServiceProxyImpl.java | 132 - .../java/calculator/CalculatorServiceSync.java | 31 - .../java/calculator/CalculatorServiceSyncImpl.java | 38 - .../src/main/resources/Calculator.composite | 43 - .../src/main/resources/CalculatorClient.composite | 30 - .../main/resources/META-INF/sca-contribution.xml | 24 - .../2.0-Beta2/samples/learning-more/async/pom.xml | 43 - .../samples/learning-more/binding-comet/pom.xml | 43 - .../binding-comet/weather-webapp/deploy.sh | 20 - .../binding-comet/weather-webapp/pom.xml | 55 - .../apache/tuscany/sca/sample/comet/Helper.java | 34 - .../tuscany/sca/sample/comet/HumidityService.java | 31 - .../sca/sample/comet/PrecipitationService.java | 31 - .../sca/sample/comet/PrecipitationServiceImpl.java | 39 - .../comet/TemperatureHumidityServiceImpl.java | 48 - .../sca/sample/comet/TemperatureService.java | 34 - .../tuscany/sca/sample/comet/model/Location.java | 43 - .../tuscany/sca/sample/comet/model/Response.java | 45 - .../src/main/webapp/META-INF/MANIFEST.MF | 2 - .../src/main/webapp/WEB-INF/appengine-web.xml | 24 - .../src/main/webapp/WEB-INF/web.composite | 45 - .../weather-webapp/src/main/webapp/WEB-INF/web.xml | 34 - .../weather-webapp/src/main/webapp/index.html | 157 - .../binding-jms/helloworld-webapp/README | 131 - .../binding-jms/helloworld-webapp/pom.xml | 96 - .../src/main/java/sample/HelloWorldClient.java | 37 - .../src/main/java/sample/HelloWorldService.java | 29 - .../main/java/sample/HelloWorldServiceImpl.java | 31 - .../src/main/webapp/META-INF/context.xml | 34 - .../src/main/webapp/WEB-INF/jetty-env.xml | 48 - .../src/main/webapp/WEB-INF/web.composite | 44 - .../src/main/webapp/WEB-INF/web.xml | 66 - .../helloworld-webapp/src/main/webapp/hello.jsp | 41 - .../samples/learning-more/binding-jms/pom.xml | 43 - .../samples/learning-more/binding-jsonrpc/README | 1 - .../binding-jsonrpc/calculator-contribution/README | 8 - .../calculator-contribution/build.xml | 57 - .../calculator-contribution/pom.xml | 57 - .../src/main/java/calculator/AddBean.java | 88 - .../src/main/java/calculator/AddService.java | 32 - .../src/main/java/calculator/AddServiceImpl.java | 43 - .../src/main/java/calculator/CalculatorClient.java | 52 - .../main/java/calculator/CalculatorService.java | 37 - .../java/calculator/CalculatorServiceImpl.java | 86 - .../src/main/java/calculator/DivideService.java | 28 - .../main/java/calculator/DivideServiceImpl.java | 38 - .../src/main/java/calculator/MultiplyService.java | 28 - .../main/java/calculator/MultiplyServiceImpl.java | 38 - .../src/main/java/calculator/SubtractService.java | 28 - .../main/java/calculator/SubtractServiceImpl.java | 38 - .../src/main/resources/Calculator.composite | 53 - .../src/main/resources/CalculatorClient.composite | 30 - .../main/resources/META-INF/sca-contribution.xml | 24 - .../test/java/calculator/CalculatorTestCase.java | 50 - .../binding-jsonrpc/calculator-webapp/README | 8 - .../calculator-webapp/build-dojo.xml | 64 - .../binding-jsonrpc/calculator-webapp/pom.xml | 112 - .../src/main/java/calculator/AddBean.java | 90 - .../src/main/java/calculator/AddService.java | 32 - .../src/main/java/calculator/AddServiceImpl.java | 44 - .../main/java/calculator/CalculatorService.java | 37 - .../java/calculator/CalculatorServiceImpl.java | 86 - .../src/main/java/calculator/DivideService.java | 28 - .../main/java/calculator/DivideServiceImpl.java | 38 - .../src/main/java/calculator/MultiplyService.java | 28 - .../main/java/calculator/MultiplyServiceImpl.java | 38 - .../src/main/java/calculator/SubtractService.java | 28 - .../main/java/calculator/SubtractServiceImpl.java | 38 - .../src/main/webapp/WEB-INF/web.composite | 53 - .../src/main/webapp/WEB-INF/web.xml | 41 - .../src/main/webapp/calculate.html | 62 - .../test/java/calculator/CalculatorTestCase.java | 50 - .../samples/learning-more/binding-jsonrpc/pom.xml | 44 - .../samples/learning-more/binding-rmi/README | 1 - .../calculator-reference-contribution/README | 11 - .../calculator-reference-contribution/build.xml | 59 - .../calculator-reference-contribution/pom.xml | 74 - .../src/main/java/calculator/AddService.java | 28 - .../main/java/calculator/CalculatorService.java | 39 - .../java/calculator/CalculatorServiceImpl.java | 68 - .../src/main/java/calculator/DivideService.java | 28 - .../src/main/java/calculator/MultiplyService.java | 28 - .../src/main/java/calculator/SubtractService.java | 28 - .../resources/CalculatorRMIReference.composite | 42 - .../calculator/CalculatorRMIReferenceTestCase.java | 70 - .../java/calculator/CalculatorRMIServiceImpl.java | 52 - .../calculator-service-contribution/README | 28 - .../calculator-service-contribution/build.xml | 59 - .../calculator-service-contribution/pom.xml | 74 - .../src/main/java/calculator/AddService.java | 28 - .../src/main/java/calculator/AddServiceImpl.java | 30 - .../src/main/java/calculator/CalculatorClient.java | 40 - .../main/java/calculator/CalculatorService.java | 36 - .../java/calculator/CalculatorServiceImpl.java | 68 - .../src/main/java/calculator/DivideService.java | 28 - .../main/java/calculator/DivideServiceImpl.java | 30 - .../src/main/java/calculator/MultiplyService.java | 28 - .../main/java/calculator/MultiplyServiceImpl.java | 30 - .../src/main/java/calculator/SubtractService.java | 28 - .../main/java/calculator/SubtractServiceImpl.java | 30 - .../main/resources/CalculatorRMIServer.composite | 53 - .../main/resources/META-INF/sca-contribution.xml | 23 - .../calculator/CalculatorRMIServerTestCase.java | 63 - .../samples/learning-more/binding-rmi/pom.xml | 44 - .../samples/learning-more/binding-sca/README | 1 - .../binding-sca/calculator-contribution/README | 8 - .../binding-sca/calculator-contribution/build.xml | 57 - .../binding-sca/calculator-contribution/pom.xml | 57 - .../src/main/java/calculator/AddService.java | 28 - .../src/main/java/calculator/AddServiceImpl.java | 38 - .../src/main/java/calculator/CalculatorClient.java | 52 - .../main/java/calculator/CalculatorService.java | 37 - .../java/calculator/CalculatorServiceImpl.java | 72 - .../src/main/java/calculator/DivideService.java | 28 - .../main/java/calculator/DivideServiceImpl.java | 38 - .../src/main/java/calculator/MultiplyService.java | 28 - .../main/java/calculator/MultiplyServiceImpl.java | 38 - .../src/main/java/calculator/SubtractService.java | 28 - .../main/java/calculator/SubtractServiceImpl.java | 38 - .../src/main/resources/Calculator.composite | 49 - .../src/main/resources/CalculatorClient.composite | 30 - .../main/resources/META-INF/sca-contribution.xml | 24 - .../test/java/calculator/CalculatorTestCase.java | 50 - .../samples/learning-more/binding-sca/pom.xml | 43 - .../samples/learning-more/binding-ws/README | 1 - .../binding-ws/calculator-contribution/README | 9 - .../binding-ws/calculator-contribution/build.xml | 55 - .../calculator-contribution/calculator.odg | Bin 12477 -> 0 bytes .../calculator-contribution/calculator.png | Bin 41196 -> 0 bytes .../binding-ws/calculator-contribution/pom.xml | 53 - .../src/main/java/calculator/AddService.java | 31 - .../src/main/java/calculator/AddServiceImpl.java | 35 - .../main/java/calculator/CalculatorService.java | 35 - .../java/calculator/CalculatorServiceImpl.java | 70 - .../src/main/java/calculator/DivideService.java | 28 - .../main/java/calculator/DivideServiceImpl.java | 35 - .../src/main/java/calculator/MultiplyService.java | 28 - .../main/java/calculator/MultiplyServiceImpl.java | 35 - .../src/main/java/calculator/SubtractService.java | 28 - .../main/java/calculator/SubtractServiceImpl.java | 35 - .../src/main/resources/Calculator.composite | 54 - .../main/resources/META-INF/sca-contribution.xml | 23 - .../test/java/calculator/CalculatorTestCase.java | 50 - .../helloworld-ws-sdo-contribution/README | 214 - .../helloworld-ws-sdo-contribution/build.xml | 101 - .../helloworld-ws-sdo.png | Bin 7549 -> 0 bytes .../maven-eclipse.xml | 8 - .../helloworld-ws-sdo-contribution/pom.xml | 180 - .../src/main/java/helloworld/HelloWorldClient.java | 51 - .../src/main/java/helloworld/HelloWorldImpl.java | 33 - .../src/main/java/helloworld/HelloWorldServer.java | 51 - .../main/java/helloworld/HelloWorldService.java | 34 - .../helloworld/HelloWorldServiceComponent.java | 42 - .../main/java/services/bcircle/BioTestCase.java | 59 - .../java/services/bcircle/BiochemicalCircle.java | 29 - .../services/bcircle/BiochemicalCircleImpl.java | 40 - .../main/resources/META-INF/sca-contribution.xml | 28 - .../src/main/resources/helloworldws.composite | 31 - .../main/resources/helloworldwsclient.composite | 34 - .../src/main/resources/logging.properties | 30 - .../resources/clinicalLaboratory.composite | 34 - .../src/main/resources/test.xsd | 35 - .../src/main/resources/wsdl/helloworld.wsdl | 88 - .../java/helloworld/HelloWorldClientTestCase.java | 85 - .../test/java/helloworld/HelloWorldTestServer.java | 67 - .../src/test/java/helloworld/TestCaseRunner.java | 329 - .../binding-ws/holder-ws-service/pom.xml | 124 - .../org/example/orderservice/ObjectFactory.java | 74 - .../main/java/org/example/orderservice/Order.java | 147 - .../org/example/orderservice/OrderService.java | 55 - .../org/example/orderservice/OrderServiceImpl.java | 65 - .../example/orderservice/OrderServiceServer.java | 112 - .../example/orderservice/OrderService_Service.java | 84 - .../java/org/example/orderservice/ReviewOrder.java | 82 - .../example/orderservice/ReviewOrderResponse.java | 82 - .../main/java/org/example/orderservice/Status.java | 75 - .../org/example/orderservice/package-info.java | 21 - .../src/main/resources/orderws.composite | 33 - .../src/main/resources/wsdl/orderservice.wsdl | 89 - .../example/orderservice/OrderServiceTestCase.java | 116 - .../samples/learning-more/binding-ws/pom.xml | 44 - .../dosgi-dynamic-calculator-operations/LICENSE | 205 - .../META-INF/MANIFEST.MF | 23 - .../dosgi-dynamic-calculator-operations/NOTICE | 6 - .../OSGI-INF/add-component.xml | 25 - .../OSGI-INF/blueprint/operations-module.xml | 40 - .../OSGI-INF/divide-component.xml | 25 - .../OSGI-INF/multiply-component.xml | 25 - .../OSGI-INF/sca-config/operations-config.xml | 29 - .../OSGI-INF/subtract-component.xml | 25 - .../dosgi-dynamic-calculator-operations/README | 6 - .../dosgi-dynamic-calculator-operations/pom.xml | 148 - .../calculator/dosgi/operations/AddService.java | 31 - .../calculator/dosgi/operations/DivideService.java | 31 - .../dosgi/operations/MultiplyService.java | 31 - .../dosgi/operations/SubtractService.java | 31 - .../dosgi/operations/impl/AddServiceImpl.java | 37 - .../dosgi/operations/impl/DivideServiceImpl.java | 37 - .../dosgi/operations/impl/MultiplyServiceImpl.java | 37 - .../dosgi/operations/impl/OperationsActivator.java | 94 - .../dosgi/operations/impl/SubtractServiceImpl.java | 37 - .../dosgi/operations/test/OSGiTestUtils.java | 105 - .../dosgi/operations/test/OperationsNode.java | 43 - .../test/OperationsOSGiNodeTestCase.java | 104 - .../dosgi-dynamic-calculator/LICENSE | 205 - .../dosgi-dynamic-calculator/META-INF/MANIFEST.MF | 23 - .../dosgi-dynamic-calculator/NOTICE | 6 - .../OSGI-INF/blueprint/calculator-module.xml | 43 - .../OSGI-INF/calculator-component.xml | 36 - .../calculator-service-descriptions.xml | 73 - .../OSGI-INF/sca-config/calculator-config.xml | 32 - .../dosgi-dynamic-calculator/README | 6 - .../dosgi-dynamic-calculator/dosgi-calculator.png | Bin 85103 -> 0 bytes .../dosgi-dynamic-calculator/pom.xml | 153 - .../java/calculator/dosgi/CalculatorService.java | 36 - .../calculator/dosgi/impl/CalculatorActivator.java | 78 - .../dosgi/impl/CalculatorServiceDSImpl.java | 114 - .../dosgi/impl/CalculatorServiceImpl.java | 99 - .../calculator/dosgi/operations/AddService.java | 31 - .../calculator/dosgi/operations/DivideService.java | 31 - .../dosgi/operations/MultiplyService.java | 31 - .../dosgi/operations/SubtractService.java | 31 - .../java/calculator/rmi/OperationsRMIServer.java | 93 - .../calculator/rmi/OperationsRMIServer_Stub.java | 132 - .../main/java/calculator/rmi/OperationsRemote.java | 37 - .../java/calculator/dosgi/test/CalculatorNode.java | 43 - .../dosgi/test/CalculatorOSGiNodeTestCase.java | 144 - .../java/calculator/dosgi/test/OSGiTestUtils.java | 105 - .../samples/learning-more/distributed-osgi/pom.xml | 44 - .../helloworld-bpel-contribution/README | 31 - .../helloworld-bpel-contribution/build.xml | 95 - .../helloworld-bpel.png | Bin 8897 -> 0 bytes .../helloworld-bpel.svg | 179 - .../helloworld-bpel-contribution/pom.xml | 76 - .../src/main/java/helloworld/Hello.java | 29 - .../main/resources/META-INF/sca-contribution.xml | 23 - .../src/main/resources/helloworld.bpel | 80 - .../src/main/resources/helloworld.composite | 29 - .../src/main/resources/helloworld.wsdl | 94 - .../src/main/resources/log4j.properties | 35 - .../helloworld-bpel-webapp/README | 6 - .../helloworld-bpel-webapp/pom.xml | 160 - .../src/main/java/sample/HelloworldService.java | 28 - .../src/main/resources/helloworld.bpel | 66 - .../src/main/resources/helloworld.wsdl | 82 - .../src/main/webapp/WEB-INF/web.composite | 37 - .../src/main/webapp/WEB-INF/web.xml | 41 - .../src/main/webapp/hello.jsp | 36 - .../learning-more/implementation-bpel/pom.xml | 44 - .../helloworld-recursive-ws/README | 7 - .../helloworld-recursive-ws/pom.xml | 82 - .../main/resources/META-INF/sca-contribution.xml | 28 - .../src/main/resources/helloworld-ws.composite | 33 - .../helloworld-recursive/README | 6 - .../helloworld-recursive/pom.xml | 76 - .../main/resources/META-INF/sca-contribution.xml | 26 - .../main/resources/helloworld-recursive.composite | 30 - .../learning-more/implementation-composite/pom.xml | 44 - .../learning-more/implementation-java/README | 1 - .../calculator-contribution/README | 8 - .../calculator-contribution/build.xml | 56 - .../calculator-contribution/pom.xml | 57 - .../src/main/java/calculator/AddService.java | 28 - .../src/main/java/calculator/AddServiceImpl.java | 35 - .../src/main/java/calculator/CalculatorClient.java | 62 - .../main/java/calculator/CalculatorService.java | 37 - .../java/calculator/CalculatorServiceImpl.java | 70 - .../src/main/java/calculator/DivideService.java | 28 - .../main/java/calculator/DivideServiceImpl.java | 35 - .../src/main/java/calculator/MultiplyService.java | 28 - .../main/java/calculator/MultiplyServiceImpl.java | 35 - .../src/main/java/calculator/SubtractService.java | 28 - .../main/java/calculator/SubtractServiceImpl.java | 35 - .../src/main/resources/Calculator.composite | 49 - .../src/main/resources/CalculatorClient.composite | 30 - .../main/resources/META-INF/sca-contribution.xml | 24 - .../test/java/calculator/CalculatorTestCase.java | 49 - .../learning-more/implementation-java/pom.xml | 43 - .../dosgi-calculator-operations/LICENSE | 205 - .../META-INF/MANIFEST.MF | 22 - .../dosgi-calculator-operations/NOTICE | 6 - .../OSGI-INF/add-component.xml | 25 - .../OSGI-INF/blueprint/operations-module.xml | 40 - .../OSGI-INF/divide-component.xml | 25 - .../OSGI-INF/multiply-component.xml | 25 - .../OSGI-INF/sca/bundle.componentType | 54 - .../OSGI-INF/sca/bundle.composite | 43 - .../OSGI-INF/subtract-component.xml | 25 - .../dosgi-calculator-operations/README | 6 - .../dosgi-calculator-operations/pom.xml | 150 - .../calculator/dosgi/operations/AddService.java | 31 - .../calculator/dosgi/operations/DivideService.java | 31 - .../dosgi/operations/MultiplyService.java | 31 - .../dosgi/operations/SubtractService.java | 31 - .../dosgi/operations/impl/AddServiceImpl.java | 37 - .../dosgi/operations/impl/DivideServiceImpl.java | 37 - .../dosgi/operations/impl/MultiplyServiceImpl.java | 37 - .../dosgi/operations/impl/OperationsActivator.java | 88 - .../dosgi/operations/impl/SubtractServiceImpl.java | 37 - .../main/resources/META-INF/sca-contribution.xml | 23 - .../dosgi/operations/test/OSGiTestUtils.java | 105 - .../dosgi/operations/test/OperationsNode.java | 43 - .../test/OperationsOSGiNodeTestCase.java | 105 - .../implementation-osgi/dosgi-calculator/LICENSE | 205 - .../dosgi-calculator/META-INF/MANIFEST.MF | 20 - .../implementation-osgi/dosgi-calculator/NOTICE | 6 - .../OSGI-INF/blueprint/calculator-module.xml | 43 - .../OSGI-INF/calculator-component.xml | 36 - .../OSGI-INF/sca/bundle.componentType | 64 - .../dosgi-calculator/OSGI-INF/sca/bundle.composite | 45 - .../implementation-osgi/dosgi-calculator/README | 6 - .../dosgi-calculator/dosgi-calculator.png | Bin 85103 -> 0 bytes .../implementation-osgi/dosgi-calculator/pom.xml | 153 - .../java/calculator/dosgi/CalculatorService.java | 36 - .../calculator/dosgi/impl/CalculatorActivator.java | 76 - .../dosgi/impl/CalculatorServiceDSImpl.java | 114 - .../dosgi/impl/CalculatorServiceImpl.java | 105 - .../calculator/dosgi/operations/AddService.java | 31 - .../calculator/dosgi/operations/DivideService.java | 31 - .../dosgi/operations/MultiplyService.java | 31 - .../dosgi/operations/SubtractService.java | 31 - .../java/calculator/rmi/OperationsRMIServer.java | 93 - .../calculator/rmi/OperationsRMIServer_Stub.java | 132 - .../main/java/calculator/rmi/OperationsRemote.java | 37 - .../main/resources/META-INF/sca-contribution.xml | 24 - .../java/calculator/dosgi/test/CalculatorNode.java | 43 - .../dosgi/test/CalculatorOSGiNodeTestCase.java | 152 - .../java/calculator/dosgi/test/OSGiTestUtils.java | 105 - .../learning-more/implementation-osgi/pom.xml | 44 - .../learning-more/implementation-script/README | 1 - .../calculator-contribution/README | 8 - .../calculator-contribution/build.xml | 57 - .../calculator-contribution/pom.xml | 57 - .../src/main/java/calculator/AddService.java | 28 - .../src/main/java/calculator/CalculatorClient.java | 52 - .../main/java/calculator/CalculatorService.java | 37 - .../java/calculator/CalculatorServiceImpl.java | 72 - .../src/main/java/calculator/DivideService.java | 28 - .../src/main/java/calculator/MultiplyService.java | 28 - .../src/main/java/calculator/SubtractService.java | 28 - .../src/main/resources/Calculator.composite | 50 - .../src/main/resources/CalculatorClient.composite | 30 - .../main/resources/META-INF/sca-contribution.xml | 24 - .../calculator/AddServiceImpl.componentType | 30 - .../main/resources/calculator/AddServiceImpl.js | 22 - .../calculator/DivideServiceImpl.componentType | 30 - .../resources/calculator/DivideServiceImpl.groovy | 22 - .../calculator/MultiplyServiceImpl.componentType | 30 - .../resources/calculator/MultiplyServiceImpl.py | 20 - .../calculator/SubtractServiceImpl.componentType | 30 - .../resources/calculator/SubtractServiceImpl.rb | 21 - .../learning-more/implementation-script/pom.xml | 43 - .../helloworld-spring-contribution/README | 8 - .../helloworld-spring-contribution/pom.xml | 67 - .../src/main/java/sample/DateService.java | 29 - .../src/main/java/sample/DateServiceImpl.java | 37 - .../src/main/java/sample/Helloworld.java | 28 - .../src/main/java/sample/HelloworldClientImpl.java | 48 - .../src/main/java/sample/HelloworldImpl.java | 34 - .../main/resources/META-INF/sca-contribution.xml | 23 - .../main/resources/helloworld-client-context.xml | 37 - .../src/main/resources/helloworld-context.xml | 30 - .../src/main/resources/helloworld.composite | 36 - .../src/test/java/sample/HelloworldTestCase.java | 33 - .../helloworld-spring-webapp/README | 9 - .../helloworld-spring-webapp/pom.xml | 185 - .../src/main/webapp/WEB-INF/web.xml | 51 - .../test/java/sample/HelloworldClientTestCase.java | 58 - .../src/test/resources/test-web.xml | 25 - .../learning-more/implementation-spring/pom.xml | 44 - .../implementation-web/helloworld-jaxrs/README | 8 - .../implementation-web/helloworld-jaxrs/pom.xml | 131 - .../src/main/java/sample/HelloWorldResource.java | 68 - .../src/main/java/sample/HelloworldService.java | 25 - .../main/java/sample/HelloworldServiceImpl.java | 28 - .../src/main/webapp/WEB-INF/application | 14 - .../src/main/webapp/WEB-INF/web.composite | 34 - .../src/main/webapp/WEB-INF/web.xml | 49 - .../src/test/java/itest/HelloworldTestCase.java | 43 - .../implementation-web/helloworld-js-client/README | 8 - .../helloworld-js-client/pom.xml | 104 - .../src/main/java/sample/HelloworldService.java | 25 - .../main/java/sample/HelloworldServiceImpl.java | 28 - .../src/main/webapp/WEB-INF/web.composite | 36 - .../src/main/webapp/WEB-INF/web.xml | 41 - .../src/main/webapp/hello.html | 51 - .../src/test/java/itest/HelloworldTestCase.java | 77 - .../implementation-web/helloworld-jsf/README | 8 - .../implementation-web/helloworld-jsf/pom.xml | 99 - .../src/main/java/sample/HelloWorldController.java | 56 - .../src/main/java/sample/HelloworldService.java | 25 - .../main/java/sample/HelloworldServiceImpl.java | 27 - .../src/main/webapp/WEB-INF/faces-config.xml | 51 - .../src/main/webapp/WEB-INF/web.composite | 34 - .../helloworld-jsf/src/main/webapp/WEB-INF/web.xml | 191 - .../helloworld-jsf/src/main/webapp/helloWorld.jsp | 40 - .../helloworld-jsf/src/main/webapp/index.jsp | 23 - .../helloworld-jsf/src/main/webapp/page2.jsp | 38 - .../implementation-web/helloworld-jsp/README | 7 - .../implementation-web/helloworld-jsp/pom.xml | 98 - .../src/main/java/sample/HelloworldService.java | 25 - .../main/java/sample/HelloworldServiceImpl.java | 28 - .../src/main/webapp/WEB-INF/web.composite | 34 - .../helloworld-jsp/src/main/webapp/WEB-INF/web.xml | 41 - .../helloworld-jsp/src/main/webapp/hello.jsp | 37 - .../src/test/java/itest/HelloworldTestCase.java | 53 - .../implementation-web/helloworld-servlet/README | 8 - .../implementation-web/helloworld-servlet/pom.xml | 105 - .../src/main/java/sample/HelloworldService.java | 25 - .../main/java/sample/HelloworldServiceImpl.java | 27 - .../src/main/java/sample/HelloworldServlet.java | 64 - .../src/main/webapp/WEB-INF/web.composite | 34 - .../src/main/webapp/WEB-INF/web.xml | 44 - .../helloworld-servlet/src/main/webapp/hello.html | 46 - .../src/test/java/itest/HelloworldTestCase.java | 55 - .../implementation-web/helloworld-stripes/README | 8 - .../implementation-web/helloworld-stripes/pom.xml | 118 - .../main/java/mystripes/action/BaseActionBean.java | 33 - .../main/java/mystripes/action/HomeActionBean.java | 45 - .../src/main/java/sample/HelloworldService.java | 25 - .../main/java/sample/HelloworldServiceImpl.java | 28 - .../src/main/resources/StripesResources.properties | 73 - .../src/main/resources/log4j.properties | 48 - .../src/main/webapp/WEB-INF/jsp/home.jsp | 26 - .../src/main/webapp/WEB-INF/jsp/layout.jsp | 39 - .../src/main/webapp/WEB-INF/jsp/taglibs.jsp | 29 - .../src/main/webapp/WEB-INF/web.composite | 34 - .../src/main/webapp/WEB-INF/web.xml | 61 - .../helloworld-stripes/src/main/webapp/index.html | 24 - .../helloworld-stripes/src/test/java/README | 7 - .../src/test/java/itest/HelloworldTestCase.java | 53 - .../learning-more/implementation-web/pom.xml | 50 - .../2.0-Beta2/samples/learning-more/pom.xml | 60 - .../sca-client/calculator-scaclient/README | 19 - .../sca-client/calculator-scaclient/pom.xml | 69 - .../main/java/calculator/CalculatorService.java | 38 - .../src/main/java/sample/CalculatorSCAClient.java | 53 - .../sca-client/helloworld-scaclient/README | 19 - .../sca-client/helloworld-scaclient/pom.xml | 69 - .../src/main/java/sample/Helloworld.java | 28 - .../src/main/java/sample/HelloworldSCAClient.java | 51 - .../src/test/java/sample/HelloworldTestCase.java | 33 - .../samples/learning-more/sca-client/pom.xml | 46 - sca-java-2.x/branches/2.0-Beta2/samples/pom.xml | 64 - .../samples/running-tuscany/command-line/README | 13 - .../samples/running-tuscany/eclipse/README | 15 - .../samples/running-tuscany/embedded-jse/README | 10 - .../samples/running-tuscany/embedded-jse/build.xml | 141 - .../samples/running-tuscany/embedded-jse/pom.xml | 84 - .../main/java/calculator/CalculatorService.java | 38 - .../JSELauncherBindingJSONRPCCalculator.java | 59 - .../launcher/JSELauncherBindingRMICalculator.java | 60 - .../launcher/JSELauncherBindingSCACalculator.java | 59 - .../launcher/JSELauncherBindingWSCalculator.java | 59 - .../JSELauncherImplementationJavaCalculator.java | 46 - ...ELauncherImplementationJavaCalculatorAsync.java | 44 - .../JSELauncherImplementationScriptCalculator.java | 59 - .../java/launcher/SampleLauncherException.java | 42 - .../src/test/java/launcher/LauncherTestCase.java | 62 - .../running-tuscany/embedded-osgi-base/README | 24 - .../running-tuscany/embedded-osgi-base/build.xml | 97 - .../running-tuscany/embedded-osgi-base/pom.xml | 71 - .../main/java/calculator/CalculatorService.java | 38 - .../src/main/java/launcher/RuntimeIntegration.java | 61 - .../src/main/java/launcher/SampleJSELauncher.java | 89 - .../java/launcher/SampleLauncherException.java | 42 - .../src/test/java/launcher/LauncherTestCase.java | 39 - .../samples/running-tuscany/embedded-osgi/README | 8 - .../running-tuscany/embedded-osgi/build.xml | 98 - .../samples/running-tuscany/embedded-osgi/pom.xml | 75 - .../main/java/calculator/CalculatorService.java | 38 - .../src/main/java/launcher/RuntimeIntegration.java | 61 - .../java/launcher/SampleLauncherException.java | 42 - .../launcher/SampleOSGILauncherBindingSCA.java | 47 - .../java/launcher/SampleOSGILauncherBindingWS.java | 84 - .../src/test/java/launcher/LauncherTestCase.java | 41 - .../maven-junit/calculator-contribution/README | 9 - .../maven-junit/calculator-contribution/build.xml | 57 - .../maven-junit/calculator-contribution/pom.xml | 57 - .../src/main/java/calculator/AddService.java | 28 - .../src/main/java/calculator/AddServiceImpl.java | 38 - .../src/main/java/calculator/CalculatorClient.java | 52 - .../main/java/calculator/CalculatorService.java | 37 - .../java/calculator/CalculatorServiceImpl.java | 72 - .../src/main/java/calculator/DivideService.java | 28 - .../main/java/calculator/DivideServiceImpl.java | 38 - .../src/main/java/calculator/MultiplyService.java | 28 - .../main/java/calculator/MultiplyServiceImpl.java | 38 - .../src/main/java/calculator/SubtractService.java | 28 - .../main/java/calculator/SubtractServiceImpl.java | 38 - .../src/main/resources/Calculator.composite | 49 - .../src/main/resources/CalculatorClient.composite | 30 - .../main/resources/META-INF/sca-contribution.xml | 24 - .../test/java/calculator/CalculatorTestCase.java | 49 - .../samples/running-tuscany/maven-junit/pom.xml | 43 - .../calculator-osgi/META-INF/MANIFEST.MF | 19 - .../maven-osgi-junit/calculator-osgi/README | 8 - .../maven-osgi-junit/calculator-osgi/build.xml | 78 - .../calculator-osgi/logging.properties | 25 - .../maven-osgi-junit/calculator-osgi/pom.xml | 116 - .../src/main/java/calculator/AddService.java | 28 - .../src/main/java/calculator/AddServiceImpl.java | 35 - .../main/java/calculator/CalculatorActivator.java | 54 - .../src/main/java/calculator/CalculatorClient.java | 52 - .../main/java/calculator/CalculatorService.java | 34 - .../java/calculator/CalculatorServiceImpl.java | 69 - .../src/main/java/calculator/DivideService.java | 28 - .../main/java/calculator/DivideServiceImpl.java | 35 - .../src/main/java/calculator/MultiplyService.java | 28 - .../main/java/calculator/MultiplyServiceImpl.java | 35 - .../src/main/java/calculator/SubtractService.java | 28 - .../main/java/calculator/SubtractServiceImpl.java | 35 - .../src/main/resources/Calculator.composite | 54 - .../test/java/calculator/CalculatorTestCase.java | 54 - .../calculator-rest-osgi/META-INF/MANIFEST.MF | 19 - .../maven-osgi-junit/calculator-rest-osgi/README | 9 - .../maven-osgi-junit/calculator-rest-osgi/pom.xml | 171 - .../src/main/java/calculator/AddService.java | 28 - .../src/main/java/calculator/AddServiceImpl.java | 36 - .../main/java/calculator/CalculatorActivator.java | 54 - .../main/java/calculator/CalculatorService.java | 66 - .../java/calculator/CalculatorServiceImpl.java | 88 - .../src/main/java/calculator/DivideService.java | 28 - .../main/java/calculator/DivideServiceImpl.java | 35 - .../src/main/java/calculator/MultiplyService.java | 28 - .../main/java/calculator/MultiplyServiceImpl.java | 35 - .../src/main/java/calculator/SubtractService.java | 28 - .../main/java/calculator/SubtractServiceImpl.java | 35 - .../src/main/resources/Calculator.composite | 55 - .../test/java/calculator/CalculatorTestCase.java | 125 - .../running-tuscany/maven-osgi-junit/pom.xml | 46 - .../2.0-Beta2/samples/running-tuscany/maven/README | 18 - .../2.0-Beta2/samples/running-tuscany/osgi/README | 33 - .../2.0-Beta2/samples/running-tuscany/pom.xml | 57 - .../2.0-Beta2/samples/running-tuscany/shell/README | 37 - .../samples/running-tuscany/shell/pom.xml | 92 - .../2.0-Beta2/samples/running-tuscany/shell/sca | 19 - .../samples/running-tuscany/shell/sca.bat | 30 - .../running-tuscany/shell/scripts/test-remote.txt | 36 - .../running-tuscany/shell/scripts/test-start.txt | 18 - .../running-tuscany/shell/scripts/test-status.txt | 17 - .../running-tuscany/shell/scripts/test-stop.txt | 17 - .../samples/running-tuscany/shell/scripts/test.txt | 36 - .../shell/src/main/java/sample/Shell.java | 203 - .../shell/src/main/java/sample/ShellServlet.java | 48 - .../shell/src/main/webapp/WEB-INF/web.xml | 48 - .../shell/src/main/webapp/index.html | 42 - .../samples/running-tuscany/webapp/README | 59 - 712 files changed, 43546 deletions(-) delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/com/facebook/fb303/FacebookService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/com/facebook/fb303/fb_status.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/scribe/thrift/LogEntry.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/scribe/thrift/ResultCode.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/scribe/thrift/scribe.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/HelloWorld.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/HelloWorldImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/Logger.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/ScribeLoggerImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/fb303.thrift delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/scribe.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/scribe.thrift delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/test/java/sample/LoggingTest.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/Cart.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/Catalog.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/CurrencyConverter.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/CurrencyConverterImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/FruitsCatalogImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/Item.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/ShoppingCartImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/Total.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/resources/store.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/webapp/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/webapp/WEB-INF/geronimo-web.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/webapp/WEB-INF/web.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/webapp/store.html delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/store.png delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/store.svg delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/build.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/launch/Launch.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/Cart.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/Catalog.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/CurrencyConverter.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/CurrencyConverterImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/FruitsCatalogImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/Item.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/ShoppingCartImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/Total.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/resources/store.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/resources/uiservices/store.html delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/test/java/client/Shopper.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/test/java/client/ShopperImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/test/java/store/StoreTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/test/resources/store-client.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/store.png delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/applications/store/store.svg delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/META-INF/MANIFEST.MF delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/SampleBinding.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/SampleBindingFactory.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleBindingProviderFactory.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleReferenceBindingProvider.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleReferenceInvoker.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleServiceBindingProvider.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleServiceInvoker.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleStash.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/sample.binding.SampleBindingFactory delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/binding-sample.xsd delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldClient.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/java/test/SampleBindingTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/resources/helloworld.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/Java.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/WSDL.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/WSDLReference.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/EmbedUtil.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/ImplUtil.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleImplementation.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleImplementationProcessor.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleJavaInvoker.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleProvider.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleProviderFactory.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLInvoker.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/resources/sample/impl/sample.xsd delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/Client.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/ClientTest.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/Hello.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/JelloTest.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/Upper.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/UpperTest.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/WelloTest.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/Xutil.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/EmbedTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/ReadWriteTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/RunTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/RunWSTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/TestUtil.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/resources/Hello.wsdl delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/resources/Upper.wsdl delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/resources/test.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/CallBack.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/Client.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/ClientImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/Launcher.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/Service.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/ServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/resources/CallBackApi.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/helloworld.cmds delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/helloworld.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/new-sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/scdl-include.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/wsClient.html delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/java/sample/Helloworld.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/java/sample/HelloworldImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/resources/helloworld.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/resources/helloworldws.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/test/java/sample/HelloworldTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/main/webapp/WEB-INF/web.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/main/webapp/hello.html delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/test/java/itest/Helloworld.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/test/java/itest/HelloworldTestCaseFIXME.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/test/resources/test-web.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/Client.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/ClientImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/CompositeService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/CompositeServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/Launcher.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/StatelessService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/StatelessServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/resources/scopes.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/scdl-include-contribution/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/scdl-include-contribution/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/scdl-include-contribution/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/getting-started/scdl-include-contribution/src/main/resources/scdl-include.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/build.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculateReferenceAsync.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorAsyncHandler.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorClient.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorPrintAsyncHandler.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceAsync.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceAsyncImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceProxyImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceSync.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceSyncImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/resources/Calculator.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/resources/CalculatorClient.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/pom.xml delete mode 100755 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/deploy.sh delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/Helper.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/HumidityService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/TemperatureHumidityServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/TemperatureService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Location.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Response.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/META-INF/MANIFEST.MF delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/appengine-web.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/web.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/web.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/index.html delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/java/sample/HelloWorldClient.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/java/sample/HelloWorldService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/java/sample/HelloWorldServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/META-INF/context.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/WEB-INF/jetty-env.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/WEB-INF/web.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/WEB-INF/web.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/hello.jsp delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/build.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddBean.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorClient.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/DivideService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/MultiplyService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/SubtractService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/resources/Calculator.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/resources/CalculatorClient.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/build-dojo.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddBean.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/CalculatorService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/CalculatorServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/DivideService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/DivideServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/MultiplyService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/MultiplyServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/SubtractService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/SubtractServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/WEB-INF/web.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/WEB-INF/web.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/calculate.html delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/test/java/calculator/CalculatorTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/build.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/AddService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/CalculatorService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/CalculatorServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/DivideService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/MultiplyService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/SubtractService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/resources/CalculatorRMIReference.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/test/java/calculator/CalculatorRMIReferenceTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/test/java/calculator/CalculatorRMIServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/build.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/AddService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/AddServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/CalculatorClient.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/CalculatorService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/CalculatorServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/DivideService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/DivideServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/MultiplyService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/MultiplyServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/SubtractService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/SubtractServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/resources/CalculatorRMIServer.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/test/java/calculator/CalculatorRMIServerTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/build.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/AddService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/AddServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/CalculatorClient.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/CalculatorService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/DivideService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/MultiplyService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/SubtractService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/resources/Calculator.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/resources/CalculatorClient.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/build.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/calculator.odg delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/calculator.png delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/AddService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/AddServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/CalculatorService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/DivideService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/MultiplyService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/SubtractService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/resources/Calculator.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/build.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/helloworld-ws-sdo.png delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/maven-eclipse.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldClient.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldServer.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldServiceComponent.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/services/bcircle/BioTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/services/bcircle/BiochemicalCircle.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/services/bcircle/BiochemicalCircleImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/helloworldws.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/helloworldwsclient.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/logging.properties delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/resources/clinicalLaboratory.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/test.xsd delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/wsdl/helloworld.wsdl delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/test/java/helloworld/HelloWorldClientTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/test/java/helloworld/HelloWorldTestServer.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/test/java/helloworld/TestCaseRunner.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/ObjectFactory.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/Order.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/OrderService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/OrderServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/OrderServiceServer.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/OrderService_Service.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/ReviewOrder.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/ReviewOrderResponse.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/Status.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/package-info.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/resources/orderws.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/resources/wsdl/orderservice.wsdl delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/test/java/org/example/orderservice/OrderServiceTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/LICENSE delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/META-INF/MANIFEST.MF delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/NOTICE delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/add-component.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/blueprint/operations-module.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/divide-component.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/multiply-component.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/sca-config/operations-config.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/subtract-component.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/LICENSE delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/META-INF/MANIFEST.MF delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/NOTICE delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/blueprint/calculator-module.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/calculator-component.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/sca-config/calculator-config.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/dosgi-calculator.png delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/CalculatorService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/AddService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/DivideService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRemote.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/build.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/helloworld-bpel.png delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/helloworld-bpel.svg delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/java/helloworld/Hello.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/helloworld.bpel delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/helloworld.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/helloworld.wsdl delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/log4j.properties delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/java/sample/HelloworldService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/resources/helloworld.bpel delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/resources/helloworld.wsdl delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/webapp/WEB-INF/web.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/webapp/WEB-INF/web.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/webapp/hello.jsp delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive-ws/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive-ws/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive-ws/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive-ws/src/main/resources/helloworld-ws.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive/src/main/resources/helloworld-recursive.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/build.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/AddService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/AddServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorClient.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/DivideService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/MultiplyService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/SubtractService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/resources/Calculator.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/resources/CalculatorClient.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/LICENSE delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/META-INF/MANIFEST.MF delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/NOTICE delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/add-component.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/blueprint/operations-module.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/divide-component.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/multiply-component.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/sca/bundle.componentType delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/sca/bundle.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/subtract-component.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/LICENSE delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/META-INF/MANIFEST.MF delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/NOTICE delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/calculator-component.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/sca/bundle.componentType delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/sca/bundle.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/dosgi-calculator.png delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/AddService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/DivideService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/OSGiTestUtils.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/build.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/AddService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorClient.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/DivideService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/MultiplyService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/SubtractService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/Calculator.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/CalculatorClient.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/AddServiceImpl.componentType delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/AddServiceImpl.js delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/DivideServiceImpl.componentType delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/DivideServiceImpl.groovy delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/MultiplyServiceImpl.componentType delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/MultiplyServiceImpl.py delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/SubtractServiceImpl.componentType delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/SubtractServiceImpl.rb delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/DateService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/DateServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/Helloworld.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/HelloworldClientImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/HelloworldImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld-client-context.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld-context.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/test/java/sample/HelloworldTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/main/webapp/WEB-INF/web.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/test/java/sample/HelloworldClientTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/test/resources/test-web.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/java/sample/HelloWorldResource.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/java/sample/HelloworldService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/java/sample/HelloworldServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/webapp/WEB-INF/application delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/webapp/WEB-INF/web.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/webapp/WEB-INF/web.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/test/java/itest/HelloworldTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/java/sample/HelloworldService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/java/sample/HelloworldServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/webapp/WEB-INF/web.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/webapp/WEB-INF/web.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/webapp/hello.html delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/test/java/itest/HelloworldTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/java/sample/HelloWorldController.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/java/sample/HelloworldService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/java/sample/HelloworldServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/WEB-INF/faces-config.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/WEB-INF/web.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/WEB-INF/web.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/helloWorld.jsp delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/index.jsp delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/page2.jsp delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/java/sample/HelloworldService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/java/sample/HelloworldServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/webapp/WEB-INF/web.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/webapp/WEB-INF/web.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/webapp/hello.jsp delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/test/java/itest/HelloworldTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/java/sample/HelloworldService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/java/sample/HelloworldServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/java/sample/HelloworldServlet.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/webapp/WEB-INF/web.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/webapp/WEB-INF/web.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/webapp/hello.html delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/test/java/itest/HelloworldTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/mystripes/action/BaseActionBean.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/mystripes/action/HomeActionBean.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/sample/HelloworldService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/sample/HelloworldServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/resources/StripesResources.properties delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/resources/log4j.properties delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/jsp/home.jsp delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/jsp/layout.jsp delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/jsp/taglibs.jsp delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/web.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/web.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/index.html delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/test/java/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/test/java/itest/HelloworldTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/calculator-scaclient/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/calculator-scaclient/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/calculator-scaclient/src/main/java/calculator/CalculatorService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/calculator-scaclient/src/main/java/sample/CalculatorSCAClient.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/src/main/java/sample/Helloworld.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/src/test/java/sample/HelloworldTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/command-line/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/eclipse/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/build.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/calculator/CalculatorService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingJSONRPCCalculator.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingRMICalculator.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingSCACalculator.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingWSCalculator.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationJavaCalculator.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationJavaCalculatorAsync.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationScriptCalculator.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/SampleLauncherException.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/test/java/launcher/LauncherTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/build.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/main/java/calculator/CalculatorService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/main/java/launcher/RuntimeIntegration.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/main/java/launcher/SampleJSELauncher.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/main/java/launcher/SampleLauncherException.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/test/java/launcher/LauncherTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/build.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/calculator/CalculatorService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/launcher/RuntimeIntegration.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleLauncherException.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleOSGILauncherBindingSCA.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleOSGILauncherBindingWS.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/test/java/launcher/LauncherTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/build.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/AddService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/AddServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorClient.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/DivideService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/MultiplyService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/SubtractService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/resources/Calculator.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/resources/CalculatorClient.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/META-INF/MANIFEST.MF delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/build.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/logging.properties delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/AddService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/AddServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorActivator.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorClient.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/DivideService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/DivideServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/MultiplyService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/MultiplyServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/SubtractService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/SubtractServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/resources/Calculator.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/META-INF/MANIFEST.MF delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/AddService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/AddServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorActivator.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/DivideService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/DivideServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/MultiplyService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/MultiplyServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/SubtractService.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/SubtractServiceImpl.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/resources/Calculator.composite delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/test/java/calculator/CalculatorTestCase.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/osgi/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/pom.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/README delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/pom.xml delete mode 100755 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/sca delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/sca.bat delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test-remote.txt delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test-start.txt delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test-status.txt delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test-stop.txt delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test.txt delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/src/main/java/sample/Shell.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/src/main/java/sample/ShellServlet.java delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/src/main/webapp/WEB-INF/web.xml delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/src/main/webapp/index.html delete mode 100644 sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/webapp/README (limited to 'sca-java-2.x/branches/2.0-Beta2/samples') diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/README b/sca-java-2.x/branches/2.0-Beta2/samples/README deleted file mode 100644 index 15736845da..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/README +++ /dev/null @@ -1,154 +0,0 @@ -The Apache Tuscany SCA Samples -============================== - -Welcome to the Apache Tuscany SCA Java runtime. You can find more general -documentation about the runtime at: - -http://tuscany.apache.org/documentation-2x/ - -Here we give a short overview of what you can find in the samples directory. -More detail on the individual sample contributions can be found at: - -http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html - -There are several samples subdirectories in the distribution; - -getting-started -=============== - -This is a good place to start if you've not tried Tuscany SCA Java before. This -directory contains a number of simple "SCA Contributions" that can be run using -the Tuscany SCA runtime. An SCA Contribution is the way that SCA composite -applications are packaged so they can be run. For general information on SCA -see http://tuscany.apache.org/documentation-2x/sca-introduction.html - -learning-more -============= - -This directory contains many more SCA Contributions that you can try with -the Tuscany SCA Java runtime. Some demonstrate particular features of the -runtime, or example, the contributions under the async directory demonstrate -the asynchronous programming model that the runtime supports. - -SCA is extensible. You can plug in extensions to support many different types -of technology. The Tuscany SCA Java runtime comes with lots of extensions -and the majority of contributions here demonstrate these extensions. They are -organized under directories following the name of the extension, for example, -contributions that demonstrate the web services binding in operation can -be found in the binding-ws directory. When you want to use the web service -binding with an SCA service a reference it appears in the composite XML in -the following way: - - - - - -Hence it should be easy to map between extensions, as they appear in -composite files and other samples that demonstrate various features of the -extension. - -The contributions here can be run with using the approach that you find -most convenient from the running-tuscany directory. - -running-tuscany -=============== - -The Tuscany SCA Java runtime can be used directly from the command line. It can -also be embedded in other programs. As such there are many different ways that -you can start the Tuscany SCA runtime and deploy contributions to it. Each -directory here describes a different way of running Tuscany. In most cases these -different approaches can be used to run any of the contributions from the -getting-started or learning-more directories. - -applications -============ - -The contributions here demonstrate more fully formed applications when -compared to the contributions found the getting-started or learning-more -directories. - -extending-tuscany -================= - -Once you're familiar with Tuscany and SCA you're likely to find that to -implement you're application you need particular bindings, implementation -types, policies or databindings. The examples in this directory show you -how to extend the Tuscany runtime to include the technologies you need to use. - -Running samples ---------------- - -Running a samples contribution involves 3 basic steps - -1) build the contribution - -Using ant, maven or eclipse (see below) - -2) launch the contribution - -Using one of the approaches described in the running-tuscany directory - -3) send a test message to the a component service - -When you want to exercise an SCA composite application you have to send a -message to a component service. There are several ways of doing this depending -on how the sample contribution has been configured. For example, you could -send a SOAP message using the Web Services explorer in Eclipse, you could -use a separate client program that uses the SCA client API, the sample -contribution itself may even include initialization code that sends a test -message when the contribution is started. The documentation for each sample -describes what to do to send a test message. - -Building the sample contributions using Ant --------------------------------------------- -Most sample contributions are provided with a build.xml file. When you see one -you can build it using Ant. - -These build.xml files are designed to work with the Tuscany SCA Java binary -distribution and build a classpath that, by various means, refers to the -jars that are shipped in the modules directory. For them to work properly -they should be run from the directory in which you find the build.xml file. - -cd -ant - -The result of this process will be the built contribution (a jar file) in the -target subdirectory of the sample contribution directory. - -Once the sample is built you have the option of running the sample in whatever -way best suits you. - -Building SCA Samples Using Maven --------------------------------- -All sample contributions are provided with a pom.xml Maven build file. The -Maven build process will work from both source and binary distributions. - -cd -mvn - -This will take a little while to complete. Experience with Maven tells us that -sometimes there are problems downloading the dependencies that Apache Tuscany -SCA requires. If Maven reports that it cannot download required dependencies -try running the Maven build again. - -When using Maven the samples are unit tested using JUnit test cases and so you -will sometimes see test output during the build process. - -The result of this process will be the built contribution (a jar file) in the -target subdirectory of the sample contribution directory. - -Once the sample is built you have the option of running the sample in whatever -way best suits you. - -Building Samples In An IDE ---------------------------- - -The easiest way to use the samples in an IDE is to use Maven to generate all -of the IDE project files for you automatically. You don't have to do this -though and can use a series of manual steps in order to import the Tuscany -samples into an IDE. - -Both approaches to importing SCA contribution projects into Eclipse are -documented at: - -http://tuscany.apache.org/import-existing-tuscany-sca-projects-into-eclipse.html diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/README b/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/README deleted file mode 100644 index 92f339ead5..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/README +++ /dev/null @@ -1,51 +0,0 @@ -This Tuscany sample shows how to implement and use a simple Logger component -that logs string messages to a Scribe logging server. - -Scribe is an Open Source server for aggregating streaming log data. It is -designed to scale to a very large number of nodes and be robust to network -and node failures. - -See the Scribe Wiki [1] for more information on Scribe. - -Getting the required Apache Thrift library -========================================== -This sample uses Apache Thrift's libthrift.jar to communicate with Scribe -servers. Libthrift is not yet available in a Maven repository, so before -building the sample with Maven, you need to download libthrift [2] and -install it in your local Maven repository like this: - -mvn install:install-file -DgroupId=org.apache.thrift -DartifactId=libthrift \ --Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=libthrift-r917130.jar - -Starting a Scribe server -======================== -Before running the LoggingTest sample test program, you need to start a Scribe -server for the sample program to connect to. - -Steps to start a Scribe server are described in the Scribe examples README [3]. -A simple Scribe server configuration can be found in the Scribe examples [4]. - -LoggingTest will try to connect to a Scribe server at localhost:1463. To use -a Scribe server at a different host or port, configure the host and port -properties in scribe.composite to match your server. - -Running the LoggingTest sample test program -=========================================== - -To run the LoggingTest sample test program, do this: -mvn -Dtest=LoggingTest test - -Checking the Scribe log output -============================== -After running LoggingTest, you should find the logged string "Hello There" in -file sample/sample_current under your Scribe log store directory. - -If you've used the example1.conf Scribe configuration from the Scribe examples -[4], you should find your log message in /tmp/scribetest/sample/sample_current. - - -[1] http://wiki.github.com/facebook/scribe/ -[2] http://svn.apache.org/repos/asf/cassandra/trunk/lib/libthrift-r917130.jar -[3] http://github.com/facebook/scribe/blob/master/examples/README -[4] http://github.com/facebook/scribe/blob/master/examples/example1.conf - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/pom.xml deleted file mode 100644 index 15ab6eb900..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/pom.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - - jar - sample-logging-scribe - Apache Tuscany SCA Scribe Logging Sample - - - - org.apache.tuscany.sca - tuscany-node-api - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-node-impl - 2.0-Beta2-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 2.0-Beta2-SNAPSHOT - runtime - - - - org.apache.thrift - libthrift - 1.0-SNAPSHOT - - - - org.slf4j - slf4j-api - 1.6.0 - - - - org.slf4j - slf4j-simple - 1.6.0 - - - - commons-lang - commons-lang - 2.4 - - - - junit - junit - 4.8.1 - test - - - - - ${artifactId} - - - org.apache.tuscany.maven.plugins - maven-tuscany-plugin - 2.0-Beta2-SNAPSHOT - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/com/facebook/fb303/FacebookService.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/com/facebook/fb303/FacebookService.java deleted file mode 100644 index 1708066955..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/com/facebook/fb303/FacebookService.java +++ /dev/null @@ -1,6823 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * Autogenerated by Thrift - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package generated.com.facebook.fb303; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.apache.thrift.*; -import org.apache.thrift.meta_data.*; -import org.apache.thrift.protocol.*; - -public class FacebookService { - - /** - * Standard base service - */ - public interface Iface { - - /** - * Returns a descriptive name of the service - */ - public String getName() throws TException; - - /** - * Returns the version of the service - */ - public String getVersion() throws TException; - - /** - * Gets the status of this service - */ - public fb_status getStatus() throws TException; - - /** - * User friendly description of status, such as why the service is in - * the dead or warning state, or what is being started or stopped. - */ - public String getStatusDetails() throws TException; - - /** - * Gets the counters for this service - */ - public Map getCounters() throws TException; - - /** - * Gets the value of a single counter - * - * @param key - */ - public long getCounter(String key) throws TException; - - /** - * Sets an option - * - * @param key - * @param value - */ - public void setOption(String key, String value) throws TException; - - /** - * Gets an option - * - * @param key - */ - public String getOption(String key) throws TException; - - /** - * Gets all options - */ - public Map getOptions() throws TException; - - /** - * Returns a CPU profile over the given time interval (client and server - * must agree on the profile format). - * - * @param profileDurationInSec - */ - public String getCpuProfile(int profileDurationInSec) throws TException; - - /** - * Returns the unix time that the server has been running since - */ - public long aliveSince() throws TException; - - /** - * Tell the server to reload its configuration, reopen log files, etc - */ - public void reinitialize() throws TException; - - /** - * Suggest a shutdown to the server - */ - public void shutdown() throws TException; - - } - - public static class Client implements Iface { - public Client(TProtocol prot) - { - this(prot, prot); - } - - public Client(TProtocol iprot, TProtocol oprot) - { - iprot_ = iprot; - oprot_ = oprot; - } - - protected TProtocol iprot_; - protected TProtocol oprot_; - - protected int seqid_; - - public TProtocol getInputProtocol() - { - return this.iprot_; - } - - public TProtocol getOutputProtocol() - { - return this.oprot_; - } - - public String getName() throws TException - { - send_getName(); - return recv_getName(); - } - - public void send_getName() throws TException - { - oprot_.writeMessageBegin(new TMessage("getName", TMessageType.CALL, seqid_)); - getName_args args = new getName_args(); - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - public String recv_getName() throws TException - { - TMessage msg = iprot_.readMessageBegin(); - if (msg.type == TMessageType.EXCEPTION) { - TApplicationException x = TApplicationException.read(iprot_); - iprot_.readMessageEnd(); - throw x; - } - getName_result result = new getName_result(); - result.read(iprot_); - iprot_.readMessageEnd(); - if (result.isSetSuccess()) { - return result.success; - } - throw new TApplicationException(TApplicationException.MISSING_RESULT, "getName failed: unknown result"); - } - - public String getVersion() throws TException - { - send_getVersion(); - return recv_getVersion(); - } - - public void send_getVersion() throws TException - { - oprot_.writeMessageBegin(new TMessage("getVersion", TMessageType.CALL, seqid_)); - getVersion_args args = new getVersion_args(); - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - public String recv_getVersion() throws TException - { - TMessage msg = iprot_.readMessageBegin(); - if (msg.type == TMessageType.EXCEPTION) { - TApplicationException x = TApplicationException.read(iprot_); - iprot_.readMessageEnd(); - throw x; - } - getVersion_result result = new getVersion_result(); - result.read(iprot_); - iprot_.readMessageEnd(); - if (result.isSetSuccess()) { - return result.success; - } - throw new TApplicationException(TApplicationException.MISSING_RESULT, "getVersion failed: unknown result"); - } - - public fb_status getStatus() throws TException - { - send_getStatus(); - return recv_getStatus(); - } - - public void send_getStatus() throws TException - { - oprot_.writeMessageBegin(new TMessage("getStatus", TMessageType.CALL, seqid_)); - getStatus_args args = new getStatus_args(); - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - public fb_status recv_getStatus() throws TException - { - TMessage msg = iprot_.readMessageBegin(); - if (msg.type == TMessageType.EXCEPTION) { - TApplicationException x = TApplicationException.read(iprot_); - iprot_.readMessageEnd(); - throw x; - } - getStatus_result result = new getStatus_result(); - result.read(iprot_); - iprot_.readMessageEnd(); - if (result.isSetSuccess()) { - return result.success; - } - throw new TApplicationException(TApplicationException.MISSING_RESULT, "getStatus failed: unknown result"); - } - - public String getStatusDetails() throws TException - { - send_getStatusDetails(); - return recv_getStatusDetails(); - } - - public void send_getStatusDetails() throws TException - { - oprot_.writeMessageBegin(new TMessage("getStatusDetails", TMessageType.CALL, seqid_)); - getStatusDetails_args args = new getStatusDetails_args(); - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - public String recv_getStatusDetails() throws TException - { - TMessage msg = iprot_.readMessageBegin(); - if (msg.type == TMessageType.EXCEPTION) { - TApplicationException x = TApplicationException.read(iprot_); - iprot_.readMessageEnd(); - throw x; - } - getStatusDetails_result result = new getStatusDetails_result(); - result.read(iprot_); - iprot_.readMessageEnd(); - if (result.isSetSuccess()) { - return result.success; - } - throw new TApplicationException(TApplicationException.MISSING_RESULT, "getStatusDetails failed: unknown result"); - } - - public Map getCounters() throws TException - { - send_getCounters(); - return recv_getCounters(); - } - - public void send_getCounters() throws TException - { - oprot_.writeMessageBegin(new TMessage("getCounters", TMessageType.CALL, seqid_)); - getCounters_args args = new getCounters_args(); - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - public Map recv_getCounters() throws TException - { - TMessage msg = iprot_.readMessageBegin(); - if (msg.type == TMessageType.EXCEPTION) { - TApplicationException x = TApplicationException.read(iprot_); - iprot_.readMessageEnd(); - throw x; - } - getCounters_result result = new getCounters_result(); - result.read(iprot_); - iprot_.readMessageEnd(); - if (result.isSetSuccess()) { - return result.success; - } - throw new TApplicationException(TApplicationException.MISSING_RESULT, "getCounters failed: unknown result"); - } - - public long getCounter(String key) throws TException - { - send_getCounter(key); - return recv_getCounter(); - } - - public void send_getCounter(String key) throws TException - { - oprot_.writeMessageBegin(new TMessage("getCounter", TMessageType.CALL, seqid_)); - getCounter_args args = new getCounter_args(); - args.key = key; - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - public long recv_getCounter() throws TException - { - TMessage msg = iprot_.readMessageBegin(); - if (msg.type == TMessageType.EXCEPTION) { - TApplicationException x = TApplicationException.read(iprot_); - iprot_.readMessageEnd(); - throw x; - } - getCounter_result result = new getCounter_result(); - result.read(iprot_); - iprot_.readMessageEnd(); - if (result.isSetSuccess()) { - return result.success; - } - throw new TApplicationException(TApplicationException.MISSING_RESULT, "getCounter failed: unknown result"); - } - - public void setOption(String key, String value) throws TException - { - send_setOption(key, value); - recv_setOption(); - } - - public void send_setOption(String key, String value) throws TException - { - oprot_.writeMessageBegin(new TMessage("setOption", TMessageType.CALL, seqid_)); - setOption_args args = new setOption_args(); - args.key = key; - args.value = value; - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - public void recv_setOption() throws TException - { - TMessage msg = iprot_.readMessageBegin(); - if (msg.type == TMessageType.EXCEPTION) { - TApplicationException x = TApplicationException.read(iprot_); - iprot_.readMessageEnd(); - throw x; - } - setOption_result result = new setOption_result(); - result.read(iprot_); - iprot_.readMessageEnd(); - return; - } - - public String getOption(String key) throws TException - { - send_getOption(key); - return recv_getOption(); - } - - public void send_getOption(String key) throws TException - { - oprot_.writeMessageBegin(new TMessage("getOption", TMessageType.CALL, seqid_)); - getOption_args args = new getOption_args(); - args.key = key; - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - public String recv_getOption() throws TException - { - TMessage msg = iprot_.readMessageBegin(); - if (msg.type == TMessageType.EXCEPTION) { - TApplicationException x = TApplicationException.read(iprot_); - iprot_.readMessageEnd(); - throw x; - } - getOption_result result = new getOption_result(); - result.read(iprot_); - iprot_.readMessageEnd(); - if (result.isSetSuccess()) { - return result.success; - } - throw new TApplicationException(TApplicationException.MISSING_RESULT, "getOption failed: unknown result"); - } - - public Map getOptions() throws TException - { - send_getOptions(); - return recv_getOptions(); - } - - public void send_getOptions() throws TException - { - oprot_.writeMessageBegin(new TMessage("getOptions", TMessageType.CALL, seqid_)); - getOptions_args args = new getOptions_args(); - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - public Map recv_getOptions() throws TException - { - TMessage msg = iprot_.readMessageBegin(); - if (msg.type == TMessageType.EXCEPTION) { - TApplicationException x = TApplicationException.read(iprot_); - iprot_.readMessageEnd(); - throw x; - } - getOptions_result result = new getOptions_result(); - result.read(iprot_); - iprot_.readMessageEnd(); - if (result.isSetSuccess()) { - return result.success; - } - throw new TApplicationException(TApplicationException.MISSING_RESULT, "getOptions failed: unknown result"); - } - - public String getCpuProfile(int profileDurationInSec) throws TException - { - send_getCpuProfile(profileDurationInSec); - return recv_getCpuProfile(); - } - - public void send_getCpuProfile(int profileDurationInSec) throws TException - { - oprot_.writeMessageBegin(new TMessage("getCpuProfile", TMessageType.CALL, seqid_)); - getCpuProfile_args args = new getCpuProfile_args(); - args.profileDurationInSec = profileDurationInSec; - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - public String recv_getCpuProfile() throws TException - { - TMessage msg = iprot_.readMessageBegin(); - if (msg.type == TMessageType.EXCEPTION) { - TApplicationException x = TApplicationException.read(iprot_); - iprot_.readMessageEnd(); - throw x; - } - getCpuProfile_result result = new getCpuProfile_result(); - result.read(iprot_); - iprot_.readMessageEnd(); - if (result.isSetSuccess()) { - return result.success; - } - throw new TApplicationException(TApplicationException.MISSING_RESULT, "getCpuProfile failed: unknown result"); - } - - public long aliveSince() throws TException - { - send_aliveSince(); - return recv_aliveSince(); - } - - public void send_aliveSince() throws TException - { - oprot_.writeMessageBegin(new TMessage("aliveSince", TMessageType.CALL, seqid_)); - aliveSince_args args = new aliveSince_args(); - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - public long recv_aliveSince() throws TException - { - TMessage msg = iprot_.readMessageBegin(); - if (msg.type == TMessageType.EXCEPTION) { - TApplicationException x = TApplicationException.read(iprot_); - iprot_.readMessageEnd(); - throw x; - } - aliveSince_result result = new aliveSince_result(); - result.read(iprot_); - iprot_.readMessageEnd(); - if (result.isSetSuccess()) { - return result.success; - } - throw new TApplicationException(TApplicationException.MISSING_RESULT, "aliveSince failed: unknown result"); - } - - public void reinitialize() throws TException - { - send_reinitialize(); - } - - public void send_reinitialize() throws TException - { - oprot_.writeMessageBegin(new TMessage("reinitialize", TMessageType.CALL, seqid_)); - reinitialize_args args = new reinitialize_args(); - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - public void shutdown() throws TException - { - send_shutdown(); - } - - public void send_shutdown() throws TException - { - oprot_.writeMessageBegin(new TMessage("shutdown", TMessageType.CALL, seqid_)); - shutdown_args args = new shutdown_args(); - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - } - public static class Processor implements TProcessor { - private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); - public Processor(Iface iface) - { - iface_ = iface; - processMap_.put("getName", new getName()); - processMap_.put("getVersion", new getVersion()); - processMap_.put("getStatus", new getStatus()); - processMap_.put("getStatusDetails", new getStatusDetails()); - processMap_.put("getCounters", new getCounters()); - processMap_.put("getCounter", new getCounter()); - processMap_.put("setOption", new setOption()); - processMap_.put("getOption", new getOption()); - processMap_.put("getOptions", new getOptions()); - processMap_.put("getCpuProfile", new getCpuProfile()); - processMap_.put("aliveSince", new aliveSince()); - processMap_.put("reinitialize", new reinitialize()); - processMap_.put("shutdown", new shutdown()); - } - - protected static interface ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException; - } - - private Iface iface_; - protected final HashMap processMap_ = new HashMap(); - - public boolean process(TProtocol iprot, TProtocol oprot) throws TException - { - TMessage msg = iprot.readMessageBegin(); - ProcessFunction fn = processMap_.get(msg.name); - if (fn == null) { - TProtocolUtil.skip(iprot, TType.STRUCT); - iprot.readMessageEnd(); - TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'"); - oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return true; - } - fn.process(msg.seqid, iprot, oprot); - return true; - } - - private class getName implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - getName_args args = new getName_args(); - args.read(iprot); - iprot.readMessageEnd(); - getName_result result = new getName_result(); - result.success = iface_.getName(); - oprot.writeMessageBegin(new TMessage("getName", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } - - } - - private class getVersion implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - getVersion_args args = new getVersion_args(); - args.read(iprot); - iprot.readMessageEnd(); - getVersion_result result = new getVersion_result(); - result.success = iface_.getVersion(); - oprot.writeMessageBegin(new TMessage("getVersion", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } - - } - - private class getStatus implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - getStatus_args args = new getStatus_args(); - args.read(iprot); - iprot.readMessageEnd(); - getStatus_result result = new getStatus_result(); - result.success = iface_.getStatus(); - oprot.writeMessageBegin(new TMessage("getStatus", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } - - } - - private class getStatusDetails implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - getStatusDetails_args args = new getStatusDetails_args(); - args.read(iprot); - iprot.readMessageEnd(); - getStatusDetails_result result = new getStatusDetails_result(); - result.success = iface_.getStatusDetails(); - oprot.writeMessageBegin(new TMessage("getStatusDetails", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } - - } - - private class getCounters implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - getCounters_args args = new getCounters_args(); - args.read(iprot); - iprot.readMessageEnd(); - getCounters_result result = new getCounters_result(); - result.success = iface_.getCounters(); - oprot.writeMessageBegin(new TMessage("getCounters", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } - - } - - private class getCounter implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - getCounter_args args = new getCounter_args(); - args.read(iprot); - iprot.readMessageEnd(); - getCounter_result result = new getCounter_result(); - result.success = iface_.getCounter(args.key); - result.setSuccessIsSet(true); - oprot.writeMessageBegin(new TMessage("getCounter", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } - - } - - private class setOption implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - setOption_args args = new setOption_args(); - args.read(iprot); - iprot.readMessageEnd(); - setOption_result result = new setOption_result(); - iface_.setOption(args.key, args.value); - oprot.writeMessageBegin(new TMessage("setOption", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } - - } - - private class getOption implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - getOption_args args = new getOption_args(); - args.read(iprot); - iprot.readMessageEnd(); - getOption_result result = new getOption_result(); - result.success = iface_.getOption(args.key); - oprot.writeMessageBegin(new TMessage("getOption", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } - - } - - private class getOptions implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - getOptions_args args = new getOptions_args(); - args.read(iprot); - iprot.readMessageEnd(); - getOptions_result result = new getOptions_result(); - result.success = iface_.getOptions(); - oprot.writeMessageBegin(new TMessage("getOptions", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } - - } - - private class getCpuProfile implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - getCpuProfile_args args = new getCpuProfile_args(); - args.read(iprot); - iprot.readMessageEnd(); - getCpuProfile_result result = new getCpuProfile_result(); - result.success = iface_.getCpuProfile(args.profileDurationInSec); - oprot.writeMessageBegin(new TMessage("getCpuProfile", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } - - } - - private class aliveSince implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - aliveSince_args args = new aliveSince_args(); - args.read(iprot); - iprot.readMessageEnd(); - aliveSince_result result = new aliveSince_result(); - result.success = iface_.aliveSince(); - result.setSuccessIsSet(true); - oprot.writeMessageBegin(new TMessage("aliveSince", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } - - } - - private class reinitialize implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - reinitialize_args args = new reinitialize_args(); - args.read(iprot); - iprot.readMessageEnd(); - iface_.reinitialize(); - return; - } - } - - private class shutdown implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - shutdown_args args = new shutdown_args(); - args.read(iprot); - iprot.readMessageEnd(); - iface_.shutdown(); - return; - } - } - - } - - public static class getName_args implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("getName_args"); - - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { -; - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - }}); - - static { - FieldMetaData.addStructMetaDataMap(getName_args.class, metaDataMap); - } - - public getName_args() { - } - - /** - * Performs a deep copy on other. - */ - public getName_args(getName_args other) { - } - - public getName_args deepCopy() { - return new getName_args(this); - } - - @Deprecated - public getName_args clone() { - return new getName_args(this); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getName_args) - return this.equals((getName_args)that); - return false; - } - - public boolean equals(getName_args that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(getName_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getName_args typedOther = (getName_args)other; - - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getName_args("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class getName_result implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("getName_result"); - - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRING, (short)0); - - public String success; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - }}); - - static { - FieldMetaData.addStructMetaDataMap(getName_result.class, metaDataMap); - } - - public getName_result() { - } - - public getName_result( - String success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getName_result(getName_result other) { - if (other.isSetSuccess()) { - this.success = other.success; - } - } - - public getName_result deepCopy() { - return new getName_result(this); - } - - @Deprecated - public getName_result clone() { - return new getName_result(this); - } - - public String getSuccess() { - return this.success; - } - - public getName_result setSuccess(String success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been asigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((String)value); - } - break; - - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getName_result) - return this.equals((getName_result)that); - return false; - } - - public boolean equals(getName_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(getName_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getName_result typedOther = (getName_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - case SUCCESS: - if (field.type == TType.STRING) { - this.success = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getName_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class getVersion_args implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("getVersion_args"); - - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { -; - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - }}); - - static { - FieldMetaData.addStructMetaDataMap(getVersion_args.class, metaDataMap); - } - - public getVersion_args() { - } - - /** - * Performs a deep copy on other. - */ - public getVersion_args(getVersion_args other) { - } - - public getVersion_args deepCopy() { - return new getVersion_args(this); - } - - @Deprecated - public getVersion_args clone() { - return new getVersion_args(this); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getVersion_args) - return this.equals((getVersion_args)that); - return false; - } - - public boolean equals(getVersion_args that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(getVersion_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getVersion_args typedOther = (getVersion_args)other; - - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getVersion_args("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class getVersion_result implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("getVersion_result"); - - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRING, (short)0); - - public String success; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - }}); - - static { - FieldMetaData.addStructMetaDataMap(getVersion_result.class, metaDataMap); - } - - public getVersion_result() { - } - - public getVersion_result( - String success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getVersion_result(getVersion_result other) { - if (other.isSetSuccess()) { - this.success = other.success; - } - } - - public getVersion_result deepCopy() { - return new getVersion_result(this); - } - - @Deprecated - public getVersion_result clone() { - return new getVersion_result(this); - } - - public String getSuccess() { - return this.success; - } - - public getVersion_result setSuccess(String success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been asigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((String)value); - } - break; - - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getVersion_result) - return this.equals((getVersion_result)that); - return false; - } - - public boolean equals(getVersion_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(getVersion_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getVersion_result typedOther = (getVersion_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - case SUCCESS: - if (field.type == TType.STRING) { - this.success = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getVersion_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class getStatus_args implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("getStatus_args"); - - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { -; - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - }}); - - static { - FieldMetaData.addStructMetaDataMap(getStatus_args.class, metaDataMap); - } - - public getStatus_args() { - } - - /** - * Performs a deep copy on other. - */ - public getStatus_args(getStatus_args other) { - } - - public getStatus_args deepCopy() { - return new getStatus_args(this); - } - - @Deprecated - public getStatus_args clone() { - return new getStatus_args(this); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getStatus_args) - return this.equals((getStatus_args)that); - return false; - } - - public boolean equals(getStatus_args that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(getStatus_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getStatus_args typedOther = (getStatus_args)other; - - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getStatus_args("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class getStatus_result implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("getStatus_result"); - - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I32, (short)0); - - /** - * - * @see fb_status - */ - public fb_status success; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { - /** - * - * @see fb_status - */ - SUCCESS((short)0, "success"); - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new EnumMetaData(TType.ENUM, fb_status.class))); - }}); - - static { - FieldMetaData.addStructMetaDataMap(getStatus_result.class, metaDataMap); - } - - public getStatus_result() { - } - - public getStatus_result( - fb_status success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getStatus_result(getStatus_result other) { - if (other.isSetSuccess()) { - this.success = other.success; - } - } - - public getStatus_result deepCopy() { - return new getStatus_result(this); - } - - @Deprecated - public getStatus_result clone() { - return new getStatus_result(this); - } - - /** - * - * @see fb_status - */ - public fb_status getSuccess() { - return this.success; - } - - /** - * - * @see fb_status - */ - public getStatus_result setSuccess(fb_status success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been asigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((fb_status)value); - } - break; - - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getStatus_result) - return this.equals((getStatus_result)that); - return false; - } - - public boolean equals(getStatus_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(getStatus_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getStatus_result typedOther = (getStatus_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - case SUCCESS: - if (field.type == TType.I32) { - this.success = fb_status.findByValue(iprot.readI32()); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI32(this.success.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getStatus_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - String success_name = success.name(); - if (success_name != null) { - sb.append(success_name); - sb.append(" ("); - } - sb.append(this.success); - if (success_name != null) { - sb.append(")"); - } - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class getStatusDetails_args implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("getStatusDetails_args"); - - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { -; - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - }}); - - static { - FieldMetaData.addStructMetaDataMap(getStatusDetails_args.class, metaDataMap); - } - - public getStatusDetails_args() { - } - - /** - * Performs a deep copy on other. - */ - public getStatusDetails_args(getStatusDetails_args other) { - } - - public getStatusDetails_args deepCopy() { - return new getStatusDetails_args(this); - } - - @Deprecated - public getStatusDetails_args clone() { - return new getStatusDetails_args(this); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getStatusDetails_args) - return this.equals((getStatusDetails_args)that); - return false; - } - - public boolean equals(getStatusDetails_args that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(getStatusDetails_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getStatusDetails_args typedOther = (getStatusDetails_args)other; - - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getStatusDetails_args("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class getStatusDetails_result implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("getStatusDetails_result"); - - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRING, (short)0); - - public String success; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - }}); - - static { - FieldMetaData.addStructMetaDataMap(getStatusDetails_result.class, metaDataMap); - } - - public getStatusDetails_result() { - } - - public getStatusDetails_result( - String success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getStatusDetails_result(getStatusDetails_result other) { - if (other.isSetSuccess()) { - this.success = other.success; - } - } - - public getStatusDetails_result deepCopy() { - return new getStatusDetails_result(this); - } - - @Deprecated - public getStatusDetails_result clone() { - return new getStatusDetails_result(this); - } - - public String getSuccess() { - return this.success; - } - - public getStatusDetails_result setSuccess(String success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been asigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((String)value); - } - break; - - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getStatusDetails_result) - return this.equals((getStatusDetails_result)that); - return false; - } - - public boolean equals(getStatusDetails_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(getStatusDetails_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getStatusDetails_result typedOther = (getStatusDetails_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - case SUCCESS: - if (field.type == TType.STRING) { - this.success = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getStatusDetails_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class getCounters_args implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("getCounters_args"); - - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { -; - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - }}); - - static { - FieldMetaData.addStructMetaDataMap(getCounters_args.class, metaDataMap); - } - - public getCounters_args() { - } - - /** - * Performs a deep copy on other. - */ - public getCounters_args(getCounters_args other) { - } - - public getCounters_args deepCopy() { - return new getCounters_args(this); - } - - @Deprecated - public getCounters_args clone() { - return new getCounters_args(this); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getCounters_args) - return this.equals((getCounters_args)that); - return false; - } - - public boolean equals(getCounters_args that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(getCounters_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getCounters_args typedOther = (getCounters_args)other; - - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getCounters_args("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class getCounters_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("getCounters_result"); - - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.MAP, (short)0); - - public Map success; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new MapMetaData(TType.MAP, - new FieldValueMetaData(TType.STRING), - new FieldValueMetaData(TType.I64)))); - }}); - - static { - FieldMetaData.addStructMetaDataMap(getCounters_result.class, metaDataMap); - } - - public getCounters_result() { - } - - public getCounters_result( - Map success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getCounters_result(getCounters_result other) { - if (other.isSetSuccess()) { - Map __this__success = new HashMap(); - for (Map.Entry other_element : other.success.entrySet()) { - - String other_element_key = other_element.getKey(); - Long other_element_value = other_element.getValue(); - - String __this__success_copy_key = other_element_key; - - Long __this__success_copy_value = other_element_value; - - __this__success.put(__this__success_copy_key, __this__success_copy_value); - } - this.success = __this__success; - } - } - - public getCounters_result deepCopy() { - return new getCounters_result(this); - } - - @Deprecated - public getCounters_result clone() { - return new getCounters_result(this); - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public void putToSuccess(String key, long val) { - if (this.success == null) { - this.success = new HashMap(); - } - this.success.put(key, val); - } - - public Map getSuccess() { - return this.success; - } - - public getCounters_result setSuccess(Map success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been asigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Map)value); - } - break; - - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getCounters_result) - return this.equals((getCounters_result)that); - return false; - } - - public boolean equals(getCounters_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - case SUCCESS: - if (field.type == TType.MAP) { - { - TMap _map0 = iprot.readMapBegin(); - this.success = new HashMap(2*_map0.size); - for (int _i1 = 0; _i1 < _map0.size; ++_i1) - { - String _key2; - long _val3; - _key2 = iprot.readString(); - _val3 = iprot.readI64(); - this.success.put(_key2, _val3); - } - iprot.readMapEnd(); - } - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeMapBegin(new TMap(TType.STRING, TType.I64, this.success.size())); - for (Map.Entry _iter4 : this.success.entrySet()) - { - oprot.writeString(_iter4.getKey()); - oprot.writeI64(_iter4.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getCounters_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class getCounter_args implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("getCounter_args"); - - private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)1); - - public String key; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { - KEY((short)1, "key"); - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - }}); - - static { - FieldMetaData.addStructMetaDataMap(getCounter_args.class, metaDataMap); - } - - public getCounter_args() { - } - - public getCounter_args( - String key) - { - this(); - this.key = key; - } - - /** - * Performs a deep copy on other. - */ - public getCounter_args(getCounter_args other) { - if (other.isSetKey()) { - this.key = other.key; - } - } - - public getCounter_args deepCopy() { - return new getCounter_args(this); - } - - @Deprecated - public getCounter_args clone() { - return new getCounter_args(this); - } - - public String getKey() { - return this.key; - } - - public getCounter_args setKey(String key) { - this.key = key; - return this; - } - - public void unsetKey() { - this.key = null; - } - - /** Returns true if field key is set (has been asigned a value) and false otherwise */ - public boolean isSetKey() { - return this.key != null; - } - - public void setKeyIsSet(boolean value) { - if (!value) { - this.key = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case KEY: - if (value == null) { - unsetKey(); - } else { - setKey((String)value); - } - break; - - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case KEY: - return getKey(); - - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - case KEY: - return isSetKey(); - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getCounter_args) - return this.equals((getCounter_args)that); - return false; - } - - public boolean equals(getCounter_args that) { - if (that == null) - return false; - - boolean this_present_key = true && this.isSetKey(); - boolean that_present_key = true && that.isSetKey(); - if (this_present_key || that_present_key) { - if (!(this_present_key && that_present_key)) - return false; - if (!this.key.equals(that.key)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(getCounter_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getCounter_args typedOther = (getCounter_args)other; - - lastComparison = Boolean.valueOf(isSetKey()).compareTo(isSetKey()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(key, typedOther.key); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - case KEY: - if (field.type == TType.STRING) { - this.key = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - oprot.writeString(this.key); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getCounter_args("); - boolean first = true; - - sb.append("key:"); - if (this.key == null) { - sb.append("null"); - } else { - sb.append(this.key); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class getCounter_result implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("getCounter_result"); - - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0); - - public long success; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I64))); - }}); - - static { - FieldMetaData.addStructMetaDataMap(getCounter_result.class, metaDataMap); - } - - public getCounter_result() { - } - - public getCounter_result( - long success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public getCounter_result(getCounter_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - this.success = other.success; - } - - public getCounter_result deepCopy() { - return new getCounter_result(this); - } - - @Deprecated - public getCounter_result clone() { - return new getCounter_result(this); - } - - public long getSuccess() { - return this.success; - } - - public getCounter_result setSuccess(long success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been asigned a value) and false otherwise */ - public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Long)value); - } - break; - - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return new Long(getSuccess()); - - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getCounter_result) - return this.equals((getCounter_result)that); - return false; - } - - public boolean equals(getCounter_result that) { - if (that == null) - return false; - - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(getCounter_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getCounter_result typedOther = (getCounter_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - case SUCCESS: - if (field.type == TType.I64) { - this.success = iprot.readI64(); - setSuccessIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI64(this.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getCounter_result("); - boolean first = true; - - sb.append("success:"); - sb.append(this.success); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class setOption_args implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("setOption_args"); - - private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)1); - private static final TField VALUE_FIELD_DESC = new TField("value", TType.STRING, (short)2); - - public String key; - public String value; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { - KEY((short)1, "key"), - VALUE((short)2, "value"); - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.VALUE, new FieldMetaData("value", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - }}); - - static { - FieldMetaData.addStructMetaDataMap(setOption_args.class, metaDataMap); - } - - public setOption_args() { - } - - public setOption_args( - String key, - String value) - { - this(); - this.key = key; - this.value = value; - } - - /** - * Performs a deep copy on other. - */ - public setOption_args(setOption_args other) { - if (other.isSetKey()) { - this.key = other.key; - } - if (other.isSetValue()) { - this.value = other.value; - } - } - - public setOption_args deepCopy() { - return new setOption_args(this); - } - - @Deprecated - public setOption_args clone() { - return new setOption_args(this); - } - - public String getKey() { - return this.key; - } - - public setOption_args setKey(String key) { - this.key = key; - return this; - } - - public void unsetKey() { - this.key = null; - } - - /** Returns true if field key is set (has been asigned a value) and false otherwise */ - public boolean isSetKey() { - return this.key != null; - } - - public void setKeyIsSet(boolean value) { - if (!value) { - this.key = null; - } - } - - public String getValue() { - return this.value; - } - - public setOption_args setValue(String value) { - this.value = value; - return this; - } - - public void unsetValue() { - this.value = null; - } - - /** Returns true if field value is set (has been asigned a value) and false otherwise */ - public boolean isSetValue() { - return this.value != null; - } - - public void setValueIsSet(boolean value) { - if (!value) { - this.value = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case KEY: - if (value == null) { - unsetKey(); - } else { - setKey((String)value); - } - break; - - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((String)value); - } - break; - - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case KEY: - return getKey(); - - case VALUE: - return getValue(); - - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - case KEY: - return isSetKey(); - case VALUE: - return isSetValue(); - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof setOption_args) - return this.equals((setOption_args)that); - return false; - } - - public boolean equals(setOption_args that) { - if (that == null) - return false; - - boolean this_present_key = true && this.isSetKey(); - boolean that_present_key = true && that.isSetKey(); - if (this_present_key || that_present_key) { - if (!(this_present_key && that_present_key)) - return false; - if (!this.key.equals(that.key)) - return false; - } - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (!this.value.equals(that.value)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(setOption_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - setOption_args typedOther = (setOption_args)other; - - lastComparison = Boolean.valueOf(isSetKey()).compareTo(isSetKey()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(key, typedOther.key); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = Boolean.valueOf(isSetValue()).compareTo(isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(value, typedOther.value); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - case KEY: - if (field.type == TType.STRING) { - this.key = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case VALUE: - if (field.type == TType.STRING) { - this.value = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - oprot.writeString(this.key); - oprot.writeFieldEnd(); - } - if (this.value != null) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeString(this.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("setOption_args("); - boolean first = true; - - sb.append("key:"); - if (this.key == null) { - sb.append("null"); - } else { - sb.append(this.key); - } - first = false; - if (!first) sb.append(", "); - sb.append("value:"); - if (this.value == null) { - sb.append("null"); - } else { - sb.append(this.value); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class setOption_result implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("setOption_result"); - - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { -; - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - }}); - - static { - FieldMetaData.addStructMetaDataMap(setOption_result.class, metaDataMap); - } - - public setOption_result() { - } - - /** - * Performs a deep copy on other. - */ - public setOption_result(setOption_result other) { - } - - public setOption_result deepCopy() { - return new setOption_result(this); - } - - @Deprecated - public setOption_result clone() { - return new setOption_result(this); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof setOption_result) - return this.equals((setOption_result)that); - return false; - } - - public boolean equals(setOption_result that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(setOption_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - setOption_result typedOther = (setOption_result)other; - - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - oprot.writeStructBegin(STRUCT_DESC); - - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("setOption_result("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class getOption_args implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("getOption_args"); - - private static final TField KEY_FIELD_DESC = new TField("key", TType.STRING, (short)1); - - public String key; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { - KEY((short)1, "key"); - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.KEY, new FieldMetaData("key", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - }}); - - static { - FieldMetaData.addStructMetaDataMap(getOption_args.class, metaDataMap); - } - - public getOption_args() { - } - - public getOption_args( - String key) - { - this(); - this.key = key; - } - - /** - * Performs a deep copy on other. - */ - public getOption_args(getOption_args other) { - if (other.isSetKey()) { - this.key = other.key; - } - } - - public getOption_args deepCopy() { - return new getOption_args(this); - } - - @Deprecated - public getOption_args clone() { - return new getOption_args(this); - } - - public String getKey() { - return this.key; - } - - public getOption_args setKey(String key) { - this.key = key; - return this; - } - - public void unsetKey() { - this.key = null; - } - - /** Returns true if field key is set (has been asigned a value) and false otherwise */ - public boolean isSetKey() { - return this.key != null; - } - - public void setKeyIsSet(boolean value) { - if (!value) { - this.key = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case KEY: - if (value == null) { - unsetKey(); - } else { - setKey((String)value); - } - break; - - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case KEY: - return getKey(); - - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - case KEY: - return isSetKey(); - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getOption_args) - return this.equals((getOption_args)that); - return false; - } - - public boolean equals(getOption_args that) { - if (that == null) - return false; - - boolean this_present_key = true && this.isSetKey(); - boolean that_present_key = true && that.isSetKey(); - if (this_present_key || that_present_key) { - if (!(this_present_key && that_present_key)) - return false; - if (!this.key.equals(that.key)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(getOption_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getOption_args typedOther = (getOption_args)other; - - lastComparison = Boolean.valueOf(isSetKey()).compareTo(isSetKey()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(key, typedOther.key); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - case KEY: - if (field.type == TType.STRING) { - this.key = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.key != null) { - oprot.writeFieldBegin(KEY_FIELD_DESC); - oprot.writeString(this.key); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getOption_args("); - boolean first = true; - - sb.append("key:"); - if (this.key == null) { - sb.append("null"); - } else { - sb.append(this.key); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class getOption_result implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("getOption_result"); - - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRING, (short)0); - - public String success; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - }}); - - static { - FieldMetaData.addStructMetaDataMap(getOption_result.class, metaDataMap); - } - - public getOption_result() { - } - - public getOption_result( - String success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getOption_result(getOption_result other) { - if (other.isSetSuccess()) { - this.success = other.success; - } - } - - public getOption_result deepCopy() { - return new getOption_result(this); - } - - @Deprecated - public getOption_result clone() { - return new getOption_result(this); - } - - public String getSuccess() { - return this.success; - } - - public getOption_result setSuccess(String success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been asigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((String)value); - } - break; - - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getOption_result) - return this.equals((getOption_result)that); - return false; - } - - public boolean equals(getOption_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(getOption_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getOption_result typedOther = (getOption_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - case SUCCESS: - if (field.type == TType.STRING) { - this.success = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getOption_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class getOptions_args implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("getOptions_args"); - - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { -; - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - }}); - - static { - FieldMetaData.addStructMetaDataMap(getOptions_args.class, metaDataMap); - } - - public getOptions_args() { - } - - /** - * Performs a deep copy on other. - */ - public getOptions_args(getOptions_args other) { - } - - public getOptions_args deepCopy() { - return new getOptions_args(this); - } - - @Deprecated - public getOptions_args clone() { - return new getOptions_args(this); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getOptions_args) - return this.equals((getOptions_args)that); - return false; - } - - public boolean equals(getOptions_args that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(getOptions_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getOptions_args typedOther = (getOptions_args)other; - - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getOptions_args("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class getOptions_result implements TBase, java.io.Serializable, Cloneable { - private static final TStruct STRUCT_DESC = new TStruct("getOptions_result"); - - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.MAP, (short)0); - - public Map success; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new MapMetaData(TType.MAP, - new FieldValueMetaData(TType.STRING), - new FieldValueMetaData(TType.STRING)))); - }}); - - static { - FieldMetaData.addStructMetaDataMap(getOptions_result.class, metaDataMap); - } - - public getOptions_result() { - } - - public getOptions_result( - Map success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getOptions_result(getOptions_result other) { - if (other.isSetSuccess()) { - Map __this__success = new HashMap(); - for (Map.Entry other_element : other.success.entrySet()) { - - String other_element_key = other_element.getKey(); - String other_element_value = other_element.getValue(); - - String __this__success_copy_key = other_element_key; - - String __this__success_copy_value = other_element_value; - - __this__success.put(__this__success_copy_key, __this__success_copy_value); - } - this.success = __this__success; - } - } - - public getOptions_result deepCopy() { - return new getOptions_result(this); - } - - @Deprecated - public getOptions_result clone() { - return new getOptions_result(this); - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public void putToSuccess(String key, String val) { - if (this.success == null) { - this.success = new HashMap(); - } - this.success.put(key, val); - } - - public Map getSuccess() { - return this.success; - } - - public getOptions_result setSuccess(Map success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been asigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Map)value); - } - break; - - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getOptions_result) - return this.equals((getOptions_result)that); - return false; - } - - public boolean equals(getOptions_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - case SUCCESS: - if (field.type == TType.MAP) { - { - TMap _map5 = iprot.readMapBegin(); - this.success = new HashMap(2*_map5.size); - for (int _i6 = 0; _i6 < _map5.size; ++_i6) - { - String _key7; - String _val8; - _key7 = iprot.readString(); - _val8 = iprot.readString(); - this.success.put(_key7, _val8); - } - iprot.readMapEnd(); - } - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.success.size())); - for (Map.Entry _iter9 : this.success.entrySet()) - { - oprot.writeString(_iter9.getKey()); - oprot.writeString(_iter9.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getOptions_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class getCpuProfile_args implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("getCpuProfile_args"); - - private static final TField PROFILE_DURATION_IN_SEC_FIELD_DESC = new TField("profileDurationInSec", TType.I32, (short)1); - - public int profileDurationInSec; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { - PROFILE_DURATION_IN_SEC((short)1, "profileDurationInSec"); - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __PROFILEDURATIONINSEC_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.PROFILE_DURATION_IN_SEC, new FieldMetaData("profileDurationInSec", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I32))); - }}); - - static { - FieldMetaData.addStructMetaDataMap(getCpuProfile_args.class, metaDataMap); - } - - public getCpuProfile_args() { - } - - public getCpuProfile_args( - int profileDurationInSec) - { - this(); - this.profileDurationInSec = profileDurationInSec; - setProfileDurationInSecIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public getCpuProfile_args(getCpuProfile_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - this.profileDurationInSec = other.profileDurationInSec; - } - - public getCpuProfile_args deepCopy() { - return new getCpuProfile_args(this); - } - - @Deprecated - public getCpuProfile_args clone() { - return new getCpuProfile_args(this); - } - - public int getProfileDurationInSec() { - return this.profileDurationInSec; - } - - public getCpuProfile_args setProfileDurationInSec(int profileDurationInSec) { - this.profileDurationInSec = profileDurationInSec; - setProfileDurationInSecIsSet(true); - return this; - } - - public void unsetProfileDurationInSec() { - __isset_bit_vector.clear(__PROFILEDURATIONINSEC_ISSET_ID); - } - - /** Returns true if field profileDurationInSec is set (has been asigned a value) and false otherwise */ - public boolean isSetProfileDurationInSec() { - return __isset_bit_vector.get(__PROFILEDURATIONINSEC_ISSET_ID); - } - - public void setProfileDurationInSecIsSet(boolean value) { - __isset_bit_vector.set(__PROFILEDURATIONINSEC_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case PROFILE_DURATION_IN_SEC: - if (value == null) { - unsetProfileDurationInSec(); - } else { - setProfileDurationInSec((Integer)value); - } - break; - - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case PROFILE_DURATION_IN_SEC: - return new Integer(getProfileDurationInSec()); - - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - case PROFILE_DURATION_IN_SEC: - return isSetProfileDurationInSec(); - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getCpuProfile_args) - return this.equals((getCpuProfile_args)that); - return false; - } - - public boolean equals(getCpuProfile_args that) { - if (that == null) - return false; - - boolean this_present_profileDurationInSec = true; - boolean that_present_profileDurationInSec = true; - if (this_present_profileDurationInSec || that_present_profileDurationInSec) { - if (!(this_present_profileDurationInSec && that_present_profileDurationInSec)) - return false; - if (this.profileDurationInSec != that.profileDurationInSec) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(getCpuProfile_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getCpuProfile_args typedOther = (getCpuProfile_args)other; - - lastComparison = Boolean.valueOf(isSetProfileDurationInSec()).compareTo(isSetProfileDurationInSec()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(profileDurationInSec, typedOther.profileDurationInSec); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - case PROFILE_DURATION_IN_SEC: - if (field.type == TType.I32) { - this.profileDurationInSec = iprot.readI32(); - setProfileDurationInSecIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(PROFILE_DURATION_IN_SEC_FIELD_DESC); - oprot.writeI32(this.profileDurationInSec); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getCpuProfile_args("); - boolean first = true; - - sb.append("profileDurationInSec:"); - sb.append(this.profileDurationInSec); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class getCpuProfile_result implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("getCpuProfile_result"); - - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRING, (short)0); - - public String success; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - }}); - - static { - FieldMetaData.addStructMetaDataMap(getCpuProfile_result.class, metaDataMap); - } - - public getCpuProfile_result() { - } - - public getCpuProfile_result( - String success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public getCpuProfile_result(getCpuProfile_result other) { - if (other.isSetSuccess()) { - this.success = other.success; - } - } - - public getCpuProfile_result deepCopy() { - return new getCpuProfile_result(this); - } - - @Deprecated - public getCpuProfile_result clone() { - return new getCpuProfile_result(this); - } - - public String getSuccess() { - return this.success; - } - - public getCpuProfile_result setSuccess(String success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been asigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((String)value); - } - break; - - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getCpuProfile_result) - return this.equals((getCpuProfile_result)that); - return false; - } - - public boolean equals(getCpuProfile_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(getCpuProfile_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getCpuProfile_result typedOther = (getCpuProfile_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - case SUCCESS: - if (field.type == TType.STRING) { - this.success = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getCpuProfile_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class aliveSince_args implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("aliveSince_args"); - - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { -; - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - }}); - - static { - FieldMetaData.addStructMetaDataMap(aliveSince_args.class, metaDataMap); - } - - public aliveSince_args() { - } - - /** - * Performs a deep copy on other. - */ - public aliveSince_args(aliveSince_args other) { - } - - public aliveSince_args deepCopy() { - return new aliveSince_args(this); - } - - @Deprecated - public aliveSince_args clone() { - return new aliveSince_args(this); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof aliveSince_args) - return this.equals((aliveSince_args)that); - return false; - } - - public boolean equals(aliveSince_args that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(aliveSince_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - aliveSince_args typedOther = (aliveSince_args)other; - - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("aliveSince_args("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class aliveSince_result implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("aliveSince_result"); - - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I64, (short)0); - - public long success; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.I64))); - }}); - - static { - FieldMetaData.addStructMetaDataMap(aliveSince_result.class, metaDataMap); - } - - public aliveSince_result() { - } - - public aliveSince_result( - long success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public aliveSince_result(aliveSince_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - this.success = other.success; - } - - public aliveSince_result deepCopy() { - return new aliveSince_result(this); - } - - @Deprecated - public aliveSince_result clone() { - return new aliveSince_result(this); - } - - public long getSuccess() { - return this.success; - } - - public aliveSince_result setSuccess(long success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been asigned a value) and false otherwise */ - public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Long)value); - } - break; - - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return new Long(getSuccess()); - - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof aliveSince_result) - return this.equals((aliveSince_result)that); - return false; - } - - public boolean equals(aliveSince_result that) { - if (that == null) - return false; - - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(aliveSince_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - aliveSince_result typedOther = (aliveSince_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - case SUCCESS: - if (field.type == TType.I64) { - this.success = iprot.readI64(); - setSuccessIsSet(true); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI64(this.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("aliveSince_result("); - boolean first = true; - - sb.append("success:"); - sb.append(this.success); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class reinitialize_args implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("reinitialize_args"); - - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { -; - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - }}); - - static { - FieldMetaData.addStructMetaDataMap(reinitialize_args.class, metaDataMap); - } - - public reinitialize_args() { - } - - /** - * Performs a deep copy on other. - */ - public reinitialize_args(reinitialize_args other) { - } - - public reinitialize_args deepCopy() { - return new reinitialize_args(this); - } - - @Deprecated - public reinitialize_args clone() { - return new reinitialize_args(this); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof reinitialize_args) - return this.equals((reinitialize_args)that); - return false; - } - - public boolean equals(reinitialize_args that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(reinitialize_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - reinitialize_args typedOther = (reinitialize_args)other; - - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("reinitialize_args("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class shutdown_args implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("shutdown_args"); - - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { -; - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - }}); - - static { - FieldMetaData.addStructMetaDataMap(shutdown_args.class, metaDataMap); - } - - public shutdown_args() { - } - - /** - * Performs a deep copy on other. - */ - public shutdown_args(shutdown_args other) { - } - - public shutdown_args deepCopy() { - return new shutdown_args(this); - } - - @Deprecated - public shutdown_args clone() { - return new shutdown_args(this); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof shutdown_args) - return this.equals((shutdown_args)that); - return false; - } - - public boolean equals(shutdown_args that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(shutdown_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - shutdown_args typedOther = (shutdown_args)other; - - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("shutdown_args("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/com/facebook/fb303/fb_status.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/com/facebook/fb303/fb_status.java deleted file mode 100644 index bb7b132477..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/com/facebook/fb303/fb_status.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * Autogenerated by Thrift - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package generated.com.facebook.fb303; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; -/** - * Common status reporting mechanism across all services - */ -public enum fb_status implements TEnum{ - DEAD(0), - STARTING(1), - ALIVE(2), - STOPPING(3), - STOPPED(4), - WARNING(5); - - private static final Map BY_VALUE = new HashMap() {{ - for(fb_status val : fb_status.values()) { - put(val.getValue(), val); - } - }}; - - private final int value; - - private fb_status(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static fb_status findByValue(int value) { - return BY_VALUE.get(value); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/scribe/thrift/LogEntry.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/scribe/thrift/LogEntry.java deleted file mode 100644 index c06570d9ef..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/scribe/thrift/LogEntry.java +++ /dev/null @@ -1,411 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * Autogenerated by Thrift - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package generated.scribe.thrift; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.apache.thrift.*; -import org.apache.thrift.meta_data.*; -import org.apache.thrift.protocol.*; - -public class LogEntry implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("LogEntry"); - - private static final TField CATEGORY_FIELD_DESC = new TField("category", TType.STRING, (short)1); - private static final TField MESSAGE_FIELD_DESC = new TField("message", TType.STRING, (short)2); - - public String category; - public String message; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { - CATEGORY((short)1, "category"), - MESSAGE((short)2, "message"); - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.CATEGORY, new FieldMetaData("category", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - put(_Fields.MESSAGE, new FieldMetaData("message", TFieldRequirementType.DEFAULT, - new FieldValueMetaData(TType.STRING))); - }}); - - static { - FieldMetaData.addStructMetaDataMap(LogEntry.class, metaDataMap); - } - - public LogEntry() { - } - - public LogEntry( - String category, - String message) - { - this(); - this.category = category; - this.message = message; - } - - /** - * Performs a deep copy on other. - */ - public LogEntry(LogEntry other) { - if (other.isSetCategory()) { - this.category = other.category; - } - if (other.isSetMessage()) { - this.message = other.message; - } - } - - public LogEntry deepCopy() { - return new LogEntry(this); - } - - @Deprecated - public LogEntry clone() { - return new LogEntry(this); - } - - public String getCategory() { - return this.category; - } - - public LogEntry setCategory(String category) { - this.category = category; - return this; - } - - public void unsetCategory() { - this.category = null; - } - - /** Returns true if field category is set (has been asigned a value) and false otherwise */ - public boolean isSetCategory() { - return this.category != null; - } - - public void setCategoryIsSet(boolean value) { - if (!value) { - this.category = null; - } - } - - public String getMessage() { - return this.message; - } - - public LogEntry setMessage(String message) { - this.message = message; - return this; - } - - public void unsetMessage() { - this.message = null; - } - - /** Returns true if field message is set (has been asigned a value) and false otherwise */ - public boolean isSetMessage() { - return this.message != null; - } - - public void setMessageIsSet(boolean value) { - if (!value) { - this.message = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case CATEGORY: - if (value == null) { - unsetCategory(); - } else { - setCategory((String)value); - } - break; - - case MESSAGE: - if (value == null) { - unsetMessage(); - } else { - setMessage((String)value); - } - break; - - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case CATEGORY: - return getCategory(); - - case MESSAGE: - return getMessage(); - - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - case CATEGORY: - return isSetCategory(); - case MESSAGE: - return isSetMessage(); - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof LogEntry) - return this.equals((LogEntry)that); - return false; - } - - public boolean equals(LogEntry that) { - if (that == null) - return false; - - boolean this_present_category = true && this.isSetCategory(); - boolean that_present_category = true && that.isSetCategory(); - if (this_present_category || that_present_category) { - if (!(this_present_category && that_present_category)) - return false; - if (!this.category.equals(that.category)) - return false; - } - - boolean this_present_message = true && this.isSetMessage(); - boolean that_present_message = true && that.isSetMessage(); - if (this_present_message || that_present_message) { - if (!(this_present_message && that_present_message)) - return false; - if (!this.message.equals(that.message)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(LogEntry other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - LogEntry typedOther = (LogEntry)other; - - lastComparison = Boolean.valueOf(isSetCategory()).compareTo(isSetCategory()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(category, typedOther.category); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = Boolean.valueOf(isSetMessage()).compareTo(isSetMessage()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(message, typedOther.message); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - case CATEGORY: - if (field.type == TType.STRING) { - this.category = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - case MESSAGE: - if (field.type == TType.STRING) { - this.message = iprot.readString(); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.category != null) { - oprot.writeFieldBegin(CATEGORY_FIELD_DESC); - oprot.writeString(this.category); - oprot.writeFieldEnd(); - } - if (this.message != null) { - oprot.writeFieldBegin(MESSAGE_FIELD_DESC); - oprot.writeString(this.message); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("LogEntry("); - boolean first = true; - - sb.append("category:"); - if (this.category == null) { - sb.append("null"); - } else { - sb.append(this.category); - } - first = false; - if (!first) sb.append(", "); - sb.append("message:"); - if (this.message == null) { - sb.append("null"); - } else { - sb.append(this.message); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - -} - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/scribe/thrift/ResultCode.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/scribe/thrift/ResultCode.java deleted file mode 100644 index 2bf826d06a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/scribe/thrift/ResultCode.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * Autogenerated by Thrift - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package generated.scribe.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; -public enum ResultCode implements TEnum{ - OK(0), - TRY_LATER(1); - - private static final Map BY_VALUE = new HashMap() {{ - for(ResultCode val : ResultCode.values()) { - put(val.getValue(), val); - } - }}; - - private final int value; - - private ResultCode(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static ResultCode findByValue(int value) { - return BY_VALUE.get(value); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/scribe/thrift/scribe.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/scribe/thrift/scribe.java deleted file mode 100644 index 40b4ca774b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/generated/scribe/thrift/scribe.java +++ /dev/null @@ -1,772 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * Autogenerated by Thrift - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package generated.scribe.thrift; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.apache.thrift.*; -import org.apache.thrift.meta_data.*; -import org.apache.thrift.protocol.*; - -public class scribe { - - public interface Iface extends generated.com.facebook.fb303.FacebookService.Iface { - - public ResultCode Log(List messages) throws TException; - - } - - public static class Client extends generated.com.facebook.fb303.FacebookService.Client implements Iface { - public Client(TProtocol prot) - { - this(prot, prot); - } - - public Client(TProtocol iprot, TProtocol oprot) - { - super(iprot, oprot); - } - - public ResultCode Log(List messages) throws TException - { - send_Log(messages); - return recv_Log(); - } - - public void send_Log(List messages) throws TException - { - oprot_.writeMessageBegin(new TMessage("Log", TMessageType.CALL, seqid_)); - Log_args args = new Log_args(); - args.messages = messages; - args.write(oprot_); - oprot_.writeMessageEnd(); - oprot_.getTransport().flush(); - } - - public ResultCode recv_Log() throws TException - { - TMessage msg = iprot_.readMessageBegin(); - if (msg.type == TMessageType.EXCEPTION) { - TApplicationException x = TApplicationException.read(iprot_); - iprot_.readMessageEnd(); - throw x; - } - Log_result result = new Log_result(); - result.read(iprot_); - iprot_.readMessageEnd(); - if (result.isSetSuccess()) { - return result.success; - } - throw new TApplicationException(TApplicationException.MISSING_RESULT, "Log failed: unknown result"); - } - - } - public static class Processor extends generated.com.facebook.fb303.FacebookService.Processor implements TProcessor { - private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); - public Processor(Iface iface) - { - super(iface); - iface_ = iface; - processMap_.put("Log", new Log()); - } - - private Iface iface_; - - public boolean process(TProtocol iprot, TProtocol oprot) throws TException - { - TMessage msg = iprot.readMessageBegin(); - ProcessFunction fn = processMap_.get(msg.name); - if (fn == null) { - TProtocolUtil.skip(iprot, TType.STRUCT); - iprot.readMessageEnd(); - TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'"); - oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid)); - x.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - return true; - } - fn.process(msg.seqid, iprot, oprot); - return true; - } - - private class Log implements ProcessFunction { - public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException - { - Log_args args = new Log_args(); - args.read(iprot); - iprot.readMessageEnd(); - Log_result result = new Log_result(); - result.success = iface_.Log(args.messages); - oprot.writeMessageBegin(new TMessage("Log", TMessageType.REPLY, seqid)); - result.write(oprot); - oprot.writeMessageEnd(); - oprot.getTransport().flush(); - } - - } - - } - - public static class Log_args implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("Log_args"); - - private static final TField MESSAGES_FIELD_DESC = new TField("messages", TType.LIST, (short)1); - - public List messages; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { - MESSAGES((short)1, "messages"); - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.MESSAGES, new FieldMetaData("messages", TFieldRequirementType.DEFAULT, - new ListMetaData(TType.LIST, - new StructMetaData(TType.STRUCT, LogEntry.class)))); - }}); - - static { - FieldMetaData.addStructMetaDataMap(Log_args.class, metaDataMap); - } - - public Log_args() { - } - - public Log_args( - List messages) - { - this(); - this.messages = messages; - } - - /** - * Performs a deep copy on other. - */ - public Log_args(Log_args other) { - if (other.isSetMessages()) { - List __this__messages = new ArrayList(); - for (LogEntry other_element : other.messages) { - __this__messages.add(new LogEntry(other_element)); - } - this.messages = __this__messages; - } - } - - public Log_args deepCopy() { - return new Log_args(this); - } - - @Deprecated - public Log_args clone() { - return new Log_args(this); - } - - public int getMessagesSize() { - return (this.messages == null) ? 0 : this.messages.size(); - } - - public java.util.Iterator getMessagesIterator() { - return (this.messages == null) ? null : this.messages.iterator(); - } - - public void addToMessages(LogEntry elem) { - if (this.messages == null) { - this.messages = new ArrayList(); - } - this.messages.add(elem); - } - - public List getMessages() { - return this.messages; - } - - public Log_args setMessages(List messages) { - this.messages = messages; - return this; - } - - public void unsetMessages() { - this.messages = null; - } - - /** Returns true if field messages is set (has been asigned a value) and false otherwise */ - public boolean isSetMessages() { - return this.messages != null; - } - - public void setMessagesIsSet(boolean value) { - if (!value) { - this.messages = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case MESSAGES: - if (value == null) { - unsetMessages(); - } else { - setMessages((List)value); - } - break; - - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case MESSAGES: - return getMessages(); - - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - case MESSAGES: - return isSetMessages(); - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof Log_args) - return this.equals((Log_args)that); - return false; - } - - public boolean equals(Log_args that) { - if (that == null) - return false; - - boolean this_present_messages = true && this.isSetMessages(); - boolean that_present_messages = true && that.isSetMessages(); - if (this_present_messages || that_present_messages) { - if (!(this_present_messages && that_present_messages)) - return false; - if (!this.messages.equals(that.messages)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(Log_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - Log_args typedOther = (Log_args)other; - - lastComparison = Boolean.valueOf(isSetMessages()).compareTo(isSetMessages()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(messages, typedOther.messages); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - case MESSAGES: - if (field.type == TType.LIST) { - { - TList _list0 = iprot.readListBegin(); - this.messages = new ArrayList(_list0.size); - for (int _i1 = 0; _i1 < _list0.size; ++_i1) - { - LogEntry _elem2; - _elem2 = new LogEntry(); - _elem2.read(iprot); - this.messages.add(_elem2); - } - iprot.readListEnd(); - } - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.messages != null) { - oprot.writeFieldBegin(MESSAGES_FIELD_DESC); - { - oprot.writeListBegin(new TList(TType.STRUCT, this.messages.size())); - for (LogEntry _iter3 : this.messages) - { - _iter3.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("Log_args("); - boolean first = true; - - sb.append("messages:"); - if (this.messages == null) { - sb.append("null"); - } else { - sb.append(this.messages); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - - public static class Log_result implements TBase, java.io.Serializable, Cloneable, Comparable { - private static final TStruct STRUCT_DESC = new TStruct("Log_result"); - - private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I32, (short)0); - - /** - * - * @see ResultCode - */ - public ResultCode success; - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements TFieldIdEnum { - /** - * - * @see ResultCode - */ - SUCCESS((short)0, "success"); - - private static final Map byId = new HashMap(); - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byId.put((int)field._thriftId, field); - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - return byId.get(fieldId); - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - - public static final Map<_Fields, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new EnumMap<_Fields, FieldMetaData>(_Fields.class) {{ - put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, - new EnumMetaData(TType.ENUM, ResultCode.class))); - }}); - - static { - FieldMetaData.addStructMetaDataMap(Log_result.class, metaDataMap); - } - - public Log_result() { - } - - public Log_result( - ResultCode success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public Log_result(Log_result other) { - if (other.isSetSuccess()) { - this.success = other.success; - } - } - - public Log_result deepCopy() { - return new Log_result(this); - } - - @Deprecated - public Log_result clone() { - return new Log_result(this); - } - - /** - * - * @see ResultCode - */ - public ResultCode getSuccess() { - return this.success; - } - - /** - * - * @see ResultCode - */ - public Log_result setSuccess(ResultCode success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been asigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((ResultCode)value); - } - break; - - } - } - - public void setFieldValue(int fieldID, Object value) { - setFieldValue(_Fields.findByThriftIdOrThrow(fieldID), value); - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - public Object getFieldValue(int fieldId) { - return getFieldValue(_Fields.findByThriftIdOrThrow(fieldId)); - } - - /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - public boolean isSet(int fieldID) { - return isSet(_Fields.findByThriftIdOrThrow(fieldID)); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof Log_result) - return this.equals((Log_result)that); - return false; - } - - public boolean equals(Log_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(Log_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - Log_result typedOther = (Log_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - lastComparison = TBaseHelper.compareTo(success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - return 0; - } - - public void read(TProtocol iprot) throws TException { - TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == TType.STOP) { - break; - } - _Fields fieldId = _Fields.findByThriftId(field.id); - if (fieldId == null) { - TProtocolUtil.skip(iprot, field.type); - } else { - switch (fieldId) { - case SUCCESS: - if (field.type == TType.I32) { - this.success = ResultCode.findByValue(iprot.readI32()); - } else { - TProtocolUtil.skip(iprot, field.type); - } - break; - } - iprot.readFieldEnd(); - } - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(TProtocol oprot) throws TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI32(this.success.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("Log_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - String success_name = success.name(); - if (success_name != null) { - sb.append(success_name); - sb.append(" ("); - } - sb.append(this.success); - if (success_name != null) { - sb.append(")"); - } - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws TException { - // check for required fields - } - - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/HelloWorld.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/HelloWorld.java deleted file mode 100644 index 7fb20fe5f4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/HelloWorld.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface HelloWorld { - - String sayHello(String name); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/HelloWorldImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/HelloWorldImpl.java deleted file mode 100644 index d90af4c792..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/HelloWorldImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Reference; - -public class HelloWorldImpl implements HelloWorld { - - @Reference - public Logger logger; - - public String sayHello(String name) { - logger.log("sample", "HelloWorldImpl.sayHello " + name); - return "Hello " + name; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/Logger.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/Logger.java deleted file mode 100644 index aab9ec27c1..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/Logger.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Logger { - - int log(String category, String message); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/ScribeLoggerImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/ScribeLoggerImpl.java deleted file mode 100644 index 10c2e079fd..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/java/sample/ScribeLoggerImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import generated.scribe.thrift.scribe; -import generated.scribe.thrift.LogEntry; -import java.util.Collections; -import org.apache.thrift.TException; -import org.apache.thrift.transport.TSocket; -import org.apache.thrift.transport.TTransport; -import org.apache.thrift.transport.TFramedTransport; -import org.apache.thrift.protocol.TProtocol; -import org.apache.thrift.protocol.TBinaryProtocol; -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.Property; -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Destroy; - -@Scope("COMPOSITE") -public class ScribeLoggerImpl implements Logger { - - @Property - public String host; - - @Property - public int port; - - scribe.Client scribe; - TTransport transport; - - @Init - public void init() { - try { - final TSocket socket = new TSocket(host, port); - socket.setTimeout(1000); - transport = new TFramedTransport(socket); - final TProtocol protocol = new TBinaryProtocol(transport); - scribe = new scribe.Client(protocol); - transport.open(); - } catch (TException e) { - e.printStackTrace(); - } - } - - @Destroy - public void destroy() { - transport.close(); - } - - public int log(String category, String message) { - try { - scribe.Log(Collections.singletonList(new LogEntry(category, message))); - return 1; - } catch (TException e) { - e.printStackTrace(); - return 0; - } - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index fe284f2c10..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/fb303.thrift b/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/fb303.thrift deleted file mode 100644 index 4926b7a736..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/fb303.thrift +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * fb303.thrift - */ - -namespace java generated.com.facebook.fb303 -namespace cpp facebook.fb303 -namespace perl Facebook.FB303 - -/** - * Common status reporting mechanism across all services - */ -enum fb_status { - DEAD = 0, - STARTING = 1, - ALIVE = 2, - STOPPING = 3, - STOPPED = 4, - WARNING = 5, -} - -/** - * Standard base service - */ -service FacebookService { - - /** - * Returns a descriptive name of the service - */ - string getName(), - - /** - * Returns the version of the service - */ - string getVersion(), - - /** - * Gets the status of this service - */ - fb_status getStatus(), - - /** - * User friendly description of status, such as why the service is in - * the dead or warning state, or what is being started or stopped. - */ - string getStatusDetails(), - - /** - * Gets the counters for this service - */ - map getCounters(), - - /** - * Gets the value of a single counter - */ - i64 getCounter(1: string key), - - /** - * Sets an option - */ - void setOption(1: string key, 2: string value), - - /** - * Gets an option - */ - string getOption(1: string key), - - /** - * Gets all options - */ - map getOptions(), - - /** - * Returns a CPU profile over the given time interval (client and server - * must agree on the profile format). - */ - string getCpuProfile(1: i32 profileDurationInSec), - - /** - * Returns the unix time that the server has been running since - */ - i64 aliveSince(), - - /** - * Tell the server to reload its configuration, reopen log files, etc - */ - oneway void reinitialize(), - - /** - * Suggest a shutdown to the server - */ - oneway void shutdown(), - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/scribe.composite b/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/scribe.composite deleted file mode 100644 index b075a13843..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/scribe.composite +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - localhost - 1463 - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/scribe.thrift b/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/scribe.thrift deleted file mode 100644 index 468412f38e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/main/resources/scribe.thrift +++ /dev/null @@ -1,38 +0,0 @@ -## Copyright (c) 2007-2008 Facebook -## -## 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. -## -## See accompanying file LICENSE or visit the Scribe site at: -## http://developers.facebook.com/scribe/ - -include "fb303.thrift" - -namespace cpp scribe.thrift -namespace java generated.scribe.thrift - -enum ResultCode -{ - OK, - TRY_LATER -} - -struct LogEntry -{ - 1: string category, - 2: string message -} - -service scribe extends fb303.FacebookService -{ - ResultCode Log(1: list messages); -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/test/java/sample/LoggingTest.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/test/java/sample/LoggingTest.java deleted file mode 100644 index 4232365f81..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/helloworld-scribe/src/test/java/sample/LoggingTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import sample.HelloWorld; -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -public class LoggingTest { - - @Test - public void testSayHello() { - NodeFactory nf = NodeFactory.newInstance(); - Node node = nf.createNode((String)null, new String[] {"target/classes"}).start(); - HelloWorld hw = node.getService(HelloWorld.class, "HelloWorld"); - assertEquals("Hello There", hw.sayHello("There")); - node.stop(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/pom.xml deleted file mode 100644 index a6a15b058c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/logging-scribe/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-sample-logging-scribe - pom - Apache Tuscany SCA Sample Logging Scribe - - - - default - - true - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/applications/pom.xml deleted file mode 100644 index 5f46e87c0c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-samples-applications - org.apache.tuscany.sca - pom - Apache Tuscany Sample Applications - - - - default - - true - - - logging-scribe - store - store-webapp - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/README b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/README deleted file mode 100644 index 46e71bf51e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/README +++ /dev/null @@ -1,28 +0,0 @@ -Store Sample -====================================== - -This is a sample store scenario that is used as a getting started guide -for Tuscany SCA. For detailed information, please see: - -http://tuscany.apache.org/getting-started-with-tuscany.html - -or - -http://tuscany.apache.org/getting-started-with-tuscany-using-tuscany-eclipse-plugin.html - - -Building And Running The Sample Using Ant ------------------------------------------ -With the binary distribution the sample can be built using Ant as follows: - -cd store -ant compile - -and then, to run: - -ant run - -Once the store application is running use your browser to visit the following -URL: - -http://localhost:8080/store/ diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/pom.xml deleted file mode 100644 index 1e28068fd3..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/pom.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-store-webapp - war - Apache Tuscany SCA Sample Getting Started Online Store as WebApp - - - - org.apache.tuscany.sca - tuscany-base-runtime - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-data-api - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-binding-atom-runtime - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-binding-atom-js-dojo - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-binding-http-runtime - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-binding-jsonrpc-runtime - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-binding-jsonrpc-js-dojo - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-implementation-widget-runtime - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-implementation-widget-runtime-dojo - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-web-javascript-dojo - 2.0-Beta2-SNAPSHOT - - - - - junit - junit - 4.8.1 - test - - - - - - ${artifactId} - - - org.codehaus.mojo - tomcat-maven-plugin - 1.0-beta-1 - - - - tomcat - - /${artifactId} - - - - org.mortbay.jetty - maven-jetty-plugin - 6.1.18 - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/Cart.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/Cart.java deleted file mode 100644 index 3fb5439bc3..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/Cart.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.apache.tuscany.sca.data.collection.Collection; -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Cart extends Collection { - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/Catalog.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/Catalog.java deleted file mode 100644 index b5e504fe11..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/Catalog.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Catalog { - Item[] get(); -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/CurrencyConverter.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/CurrencyConverter.java deleted file mode 100644 index a064f3dd69..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/CurrencyConverter.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface CurrencyConverter { - public double getConversion(String fromCurrenycCode, String toCurrencyCode, double amount); - - public String getCurrencySymbol(String currencyCode); -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/CurrencyConverterImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/CurrencyConverterImpl.java deleted file mode 100644 index c354aed447..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/CurrencyConverterImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -public class CurrencyConverterImpl implements CurrencyConverter { - public double getConversion(String fromCurrencyCode, String toCurrencyCode, double amount) { - if (toCurrencyCode.equals("USD")) - return amount; - else if (toCurrencyCode.equals("EUR")) - return ((double)Math.round(amount * 0.7256 * 100)) /100; - return 0; - } - - public String getCurrencySymbol(String currencyCode) { - if (currencyCode.equals("USD")) - return "$"; - else if (currencyCode.equals("EUR")) - return "E"; //"€"; - return "?"; - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/FruitsCatalogImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/FruitsCatalogImpl.java deleted file mode 100644 index d132a24b00..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/FruitsCatalogImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import java.util.ArrayList; -import java.util.List; - -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Property; -import org.oasisopen.sca.annotation.Reference; - -public class FruitsCatalogImpl implements Catalog { - - @Property - public String currencyCode = "USD"; - - @Reference - public CurrencyConverter currencyConverter; - - private List catalog = new ArrayList(); - - @Init - public void init() { - String currencySymbol = currencyConverter.getCurrencySymbol(currencyCode); - catalog.add(new Item("Apple", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 2.99))); - catalog.add(new Item("Orange", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 3.55))); - catalog.add(new Item("Pear", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 1.55))); - } - - public Item[] get() { - Item[] catalogArray = new Item[catalog.size()]; - catalog.toArray(catalogArray); - return catalogArray; - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/Item.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/Item.java deleted file mode 100644 index 27abd4f016..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/Item.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - - -public class Item { - private String name; - private String price; - - public Item() { - } - - public Item(String name, String price) { - this.name = name; - this.price = price; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/ShoppingCartImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/ShoppingCartImpl.java deleted file mode 100644 index 698614212d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/ShoppingCartImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import org.apache.tuscany.sca.data.collection.Entry; -import org.apache.tuscany.sca.data.collection.NotFoundException; -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Scope; - -@Scope("COMPOSITE") -public class ShoppingCartImpl implements Cart, Total { - - private Map cart; - - @Init - public void init() { - cart = new HashMap(); - } - - public Entry[] getAll() { - Entry[] entries = new Entry[cart.size()]; - int i = 0; - for (Map.Entry e: cart.entrySet()) { - entries[i++] = new Entry(e.getKey(), e.getValue()); - } - return entries; - } - - public Item get(String key) throws NotFoundException { - Item item = cart.get(key); - if (item == null) { - throw new NotFoundException(key); - } else { - return item; - } - } - - public String post(String key, Item item) { - if (key == null) { - key ="cart-" + UUID.randomUUID().toString(); - } - cart.put(key, item); - return key; - } - - public void put(String key, Item item) throws NotFoundException { - if (!cart.containsKey(key)) { - throw new NotFoundException(key); - } - cart.put(key, item); - } - - public void delete(String key) throws NotFoundException { - if (key == null || key.equals("")) { - cart.clear(); - } else { - Item item = cart.remove(key); - if (item == null) - throw new NotFoundException(key); - } - } - - public Entry[] query(String queryString) { - List> entries = new ArrayList>(); - if (queryString.startsWith("name=")) { - String name = queryString.substring(5); - for (Map.Entry e: cart.entrySet()) { - Item item = e.getValue(); - if (item.getName().equals(name)) { - entries.add(new Entry(e.getKey(), e.getValue())); - } - } - } - return entries.toArray(new Entry[entries.size()]); - } - - public String getTotal() { - double total = 0; - String currencySymbol = ""; - if (!cart.isEmpty()) { - Item item = cart.values().iterator().next(); - currencySymbol = item.getPrice().substring(0, 1); - } - for (Item item : cart.values()) { - total += Double.valueOf(item.getPrice().substring(1)); - } - return currencySymbol + String.valueOf(total); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/Total.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/Total.java deleted file mode 100644 index b77cc1c7ac..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/java/services/Total.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Total { - - String getTotal(); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/resources/store.composite b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/resources/store.composite deleted file mode 100644 index 7a07b89903..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/resources/store.composite +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - USD - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/webapp/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/webapp/META-INF/sca-contribution.xml deleted file mode 100644 index cdda6bbcad..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/webapp/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/webapp/WEB-INF/geronimo-web.xml b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/webapp/WEB-INF/geronimo-web.xml deleted file mode 100644 index b353a6e759..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/webapp/WEB-INF/geronimo-web.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - org.apache.tuscany - sample-store-webapp - 1.0 - car - - - - - org.apache.axiom - org.apache.axis2 - org.apache.commons - org.jdom - - - - /sample-store-secure-webapp - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/webapp/WEB-INF/web.xml b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index bf3fe972ca..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - sample-store-webapp - - - tuscany - org.apache.tuscany.sca.host.webapp.TuscanyServletFilter - - - - tuscany - /* - - - - store.html - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/webapp/store.html b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/webapp/store.html deleted file mode 100644 index 7fa2e07d5a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/src/main/webapp/store.html +++ /dev/null @@ -1,163 +0,0 @@ - - - -Store - - - - - - - - - -

Store

-
-

Catalog

-
-
-
- -
- -
- -

Your Shopping Cart

-
-
-
-
-
- - - (feed) -
-
- - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/store.png b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/store.png deleted file mode 100644 index da413edeee..0000000000 Binary files a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/store.png and /dev/null differ diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/store.svg b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/store.svg deleted file mode 100644 index 74f8ecd36d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store-webapp/store.svg +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - store - ufs - - ShoppingCart - - CurrencyConverter - - - - - - - - - - CurrenyCode HTTP JSONRPC Atom - - Catalog - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/README b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/README deleted file mode 100644 index d31e4c59b7..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/README +++ /dev/null @@ -1,28 +0,0 @@ -Store Sample -====================================== - -This is a sample store scenario that is used as a getting started guide -for Tuscany SCA. For detailed information, please see: - -http://tuscany.apache.org/getting-started-with-tuscany.html - -or - -http://tuscany.apache.org/getting-started-with-tuscany-using-tuscany-eclipse-plugin.html - - -Building And Running The Sample Using Ant ------------------------------------------ -With the binary distribution the sample can be built using Ant as follows: - -cd store -ant compile - -and then, to run: - -ant run - -Once the store application is running use your browser to visit the following -URL: - -http://localhost:8080/store diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/build.xml b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/build.xml deleted file mode 100644 index e28e7c87be..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/build.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/pom.xml deleted file mode 100644 index 220971d08b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/pom.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-store - Apache Tuscany SCA Sample Getting Started Online Store - - - - org.apache.tuscany.sca - tuscany-base-runtime - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-data-api - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-binding-atom-runtime - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-binding-atom-js-dojo - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-binding-http-runtime - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-binding-jsonrpc-runtime - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-binding-jsonrpc-js-dojo - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-implementation-widget-runtime - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-implementation-widget-runtime-dojo - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-web-javascript-dojo - 2.0-Beta2-SNAPSHOT - - - - org.mortbay.jetty - jetty - 6.1.19 - test - - - - net.sourceforge.htmlunit - htmlunit - 2.6 - test - - - - junit - junit - 4.8.1 - test - - - - - ${artifactId} - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/launch/Launch.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/launch/Launch.java deleted file mode 100644 index 8e4b5839e4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/launch/Launch.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package launch; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -public class Launch { - public static void main(String[] args) throws Exception { - System.out.println("Starting ..."); - String contribution = ContributionLocationHelper.getContributionLocation(Launch.class); - Node node = NodeFactory.newInstance().createNode("store.composite", new Contribution("test", contribution)); - node.start(); - System.out.println("store.composite ready for big business !!!"); - System.in.read(); - System.out.println("Stopping ..."); - node.stop(); - System.out.println(); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/Cart.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/Cart.java deleted file mode 100644 index 3fb5439bc3..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/Cart.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.apache.tuscany.sca.data.collection.Collection; -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Cart extends Collection { - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/Catalog.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/Catalog.java deleted file mode 100644 index b5e504fe11..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/Catalog.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Catalog { - Item[] get(); -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/CurrencyConverter.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/CurrencyConverter.java deleted file mode 100644 index a064f3dd69..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/CurrencyConverter.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface CurrencyConverter { - public double getConversion(String fromCurrenycCode, String toCurrencyCode, double amount); - - public String getCurrencySymbol(String currencyCode); -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/CurrencyConverterImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/CurrencyConverterImpl.java deleted file mode 100644 index c354aed447..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/CurrencyConverterImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -public class CurrencyConverterImpl implements CurrencyConverter { - public double getConversion(String fromCurrencyCode, String toCurrencyCode, double amount) { - if (toCurrencyCode.equals("USD")) - return amount; - else if (toCurrencyCode.equals("EUR")) - return ((double)Math.round(amount * 0.7256 * 100)) /100; - return 0; - } - - public String getCurrencySymbol(String currencyCode) { - if (currencyCode.equals("USD")) - return "$"; - else if (currencyCode.equals("EUR")) - return "E"; //"€"; - return "?"; - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/FruitsCatalogImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/FruitsCatalogImpl.java deleted file mode 100644 index d132a24b00..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/FruitsCatalogImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import java.util.ArrayList; -import java.util.List; - -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Property; -import org.oasisopen.sca.annotation.Reference; - -public class FruitsCatalogImpl implements Catalog { - - @Property - public String currencyCode = "USD"; - - @Reference - public CurrencyConverter currencyConverter; - - private List catalog = new ArrayList(); - - @Init - public void init() { - String currencySymbol = currencyConverter.getCurrencySymbol(currencyCode); - catalog.add(new Item("Apple", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 2.99))); - catalog.add(new Item("Orange", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 3.55))); - catalog.add(new Item("Pear", currencySymbol + currencyConverter.getConversion("USD", currencyCode, 1.55))); - } - - public Item[] get() { - Item[] catalogArray = new Item[catalog.size()]; - catalog.toArray(catalogArray); - return catalogArray; - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/Item.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/Item.java deleted file mode 100644 index 0a9dcb2ffc..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/Item.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -public class Item { - private String name; - private String price; - - public Item() { - } - - public Item(String name, String price) { - this.name = name; - this.price = price; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - - public String toString() { - return "Item name: " + name + ", price: " + price; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/ShoppingCartImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/ShoppingCartImpl.java deleted file mode 100644 index 698614212d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/ShoppingCartImpl.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - -import org.apache.tuscany.sca.data.collection.Entry; -import org.apache.tuscany.sca.data.collection.NotFoundException; -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Scope; - -@Scope("COMPOSITE") -public class ShoppingCartImpl implements Cart, Total { - - private Map cart; - - @Init - public void init() { - cart = new HashMap(); - } - - public Entry[] getAll() { - Entry[] entries = new Entry[cart.size()]; - int i = 0; - for (Map.Entry e: cart.entrySet()) { - entries[i++] = new Entry(e.getKey(), e.getValue()); - } - return entries; - } - - public Item get(String key) throws NotFoundException { - Item item = cart.get(key); - if (item == null) { - throw new NotFoundException(key); - } else { - return item; - } - } - - public String post(String key, Item item) { - if (key == null) { - key ="cart-" + UUID.randomUUID().toString(); - } - cart.put(key, item); - return key; - } - - public void put(String key, Item item) throws NotFoundException { - if (!cart.containsKey(key)) { - throw new NotFoundException(key); - } - cart.put(key, item); - } - - public void delete(String key) throws NotFoundException { - if (key == null || key.equals("")) { - cart.clear(); - } else { - Item item = cart.remove(key); - if (item == null) - throw new NotFoundException(key); - } - } - - public Entry[] query(String queryString) { - List> entries = new ArrayList>(); - if (queryString.startsWith("name=")) { - String name = queryString.substring(5); - for (Map.Entry e: cart.entrySet()) { - Item item = e.getValue(); - if (item.getName().equals(name)) { - entries.add(new Entry(e.getKey(), e.getValue())); - } - } - } - return entries.toArray(new Entry[entries.size()]); - } - - public String getTotal() { - double total = 0; - String currencySymbol = ""; - if (!cart.isEmpty()) { - Item item = cart.values().iterator().next(); - currencySymbol = item.getPrice().substring(0, 1); - } - for (Item item : cart.values()) { - total += Double.valueOf(item.getPrice().substring(1)); - } - return currencySymbol + String.valueOf(total); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/Total.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/Total.java deleted file mode 100644 index b77cc1c7ac..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/java/services/Total.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Total { - - String getTotal(); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/resources/store.composite b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/resources/store.composite deleted file mode 100644 index 9c3b79c508..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/resources/store.composite +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - USD - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/resources/uiservices/store.html b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/resources/uiservices/store.html deleted file mode 100644 index be3efea327..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/main/resources/uiservices/store.html +++ /dev/null @@ -1,162 +0,0 @@ - - - -Store - - - - - - - - - -

Store

-
-

Catalog

-
-
-
- -
- -
- -

Your Shopping Cart

-
-
-
-
-
- - - (feed) -
-
- - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/test/java/client/Shopper.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/test/java/client/Shopper.java deleted file mode 100644 index 4e2fa63493..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/test/java/client/Shopper.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package client; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Shopper { - - String shop(String itemName, int quantity); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/test/java/client/ShopperImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/test/java/client/ShopperImpl.java deleted file mode 100644 index 05b1800d4f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/test/java/client/ShopperImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package client; - -import org.apache.tuscany.sca.data.collection.NotFoundException; -import org.oasisopen.sca.annotation.Reference; - -import services.Cart; -import services.Catalog; -import services.Item; -import services.Total; - -public class ShopperImpl implements Shopper { - - @Reference - public Catalog catalog; - - @Reference - public Cart shoppingCart; - - @Reference - public Total shoppingTotal; - - public String shop(String itemName, int quantity) { - - Item[] items = catalog.get(); - for (Item item: items) { - if (item.getName().startsWith(itemName)) { - - try { - shoppingCart.delete(""); - } catch (NotFoundException e) { - // ignore - } - - for (int i = 0; i < quantity; i++) { - shoppingCart.post("item" + i, item); - } - - return shoppingTotal.getTotal(); - } - } - - return ""; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/test/java/store/StoreTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/test/java/store/StoreTestCase.java deleted file mode 100644 index 883aaa76f6..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/test/java/store/StoreTestCase.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package store; - -import java.io.IOException; -import java.net.MalformedURLException; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; - -import client.Shopper; - -import com.gargoylesoftware.htmlunit.BrowserVersion; -import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; -import com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController; -import com.gargoylesoftware.htmlunit.WebClient; -import com.gargoylesoftware.htmlunit.html.HtmlCheckBoxInput; -import com.gargoylesoftware.htmlunit.html.HtmlForm; -import com.gargoylesoftware.htmlunit.html.HtmlPage; - - -/** - * Test the store-merger. - * - * @version $Rev$ $Date$ - */ -public class StoreTestCase { - private static Node nodeStore; - - @BeforeClass - public static void setUp() throws Exception { - String storeLocation = ContributionLocationHelper.getContributionLocation("store.composite"); - String storeClientLocation = ContributionLocationHelper.getContributionLocation("store-client.composite"); - - nodeStore = NodeFactory.newInstance().createNode(new Contribution("store", storeLocation), new Contribution("storeClient", storeClientLocation)); - nodeStore.start(); - } - - @AfterClass - public static void tearDown() throws Exception { - nodeStore.stop(); - } - - @Test - @Ignore - public void testWaitForInput() { - try { - System.out.println("press enter to continue)"); - System.in.read(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - @Test - public void testShop() { - Shopper shopper = nodeStore.getService(Shopper.class, "StoreClient"); - - String total = shopper.shop("Orange", 5); - System.out.println("Total: " + total); - - Assert.assertEquals("$17.75", total); - - } - - @Test - public void testStoreWidget() throws FailingHttpStatusCodeException, MalformedURLException, IOException { - WebClient webClient = new WebClient(BrowserVersion.FIREFOX_3); - webClient.setRedirectEnabled(true); - webClient.setThrowExceptionOnScriptError(false); - //webClient.waitForBackgroundJavaScript(100000); - //webClient.waitForBackgroundJavaScriptStartingBefore(100000); - webClient.setAjaxController(new NicelyResynchronizingAjaxController()); - - HtmlPage page = (HtmlPage) webClient.getPage("http://localhost:8080/store/store.html"); - - HtmlForm form = (HtmlForm) page.getFormByName("catalogForm"); - - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - } - - HtmlCheckBoxInput catalogItems = (HtmlCheckBoxInput) form.getInputByName("items"); - - System.out.println(">>>" + catalogItems.getAttribute("value")); - Assert.assertEquals("Apple - $2.99", catalogItems.getAttribute("value")); - - webClient.closeAllWindows(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/test/resources/store-client.composite b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/test/resources/store-client.composite deleted file mode 100644 index c9abe8e996..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/src/test/resources/store-client.composite +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/store.png b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/store.png deleted file mode 100644 index da413edeee..0000000000 Binary files a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/store.png and /dev/null differ diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/store.svg b/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/store.svg deleted file mode 100644 index 74f8ecd36d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/applications/store/store.svg +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - store - ufs - - ShoppingCart - - CurrencyConverter - - - - - - - - - - CurrenyCode HTTP JSONRPC Atom - - Catalog - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/META-INF/MANIFEST.MF b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/META-INF/MANIFEST.MF deleted file mode 100644 index 8b328a00be..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/META-INF/MANIFEST.MF +++ /dev/null @@ -1,17 +0,0 @@ -Manifest-Version: 1.0 -SCA-Version: 1.1 -Bundle-Name: Apache Tuscany SCA Sample Binding -Bundle-Vendor: The Apache Software Foundation -Bundle-Version: 2.0.0 -Bundle-ManifestVersion: 2 -Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt -Bundle-Description: Apache Tuscany SCA Sample Binding -Import-Package: org.apache.tuscany.sca.assembly;version="2.0.0", - org.apache.tuscany.sca.core;version="2.0.0", - org.apache.tuscany.sca.interfacedef;version="2.0.0", - org.apache.tuscany.sca.invocation;version="2.0.0", - org.apache.tuscany.sca.provider;version="2.0.0", - org.apache.tuscany.sca.runtime;version="2.0.0" -Bundle-SymbolicName: org.apache.tuscany.sca.binding.sample -Bundle-DocURL: http://www.apache.org/ -Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6 diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/README b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/README deleted file mode 100644 index 359c42f012..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/README +++ /dev/null @@ -1,8 +0,0 @@ -Sample Binding Extension -=============================== -This sample demonstrates how to develop a new binding type for Apache -Tuscany SCA. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/pom.xml deleted file mode 100644 index bcc11bb816..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/pom.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../../pom.xml - - - sample-binding-extension - Apache Tuscany SCA Sample Binding Extension - - - - - org.apache.tuscany.sca - tuscany-assembly-xml - 2.0-Beta2-SNAPSHOT - provided - - - - org.apache.tuscany.sca - tuscany-host-http - 2.0-Beta2-SNAPSHOT - provided - - - - javax.servlet - servlet-api - 2.5 - provided - - - - org.apache.tuscany.sca - tuscany-host-jetty - 2.0-Beta2-SNAPSHOT - test - - - - org.apache.tuscany.sca - tuscany-node-impl - 2.0-Beta2-SNAPSHOT - test - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 2.0-Beta2-SNAPSHOT - test - - - - org.apache.tuscany.sca - tuscany-sca-api - 2.0-Beta2-SNAPSHOT - test - - - - junit - junit - 4.8.1 - test - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/SampleBinding.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/SampleBinding.java deleted file mode 100644 index 174a32fce4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/SampleBinding.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample.binding; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.provider.BaseBindingImpl; - -/** - * Represents a binding to a Sample service. - */ -public class SampleBinding extends BaseBindingImpl { - - public static final QName TYPE = new QName(SCA11_TUSCANY_NS, "binding.sample"); - - private String someAttr; - - public SampleBinding() { - } - - public QName getType() { - return TYPE; - } - - public String getSomeAttr() { - return someAttr; - } - - public void setSomeAttr(String someAttr) { - this.someAttr = someAttr; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/SampleBindingFactory.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/SampleBindingFactory.java deleted file mode 100644 index 6f4920448c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/SampleBindingFactory.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.binding; - - -/** - * Factory implementation to create Sample Models - */ -public class SampleBindingFactory { - - public SampleBinding createSampleBinding() { - return new SampleBinding(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleBindingProviderFactory.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleBindingProviderFactory.java deleted file mode 100644 index 4fb966138d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleBindingProviderFactory.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.binding.runtime; - -import sample.binding.SampleBinding; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.provider.BindingProviderFactory; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; -import org.apache.tuscany.sca.provider.ServiceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeEndpoint; -import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; - -public class SampleBindingProviderFactory implements BindingProviderFactory { - - public SampleBindingProviderFactory(ExtensionPointRegistry extensionPoints) { - } - - public Class getModelType() { - return SampleBinding.class; - } - - public ReferenceBindingProvider createReferenceBindingProvider(RuntimeEndpointReference endpoint) { - return new SampleReferenceBindingProvider(endpoint); - } - - public ServiceBindingProvider createServiceBindingProvider(RuntimeEndpoint endpoint) { - return new SampleServiceBindingProvider(endpoint); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleReferenceBindingProvider.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleReferenceBindingProvider.java deleted file mode 100644 index b1edf6c729..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleReferenceBindingProvider.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.binding.runtime; - -import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.provider.ReferenceBindingProvider; - -public class SampleReferenceBindingProvider implements ReferenceBindingProvider { - - private EndpointReference endpoint; - private InterfaceContract contract; - - public SampleReferenceBindingProvider(EndpointReference endpoint) { - this.endpoint = endpoint; - } - - public Invoker createInvoker(Operation operation) { - return new SampleReferenceInvoker(operation, endpoint); - } - - public void start() { - } - - public void stop() { - } - - public InterfaceContract getBindingInterfaceContract() { - return contract; - } - - public boolean supportsOneWayInvocation() { - return false; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleReferenceInvoker.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleReferenceInvoker.java deleted file mode 100644 index 31cb339818..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleReferenceInvoker.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.binding.runtime; - -import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.invocation.Message; - -public class SampleReferenceInvoker implements Invoker { - - protected Operation operation; - protected EndpointReference endpoint; - - public SampleReferenceInvoker(Operation operation, EndpointReference endpoint) { - this.operation = operation; - this.endpoint = endpoint; - } - - public Message invoke(Message msg) { - try { - - return doInvoke(msg); - - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public Message doInvoke(Message msg) { - // Add some code here to make an invocation over the Sample binding protocol - // For this sample we'll just get it from the static stash - SampleServiceInvoker fi = SampleStash.getService(endpoint.getBinding().getURI()); - return fi.invokeService(msg); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleServiceBindingProvider.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleServiceBindingProvider.java deleted file mode 100644 index f8aab77fde..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleServiceBindingProvider.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.binding.runtime; - -import sample.binding.SampleBinding; -import org.apache.tuscany.sca.interfacedef.InterfaceContract; -import org.apache.tuscany.sca.provider.ServiceBindingProvider; -import org.apache.tuscany.sca.runtime.RuntimeEndpoint; - -public class SampleServiceBindingProvider implements ServiceBindingProvider { - - private RuntimeEndpoint endpoint; - private InterfaceContract contract; - - public SampleServiceBindingProvider(RuntimeEndpoint endpoint) { - this.endpoint = endpoint; - } - - public void start() { - // add some code here to start the service - - // For this sample we'll just share it in a static - SampleStash.addService(endpoint.getBinding().getURI(), new SampleServiceInvoker(endpoint)); - - System.out.println("someAttr=" + ((SampleBinding)endpoint.getBinding()).getSomeAttr()); - } - - public void stop() { - SampleStash.removeService(endpoint.getBinding().getURI()); - } - - public InterfaceContract getBindingInterfaceContract() { - return contract; - } - - public boolean supportsOneWayInvocation() { - return false; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleServiceInvoker.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleServiceInvoker.java deleted file mode 100644 index bfbfe80966..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleServiceInvoker.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.binding.runtime; - -import org.apache.tuscany.sca.invocation.Message; -import org.apache.tuscany.sca.runtime.RuntimeEndpoint; - -public class SampleServiceInvoker { - - private RuntimeEndpoint wire; - - public SampleServiceInvoker(RuntimeEndpoint wire) { - this.wire = wire; - } - - /** - * Send the request down the wire to invoke the service - */ - public Message invokeService(Message msg) { - return wire.invoke(msg); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleStash.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleStash.java deleted file mode 100644 index cbebe77cf6..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/java/sample/binding/runtime/SampleStash.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.binding.runtime; - -import java.util.HashMap; -import java.util.Map; - -/** - * Simplistic static Map to share service endpoints with references - */ -public class SampleStash { - - private static Map services = new HashMap(); - - public static void addService(String uri, SampleServiceInvoker SampleServiceInvoker) { - services.put(uri, SampleServiceInvoker); - } - - public static SampleServiceInvoker getService(String uri) { - return services.get(uri); - } - - public static void removeService(String uri) { - services.remove(uri); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor deleted file mode 100644 index 91c49a69e0..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor +++ /dev/null @@ -1,20 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Implementation class for the artifact processor extension -org.apache.tuscany.sca.assembly.xml.DefaultBeanModelProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#binding.sample,model=sample.binding.SampleBinding,factory=sample.binding.SampleBindingFactory - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema deleted file mode 100644 index dda33eb075..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -binding-sample.xsd - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory deleted file mode 100644 index e6b86ac871..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.BindingProviderFactory +++ /dev/null @@ -1,20 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Implementation class for the binding extension -sample.binding.runtime.SampleBindingProviderFactory;model=sample.binding.SampleBinding - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/sample.binding.SampleBindingFactory b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/sample.binding.SampleBindingFactory deleted file mode 100644 index ec8c4b9936..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/META-INF/services/sample.binding.SampleBindingFactory +++ /dev/null @@ -1,20 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Implementation class for model factory -sample.binding.SampleBindingFactory - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/binding-sample.xsd b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/binding-sample.xsd deleted file mode 100644 index 26f4f80ea4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/main/resources/binding-sample.xsd +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldClient.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldClient.java deleted file mode 100644 index bafb453a30..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldClient.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package helloworld; - -import org.oasisopen.sca.annotation.Reference; - -public class HelloWorldClient implements HelloWorldService { - - @Reference - public HelloWorldService ref; - - public String sayHello(String name) { - return ref.sayHello(name); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldImpl.java deleted file mode 100644 index 98989e6e49..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package helloworld; - - -public class HelloWorldImpl implements HelloWorldService { - - public String sayHello(String name) { - return "Hello " + name; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldService.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldService.java deleted file mode 100644 index 59b4bd0d57..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/java/helloworld/HelloWorldService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package helloworld; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface HelloWorldService { - - String sayHello(String name); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/java/test/SampleBindingTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/java/test/SampleBindingTestCase.java deleted file mode 100644 index f3274a7fcb..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/java/test/SampleBindingTestCase.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package test; - -import helloworld.HelloWorldService; -import junit.framework.Assert; - -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -public class SampleBindingTestCase { - - private static Node node; - - @Test - public void testSayHello() { - HelloWorldService service = node.getService(HelloWorldService.class, "HelloWorldClient/HelloWorldService"); - Assert.assertEquals("Hello boo", service.sayHello("boo")); - } - - @BeforeClass - public static void init() throws Exception { - node = NodeFactory.newInstance().createNode("helloworld.composite").start(); - } - - @AfterClass - public static void destroy() throws Exception { - if (node != null) { - node.stop(); - } - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/resources/helloworld.composite b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/resources/helloworld.composite deleted file mode 100644 index 9bb69bae65..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/binding-sample/src/test/resources/helloworld.composite +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/README b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/README deleted file mode 100644 index c0e6c0f575..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/README +++ /dev/null @@ -1,8 +0,0 @@ -Sample Implementation Extension -=============================== -This sample demonstrates how to develop a new component implementation type -for Apache Tuscany SCA. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/pom.xml deleted file mode 100644 index 84ae4037ce..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/pom.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../../pom.xml - - sample-implementation-extension - Apache Tuscany SCA Sample Implementation Extension - jar - - - - org.apache.tuscany.sca - tuscany-base-runtime - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-binding-ws-runtime-axis2 - 2.0-Beta2-SNAPSHOT - - - - org.mortbay.jetty - jetty - 6.1.19 - - - - junit - junit - 4.8.1 - test - - - - - - ${artifactId} - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/Java.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/Java.java deleted file mode 100644 index 6c9240005f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/Java.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.api; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -@Target( {TYPE, FIELD}) -@Retention(RUNTIME) -public @interface Java { - - Class value(); -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/WSDL.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/WSDL.java deleted file mode 100644 index 655770ec32..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/WSDL.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.api; - -import static java.lang.annotation.ElementType.FIELD; -import static java.lang.annotation.ElementType.TYPE; -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -import java.lang.annotation.Retention; -import java.lang.annotation.Target; - -@Target( {TYPE, FIELD}) -@Retention(RUNTIME) -public @interface WSDL { - - String value(); -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/WSDLReference.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/WSDLReference.java deleted file mode 100644 index cad8478a2a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/api/WSDLReference.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.api; - -import org.w3c.dom.Element; - -public interface WSDLReference { - - Element call(String op, Element e); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/EmbedUtil.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/EmbedUtil.java deleted file mode 100644 index 0ccbcc9e36..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/EmbedUtil.java +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.impl; - -import java.net.URI; -import java.net.URL; -import java.util.Arrays; - -import javax.wsdl.PortType; -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.assembly.Contract; -import org.apache.tuscany.sca.assembly.Implementation; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.contribution.Artifact; -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.ContributionFactory; -import org.apache.tuscany.sca.contribution.processor.ContributionResolveException; -import org.apache.tuscany.sca.contribution.processor.ExtensibleURLArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.ProcessorContext; -import org.apache.tuscany.sca.contribution.processor.URLArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.resolver.ExtensibleModelResolver; -import org.apache.tuscany.sca.contribution.resolver.ModelResolverExtensionPoint; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.FactoryExtensionPoint; -import org.apache.tuscany.sca.databinding.xml.DOMDataBinding; -import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLObject; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint; - -/** - * A few utility functions to help embed a Tuscany runtime, and a simple DSL - * to help assemble and run SCDL. - */ -public class EmbedUtil { - - /** - * A runtime embedder context, which conveniently initializes a Node factory - * and gets the various registries, factories and extension points we need. - */ - static class Context { - final NodeFactory nf; - final ExtensionPointRegistry epr; - final FactoryExtensionPoint fep; - final ContributionFactory cf; - final AssemblyFactory af; - final JavaInterfaceFactory jif; - final WSDLFactory wif; - final URLArtifactProcessorExtensionPoint apep; - final ExtensibleURLArtifactProcessor aproc; - final ModelResolverExtensionPoint mrep; - final ProviderFactoryExtensionPoint pfep; - - Context(final NodeFactory nf) { - this.nf = nf; - epr = nf.getExtensionPointRegistry(); - fep = epr.getExtensionPoint(FactoryExtensionPoint.class); - cf = fep.getFactory(ContributionFactory.class); - af = fep.getFactory(AssemblyFactory.class); - jif = fep.getFactory(JavaInterfaceFactory.class); - wif = fep.getFactory(WSDLFactory.class); - apep = epr.getExtensionPoint(URLArtifactProcessorExtensionPoint.class); - aproc = new ExtensibleURLArtifactProcessor(apep); - mrep = epr.getExtensionPoint(ModelResolverExtensionPoint.class); - pfep = epr.getExtensionPoint(ProviderFactoryExtensionPoint.class); - } - } - - static Context embedContext(NodeFactory nf) { - return new Context(nf); - } - - /** - * A mini DSL to help build and assemble contributions and SCDL composites. - */ - interface Builder { - T build(Context ec); - } - - static T build(final Builder builder, final Context ec) { - return builder.build(ec); - } - - /** - * Return a contribution builder. - */ - static Builder contrib(final String uri, final String loc, final Builder... artifacts) { - return new Builder() { - public Contribution build(final Context ec) { - final Contribution c = ec.cf.createContribution(); - c.setURI(uri); - c.setLocation(loc); - c.setModelResolver(new ExtensibleModelResolver(c, ec.mrep, ec.fep)); - for(Builder a: artifacts) - c.getArtifacts().add(a.build(ec)); - return c; - } - }; - } - - /** - * Return an artifact builder. - */ - static Builder artifact(final String uri, final Object model) { - return new Builder() { - public Artifact build(final Context ec) { - final Artifact a = ec.cf.createArtifact(); - a.setURI(uri); - a.setModel(model); - return a; - } - }; - } - - /** - * Return a composite builder. - */ - static Builder composite(final String ns, final String name, final Builder... components) { - return new Builder() { - public Composite build(final Context ec) { - final Composite compos = ec.af.createComposite(); - compos.setName(new QName(ns, name)); - for(final Builder c: components) - compos.getComponents().add(c.build(ec)); - return compos; - } - }; - } - - /** - * Return a component builder. - */ - static Builder component(final String name, final Builder impl, final Builder... references) { - return new Builder() { - public Component build(final Context ec) { - final Component c = ec.af.createComponent(); - c.setName(name); - c.setImplementation(impl.build(ec)); - for(Builder r: references) - c.getReferences().add(r.build(ec)); - return c; - } - }; - } - - /** - * Return an implementation builder. - */ - static Builder implementation(final Class clazz, final Builder... contracts) { - return new Builder() { - public SampleImplementation build(final Context ec) { - final SampleImplementation impl = ImplUtil.implementation(clazz.getName()); - impl.clazz = clazz; - impl.setUnresolved(false); - for(final Builder b: contracts) { - Contract c = b.build(ec); - if(c instanceof Service) - impl.getServices().add((Service)c); - else - impl.getReferences().add((Reference)c); - } - return impl; - } - }; - } - - /** - * Return a reference builder. - */ - static Builder reference(final String name, final Class c) { - return new Builder() { - public Reference build(final Context ec) { - try { - return ImplUtil.reference(name, c, ec.jif, ec.af); - } catch(InvalidInterfaceException e) { - throw new RuntimeException(e); - } - } - }; - } - - static Builder reference(final String name, final WSDLInterface c) { - return new Builder() { - public Reference build(final Context ec) { - return ImplUtil.reference(name, c, ec.wif, ec.af); - } - }; - } - - static Builder reference(final String name, final String target) { - return new Builder() { - public ComponentReference build(final Context ec) { - final ComponentReference r = ec.af.createComponentReference(); - r.setName(name); - final ComponentService s = ec.af.createComponentService(); - s.setUnresolved(true); - s.setName(target); - r.getTargets().add(s); - return r; - } - }; - } - - /** - * Return a service builder. - */ - static Builder service(final Class c) { - return new Builder() { - public Service build(final Context ec) { - try { - return ImplUtil.service(c, ec.jif, ec.af); - } catch(InvalidInterfaceException e) { - throw new RuntimeException(e); - } - } - }; - } - - static Builder service(final WSDLInterface c) { - return new Builder() { - public Service build(final Context ec) { - return ImplUtil.service(c, ec.wif, ec.af); - } - }; - } - - /** - * Return a WSDLInterface builder which loads a WSDL into a contribution. - */ - static Builder wsdli(final String uri, final String ns, final String name, final Contribution c) { - return new Builder() { - public WSDLInterface build(final Context ec) { - try { - final ProcessorContext ctx = new ProcessorContext(); - final WSDLDefinition wd = ec.aproc.read(null, new URI(uri), new URL(new URL(c.getLocation()), uri), ctx, WSDLDefinition.class); - c.getModelResolver().addModel(wd, ctx); - c.getModelResolver().resolveModel(WSDLDefinition.class, wd, ctx); - final WSDLObject pt = wd.getWSDLObject(PortType.class, new QName(ns, name)); - if(pt == null) - throw new ContributionResolveException("Couldn't find " + name); - final WSDLInterface nwi = ec.wif.createWSDLInterface(pt.getElement(), wd, c.getModelResolver(), null); - nwi.setWsdlDefinition(wd); - nwi.resetDataBinding(DOMDataBinding.NAME); - return nwi; - } catch(Exception e) { - throw new RuntimeException(e); - } - } - }; - } - - /** - * Return the extension point registry used by our nodes. - */ - static ExtensionPointRegistry extensionPoints(final Context ec) { - return ec.epr; - } - - /** - * Return the provider factory extension point used by our nodes. - */ - static ProviderFactoryExtensionPoint providerFactories(final Context ec) { - return ec.pfep; - } - - /** - * Add a deployable composite to a contribution. - */ - static Contribution deploy(final Contribution contrib, final Composite... comps) { - for(Composite c: comps) - contrib.getDeployables().add(c); - return contrib; - } - - /** - * Configure a node with a list of contributions. - */ - static Node node(final NodeFactory nf, final Contribution... contributions) { - return nf.createNode(Arrays.asList(contributions)); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/ImplUtil.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/ImplUtil.java deleted file mode 100644 index abd4cd7ab0..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/ImplUtil.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.impl; - -import java.lang.annotation.Annotation; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.assembly.Reference; -import org.apache.tuscany.sca.assembly.Service; -import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceContract; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterfaceContract; - -import sample.api.Java; -import sample.api.WSDL; - -/** - * Utility functions to help develop a component implementation extension. - */ -class ImplUtil { - - /** - * Return a Sample implementation with the given name. - */ - static SampleImplementation implementation(String name) { - final SampleImplementation impl = new SampleImplementation(name); - impl.setUnresolved(true); - return impl; - } - - /** - * Return the Java class configured on an annotation. - */ - static Class clazz(final Annotation a) { - return ((Java)a).value(); - } - - /** - * Return the WSDL QName configured on an annotation. - */ - static QName qname(final Annotation a) { - final String uri = ((WSDL)a).value(); - final int h = uri.indexOf('#'); - return new QName(uri.substring(0, h), uri.substring(h + 1)); - } - - /** - * Convert a Java class to an interface contract. - */ - static JavaInterfaceContract contract(final Class c, final JavaInterfaceFactory jif) throws InvalidInterfaceException { - final JavaInterfaceContract ic = jif.createJavaInterfaceContract(); - ic.setInterface(jif.createJavaInterface(c)); - return ic; - } - - /** - * Convert a WSDL interface to an interface contract. - */ - static WSDLInterfaceContract contract(final WSDLInterface wi, final WSDLFactory wf) { - final WSDLInterfaceContract ic = wf.createWSDLInterfaceContract(); - ic.setInterface(wi); - return ic; - } - - /** - * Convert a Java class to a service. - */ - static Service service(final Class c, final JavaInterfaceFactory jif, final AssemblyFactory af) throws InvalidInterfaceException { - Service s = af.createService(); - s.setName(c.getSimpleName()); - s.setInterfaceContract(contract(c, jif)); - return s; - } - - /** - * Convert a WSDL interface to a service. - */ - static Service service(final WSDLInterface wi, final WSDLFactory wf, final AssemblyFactory af) { - Service s = af.createService(); - s.setName(wi.getName().getLocalPart()); - s.setInterfaceContract(contract(wi, wf)); - return s; - } - - /** - * Convert a name and Java class to a reference. - */ - static Reference reference(final String name, final Class c, final JavaInterfaceFactory jif, final AssemblyFactory af) throws InvalidInterfaceException { - final Reference r = af.createReference(); - r.setName(name); - r.setInterfaceContract(contract(c, jif)); - return r; - } - - /** - * Convert a name and WSDL interface to a reference. - */ - static Reference reference(final String name, final WSDLInterface wi, final WSDLFactory wf, final AssemblyFactory af) { - final Reference r = af.createReference(); - r.setName(name); - r.setInterfaceContract(contract(wi, wf)); - return r; - } - - /** - * Convert a WSDL qname to a WSDL interface. - */ - static WSDLInterface interfaze(final QName name, final WSDLFactory wif) { - final WSDLInterface wir = wif.createWSDLInterface(); - wir.setUnresolved(true); - wir.setName(name); - return wir; - } - - /** - * Convert a WSDL qname to a WSDL definition. - */ - static WSDLDefinition definition(final QName name, final WSDLFactory wif) { - final WSDLDefinition wdr = wif.createWSDLDefinition(); - wdr.setUnresolved(true); - wdr.setNamespace(name.getNamespaceURI()); - wdr.setNameOfPortTypeToResolve(name); - return wdr; - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleImplementation.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleImplementation.java deleted file mode 100644 index 41ce71a732..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleImplementation.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample.impl; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.assembly.impl.ImplementationImpl; - -/** - * Model representing a Sample implementation in an SCA assembly. - * - * @version $Rev$ $Date$ - */ -public class SampleImplementation extends ImplementationImpl { - static final QName QN = new QName(SCA11_TUSCANY_NS, "implementation.sample"); - - final String name; - Class clazz; - - SampleImplementation(final String name) { - super(QN); - this.name = name; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleImplementationProcessor.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleImplementationProcessor.java deleted file mode 100644 index 6017030d35..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleImplementationProcessor.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample.impl; - -import static javax.xml.stream.XMLStreamConstants.END_ELEMENT; -import static sample.impl.SampleImplementation.QN; -import static sample.impl.ImplUtil.clazz; -import static sample.impl.ImplUtil.definition; -import static sample.impl.ImplUtil.implementation; -import static sample.impl.ImplUtil.interfaze; -import static sample.impl.ImplUtil.qname; -import static sample.impl.ImplUtil.reference; -import static sample.impl.ImplUtil.service; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Field; - -import javax.wsdl.PortType; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import javax.xml.stream.XMLStreamWriter; - -import org.apache.tuscany.sca.assembly.AssemblyFactory; -import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.ContributionReadException; -import org.apache.tuscany.sca.contribution.processor.ContributionResolveException; -import org.apache.tuscany.sca.contribution.processor.ContributionWriteException; -import org.apache.tuscany.sca.contribution.processor.ProcessorContext; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.resolver.ClassReference; -import org.apache.tuscany.sca.contribution.resolver.ModelResolver; -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.FactoryExtensionPoint; -import org.apache.tuscany.sca.databinding.xml.DOMDataBinding; -import org.apache.tuscany.sca.interfacedef.InvalidInterfaceException; -import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLDefinition; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLFactory; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLObject; - -import sample.api.Java; -import sample.api.WSDL; - -/** - * StAX artifact processor for Sample implementations. - * - * @version $Rev$ $Date$ - */ -public class SampleImplementationProcessor extends BaseStAXArtifactProcessor implements StAXArtifactProcessor { - final AssemblyFactory af; - final JavaInterfaceFactory jif; - final WSDLFactory wf; - - public SampleImplementationProcessor(final ExtensionPointRegistry ep) { - final FactoryExtensionPoint fep = ep.getExtensionPoint(FactoryExtensionPoint.class); - this.af = fep.getFactory(AssemblyFactory.class); - this.jif = fep.getFactory(JavaInterfaceFactory.class); - this.wf = fep.getFactory(WSDLFactory.class); - } - - public QName getArtifactType() { - return QN; - } - - public Class getModelType() { - return SampleImplementation.class; - } - - public SampleImplementation read(final XMLStreamReader r, final ProcessorContext ctx) throws ContributionReadException, XMLStreamException { - // Read the component implementation element - final SampleImplementation impl = implementation(r.getAttributeValue(null, "class")); - while(r.hasNext() && !(r.next() == END_ELEMENT && QN.equals(r.getName()))) - ; - return impl; - } - - public void resolve(final SampleImplementation impl, final ModelResolver res, final ProcessorContext ctx) throws ContributionResolveException { - try { - // Resolve and introspect the implementation class - impl.clazz = resolve(impl.name, res, ctx); - - for(final Annotation a: impl.clazz.getAnnotations()) { - if(a instanceof Java) - impl.getServices().add(service(clazz(a), jif, af)); - else if(a instanceof WSDL) - impl.getServices().add(service(resolve(qname(a), res, ctx, wf), wf, af)); - } - - for(Field f: impl.clazz.getDeclaredFields()) { - for(final Annotation a: f.getAnnotations()) { - if(a instanceof Java) - impl.getReferences().add(reference(f.getName(), clazz(a), jif, af)); - else if(a instanceof WSDL) - impl.getReferences().add(reference(f.getName(), resolve(qname(a), res, ctx, wf), wf, af)); - } - } - - impl.setUnresolved(false); - } catch(InvalidInterfaceException e) { - throw new ContributionResolveException(e); - } - } - - public void write(final SampleImplementation impl, final XMLStreamWriter w, final ProcessorContext ctx) throws ContributionWriteException, XMLStreamException { - writeStart(w, QN.getNamespaceURI(), QN.getLocalPart(), new XAttr("class", impl.name)); - writeEnd(w); - } - - /** - * Resolve a Java class. - */ - static Class resolve(final String name, final ModelResolver res, final ProcessorContext ctx) throws ContributionResolveException { - final ClassReference cr = res.resolveModel(ClassReference.class, new ClassReference(name), ctx); - if(cr.getJavaClass() != null) - return cr.getJavaClass(); - throw new ContributionResolveException(new ClassNotFoundException(name)); - } - - /** - * Resolve a WSDL interface. - */ - static WSDLInterface resolve(final QName name, final ModelResolver res, final ProcessorContext ctx, final WSDLFactory wif) throws ContributionResolveException { - final WSDLInterface wi = res.resolveModel(WSDLInterface.class, interfaze(name, wif), ctx); - if(!wi.isUnresolved()) - return domBound(wi); - - final WSDLDefinition wd = res.resolveModel(WSDLDefinition.class, definition(wi.getName(), wif), ctx); - if(wd.isUnresolved()) - throw new ContributionResolveException("Couldn't find " + name.getNamespaceURI()); - - WSDLObject pt = wd.getWSDLObject(PortType.class, name); - if(pt == null) - throw new ContributionResolveException("Couldn't find " + name); - try { - final WSDLInterface nwi = wif.createWSDLInterface(pt.getElement(), wd, res, ctx.getMonitor()); - nwi.setWsdlDefinition(wd); - res.addModel(nwi, ctx); - return domBound(nwi); - } catch(InvalidInterfaceException e) { - throw new ContributionResolveException(e); - } - } - - /** - * Return a WSDL interface configured to use a DOM databinding. - */ - static WSDLInterface domBound(WSDLInterface wi) throws ContributionResolveException { - try { - final WSDLInterface domwi = (WSDLInterface)wi.clone(); - domwi.resetDataBinding(DOMDataBinding.NAME); - return domwi; - } catch(CloneNotSupportedException e) { - throw new ContributionResolveException(e); - } - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleJavaInvoker.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleJavaInvoker.java deleted file mode 100644 index 244251c4c9..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleJavaInvoker.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.impl; - -import java.lang.reflect.Method; - -import org.apache.tuscany.sca.interfacedef.java.JavaOperation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.invocation.Message; - -/** - * Invoker for Sample components that implement a Java interface. - * - * @version $Rev$ $Date$ - */ -class SampleJavaInvoker implements Invoker { - final Object instance; - final Method method; - - SampleJavaInvoker(final JavaOperation op, final Class clazz, final Object instance) throws SecurityException, NoSuchMethodException { - this.instance = instance; - this.method = clazz.getMethod(op.getJavaMethod().getName(), op.getJavaMethod().getParameterTypes()); - } - - public Message invoke(final Message msg) { - try { - // Call the method that implements the operation - msg.setBody(method.invoke(instance, (Object[])msg.getBody())); - } catch(Exception e) { - e.printStackTrace(); - msg.setFaultBody(e.getCause()); - } - return msg; - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleProvider.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleProvider.java deleted file mode 100644 index 5d946b037b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleProvider.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.impl; - -import java.lang.reflect.Field; - -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.core.invocation.ProxyFactory; -import org.apache.tuscany.sca.interfacedef.Interface; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.interfacedef.java.JavaInterface; -import org.apache.tuscany.sca.interfacedef.java.JavaOperation; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLOperation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.provider.ImplementationProvider; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.apache.tuscany.sca.runtime.RuntimeComponentService; - -/** - * Implementation provider for Sample component implementations. - * - * @version $Rev$ $Date$ - */ -class SampleProvider implements ImplementationProvider { - final RuntimeComponent comp; - final SampleImplementation impl; - final ProxyFactory pxf; - Object instance; - - SampleProvider(final RuntimeComponent comp, final SampleImplementation impl, ProxyFactory pf) { - this.comp = comp; - this.impl = impl; - this.pxf = pf; - } - - public void start() { - // Construct implementation instance and inject reference proxies - try { - instance = impl.clazz.newInstance(); - - for(ComponentReference r: comp.getReferences()) { - final Field f = impl.clazz.getDeclaredField(r.getName()); - f.setAccessible(true); - // Inject a Java or WSDLReference proxy - final Interface i = r.getInterfaceContract().getInterface(); - if(i instanceof JavaInterface) - f.set(instance, pxf.createProxy(comp.getComponentContext().getServiceReference(f.getType(), r.getName()))); - else - f.set(instance, new SampleWSDLProxy(r.getEndpointReferences().get(0), i)); - } - } catch(Exception e) { - throw new RuntimeException(e); - } - } - - public void stop() { - instance = null; - } - - public boolean supportsOneWayInvocation() { - return false; - } - - public Invoker createInvoker(final RuntimeComponentService s, final Operation op) { - try { - // Creating an invoker for a Java or WSDL-typed implementation - if(op instanceof JavaOperation) - return new SampleJavaInvoker((JavaOperation)op, impl.clazz, instance); - return new SampleWSDLInvoker((WSDLOperation)op, impl.clazz, instance); - } catch(Exception e) { - throw new RuntimeException(e); - } - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleProviderFactory.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleProviderFactory.java deleted file mode 100644 index 4ad24d33ff..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleProviderFactory.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.impl; - -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.core.invocation.ExtensibleProxyFactory; -import org.apache.tuscany.sca.core.invocation.ProxyFactory; -import org.apache.tuscany.sca.provider.ImplementationProvider; -import org.apache.tuscany.sca.provider.ImplementationProviderFactory; -import org.apache.tuscany.sca.runtime.RuntimeComponent; - -/** - * Factory for Sample implementation providers. - * - * @version $Rev$ $Date$ - */ -public class SampleProviderFactory implements ImplementationProviderFactory { - final ProxyFactory pxf; - - public SampleProviderFactory(final ExtensionPointRegistry ep) { - pxf = ExtensibleProxyFactory.getInstance(ep); - } - - public ImplementationProvider createImplementationProvider(final RuntimeComponent comp, final SampleImplementation impl) { - return new SampleProvider(comp, impl, pxf); - } - - public Class getModelType() { - return SampleImplementation.class; - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLInvoker.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLInvoker.java deleted file mode 100644 index 6c5317274f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLInvoker.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.impl; - -import java.lang.reflect.Method; - -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLOperation; -import org.apache.tuscany.sca.invocation.Invoker; -import org.apache.tuscany.sca.invocation.Message; -import org.w3c.dom.Element; - -/** - * Invoker for Sample components that implement a WSDL interface using a generic - * call method. - * - * @version $Rev$ $Date$ - */ -class SampleWSDLInvoker implements Invoker { - final String name; - final Object instance; - final Method method; - - SampleWSDLInvoker(final WSDLOperation op, final Class clazz, final Object instance) throws SecurityException, NoSuchMethodException { - this.name = op.getName(); - this.instance = instance; - this.method = clazz.getMethod("call", String.class, Element.class); - } - - public Message invoke(final Message msg) { - try { - // Invoke the generic call method - msg.setBody(method.invoke(instance, name, ((Object[])msg.getBody())[0])); - } catch(Exception e) { - e.printStackTrace(); - msg.setFaultBody(e.getCause()); - } - return msg; - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java deleted file mode 100644 index a6882a0103..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/java/sample/impl/SampleWSDLProxy.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.impl; - -import java.lang.reflect.InvocationTargetException; -import java.util.HashMap; -import java.util.Map; - -import org.apache.tuscany.sca.assembly.EndpointReference; -import org.apache.tuscany.sca.interfacedef.Interface; -import org.apache.tuscany.sca.interfacedef.Operation; -import org.apache.tuscany.sca.runtime.RuntimeEndpointReference; -import org.w3c.dom.Element; - -import sample.api.WSDLReference; - -/** - * Proxy used to call operations on WSDL references. - */ -class SampleWSDLProxy implements WSDLReference { - final RuntimeEndpointReference repr; - final Map ops; - - SampleWSDLProxy(EndpointReference epr, Interface wi) { - repr = (RuntimeEndpointReference)epr; - ops = new HashMap(); - for(Operation o: wi.getOperations()) - ops.put(o.getName(), o); - } - - @Override - public Element call(String op, Element e) { - try { - // Invoke the named operation on the endpoint reference - return (Element)repr.invoke(ops.get(op), new Object[] {e}); - } catch(InvocationTargetException ex) { - throw new RuntimeException(ex); - } - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor deleted file mode 100644 index 908ac95a2e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor +++ /dev/null @@ -1,20 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Implementation class for the artifact processor extension -sample.impl.SampleImplementationProcessor;qname=http://tuscany.apache.org/xmlns/sca/1.1#implementation.sample,model=sample.impl.SampleImplementation - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema deleted file mode 100644 index 85aff44074..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.ValidationSchema +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -sample/impl/sample.xsd diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory deleted file mode 100644 index 32a7efcaf9..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/resources/META-INF/services/org.apache.tuscany.sca.provider.ImplementationProviderFactory +++ /dev/null @@ -1,20 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# Implementation provider for Sample components -sample.impl.SampleProviderFactory;model=sample.impl.SampleImplementation - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/resources/sample/impl/sample.xsd b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/resources/sample/impl/sample.xsd deleted file mode 100644 index c057aef1c1..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/main/resources/sample/impl/sample.xsd +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/Client.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/Client.java deleted file mode 100644 index 1b7e11c786..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/Client.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * Sample service interface. - * - * @version $Rev$ $Date$ - */ -@Remotable -public interface Client { - - String jello(String s); - - String wello(String s); -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/ClientTest.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/ClientTest.java deleted file mode 100644 index 92291c98a1..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/ClientTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample; - -import static java.lang.System.out; -import static sample.Xutil.elem; -import static sample.Xutil.elems; -import static sample.Xutil.print; -import static sample.Xutil.select; -import static sample.Xutil.text; -import static sample.Xutil.xdom; -import static sample.Xutil.xfilter; -import static sample.Xutil.xreduce; - -import org.w3c.dom.Element; - -import sample.api.Java; -import sample.api.WSDL; -import sample.api.WSDLReference; - -/** - * Sample component implementation that uses a mix of Java and WSDL interfaces. - * - * @version $Rev$ $Date$ - */ -@Java(Client.class) -public class ClientTest { - - @Java(Hello.class) - Hello jello; - - @WSDL("http://sample/hello#Hello") - WSDLReference wello; - - public String jello(String s) { - out.println("ClientTest.jello(" + s + ")"); - return jello.hello(s); - } - - public String wello(String s) { - out.println("ClientTest.wello(" + s + ")"); - final Element hreq = xdom("http://sample/hello", "hello", elem("name", text(s))); - - final Element hres = wello.call("hello", hreq); - - return xreduce(print, "", xfilter(select("result"), elems(hres))); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/Hello.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/Hello.java deleted file mode 100644 index 247fc8aa78..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/Hello.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * Sample service interface. - * - * @version $Rev$ $Date$ - */ -@Remotable -public interface Hello { - - String hello(String s); -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/JelloTest.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/JelloTest.java deleted file mode 100644 index 5c999a6c80..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/JelloTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample; - -import static java.lang.System.out; -import sample.api.Java; - -/** - * Sample component implementation that uses Java interfaces. - * - * @version $Rev$ $Date$ - */ -@Java(Hello.class) -public class JelloTest { - - @Java(Upper.class) - Upper upper; - - public String hello(String s) { - out.println("JelloTest.hello(" + s + ")"); - return upper.upper("Hello " + s); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/Upper.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/Upper.java deleted file mode 100644 index 9c772b3487..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/Upper.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * Sample service interface. - * - * @version $Rev$ $Date$ - */ -@Remotable -public interface Upper { - - String upper(String s); -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/UpperTest.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/UpperTest.java deleted file mode 100644 index 5399e4410d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/UpperTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample; - -import static java.lang.System.out; -import sample.api.Java; - -/** - * Sample component implementation that uses Java interfaces. - * - * @version $Rev$ $Date$ - */ -@Java(Upper.class) -public class UpperTest { - - public String upper(String s) { - out.println("UpperTest.upper(" + s + ")"); - return s.toUpperCase(); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/WelloTest.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/WelloTest.java deleted file mode 100644 index 1bb9fc11ce..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/WelloTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample; - -import static java.lang.System.out; -import static sample.Xutil.elem; -import static sample.Xutil.elems; -import static sample.Xutil.print; -import static sample.Xutil.select; -import static sample.Xutil.text; -import static sample.Xutil.xdom; -import static sample.Xutil.xfilter; -import static sample.Xutil.xml; -import static sample.Xutil.xreduce; - -import org.w3c.dom.Element; - -import sample.api.WSDL; -import sample.api.WSDLReference; - -/** - * Sample component implementation that uses WSDL interfaces. - * - * @version $Rev$ $Date$ - */ -@WSDL("http://sample/hello#Hello") -public class WelloTest { - - @WSDL("http://sample/upper#Upper") - WSDLReference upper; - - public Element call(String op, Element e) { - out.println("WelloTest." + op + "(" + xml(e) + ")"); - final String name = xreduce(print, "", xfilter(select("name"), elems(e))); - - final Element ureq = xdom("http://sample/upper", "upper", elem("s", text("Hello " + name))); - final Element ures = upper.call("upper", ureq); - - final String s = xreduce(print, "", xfilter(select("result"), elems(ures))); - return xdom("http://sample/hello", "helloResponse", elem("result", text(s))); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/Xutil.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/Xutil.java deleted file mode 100644 index ce89f9dd8c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/Xutil.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample; - -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - -/** - * Just for fun, a little bit of magic code and utility functions to help work with XML DOM. - */ -class Xutil { - interface NodeBuilder { - Node build(Document doc); - } - - /** - * Convert a name and a list of children to a document element. - */ - static Element xdom(String ns, String name, final NodeBuilder... nodes) { - return (Element)elem(ns, name, nodes).build(db.newDocument()); - } - - /** - * Convert a name and children to an element. - */ - static NodeBuilder elem(final String uri, final String n, final NodeBuilder... nodes) { - return new NodeBuilder() { - public Node build(Document doc) { - final Element e = doc.createElementNS(uri, n); - for(final NodeBuilder n: nodes) - e.appendChild(n.build(doc)); - return e; - } - }; - } - - static NodeBuilder elem(final String n, final NodeBuilder... nodes) { - return elem(null, n, nodes); - } - - /** - * Convert a string to a text element. - */ - static NodeBuilder text(final String t) { - return new NodeBuilder() { - public Node build(final Document doc) { - return doc.createTextNode(t); - } - }; - } - - private final static DocumentBuilder db = db(); - - private static DocumentBuilder db() { - try { - return DocumentBuilderFactory.newInstance().newDocumentBuilder(); - } catch(ParserConfigurationException e) { - throw new RuntimeException(e); - } - } - - /** - * Convert an element to XML. - */ - static TransformerFactory trf = TransformerFactory.newInstance(); - - static String xml(final Node node) { - try { - final StreamResult r = new StreamResult(new StringWriter()); - trf.newTransformer().transform(new DOMSource(node), r); - return r.getWriter().toString(); - } catch(TransformerException e) { - throw new RuntimeException(e); - } - } - - /** - * Evaluate an xpath expression. - */ - private static XPathFactory xpf = XPathFactory.newInstance(); - - static String xpath(final String expr, final Node node) { - final XPath xp = xpf.newXPath(); - try { - return (String)xp.evaluate(expr, node, XPathConstants.STRING); - } catch(XPathExpressionException e) { - throw new RuntimeException(e); - } - } - - /** - * A pure Java FP-style alternative to xpath for DOM. - */ - interface Mapper { - T map(final Element e); - } - - static Mapper identity = new Mapper() { - public Element map(Element e) { - return e; - }; - }; - - interface Reducer { - T reduce(final T accum, final Element e); - } - - static Reducer print = new Reducer() { - public String reduce(String accum, Element e) { - return accum + e.getTextContent(); - } - }; - - /** - * Apply a mapper to a list of elements. - */ - static List xmap(final Mapper f, final Iterable l) { - final List v = new ArrayList(); - for(Element e: l) - v.add(f.map(e)); - return v; - } - - /** - * Apply a filter to a list of elements. - */ - static List xfilter(final Mapper f, final Iterable l) { - final List v = new ArrayList(); - for(Element e: l) - if(f.map(e)) - v.add(e); - return v; - } - - /** - * Perform a reduction over a list of elements. - */ - static T xreduce(final Reducer f, final T initial, final Iterable l) { - T accum = initial; - for(Element e: l) - accum = f.reduce(accum, e); - return accum; - } - - /** - * Return a filter that selects elements by name. - */ - static Mapper select(final String name) { - return new Mapper() { - public Boolean map(Element e) { - return name.equals(e.getLocalName()); - } - }; - } - - /** - * Return the child elements of a node. - */ - static Iterable elems(final Node parent) { - final List l = new ArrayList(); - for (Node n: children(parent)) - if (n instanceof Element) - l.add((Element)n); - return l; - } - - /** - * An iterable over the children of a node. - */ - private static Iterable children(Node parent) { - final NodeList l = parent.getChildNodes(); - final int n = l.getLength(); - return new Iterable() { - public Iterator iterator() { - return new Iterator() { - int i = 0; - public boolean hasNext() { - return i < n; - } - public Node next() { - return l.item(i++); - } - public void remove() { - } - }; - } - }; - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/EmbedTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/EmbedTestCase.java deleted file mode 100644 index 406dbabee0..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/EmbedTestCase.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.impl; - -import static java.lang.System.out; -import static org.junit.Assert.assertEquals; -import static sample.impl.EmbedUtil.build; -import static sample.impl.EmbedUtil.component; -import static sample.impl.EmbedUtil.composite; -import static sample.impl.EmbedUtil.contrib; -import static sample.impl.EmbedUtil.deploy; -import static sample.impl.EmbedUtil.embedContext; -import static sample.impl.EmbedUtil.extensionPoints; -import static sample.impl.EmbedUtil.implementation; -import static sample.impl.EmbedUtil.node; -import static sample.impl.EmbedUtil.providerFactories; -import static sample.impl.EmbedUtil.reference; -import static sample.impl.EmbedUtil.service; -import static sample.impl.EmbedUtil.wsdli; -import static sample.impl.TestUtil.here; - -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.apache.tuscany.sca.provider.ImplementationProvider; -import org.apache.tuscany.sca.provider.ProviderFactory; -import org.apache.tuscany.sca.runtime.RuntimeComponent; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -import sample.Client; -import sample.ClientTest; -import sample.Hello; -import sample.JelloTest; -import sample.Upper; -import sample.UpperTest; -import sample.WelloTest; - -/** - * Test how to assemble a contribution, a SCDL composite and run it on an embedded - * Tuscany runtime node. Also shows how pass in a ProviderFactory instead of having - * it loaded and constructed by the runtime node. - * - * @version $Rev$ $Date$ - */ -public class EmbedTestCase { - static NodeFactory nf; - static EmbedUtil.Context ec; - static Node node; - - @SuppressWarnings("unchecked") - @BeforeClass - public static void setUp() throws Exception { - nf = NodeFactory.newInstance(); - ec = embedContext(nf); - - // Load the test WSDL definitions (could also construct the WSDL - // and XSD models in code but that'd be quite painful, so just - // load them from XML for now) - final Contribution contrib = build(contrib("test", here()), ec); - WSDLInterface Hello_wsdl = build(wsdli("Hello.wsdl", "http://sample/hello", "Hello", contrib), ec); - WSDLInterface Upper_wsdl = build(wsdli("Upper.wsdl", "http://sample/upper", "Upper", contrib), ec); - - // Assemble a test composite model (see EmbedUtil - // for the little DSL used here, much more concise - // than using the assembly model interfaces) - final Composite comp = - build(composite("http://sample", "test", - component("client-test", - implementation(ClientTest.class, - service(Client.class), - reference("jello", Hello.class), - reference("wello", Hello_wsdl)), - reference("jello", "jello-test"), - reference("wello", "wello-test")), - component("wello-test", - implementation(WelloTest.class, - service(Hello_wsdl), - reference("upper", Upper_wsdl)), - reference("upper", "upper-test")), - component("jello-test", - implementation(JelloTest.class, - service(Hello.class), - reference("upper", Upper.class)), - reference("upper", "upper-test")), - component("upper-test", - implementation(UpperTest.class, - service(Upper.class)))), ec); - - // Register a test instance of our sample implementation ProviderFactory - providerFactories(ec).addProviderFactory(testProviderFactory()); - - // Run with it - node = node(nf, deploy(contrib, comp)); - node.start(); - } - - static ProviderFactory testProviderFactory() { - // This shows how to get called when a provider is created - return new SampleProviderFactory(extensionPoints(ec)) { - public ImplementationProvider createImplementationProvider(RuntimeComponent comp, SampleImplementation impl) { - out.println("Creating a provider for component " + comp.getName()); - return super.createImplementationProvider(comp, impl); - }}; - } - - @AfterClass - public static void tearDown() throws Exception { - node.stop(); - } - - @Test - public void jello() { - out.println("RunTestCase.jello"); - final String r = client().jello("Java"); - out.println(r); - assertEquals("HELLO JAVA", r); - } - - @Test - public void wello() { - out.println("RunTestCase.wello"); - final String r = client().wello("WSDL"); - out.println(r); - assertEquals("HELLO WSDL", r); - } - - static Client client() { - return node.getService(Client.class, "client-test/Client"); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/ReadWriteTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/ReadWriteTestCase.java deleted file mode 100644 index 8a4768cd9e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/ReadWriteTestCase.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.impl; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static sample.impl.TestUtil.here; - -import java.io.ByteArrayOutputStream; -import java.io.InputStream; - -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLOutputFactory; - -import org.apache.tuscany.sca.assembly.Composite; -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.DefaultContributionFactory; -import org.apache.tuscany.sca.contribution.processor.DefaultStAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.contribution.processor.ExtensibleStAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.ProcessorContext; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; -import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; -import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * Test read/write Sample SCDL implementation elements. - * - * @version $Rev$ $Date$ - */ -public class ReadWriteTestCase { - static XMLInputFactory xif; - static XMLOutputFactory xof; - static StAXArtifactProcessor xproc; - static ProcessorContext ctx; - - @BeforeClass - public static void setUp() throws Exception { - final DefaultExtensionPointRegistry ep = new DefaultExtensionPointRegistry(); - final Contribution contrib = new DefaultContributionFactory().createContribution(); - contrib.setLocation(here()); - ctx = new ProcessorContext(contrib, null); - xif = XMLInputFactory.newInstance(); - xof = XMLOutputFactory.newInstance(); - final StAXArtifactProcessorExtensionPoint xpep = new DefaultStAXArtifactProcessorExtensionPoint(ep); - xproc = new ExtensibleStAXArtifactProcessor(xpep, xif, xof); - } - - @Test - public void testRead() throws Exception { - final InputStream is = getClass().getClassLoader().getResourceAsStream("test.composite"); - final Composite c = (Composite)xproc.read(xif.createXMLStreamReader(is), ctx); - assertNotNull(c); - assertEquals("sample.ClientTest", ((SampleImplementation)c.getComponents().get(0).getImplementation()).name); - } - - @Test - public void testReadWrite() throws Exception { - final InputStream is = getClass().getClassLoader().getResourceAsStream("test.composite"); - final Composite c = (Composite)xproc.read(xif.createXMLStreamReader(is), ctx); - final ByteArrayOutputStream bos = new ByteArrayOutputStream(); - xproc.write(c, xof.createXMLStreamWriter(bos), ctx); - assertTrue(bos.toString().contains("class=\"sample.WelloTest\"")); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/RunTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/RunTestCase.java deleted file mode 100644 index 29bf02d26b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/RunTestCase.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.impl; - -import static java.lang.System.out; -import static org.junit.Assert.assertEquals; -import static sample.impl.TestUtil.here; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -import sample.Client; - -/** - * Test how to run an SCA contribution containing a test composite on a - * Tuscany runtime node. - * - * @version $Rev$ $Date$ - */ -public class RunTestCase { - static Node node; - - @BeforeClass - public static void setUp() throws Exception { - final NodeFactory nf = NodeFactory.newInstance(); - node = nf.createNode(new Contribution("test", here())); - node.start(); - } - - @AfterClass - public static void tearDown() throws Exception { - node.stop(); - } - - @Test - public void jello() { - out.println("RunTestCase.jello"); - final String r = client().jello("Java"); - out.println(r); - assertEquals("HELLO JAVA", r); - } - - @Test - public void wello() { - out.println("RunTestCase.wello"); - final String r = client().wello("WSDL"); - out.println(r); - assertEquals("HELLO WSDL", r); - } - - static Client client() { - return node.getService(Client.class, "client-test/Client"); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/RunWSTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/RunWSTestCase.java deleted file mode 100644 index 61133d0fbf..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/RunWSTestCase.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.impl; - -import static java.lang.System.out; -import static org.junit.Assert.assertTrue; -import static sample.impl.TestUtil.here; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.net.Socket; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.tuscany.sca.core.ExtensionPointRegistry; -import org.apache.tuscany.sca.http.jetty.JettyServer; -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * Test a component that provides and consumes SOAP Web services. - * - * @version $Rev$ $Date$ - */ -public class RunWSTestCase { - static Node node; - static JettyServer jetty; - - @BeforeClass - public static void setUp() throws Exception { - // Start test composite on a Tuscany node - final NodeFactory nf = NodeFactory.newInstance(); - node = nf.createNode(new Contribution("test", here())); - node.start(); - - // Mock up a test Web service on http://localhost:8086/wsupper - jetty = new JettyServer((ExtensionPointRegistry)nf.getExtensionPointRegistry()); - jetty.start(); - jetty.addServletMapping("http://localhost:8086/wsupper", new HttpServlet() { - private static final long serialVersionUID = 1L; - protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - assertTrue(read(req.getInputStream()).contains("Hello SOAP")); - final String soapresp = - "" + - "" + - "HELLO SOAP" + - ""; - - write(soapresp, resp.getOutputStream()); - } - }); - } - - @AfterClass - public static void tearDown() throws Exception { - jetty.stop(); - node.stop(); - } - - @Test - public void wsello() throws Exception { - out.println("RunWSTestCase.wsello"); - // Send a SOAP request to the Web service provided by SCA component wsello-test - // on http://localhost:8085/wsello - final Socket s = new Socket("localhost", 8085); - final String soapreq = - "POST /wsello HTTP/1.0\r\n" + - "Content-Type: text/xml; charset=UTF-8\r\n" + - "Content-length: 231\r\n\r\n" + - "" + - "" + - "SOAP" + - ""; - write(soapreq, s.getOutputStream()); - assertTrue(read(s.getInputStream()).contains("HELLO SOAP")); - } - - static void write(final String s, final OutputStream o) throws IOException { - final OutputStreamWriter w = new OutputStreamWriter(o); - w.write(s); - w.flush(); - } - - static String read(final InputStream i) throws IOException { - return read(new BufferedReader(new InputStreamReader(i))); - } - - static String read(final BufferedReader r) throws IOException { - final String s = r.readLine(); - return s == null? "" : s + read(r); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/TestUtil.java b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/TestUtil.java deleted file mode 100644 index 6dcfb33912..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/java/sample/impl/TestUtil.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample.impl; - -/** - * A hack to determine the test contribution location. - */ -public class TestUtil { - - static String here() { - return TestUtil.class.getProtectionDomain().getCodeSource().getLocation().toString(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/resources/Hello.wsdl b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/resources/Hello.wsdl deleted file mode 100644 index 360cea5ff3..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/resources/Hello.wsdl +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/resources/Upper.wsdl b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/resources/Upper.wsdl deleted file mode 100644 index 8a148bb5e8..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/resources/Upper.wsdl +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/resources/test.composite b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/resources/test.composite deleted file mode 100644 index 43a75f50a7..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/implementation-sample/src/test/resources/test.composite +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/pom.xml deleted file mode 100644 index 6118010fc4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/extending-tuscany/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - - tuscany-samples-extending-tuscany - pom - Apache Tuscany SCA Extending Tuscany Samples - - - - default - - true - - - binding-sample - implementation-sample - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/pom.xml deleted file mode 100644 index 54a13ada0b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-callback-api-contribution - Apache Tuscany SCA Sample Callback API Contribution - - - - org.apache.tuscany.sca - tuscany-node-api - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-node-impl - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 2.0-Beta2-SNAPSHOT - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/CallBack.java b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/CallBack.java deleted file mode 100644 index 16e4297e9d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/CallBack.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The callback interface. - */ -@Remotable -public interface CallBack { - - void callBackMessage(String aString); - - void callBackIncrement(); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/Client.java b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/Client.java deleted file mode 100644 index 7e0709e660..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/Client.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Client { - - void run(); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/ClientImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/ClientImpl.java deleted file mode 100644 index 01219aa608..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/ClientImpl.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Service; - -@Service(Client.class) -public class ClientImpl implements Client, CallBack { - - public static final String DELIMITER = "\n----------------------------"; - - @Reference - protected sample.Service service; - - private static int callBackCount = 0; - - /** - * This function prints the message received from the service - * implementation. - * - * @param String the message received from the service - */ - public void callBackMessage(String aString) { - System.out.println("ClientImpl - Received callback message: " + aString); - } - - /** - * This function increments the callBackCount variable when called from the - * service implementation. - */ - public void callBackIncrement() { - System.out.println("ClientImpl - Received increment callback"); - callBackCount++; - System.out.println("ClientImpl - Callback counter incremented to : " + getCallBackCount()); - } - - /** - * This method runs different kinds of service calls implying callbacks. - */ - public void run() { - simpleCallBack(); - simpleCallBackByRef(); - noCallBack(); - multipleCallBack(); - } - - /** - * The basic callback where the target calls back prior to returning to the - * client. - */ - private void simpleCallBack() { - System.out.println(DELIMITER + "\nSimple callback" + DELIMITER); - service.knockKnock("Knock Knock"); - } - - /** - * The basic callback where the target calls back prior to returning to the - * client. - */ - private void simpleCallBackByRef() { - System.out.println(DELIMITER + "\nSimple callback by reference" + DELIMITER); - service.knockKnockByRef("Knock Knock by reference"); - } - - /** - * The basic callback where the target does not call back to the client. - */ - private void noCallBack() { - System.out.println(DELIMITER + "\nNo callback" + DELIMITER); - service.noCallBack("No Reply Desired"); - } - - /** - * The basic callback where the target calls back multiple times to the - * client. - */ - private void multipleCallBack() { - System.out.println(DELIMITER + "\nMultiple callbacks" + DELIMITER); - service.multiCallBack("Call me back 3 times"); - } - - /** - * This function returns the callBackCount variable. - * - * @return Integer the callBackCount variable - */ - public int getCallBackCount() { - return callBackCount; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/Launcher.java b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/Launcher.java deleted file mode 100644 index fa1a59d726..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/Launcher.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -/** - * This class starts the Tuscany Runtime and runs the client calls to the - * service. - */ -public class Launcher { - - public static void main(String[] args) { - Node node = startRuntime(); - Client client = node.getService(Client.class, "Client"); - client.run(); - stopRuntime(node); - } - - /** - * Starts a Tuscany node with the predefined contribution. - * - * @return the running node - */ - private static Node startRuntime() { - String location = ContributionLocationHelper.getContributionLocation("CallBackApi.composite"); - Node node = NodeFactory.newInstance().createNode("CallBackApi.composite", new Contribution("c1", location)); - node.start(); - return node; - } - - /** - * Stops a Tuscany node. - * - * @param node the node to stop - */ - private static void stopRuntime(Node node) { - node.stop(); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/Service.java b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/Service.java deleted file mode 100644 index 6723af2adf..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/Service.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Callback; -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -@Callback(CallBack.class) -public interface Service { - - void knockKnock(String aString); - - void knockKnockByRef(String aString); - - void noCallBack(String aString); - - void multiCallBack(String aString); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/ServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/ServiceImpl.java deleted file mode 100644 index 4850f434ff..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/java/sample/ServiceImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.ServiceReference; -import org.oasisopen.sca.annotation.Callback; -import org.oasisopen.sca.annotation.Context; -import org.oasisopen.sca.annotation.Service; - -@Service(sample.Service.class) -public class ServiceImpl implements sample.Service { - - public static final String MESSAGE_RECEIVED = "ServiceImpl - Received message: "; - - @Context - protected ComponentContext componentContext; - - @Callback - protected ServiceReference callbackRef; - - /** - * This function gets an object of ServiceImpl by calling - * getCallBackInterface function and calls the callBackMessage function. - * - * @param aString String passed by a function call - */ - public void knockKnock(String aString) { - System.out.println(MESSAGE_RECEIVED + aString); - CallBack callback = this.getCallBackFromComponentContext(); - callback.callBackMessage("Who's There"); - } - - /** - * This function calls the callBackMessage function. The reference to this - * function is received from the callback reference to the Service class. - * - * @param aString String passed by a function call - */ - public void knockKnockByRef(String aString) { - System.out.println(MESSAGE_RECEIVED + aString); - callbackRef.getService().callBackMessage("Who's There"); - } - - /** - * This function gets an object of ServiceImpl by calling - * getCallBackInterface function. This function then places multiple - * callbacks using the callbackIncrement function defined in the callback - * implementation. - * - * @param aString String passed by a function call - */ - public void multiCallBack(String aString) { - CallBack callback = this.getCallBackFromComponentContext(); - System.out.println(MESSAGE_RECEIVED + aString); - callback.callBackIncrement(); - callback.callBackIncrement(); - callback.callBackIncrement(); - } - - /** - * This function does not callBack any function. - * - * @param aString String passed by a function call - */ - public void noCallBack(String aString) { - System.out.println(MESSAGE_RECEIVED + aString); - } - - /** - * This function gets an object of ServiceImpl from the present - * componentContext. - * - * @return the callback - */ - private CallBack getCallBackFromComponentContext() { - return componentContext.getRequestContext().getCallback(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/resources/CallBackApi.composite b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/resources/CallBackApi.composite deleted file mode 100644 index ca3a6e5f9d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/resources/CallBackApi.composite +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index f17791205a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/callback-api/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/helloworld.cmds b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/helloworld.cmds deleted file mode 100644 index e94a0e42a6..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/helloworld.cmds +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# install the helloworld contribution and start its deployables -install helloworld-contribution/target/helloworld-contribution.jar -start diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/helloworld.xml b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/helloworld.xml deleted file mode 100644 index e01074870c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/helloworld.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/new-sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/new-sca-contribution.xml deleted file mode 100644 index 62e8fef55d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/new-sca-contribution.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/scdl-include.xml b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/scdl-include.xml deleted file mode 100644 index b15b20befd..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/scdl-include.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/wsClient.html b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/wsClient.html deleted file mode 100644 index 402f30cdf8..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/files/wsClient.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - -Tuscany Web service Sample Client - - - - - -

Tuscany Web service Sample Client

- -

Tuscany Web service Sample Client

- -

Sends a request to a Web Service endpoint. (This requires JavaScript)

-

Target: .

- - - - - - - - - -
- - - -
- -
- - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/README b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/README deleted file mode 100644 index ed0f1d0ce4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/README +++ /dev/null @@ -1,7 +0,0 @@ -The README in the /samples directory provides -general instructions about building and running samples. (where -distribution-unpack-dir is the directory in which you unpacked the tuscany -binary distribution archive). Take a look there first (noting at you read it that this sample -is not a new style sample). - -TODO - finish this \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/pom.xml deleted file mode 100644 index 3f14f59c7b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - - jar - sample-helloworld-contribution - Apache Tuscany SCA Samples - Getting Started - helloworld-contribution - - - - org.apache.tuscany.sca - tuscany-base-runtime - 2.0-Beta2-SNAPSHOT - - - junit - junit - 4.8.1 - test - - - - - ${artifactId} - - - org.apache.tuscany.maven.plugins - maven-tuscany-plugin - 2.0-Beta2-SNAPSHOT - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/java/sample/Helloworld.java b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/java/sample/Helloworld.java deleted file mode 100644 index f4e8c50448..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/java/sample/Helloworld.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Helloworld { - - String sayHello(String name); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/java/sample/HelloworldImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/java/sample/HelloworldImpl.java deleted file mode 100644 index aa563cbdf3..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/java/sample/HelloworldImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.EagerInit; - -@Scope("COMPOSITE") @EagerInit -public class HelloworldImpl implements Helloworld { - - public String sayHello(String name) { - System.out.println("HelloworldImpl.sayHello " + name); - return "Hello " + name; - } - - @Init - public void init() { - System.out.println(sayHello("world")); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 61053aa92e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/resources/helloworld.composite b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/resources/helloworld.composite deleted file mode 100644 index 324395c246..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/resources/helloworld.composite +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/resources/helloworldws.composite b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/resources/helloworldws.composite deleted file mode 100644 index abefee7360..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/main/resources/helloworldws.composite +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/test/java/sample/HelloworldTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/test/java/sample/HelloworldTestCase.java deleted file mode 100644 index ded7418469..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-contribution/src/test/java/sample/HelloworldTestCase.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import static org.junit.Assert.assertEquals; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.Test; - -public class HelloworldTestCase { - - @Test - public void testSayHello() { - // Start up the Tuscany runtime with this modules as the contribution - Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "target/classes")); - node.start(); - - // This contribution is configured to deploy the helloworld.composite file - // automatically. This defines the HelloworldComponent. Get a local proxy to it - // and call the sayHello service operation. - Helloworld helloworld = node.getService(Helloworld.class, "HelloworldComponent"); - String response = helloworld.sayHello("Petra"); - System.out.println("Response from helloworld.sayHello(\"Petra\") = " + response); - assertEquals("Hello Petra", response); - - // Stop the Tuscany runtime - node.stop(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/README b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/README deleted file mode 100644 index 828aadb0f1..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/README +++ /dev/null @@ -1,7 +0,0 @@ -The README in the /samples directory provides -general instructions about building and running samples. (where -distribution-unpack-dir is the directory in which you unpacked the tuscany -binary distribution archive). Take a look there first (noting at you read it that this sample -is not a new style sample). - -TODO - finish \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/pom.xml deleted file mode 100644 index e080e66122..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/pom.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../../pom.xml - - - sample-helloworld-webapp - Apache Tuscany SCA Sample Helloworld - war - - - - - org.apache.tuscany.sca - tuscany-base-runtime - 2.0-Beta2-SNAPSHOT - - - - junit - junit - 4.8.1 - test - - - - - - helloworld - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy - compile - - copy - - - - - org.apache.tuscany.sca - sample-helloworld-contribution - ${pom.version} - - src/main/webapp/WEB-INF/sca-contributions - - - - - - - - - org.mortbay.jetty - maven-jetty-plugin - 6.1.18 - - helloworld - foo - 9999 - - - - start-jetty - process-test-classes - - run - - - src/test/resources/test-web.xml - 0 - true - - - 8085 - - - - - - stop-jetty - prepare-package - - stop - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/main/webapp/WEB-INF/web.xml b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 755162e305..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Apache Tuscany Helloworld Sample - - - contributions - /WEB-INF/sca-contributions - - - - - - tuscany - org.apache.tuscany.sca.host.webapp.TuscanyServletFilter - - - - tuscany - /* - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/main/webapp/hello.html b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/main/webapp/hello.html deleted file mode 100644 index 05038391a0..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/main/webapp/hello.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - -Apache Tuscany Helloworld Servlet Sample - - - - -

Apache Tuscany Helloworld Servlet Sample

- -WSDL for binding.ws of the Helloworld service of the HelloWorldWS component - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/test/java/itest/Helloworld.java b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/test/java/itest/Helloworld.java deleted file mode 100644 index f1ccf0b1ba..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/test/java/itest/Helloworld.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package itest; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Helloworld { - String sayHello(String name); -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/test/java/itest/HelloworldTestCaseFIXME.java b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/test/java/itest/HelloworldTestCaseFIXME.java deleted file mode 100644 index c1c2c6aae0..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/test/java/itest/HelloworldTestCaseFIXME.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package itest; - -import static org.junit.Assert.assertEquals; - -import java.net.URI; - -import org.junit.Test; -import org.oasisopen.sca.NoSuchDomainException; -import org.oasisopen.sca.NoSuchServiceException; -import org.oasisopen.sca.client.SCAClientFactory; - -/** - */ -public class HelloworldTestCaseFIXME { - - @Test - public void testHelloworld() throws NoSuchDomainException, NoSuchServiceException { -// TODO: need to fix the config URI so it works properly -// SCAClientFactory factory = SCAClientFactory.newInstance(URI.create("uri:default?remote=127.0.0.1:54321")); - SCAClientFactory factory = SCAClientFactory.newInstance(URI.create("tuscany:default?remotes=192.168.1.64")); - Helloworld helloworld = factory.getService(Helloworld.class, "HelloworldComponent"); - assertEquals("Hello World", helloworld.sayHello("World")); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/test/resources/test-web.xml b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/test/resources/test-web.xml deleted file mode 100644 index a68aa28698..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/helloworld-webapp/src/test/resources/test-web.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - org.apache.tuscany.sca.config - uri:default?bind=127.0.0.1:54321 - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/pom.xml deleted file mode 100644 index 654be322aa..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/pom.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-samples-getting-started-contributions - org.apache.tuscany.sca - pom - Apache Tuscany SCA Getting Started Sample Contributions - - - - default - - true - - - helloworld-contribution - scdl-include-contribution - callback-api - sca-scopes - helloworld-webapp - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/pom.xml deleted file mode 100644 index 37cad4e913..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - Apache Tuscany SCA Sample SCA Scopes Contribution - sample-sca-scopes-contribution - - - - org.apache.tuscany.sca - tuscany-node-api - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-node-impl - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 2.0-Beta2-SNAPSHOT - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/Client.java b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/Client.java deleted file mode 100644 index 13f6e003f8..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/Client.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -public interface Client { - - void run(); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/ClientImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/ClientImpl.java deleted file mode 100644 index 3dbeeb0649..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/ClientImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Reference; - -public class ClientImpl implements Client { - - private static final int TIMES = 5; - - @Reference - private CompositeService compositeService; - - @Reference - private StatelessService statelessService; - - public void setCompositeService(CompositeService compositeService) { - this.compositeService = compositeService; - } - - public void setStatelessService(StatelessService statelessService) { - this.statelessService = statelessService; - } - - @Override - public void run() { - System.out.println("Calling CompositeService " + TIMES + " times..."); - for (int i = 0 ; i < TIMES; i++) { - compositeService.hello(); - } - System.out.println("Calling StatelessService " + TIMES + " times..."); - for (int i = 0 ; i < TIMES; i++) { - statelessService.hello(); - } - } - - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/CompositeService.java b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/CompositeService.java deleted file mode 100644 index 60384cb73c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/CompositeService.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */package sample; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface CompositeService { - - void hello(); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/CompositeServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/CompositeServiceImpl.java deleted file mode 100644 index f4587671c0..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/CompositeServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.Service; - -@Scope("COMPOSITE") -@Service(CompositeService.class) -public class CompositeServiceImpl implements CompositeService { - - public CompositeServiceImpl() { - super(); - System.out.println("Constructing CompositeServiceImpl instance."); - } - - @Override - public void hello() { - System.out.println("Saying hello to CompositeServiceImpl instance."); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/Launcher.java b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/Launcher.java deleted file mode 100644 index 8d00b6ef64..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/Launcher.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -public class Launcher { - - public static void main(String[] args) { - Node node = startRuntime(); - Client client = node.getService(Client.class, "Client"); - client.run(); - stopRuntime(node); - } - - /** - * Starts a Tuscany node with the predefined contribution. - * - * @return the running node - */ - private static Node startRuntime() { - String location = ContributionLocationHelper.getContributionLocation("scopes.composite"); - Node node = NodeFactory.newInstance().createNode("scopes.composite", new Contribution("c1", location)); - node.start(); - return node; - } - - /** - * Stops a Tuscany node. - * - * @param node the node to stop - */ - private static void stopRuntime(Node node) { - node.stop(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/StatelessService.java b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/StatelessService.java deleted file mode 100644 index 8474bc6ff3..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/StatelessService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface StatelessService { - - void hello(); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/StatelessServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/StatelessServiceImpl.java deleted file mode 100644 index 94d6339c3d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/java/sample/StatelessServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Scope; -import org.oasisopen.sca.annotation.Service; - -@Scope("STATELESS") -@Service(StatelessService.class) -public class StatelessServiceImpl implements StatelessService { - - public StatelessServiceImpl() { - super(); - System.out.println("Constructing StatelessServiceImpl instance."); - } - - @Override - public void hello() { - System.out.println("Saying hello to StatelessServiceImpl."); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/resources/scopes.composite b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/resources/scopes.composite deleted file mode 100644 index 14937a1f34..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/sca-scopes/src/main/resources/scopes.composite +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/scdl-include-contribution/README b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/scdl-include-contribution/README deleted file mode 100644 index ed0f1d0ce4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/scdl-include-contribution/README +++ /dev/null @@ -1,7 +0,0 @@ -The README in the /samples directory provides -general instructions about building and running samples. (where -distribution-unpack-dir is the directory in which you unpacked the tuscany -binary distribution archive). Take a look there first (noting at you read it that this sample -is not a new style sample). - -TODO - finish this \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/scdl-include-contribution/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/scdl-include-contribution/pom.xml deleted file mode 100644 index 20abde1c6d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/scdl-include-contribution/pom.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - - zip - sample-scdl-include-contribution - Apache Tuscany SCA Sample include Composite Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 2.0-Beta2-SNAPSHOT - provided - - - junit - junit - 4.8.1 - test - - - - - ${artifactId} - - - - - - org.apache.tuscany.maven.plugins - maven-zip-plugin - alpha2 - true - - - - - org.apache.tuscany.maven.plugins - maven-tuscany-plugin - 2.0-Beta2-SNAPSHOT - - - - ..\helloworld-contribution\target\helloworld-contribution.jar - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/scdl-include-contribution/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/scdl-include-contribution/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index b7677f1740..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/scdl-include-contribution/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/scdl-include-contribution/src/main/resources/scdl-include.composite b/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/scdl-include-contribution/src/main/resources/scdl-include.composite deleted file mode 100644 index 7f75c65a68..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/getting-started/scdl-include-contribution/src/main/resources/scdl-include.composite +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/README deleted file mode 100644 index 7f1192d44a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/README +++ /dev/null @@ -1,7 +0,0 @@ -Sample async implemenation.java -=============================== -This sample demonstrates the SCA Java asynchronous programming model - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/build.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/build.xml deleted file mode 100644 index 5cea87e4c3..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/build.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - ${tuscany.home} - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/pom.xml deleted file mode 100644 index 8679334aa0..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-implementation-java-calculator-async-contribution - Apache Tuscany SCA Sample implementation.java Calculator Async Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 2.0-Beta2-SNAPSHOT - - - - junit - junit - 4.8.1 - test - - - - - ${artifactId} - - - org.apache.tuscany.maven.plugins - maven-tuscany-plugin - 2.0-Beta2-SNAPSHOT - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculateReferenceAsync.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculateReferenceAsync.java deleted file mode 100644 index a8a323ba04..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculateReferenceAsync.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -import java.util.concurrent.Future; - -import javax.xml.ws.AsyncHandler; -import javax.xml.ws.Response; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * Async client version of the CalculatorService interface - * - */ - -@Remotable -public interface CalculateReferenceAsync { - - // Sync - public String calculate(Integer i1); - - // Aysnc Poll - public Response calculateAsync(Integer i1); - - // Async Callback - public Future calculateAsync(Integer i1, AsyncHandler handler); - -/* TUSCANY-3757 - // Sync - public void print(Integer i1); - - // Aysnc Poll - public Response printAsync(Integer i1); - - // Async Callback - public Future printAsync(Integer i1, AsyncHandler handler); -*/ -} - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorAsyncHandler.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorAsyncHandler.java deleted file mode 100644 index abaeef8062..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorAsyncHandler.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import javax.xml.ws.AsyncHandler; -import javax.xml.ws.Response; - -/** - * Handles callbacks to the async client - */ - -public class CalculatorAsyncHandler implements AsyncHandler { - public void handleResponse(Response res) { - try { - System.out.println("Async client callback patern: result in handler = " + res.get()); - } catch(Exception ex){ - System.out.println("Async client callback patern: exception in handler = " + ex.getMessage()); - } - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorClient.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorClient.java deleted file mode 100644 index 6f4ffc0ca7..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorClient.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -import org.oasisopen.sca.annotation.EagerInit; -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; - -/** - * This client program shows how to create an SCA runtime, start it, - * and locate and invoke a SCA component - */ -@Scope("COMPOSITE") @EagerInit -public class CalculatorClient { - - private CalculatorServiceSync calculatorService; - - - @Reference - public void setCalculatorService(CalculatorServiceSync calculatorService) { - this.calculatorService = calculatorService; - } - - @Init - public void calculate() { - System.out.println("calculation=" + calculatorService.calculate(20)); - System.out.println("print"); - /* TUSCANY-3757 - calculatorService.print(27); - */ - } - - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorPrintAsyncHandler.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorPrintAsyncHandler.java deleted file mode 100644 index 8faf390974..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorPrintAsyncHandler.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import javax.xml.ws.AsyncHandler; -import javax.xml.ws.Response; - -/** - * Handles callbacks to the async client - */ - -public class CalculatorPrintAsyncHandler implements AsyncHandler { - public void handleResponse(Response res) { - try { - System.out.println("Async client callback patern: result in print handler = " + res.get()); - } catch(Exception ex){ - System.out.println("Async client callback patern: exception in print handler = " + ex.getMessage()); - } - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceAsync.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceAsync.java deleted file mode 100644 index bcb931e418..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceAsync.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.ResponseDispatch; -import org.oasisopen.sca.annotation.AsyncInvocation; -import org.oasisopen.sca.annotation.Remotable; - -/** - * The async Calculator service interface. - */ - -@Remotable -@AsyncInvocation -public interface CalculatorServiceAsync { - void calculateAsync(Integer n1, ResponseDispatch response); - /* TUSCANY-3757 - void printAsync(Integer n1, ResponseDispatch response); - */ -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceAsyncImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceAsyncImpl.java deleted file mode 100644 index d865bcf454..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceAsyncImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -import org.oasisopen.sca.ResponseDispatch; - -public class CalculatorServiceAsyncImpl implements CalculatorServiceAsync { - - @Override - public void calculateAsync(Integer n1, ResponseDispatch response) { - int result = n1 + n1; - String retval = "async service invoked: " + n1 + " + " + n1 + " = " + result; - - response.sendResponse(retval); - } - -/* TUSCANY-3757 - @Override - - public void printAsync(Integer n1, ResponseDispatch response) { - int result = n1 + n1; - String retval = "async service invoked: " + n1 + " + " + n1 + " = " + result; - System.out.println(retval); - } -*/ - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceProxyImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceProxyImpl.java deleted file mode 100644 index 45e23b8e93..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceProxyImpl.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; - -import javax.xml.ws.Response; - -import org.oasisopen.sca.annotation.Reference; - -/** - * An implementation of the Calculator service which just proxies - * to sync and asyn versions of the calculator service. This proxy - * exercises the various async interface alternatives - */ -public class CalculatorServiceProxyImpl implements CalculatorServiceSync { - - @Reference - protected CalculateReferenceAsync calculatorServiceRefSync; - - @Reference - protected CalculateReferenceAsync calculatorServiceRefAsync; - - @Override - public String calculate(Integer n1) { - String result = null; - - // calculate using a sync service - System.out.println("Calling sync service for calculate"); - result = calculate(calculatorServiceRefSync, n1); - - // calculate using an aycn service - System.out.println("Calling async service for calculate"); - result += calculate(calculatorServiceRefAsync, n1); - - return result; - } - - // exercise sync and async versions of a service interface method - private String calculate(CalculateReferenceAsync calculatorRef, Integer n1) { - - // sync - String result = calculatorRef.calculate(1); - System.out.println("Sync client patern: result = " + result); - - // async poll - Response response = calculatorRef.calculateAsync(20); - - while (!response.isDone()){ - System.out.println("Waiting for poll"); - try { - Thread.sleep(500); - } catch (Exception ex) { - // do nothing - } - } - - try { - result = response.get(); - System.out.println("Async client poll patern: result = " + result); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (ExecutionException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - // async callback - CalculatorAsyncHandler handler = new CalculatorAsyncHandler(); - Future future = calculatorRef.calculateAsync(3, handler); - - while (!future.isDone()){ - System.out.println("Waiting for callback"); - try { - Thread.sleep(500); - } catch (Exception ex) { - // do nothing - } - } - - return result; - } - -/* TUSCANY-3757 - @Override -*/ - public void print(Integer n1) { - - // calculate using a sync service - System.out.println("Calling sync service for print"); - //print(calculatorServiceRefSync, n1); - - // calculate using an asycn service - System.out.println("Calling async service for print"); - //print(calculatorServiceRefAsync, n1); - } - -/* TUSCANY-3757 - // exercise sync and async versions of a service interface method - private void print(CalculateReferenceAsync calculatorRef, Integer n1) { - - // sync - calculatorRef.print(1); - - // async poll - Response response = calculatorRef.printAsync(20); - - // async callback - CalculatorPrintAsyncHandler handler = new CalculatorPrintAsyncHandler(); - Future future = calculatorRef.printAsync(3, handler); - - } -*/ -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceSync.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceSync.java deleted file mode 100644 index cded310a15..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceSync.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The sync Calculator service interface. - */ - -@Remotable -public interface CalculatorServiceSync { - String calculate(Integer n1); - void print(Integer n1); -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceSyncImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceSyncImpl.java deleted file mode 100644 index 01e0d9f414..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/java/calculator/CalculatorServiceSyncImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -public class CalculatorServiceSyncImpl implements CalculatorServiceSync { - - @Override - public String calculate(Integer n1) { - int result = n1 + n1; - String retval = "sync service invoked: " + n1 + " + " + n1 + " = " + result; - return retval; - } - - @Override - public void print(Integer n1) { - int result = n1 + n1; - String retval = "sync service invoked: " + n1 + " + " + n1 + " = " + result; - System.out.println(retval); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/resources/Calculator.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/resources/Calculator.composite deleted file mode 100644 index 6117d436db..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/resources/Calculator.composite +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/resources/CalculatorClient.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/resources/CalculatorClient.composite deleted file mode 100644 index 374ef27e2b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/resources/CalculatorClient.composite +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 3e64787ce4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/pom.xml deleted file mode 100644 index e8c4785cef..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/async/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-tuscany-async - pom - Apache Tuscany SCA Samples for Synchronous/Asynchronous invocation - - - - default - - true - - - calculator-contribution - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/pom.xml deleted file mode 100644 index 1db87439cd..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-sample-binding-comet - pom - Apache Tuscany SCA Sample binding.comet - - - - default - - true - - - weather-webapp - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/deploy.sh b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/deploy.sh deleted file mode 100755 index eb53bd5c76..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/deploy.sh +++ /dev/null @@ -1,20 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations - -#!/bin/bash - -mvn clean install -appcfg.sh update target/comet-webapp \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/pom.xml deleted file mode 100644 index 4288be5453..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/pom.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - - org.apache.tuscany.sca - sample-binding-comet-weather-webapp - war - 1.0 - Apache Tuscany SCA Sample binding.comet Weather Webapp - - - - org.apache.tuscany.sca - tuscany-base-runtime - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-binding-comet-runtime - 2.0-Beta2-SNAPSHOT - - - javax - javaee-web-api - 6.0 - provided - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/Helper.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/Helper.java deleted file mode 100644 index eecc6044ea..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/Helper.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.sample.comet; - -import java.util.Date; -import java.util.Random; - -public final class Helper { - - public static int randomInt(final int max) { - return (new Random(new Date().getTime()).nextInt(100)); - } - - private Helper() { - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/HumidityService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/HumidityService.java deleted file mode 100644 index 00cbe73e82..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/HumidityService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.sample.comet; - -import org.apache.tuscany.sca.sample.comet.model.Location; -import org.apache.tuscany.sca.sample.comet.model.Response; -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface HumidityService { - - Response getHumidity(Location location); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationService.java deleted file mode 100644 index afbdcbc8d7..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.sample.comet; - -import org.apache.tuscany.sca.sample.comet.model.Location; -import org.apache.tuscany.sca.sample.comet.model.Response; -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface PrecipitationService { - - Response getPrecipitation(Location location); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationServiceImpl.java deleted file mode 100644 index 4278ef975b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/PrecipitationServiceImpl.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.sample.comet; - -import java.util.Date; - -import org.apache.tuscany.sca.sample.comet.model.Location; -import org.apache.tuscany.sca.sample.comet.model.Response; -import org.oasisopen.sca.annotation.Service; - -@Service(PrecipitationService.class) -public class PrecipitationServiceImpl implements PrecipitationService { - - @Override - public Response getPrecipitation(final Location location) { - final Response response = new Response(); - response.setDate(new Date()); - response.setData(Helper.randomInt(100) + "%"); - return response; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/TemperatureHumidityServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/TemperatureHumidityServiceImpl.java deleted file mode 100644 index 55f935fa9f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/TemperatureHumidityServiceImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.sample.comet; - -import java.util.Date; - -import org.apache.tuscany.sca.sample.comet.model.Location; -import org.apache.tuscany.sca.sample.comet.model.Response; -import org.oasisopen.sca.annotation.Service; - -@Service({TemperatureService.class, HumidityService.class}) -public class TemperatureHumidityServiceImpl implements TemperatureService, HumidityService { - - @Override - public Response getHumidity(final Location location) { - final Response response = new Response(); - response.setDate(new Date()); - response.setData(Helper.randomInt(90) + "%"); - return response; - } - - @Override - public Response getTemperature(final Location location, final int scale) { - final Response response = new Response(); - response.setDate(new Date()); - final String data = "" + Helper.randomInt(scale == TemperatureService.CELSIUS ? 40 : 150); - response.setData(data); - return response; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/TemperatureService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/TemperatureService.java deleted file mode 100644 index 092988213b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/TemperatureService.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.sample.comet; - -import org.apache.tuscany.sca.sample.comet.model.Location; -import org.apache.tuscany.sca.sample.comet.model.Response; -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface TemperatureService { - - public static final int CELSIUS = 1; - public static final int FAHRENHEIT = 2; - - Response getTemperature(Location location, int scale); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Location.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Location.java deleted file mode 100644 index ff2da3a360..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Location.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.sample.comet.model; - -public class Location { - - private String city; - private String country; - - public String getCity() { - return this.city; - } - - public void setCity(final String city) { - this.city = city; - } - - public String getCountry() { - return this.country; - } - - public void setCountry(final String country) { - this.country = country; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Response.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Response.java deleted file mode 100644 index aaa23f0b8a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/java/org/apache/tuscany/sca/sample/comet/model/Response.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tuscany.sca.sample.comet.model; - -import java.util.Date; - -public class Response { - - private Date date; - private String data; - - public Date getDate() { - return this.date; - } - - public void setDate(final Date date) { - this.date = date; - } - - public String getData() { - return this.data; - } - - public void setData(final String data) { - this.data = data; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/META-INF/MANIFEST.MF b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/META-INF/MANIFEST.MF deleted file mode 100644 index 58630c02ef..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/META-INF/MANIFEST.MF +++ /dev/null @@ -1,2 +0,0 @@ -Manifest-Version: 1.0 - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/appengine-web.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/appengine-web.xml deleted file mode 100644 index 8696f76c50..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/appengine-web.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - tuscany-comet - 1 - true - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/web.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/web.composite deleted file mode 100644 index 05b2ddd0d7..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/web.composite +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/web.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 25b06c457a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - Apache Tuscany Stock Comet Sample - - tuscany - org.apache.tuscany.sca.host.webapp.TuscanyServletFilter - true - - - tuscany - /* - - - index.html - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/index.html b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/index.html deleted file mode 100644 index 0387e67adb..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-comet/weather-webapp/src/main/webapp/index.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - Apache Tuscany Comet Sample - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/README deleted file mode 100644 index 580d5e79c7..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/README +++ /dev/null @@ -1,131 +0,0 @@ -JMS HelloWorld Sample -===================== -This sample demonstrates a simple webapp containing a hello world style client -and service using the JMS binding for request-response style messaging. - -The README in the samples directory (the directory three directories above this) provides -general instructions about building and running samples. Take a look there -first. - -As this sample provides a web app there is a manual step where the WAR file -that contains the sample is copied to your web app container. If you just want -to give this sample a go deploy the WAR file (target/helloworld-jms.war ) -to you web application server. Alternatevly, the sample pom.xml is configured -with the Jetty plugin so you can run the it with Jetty by simply doing "mvn jetty:run". - -Once the web app is deployed use your browser to visit the following URL; - -http://localhost:8080/helloworld-jms - -The port and hostname will of course vary depending on your local installation. - -Configuring the JMS resources ------------------------------ - -The sample requires JMS resources be manually configured in the server environment, these are: - -- a JMS connection factory named "ConnectionFactory" -- a JMS queue named "HelloWorldService" - -See the following for how to define these resources depending on the application server being used: - -Tuscany with embedded ActiveMQ broker -------------------------------------- - - -Apache Tomcat -------------- - -No configuration is necessary for Tomcat as the sample WAR includes everything pre-configured to run -an ActiveMQ embedded JMS broker and to configure the JMS resources in JNDI. - -The JNDI resources are configured in the META-INF/comtext.xml file, for more information on running -ActiveMQ in Tomcat see: http://activemq.apache.org/tomcat.html - - -Apache Geronimo ---------------- - -For Apache Geronimo 2.0.1 (2.0.2 fails to define JMS resources for me) - -Logon to the Geronimo Server Console (http://localhost:8080/console, uid system, pswd manager) - -In the Console Navigation on the left under Services click JMS Resources - -At the bottom of the JMS Resources panel click under Create a new JMS Resource Group click For ActiveMQ - -In Resource Group Name enter "MyRGN" and click next - -At JMS Resource Group click Add Connection Factory - -For JMS Factory Type choose javax.jms.ConnectionFactory and click Next - -In Connection Factory Name enter "ConnectionFactory" and click Next - -Click Add destination - -For JMS Destination Type choose javax.jms.Queue and click Next - -Enter "HelloWorldService" for both Message Destination Name and PhysicalName and click Next - -Click Deploy Now - -Thats it, you're done. - - -WebSphere ---------- - -To define the JMS resources in a new WebSphere Application Server 6.1 installation: - -1) First define a Service integration bus: - -Logon to the WebSphere Integrated Solutions Console (http://localhost:9060/ibm/console) - -On the Left hand menu expand Service integration, and click on Buses. - -In the Buses panel click on New - -Enter a name for the bus, eg MyBus, and click Next, and then click Finish and Save the changes. - -In the Buses panel click on MyBus - -Find the Topology secion and click on Bus members - -Click on Add, leave the defaults and click Next, Next, Next, Finish, and Save the changes. - -Restart WebSphere and when back up logon back on to the Integrated Solutions Console - -2) Now define the JMS rescources - -On the Left hand menu expand Resources, and JMS and click on Connection Facotories. - -In the Connection factories panel click New. - -Leave the Default messaging provider and click OK - -Enter "ConnectionFactory" in the Name and JNDI name and in the Bus name in the Connection pane choose MyBus and click OK - -On the Left hand menu in JMS click on Queues - -In the Queues panel click New, accept the defaults and click OK - -Enter "HelloWorldService" for the Name and JNDI name and in the Bus name in the Connection pane choose MyBus, -and then in the Queue name drop down list choose "Create SIB destination" - -In the Set queue attributes panel enter "HelloWorldService" for the Identifier and click Next, Next, and Finish - -That should take you back to the Queues panel where you can click OK to create the new JMS queue. - -Save the changes - -Restart WebSphere and you're done. - - - -Others... ---------- - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/pom.xml deleted file mode 100644 index f843bbcc57..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/pom.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../../pom.xml - - - sample-binding-jms-helloworld-webapp - war - Apache Tuscany SCA Sample binding.jms HelloWorld WebApp - - - - - org.apache.tuscany.sca - tuscany-base-runtime - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-binding-jms-runtime - 2.0-Beta2-SNAPSHOT - - - - org.apache.activemq - activemq-all - 5.3.0 - runtime - - - - - - helloworld-jms - - - org.mortbay.jetty - maven-jetty-plugin - 6.1.18 - - helloworld-jms - foo - 9999 - - - - start-jetty - process-test-classes - - run - - - 0 - true - - - 8085 - - - - - - stop-jetty - prepare-package - - stop - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/java/sample/HelloWorldClient.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/java/sample/HelloWorldClient.java deleted file mode 100644 index f209f11605..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/java/sample/HelloWorldClient.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -/** - * The HelloWorld client implementation - */ -public class HelloWorldClient implements HelloWorldService { - - HelloWorldService helloWorldRef; - - public String sayHello(String name) { - System.out.println("HelloWorldClient.sayHello " + name); - return helloWorldRef.sayHello(name); - } - - public void setHelloWorldRef(HelloWorldService helloWorldRef) { - System.out.println("HelloWorldClient.setHelloWorldService " + helloWorldRef); - this.helloWorldRef = helloWorldRef; - } -} \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/java/sample/HelloWorldService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/java/sample/HelloWorldService.java deleted file mode 100644 index df2a852161..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/java/sample/HelloWorldService.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the helloworld service - */ -@Remotable -public interface HelloWorldService { - public String sayHello(String name); -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/java/sample/HelloWorldServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/java/sample/HelloWorldServiceImpl.java deleted file mode 100644 index c09af51e23..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/java/sample/HelloWorldServiceImpl.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -/** - * This class implements the HelloWorld service. - */ -public class HelloWorldServiceImpl implements HelloWorldService { - - public String sayHello(String name) { - System.out.println("HelloWorldServiceImpl.sayHello " + name); - return "Hello " + name; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/META-INF/context.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/META-INF/context.xml deleted file mode 100644 index 7575edfc29..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/META-INF/context.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/WEB-INF/jetty-env.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/WEB-INF/jetty-env.xml deleted file mode 100644 index a8cd27f6c6..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/WEB-INF/jetty-env.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - ConnectionFactory - - - vm://localhost?broker.persistent=false - - - - - - HelloWorldService - - - DEMO - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/WEB-INF/web.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/WEB-INF/web.composite deleted file mode 100644 index b5d8c70d14..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/WEB-INF/web.composite +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/WEB-INF/web.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 86710435ae..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - Apache Tuscany JMS Web Service Sample - - - tuscany - org.apache.tuscany.sca.host.webapp.TuscanyServletFilter - - - - tuscany - /* - - - - hello.jsp - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/hello.jsp b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/hello.jsp deleted file mode 100644 index 9ae037f2c2..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/helloworld-webapp/src/main/webapp/hello.jsp +++ /dev/null @@ -1,41 +0,0 @@ -<%-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---%> - -<%@ page contentType="text/html;charset=UTF-8" language="java" %> -<%@ taglib uri="http://www.osoa.org/sca/sca_jsp.tld" prefix="sca" %> - - - - -HelloWorld JMS sample - - - -If this sample is working correctly you should see "Hello World" on the next line... -

-<%= service.sayHello("world") %> -

-If you do not see "Hello World" on the line above then there has been a problem. -

-The sample requires JMS resources be manually configured in the server environment, these are: -a JMS connection factory named "ConnectionFactory", and a destination queues named "HelloWorldService". -See the sample README file for more information. - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/pom.xml deleted file mode 100644 index 7782f01ecc..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jms/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-sample-binding-jms - pom - Apache Tuscany SCA Sample binding.jms - - - - default - - true - - - helloworld-webapp - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/README deleted file mode 100644 index 18ba62d494..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/README +++ /dev/null @@ -1 +0,0 @@ -Please look at the README files in the subdirectories of this directory for descriptions of the sample contributions. diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/README deleted file mode 100644 index fe9aac7f3c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/README +++ /dev/null @@ -1,8 +0,0 @@ -Calculator Sample Contribution -============================== - -This sample contribution implements a simple calculator using SCA components. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/build.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/build.xml deleted file mode 100644 index 00abb659d6..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/build.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - ${tuscany.home} - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/pom.xml deleted file mode 100644 index 82531c0489..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-binding-jsonrpc-calculator-contribution - Apache Tuscany SCA Sample binding.jsonrpc Calculator Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 2.0-Beta2-SNAPSHOT - - - - junit - junit - 4.8.1 - test - - - - - - ${artifactId} - - - org.apache.tuscany.maven.plugins - maven-tuscany-plugin - 2.0-Beta2-SNAPSHOT - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddBean.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddBean.java deleted file mode 100644 index bb39e961b4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddBean.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -public class AddBean { - - protected double n1; - protected double n2; - protected double n3; - - protected Boolean b; - protected String s; - protected int x; - protected Integer y; - - public double getN1() { - return n1; - } - - public void setN1(double n1) { - this.n1 = n1; - } - - public double getN2() { - return n2; - } - - public void setN2(double n2) { - this.n2 = n2; - } - - public double getN3() { - return n3; - } - - public void setN3(double n3) { - this.n3 = n3; - } - - public Boolean getB() { - return b; - } - - public void setB(Boolean b) { - this.b = b; - } - - public String getS() { - return s; - } - - public void setS(String s) { - this.s = s; - } - - public int getX() { - return x; - } - - public void setX(int x) { - this.x = x; - } - - public Integer getY() { - return y; - } - - public void setY(Integer y) { - this.y = y; - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddService.java deleted file mode 100644 index 03e844d09c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The Add service interface - */ -@Remotable -public interface AddService { - - double add(double n1, double n2); - AddBean addComplexParam(AddBean aBean); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddServiceImpl.java deleted file mode 100644 index 8eabfa6773..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the Add service - */ -@Service(AddService.class) -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Adding " + n1 + " and " + n2); - return n1 + n2; - } - - public AddBean addComplexParam(AddBean aBean) { - aBean.setN3(aBean.getN1() + aBean.getN2()); - return aBean; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorClient.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorClient.java deleted file mode 100644 index 1df1f31c48..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorClient.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -import org.oasisopen.sca.annotation.EagerInit; -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; - -/** - * This client program shows how to create an SCA runtime, start it, - * and locate and invoke a SCA component - */ -@Scope("COMPOSITE") -@EagerInit -public class CalculatorClient { - - private CalculatorService calculatorService; - - @Reference - public void setCalculatorService(CalculatorService calculatorService) { - this.calculatorService = calculatorService; - } - - @Init - public void calculate() { - // Calculate - System.out.println("SCA API ClassLoader: " + Reference.class.getClassLoader()); - System.out.println("3 + 2=" + calculatorService.add(3, 2)); - System.out.println("3 - 2=" + calculatorService.subtract(3, 2)); - System.out.println("3 * 2=" + calculatorService.multiply(3, 2)); - System.out.println("3 / 2=" + calculatorService.divide(3, 2)); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index 78eea39c71..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The Calculator service interface. - */ -@Remotable -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index d32cc73815..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Service; - - -/** - * An implementation of the Calculator service. - */ -@Service(CalculatorService.class) -public class CalculatorServiceImpl implements CalculatorService { - - private AddService addService; - private SubtractService subtractService; - private MultiplyService multiplyService; - private DivideService divideService; - - @Reference - public void setAddService(AddService addService) { - this.addService = addService; - } - - @Reference - public void setSubtractService(SubtractService subtractService) { - this.subtractService = subtractService; - } - - @Reference - public void setDivideService(DivideService divideService) { - this.divideService = divideService; - } - - @Reference - public void setMultiplyService(MultiplyService multiplyService) { - this.multiplyService = multiplyService; - } - - public double add(double n1, double n2) { - AddBean aBean = new AddBean(); - // So data to test different types - aBean.setB(true); - aBean.setS("Fred"); - aBean.setX(27); - aBean.setY(58); - - // the numbers to be added - aBean.setN1(n1); - aBean.setN2(n2); - - aBean = addService.addComplexParam(aBean); - - return aBean.getN3(); - //return addService.add(n1, n2); - } - - public double subtract(double n1, double n2) { - return subtractService.subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return multiplyService.multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return divideService.divide(n1, n2); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/DivideService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/DivideService.java deleted file mode 100644 index ef6a8b375b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The divide service interface - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java deleted file mode 100644 index ddd7b9cc6e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the Divide service. - */ -@Service(DivideService.class) -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2); - return n1 / n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/MultiplyService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index db568cc762..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index cc0de498d3..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the Multiply service. - */ -@Service(MultiplyService.class) -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2); - return n1 * n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/SubtractService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/SubtractService.java deleted file mode 100644 index 56ee372fc4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 22e95f7f54..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the subtract service. - */ -@Service(SubtractService.class) -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2); - return n1 - n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/resources/Calculator.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/resources/Calculator.composite deleted file mode 100644 index 5f1add2431..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/resources/Calculator.composite +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/resources/CalculatorClient.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/resources/CalculatorClient.composite deleted file mode 100644 index dfd32761be..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/resources/CalculatorClient.composite +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 70aab0e051..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java deleted file mode 100644 index 1952eb4a6e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -/** - * A unit test of the basic Java implementation classes in this contribution - * without using SCA - */ -public class CalculatorTestCase { - - @Test - public void testCalculator() throws Exception { - AddService add = new AddServiceImpl(); - SubtractService subtract = new SubtractServiceImpl(); - MultiplyService multiply = new MultiplyServiceImpl(); - DivideService divide = new DivideServiceImpl(); - - CalculatorServiceImpl calculator = new CalculatorServiceImpl(); - - calculator.setAddService(add); - calculator.setSubtractService(subtract); - calculator.setMultiplyService(multiply); - calculator.setDivideService(divide); - - assertEquals(calculator.add(3, 2), 5.0, 0); - assertEquals(calculator.subtract(3, 2), 1.0, 0); - assertEquals(calculator.multiply(3, 2), 6.0, 0); - assertEquals(calculator.divide(3, 2), 1.5, 0); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/README deleted file mode 100644 index fe9aac7f3c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/README +++ /dev/null @@ -1,8 +0,0 @@ -Calculator Sample Contribution -============================== - -This sample contribution implements a simple calculator using SCA components. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/build-dojo.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/build-dojo.xml deleted file mode 100644 index 36714c67fc..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/build-dojo.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/pom.xml deleted file mode 100644 index c4969673ad..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/pom.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-binding-jsonrpc-calculator-webapp - Apache Tuscany SCA Sample binding.jsonrpc Calculator WebApp - war - - - - org.apache.tuscany.sca - tuscany-base-runtime - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-binding-jsonrpc-runtime - 2.0-Beta2-SNAPSHOT - - - - org.dojotoolkit - dojo - 1.3.0 - zip - - - - junit - junit - 4.8.1 - test - - - - - - ${artifactId} - - - org.apache.tuscany.maven.plugins - maven-tuscany-plugin - 2.0-Beta2-SNAPSHOT - - - org.apache.maven.plugins - maven-antrun-plugin - - - copy-dojo-files - generate-resources - - run - - - - - - - - - - - - clean-dojo-files - clean - - run - - - - - - - - - - - - - - org.mortbay.jetty - maven-jetty-plugin - 6.1.18 - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddBean.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddBean.java deleted file mode 100644 index 71724ee7ae..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddBean.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -public class AddBean { - private static final String DEFAULT_S = "default string"; - private static final Boolean DEFAULT_B = false; - - protected double n1; - protected double n2; - protected double n3; - - protected Boolean b; - protected String s; - protected int x; - protected Integer y; - - public double getN1() { - return n1; - } - - public void setN1(double n1) { - this.n1 = n1; - } - - public double getN2() { - return n2; - } - - public void setN2(double n2) { - this.n2 = n2; - } - - public double getN3() { - return n3; - } - - public void setN3(double n3) { - this.n3 = n3; - } - - public Boolean getB() { - return b; - } - - public void setB(Boolean b) { - this.b = b; - } - - public String getS() { - return s; - } - - public void setS(String s) { - this.s = s; - } - - public int getX() { - return x; - } - - public void setX(int x) { - this.x = x; - } - - public Integer getY() { - return y; - } - - public void setY(Integer y) { - this.y = y; - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddService.java deleted file mode 100644 index 03e844d09c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The Add service interface - */ -@Remotable -public interface AddService { - - double add(double n1, double n2); - AddBean addComplexParam(AddBean aBean); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddServiceImpl.java deleted file mode 100644 index e16b352021..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the Add service - */ -@Service(AddService.class) -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Adding " + n1 + " and " + n2); - return n1 + n2; - } - - public AddBean addComplexParam(AddBean aBean) { - aBean.setN3(aBean.getN1() + aBean.getN2()); - System.out.println("Adding " + aBean.getN1() + " to " + aBean.getN1() + " gives " + aBean.getN3()); - return aBean; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/CalculatorService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index 78eea39c71..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The Calculator service interface. - */ -@Remotable -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/CalculatorServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index d32cc73815..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Service; - - -/** - * An implementation of the Calculator service. - */ -@Service(CalculatorService.class) -public class CalculatorServiceImpl implements CalculatorService { - - private AddService addService; - private SubtractService subtractService; - private MultiplyService multiplyService; - private DivideService divideService; - - @Reference - public void setAddService(AddService addService) { - this.addService = addService; - } - - @Reference - public void setSubtractService(SubtractService subtractService) { - this.subtractService = subtractService; - } - - @Reference - public void setDivideService(DivideService divideService) { - this.divideService = divideService; - } - - @Reference - public void setMultiplyService(MultiplyService multiplyService) { - this.multiplyService = multiplyService; - } - - public double add(double n1, double n2) { - AddBean aBean = new AddBean(); - // So data to test different types - aBean.setB(true); - aBean.setS("Fred"); - aBean.setX(27); - aBean.setY(58); - - // the numbers to be added - aBean.setN1(n1); - aBean.setN2(n2); - - aBean = addService.addComplexParam(aBean); - - return aBean.getN3(); - //return addService.add(n1, n2); - } - - public double subtract(double n1, double n2) { - return subtractService.subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return multiplyService.multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return divideService.divide(n1, n2); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/DivideService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/DivideService.java deleted file mode 100644 index ef6a8b375b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The divide service interface - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/DivideServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/DivideServiceImpl.java deleted file mode 100644 index ddd7b9cc6e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the Divide service. - */ -@Service(DivideService.class) -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2); - return n1 / n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/MultiplyService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index db568cc762..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/MultiplyServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index cc0de498d3..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the Multiply service. - */ -@Service(MultiplyService.class) -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2); - return n1 * n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/SubtractService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/SubtractService.java deleted file mode 100644 index 56ee372fc4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/SubtractServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 22e95f7f54..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the subtract service. - */ -@Service(SubtractService.class) -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2); - return n1 - n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/WEB-INF/web.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/WEB-INF/web.composite deleted file mode 100644 index dc0df8756c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/WEB-INF/web.composite +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/WEB-INF/web.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index b7e216baf7..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Apache Tuscany Contribution binding-jsonrpc Calculator WebApp Sample - - - tuscany - org.apache.tuscany.sca.host.webapp.TuscanyServletFilter - - - - tuscany - /* - - - - calculate.html - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/calculate.html b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/calculate.html deleted file mode 100644 index 6d22806e8f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/main/webapp/calculate.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - Apache Tuscany binding-jsonrpc Calculator WebApp with DOJO Sample - - - - - - - - - -

Apache Tuscany binding-jsonrpc Calculator WebApp with DOJO Sample

- - 1 + 1 = - - -
- - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/test/java/calculator/CalculatorTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/test/java/calculator/CalculatorTestCase.java deleted file mode 100644 index 1952eb4a6e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/calculator-webapp/src/test/java/calculator/CalculatorTestCase.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -/** - * A unit test of the basic Java implementation classes in this contribution - * without using SCA - */ -public class CalculatorTestCase { - - @Test - public void testCalculator() throws Exception { - AddService add = new AddServiceImpl(); - SubtractService subtract = new SubtractServiceImpl(); - MultiplyService multiply = new MultiplyServiceImpl(); - DivideService divide = new DivideServiceImpl(); - - CalculatorServiceImpl calculator = new CalculatorServiceImpl(); - - calculator.setAddService(add); - calculator.setSubtractService(subtract); - calculator.setMultiplyService(multiply); - calculator.setDivideService(divide); - - assertEquals(calculator.add(3, 2), 5.0, 0); - assertEquals(calculator.subtract(3, 2), 1.0, 0); - assertEquals(calculator.multiply(3, 2), 6.0, 0); - assertEquals(calculator.divide(3, 2), 1.5, 0); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/pom.xml deleted file mode 100644 index 0af213fd69..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-jsonrpc/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-sample-binding-jsonrpc - pom - Apache Tuscany SCA Sample binding.jsonrpc - - - - default - - true - - - calculator-contribution - calculator-webapp - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/README deleted file mode 100644 index 18ba62d494..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/README +++ /dev/null @@ -1 +0,0 @@ -Please look at the README files in the subdirectories of this directory for descriptions of the sample contributions. diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/README deleted file mode 100644 index f647ef1c50..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/README +++ /dev/null @@ -1,11 +0,0 @@ -Calculator RMI Reference Sample Contribution -============================================ - -This sample illustrates the use of Tuscany RMI Binding to call reference -services that are hosted as Java RMI services. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/build.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/build.xml deleted file mode 100644 index 06f6ba8730..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/build.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - ${tuscany.home} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/pom.xml deleted file mode 100644 index 8f588f184c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/pom.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-binding-rmi-calculator-reference-contribution - Apache Tuscany SCA Sample binding.rmi Calculator Reference Contribution - - - - org.apache.tuscany.sca - tuscany-node-api - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-node-impl - 2.0-Beta2-SNAPSHOT - test - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 2.0-Beta2-SNAPSHOT - runtime - - - org.apache.tuscany.sca - tuscany-binding-rmi-runtime - 2.0-Beta2-SNAPSHOT - runtime - - - junit - junit - 4.8.1 - test - - - - - ${artifactId} - - - org.apache.tuscany.maven.plugins - maven-tuscany-plugin - 2.0-Beta2-SNAPSHOT - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/AddService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/AddService.java deleted file mode 100644 index a235e648c7..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the add service - */ -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/CalculatorService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index 0f7dec116f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.rmi.Remote; -import java.rmi.RemoteException; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The Calculator service interface. - */ -@Remotable -public interface CalculatorService extends Remote { - - double add(double n1, double n2) throws RemoteException; - - double subtract(double n1, double n2) throws RemoteException; - - double multiply(double n1, double n2) throws RemoteException; - - double divide(double n1, double n2) throws RemoteException; -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/CalculatorServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index bcfd8871b6..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Reference; - -/** - * An implementation of the Calculator service. - */ -public class CalculatorServiceImpl implements CalculatorService { - - private AddService addService; - private SubtractService subtractService; - private MultiplyService multiplyService; - private DivideService divideService; - - @Reference - public void setAddService(AddService addService) { - this.addService = addService; - } - - @Reference - public void setSubtractService(SubtractService subtractService) { - this.subtractService = subtractService; - } - - @Reference - public void setDivideService(DivideService divideService) { - this.divideService = divideService; - } - - @Reference - public void setMultiplyService(MultiplyService multiplyService) { - this.multiplyService = multiplyService; - } - - public double add(double n1, double n2) { - return addService.add(n1, n2); - } - - public double subtract(double n1, double n2) { - return subtractService.subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return multiplyService.multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return divideService.divide(n1, n2); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/DivideService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/DivideService.java deleted file mode 100644 index 497dafd4fd..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the divide service - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/MultiplyService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index 5290605938..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/SubtractService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/SubtractService.java deleted file mode 100644 index 376b3e5bb9..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the subtract service - */ -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/resources/CalculatorRMIReference.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/resources/CalculatorRMIReference.composite deleted file mode 100644 index 7455dc7d38..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/main/resources/CalculatorRMIReference.composite +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/test/java/calculator/CalculatorRMIReferenceTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/test/java/calculator/CalculatorRMIReferenceTestCase.java deleted file mode 100644 index 39d4b2fd28..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/test/java/calculator/CalculatorRMIReferenceTestCase.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import static org.junit.Assert.assertEquals; - -import java.rmi.registry.LocateRegistry; -import java.rmi.registry.Registry; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - - -/** - * This shows how to test the Calculator service component. - */ -public class CalculatorRMIReferenceTestCase { - - private static Node node; - private static CalculatorService calculatorService; - - @BeforeClass - public static void setUp() throws Exception { - CalculatorRMIServiceImpl rmiCalculatorImpl = new CalculatorRMIServiceImpl(); - Registry rmiRegistry = LocateRegistry.createRegistry(8099); - rmiRegistry.bind("CalculatorRMIService", rmiCalculatorImpl); - - String uri = ContributionLocationHelper.getContributionLocation(CalculatorService.class); - Contribution contribution = new Contribution("c1", uri); - node = NodeFactory.newInstance().createNode("CalculatorRMIReference.composite", contribution); - node.start(); - calculatorService = node.getService(CalculatorService.class, "CalculatorServiceComponent"); - } - - @AfterClass - public static void tearDown() throws Exception { - node.stop(); - LocateRegistry.getRegistry(8099).unbind("CalculatorRMIService"); - } - - @Test - public void testCalculator() throws Exception { - // Calculate - assertEquals(calculatorService.add(3, 2), 5.0, 0.0); - assertEquals(calculatorService.subtract(3, 2), 1.0, 0.0); - assertEquals(calculatorService.multiply(3, 2), 6.0, 0.0); - assertEquals(calculatorService.divide(3, 2), 1.5, 0.0); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/test/java/calculator/CalculatorRMIServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/test/java/calculator/CalculatorRMIServiceImpl.java deleted file mode 100644 index d8ded42cb2..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-reference-contribution/src/test/java/calculator/CalculatorRMIServiceImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.rmi.RemoteException; -import java.rmi.server.UnicastRemoteObject; - - - -/** - * An implementation of the Calculator service. - */ -public class CalculatorRMIServiceImpl extends UnicastRemoteObject implements CalculatorService { - - private static final long serialVersionUID = -1543948944662001428L; - - public CalculatorRMIServiceImpl() throws RemoteException { - super(); - } - - public double add(double n1, double n2) throws RemoteException { - return n1 + n2; - } - - public double subtract(double n1, double n2) { - return n1 - n2; - } - - public double multiply(double n1, double n2) { - return n1 * n2; - } - - public double divide(double n1, double n2) { - return n1 / n2; - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/README deleted file mode 100644 index cb25027f14..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/README +++ /dev/null @@ -1,28 +0,0 @@ -Calculator RMI Service Sample Contribution -========================================== - -This sample illustrates the use of Tuscany RMI Binding to expose component -services as Java RMI Services. It also demonstrates how a simple Java RMI -Client application invokes the SCA Application's services exposed as RMI -Services. - -The README in the /samples directory provides -general instructions about building and running samples. ( where -distribution-unpack-dir is the directory in which you unpacked the tuscany -binary distribution archive) Take a look there for instructions on how to launch -this sample contribution. - - -Sample Overview ---------------- -This sample extends the calculator sample by replacing the local service -binding with an RMI binding. SO a java client can call the service exposed -by the SCA application using an RMI client. - -Amongst the other output created by the launcher/contribution combination, you should see the following output ... - - - [java] 3 + 2=5.0 - [java] 3 - 2=1.0 - [java] 3 * 2=6.0 - [java] 3 / 2=1.5 diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/build.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/build.xml deleted file mode 100644 index 79ec168c8a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/build.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - ${tuscany.home} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/pom.xml deleted file mode 100644 index 6224ebdb5f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/pom.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-binding-rmi-calculator-service-contribution - Apache Tuscany SCA Sample binding.rmi Calculator Service Contribution - - - - org.apache.tuscany.sca - tuscany-node-api - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-node-impl - 2.0-Beta2-SNAPSHOT - test - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 2.0-Beta2-SNAPSHOT - runtime - - - org.apache.tuscany.sca - tuscany-binding-rmi-runtime - 2.0-Beta2-SNAPSHOT - runtime - - - junit - junit - 4.8.1 - test - - - - - ${artifactId} - - - org.apache.tuscany.maven.plugins - maven-tuscany-plugin - 2.0-Beta2-SNAPSHOT - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/AddService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/AddService.java deleted file mode 100644 index a235e648c7..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the add service - */ -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/AddServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/AddServiceImpl.java deleted file mode 100644 index 8b6fe066a6..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * An implementation of the Add service - */ -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - return n1 + n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/CalculatorClient.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/CalculatorClient.java deleted file mode 100644 index 2b99485b68..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/CalculatorClient.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -import java.rmi.Naming; - -/** - * This client program shows how to create an SCA runtime, start it, - * and locate and invoke a SCA component - */ -public class CalculatorClient { - public static void main(String[] args) throws Exception { - CalculatorService calculatorService = (CalculatorService)Naming.lookup("//localhost:8099/CalculatorRMIService"); - - // Calculate - System.out.println("3 + 2=" + calculatorService.add(3, 2)); - System.out.println("3 - 2=" + calculatorService.subtract(3, 2)); - System.out.println("3 * 2=" + calculatorService.multiply(3, 2)); - System.out.println("3 / 2=" + calculatorService.divide(3, 2)); - - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/CalculatorService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index 3c0375924f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The Calculator service interface. - */ -@Remotable -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/CalculatorServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index bcfd8871b6..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Reference; - -/** - * An implementation of the Calculator service. - */ -public class CalculatorServiceImpl implements CalculatorService { - - private AddService addService; - private SubtractService subtractService; - private MultiplyService multiplyService; - private DivideService divideService; - - @Reference - public void setAddService(AddService addService) { - this.addService = addService; - } - - @Reference - public void setSubtractService(SubtractService subtractService) { - this.subtractService = subtractService; - } - - @Reference - public void setDivideService(DivideService divideService) { - this.divideService = divideService; - } - - @Reference - public void setMultiplyService(MultiplyService multiplyService) { - this.multiplyService = multiplyService; - } - - public double add(double n1, double n2) { - return addService.add(n1, n2); - } - - public double subtract(double n1, double n2) { - return subtractService.subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return multiplyService.multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return divideService.divide(n1, n2); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/DivideService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/DivideService.java deleted file mode 100644 index 497dafd4fd..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the divide service - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/DivideServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/DivideServiceImpl.java deleted file mode 100644 index f7ac0b7287..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * An implementation of the Divide service. - */ -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - return n1 / n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/MultiplyService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index 5290605938..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/MultiplyServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index b7dca792b2..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * An implementation of the Multiply service. - */ -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - return n1 * n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/SubtractService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/SubtractService.java deleted file mode 100644 index 376b3e5bb9..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the subtract service - */ -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/SubtractServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 77b128ab8d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * An implementation of the subtract service. - */ -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - return n1 - n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/resources/CalculatorRMIServer.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/resources/CalculatorRMIServer.composite deleted file mode 100644 index 8b37d407f0..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/resources/CalculatorRMIServer.composite +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 8d6012e5c4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/test/java/calculator/CalculatorRMIServerTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/test/java/calculator/CalculatorRMIServerTestCase.java deleted file mode 100644 index 0e352db9bb..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/calculator-service-contribution/src/test/java/calculator/CalculatorRMIServerTestCase.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import static org.junit.Assert.assertEquals; - -import java.rmi.Naming; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * This shows how to test the Calculator service component. - */ -public class CalculatorRMIServerTestCase { - - private static Node node; - private static CalculatorService calculatorService; - - @BeforeClass - public static void setUp() throws Exception { - String uri = ContributionLocationHelper.getContributionLocation(CalculatorService.class); - Contribution contribution = new Contribution("c1", uri); - node = NodeFactory.newInstance().createNode("CalculatorRMIServer.composite", contribution); - node.start(); - } - - @AfterClass - public static void tearDown() throws Exception { - node.stop(); - } - - @Test - public void testCalculator() throws Exception { - // Calculate - calculatorService = (CalculatorService)Naming.lookup("//localhost:8099/CalculatorRMIService"); - assertEquals(calculatorService.add(3, 2), 5.0, 0.0); - assertEquals(calculatorService.subtract(3, 2), 1.0, 0.0); - assertEquals(calculatorService.multiply(3, 2), 6.0, 0.0); - assertEquals(calculatorService.divide(3, 2), 1.5, 0.0); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/pom.xml deleted file mode 100644 index 62f4bad20c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-rmi/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-sample-binding-rmi - pom - Apache Tuscany SCA Sample binding.rmi - - - - default - - true - - - calculator-reference-contribution - calculator-service-contribution - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/README deleted file mode 100644 index 18ba62d494..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/README +++ /dev/null @@ -1 +0,0 @@ -Please look at the README files in the subdirectories of this directory for descriptions of the sample contributions. diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/README deleted file mode 100644 index 4102b81e28..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/README +++ /dev/null @@ -1,8 +0,0 @@ -Calculator Sample Contribution -============================== - -This sample contribution implements a simple calculator using SCA components. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/build.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/build.xml deleted file mode 100644 index 8fef755c8b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/build.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - ${tuscany.home} - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/pom.xml deleted file mode 100644 index 65278eeb7b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-binding-sca-calculator-contribution - Apache Tuscany SCA Sample binding.sca Calculator Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 2.0-Beta2-SNAPSHOT - - - - junit - junit - 4.8.1 - test - - - - - - ${artifactId} - - - org.apache.tuscany.maven.plugins - maven-tuscany-plugin - 2.0-Beta2-SNAPSHOT - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/AddService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/AddService.java deleted file mode 100644 index 188451ebac..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The Add service interface - */ -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/AddServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/AddServiceImpl.java deleted file mode 100644 index bb75bb2337..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the Add service - */ -@Service(AddService.class) -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Adding " + n1 + " and " + n2); - return n1 + n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/CalculatorClient.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/CalculatorClient.java deleted file mode 100644 index afd5ea48fc..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/CalculatorClient.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -import org.oasisopen.sca.annotation.EagerInit; -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; - -/** - * This client program shows how to create an SCA runtime, start it, - * and locate and invoke a SCA component - */ -@Scope("COMPOSITE") -@EagerInit -public class CalculatorClient { - - private CalculatorService calculatorService; - - @Reference - public void setCalculatorService(CalculatorService calculatorService) { - this.calculatorService = calculatorService; - } - - @Init - public void calculate() { - // Calculate - System.out.println("SCA API ClassLoader: " + Reference.class.getClassLoader()); - System.out.println("3 + 2=" + calculatorService.add(3, 2)); - System.out.println("3 - 2=" + calculatorService.subtract(3, 2)); - System.out.println("3 * 2=" + calculatorService.multiply(3, 2)); - System.out.println("3 / 2=" + calculatorService.divide(3, 2)); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/CalculatorService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index ce1cdaae5a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The Calculator service interface. - */ -@Remotable -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index fc53393d23..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Service; - - -/** - * An implementation of the Calculator service. - */ -@Service(CalculatorService.class) -public class CalculatorServiceImpl implements CalculatorService { - - private AddService addService; - private SubtractService subtractService; - private MultiplyService multiplyService; - private DivideService divideService; - - @Reference - public void setAddService(AddService addService) { - this.addService = addService; - } - - @Reference - public void setSubtractService(SubtractService subtractService) { - this.subtractService = subtractService; - } - - @Reference - public void setDivideService(DivideService divideService) { - this.divideService = divideService; - } - - @Reference - public void setMultiplyService(MultiplyService multiplyService) { - this.multiplyService = multiplyService; - } - - public double add(double n1, double n2) { - return addService.add(n1, n2); - } - - public double subtract(double n1, double n2) { - return subtractService.subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return multiplyService.multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return divideService.divide(n1, n2); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/DivideService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/DivideService.java deleted file mode 100644 index 30d248208b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The divide service interface - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java deleted file mode 100644 index b1250ed9f2..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the Divide service. - */ -@Service(DivideService.class) -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2); - return n1 / n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/MultiplyService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index 5290605938..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index 11f68c66e3..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the Multiply service. - */ -@Service(MultiplyService.class) -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2); - return n1 * n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/SubtractService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/SubtractService.java deleted file mode 100644 index bf0d1882b6..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 30e59bf668..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the subtract service. - */ -@Service(SubtractService.class) -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2); - return n1 - n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/resources/Calculator.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/resources/Calculator.composite deleted file mode 100644 index 05bea57944..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/resources/Calculator.composite +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/resources/CalculatorClient.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/resources/CalculatorClient.composite deleted file mode 100644 index dfd32761be..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/resources/CalculatorClient.composite +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 3e64787ce4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java deleted file mode 100644 index 9d3024f451..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -/** - * A unit test of the basic Java implementation classes in this contribution - * without using SCA - */ -public class CalculatorTestCase { - - @Test - public void testCalculator() throws Exception { - AddService add = new AddServiceImpl(); - SubtractService subtract = new SubtractServiceImpl(); - MultiplyService multiply = new MultiplyServiceImpl(); - DivideService divide = new DivideServiceImpl(); - - CalculatorServiceImpl calculator = new CalculatorServiceImpl(); - - calculator.setAddService(add); - calculator.setSubtractService(subtract); - calculator.setMultiplyService(multiply); - calculator.setDivideService(divide); - - assertEquals(calculator.add(3, 2), 5.0, 0); - assertEquals(calculator.subtract(3, 2), 1.0, 0); - assertEquals(calculator.multiply(3, 2), 6.0, 0); - assertEquals(calculator.divide(3, 2), 1.5, 0); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/pom.xml deleted file mode 100644 index 6d2df62735..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-sca/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-sample-binding-sca - pom - Apache Tuscany SCA Sample binding.sca - - - - default - - true - - - calculator-contribution - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/README deleted file mode 100644 index 18ba62d494..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/README +++ /dev/null @@ -1 +0,0 @@ -Please look at the README files in the subdirectories of this directory for descriptions of the sample contributions. diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/README deleted file mode 100644 index 73246be305..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/README +++ /dev/null @@ -1,9 +0,0 @@ -Calculator Contribution Sample -============================== - -This directory contains code which implements a simple calculator SCA contribution. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/build.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/build.xml deleted file mode 100644 index ab27460ea9..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/build.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - ${tuscany.home} - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/calculator.odg b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/calculator.odg deleted file mode 100644 index c2646f7d5e..0000000000 Binary files a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/calculator.odg and /dev/null differ diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/calculator.png b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/calculator.png deleted file mode 100644 index 476306e5f0..0000000000 Binary files a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/calculator.png and /dev/null differ diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/pom.xml deleted file mode 100644 index e0fb03ee1f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/pom.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-binding-ws-calculator-contribution - Apache Tuscany SCA Sample binding.ws Calculator Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 2.0-Beta2-SNAPSHOT - - - - junit - junit - 4.8.1 - test - - - - - - ${artifactId} - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/AddService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/AddService.java deleted file mode 100644 index 138213b5fc..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The Add service interface - */ -@Remotable -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/AddServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/AddServiceImpl.java deleted file mode 100644 index caf4d358df..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Add service - */ -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Adding " + n1 + " and " + n2); - return n1 + n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/CalculatorService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index ad87375529..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - - -/** - * The Calculator service interface. - */ -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index d3fa7a8f41..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Reference; - - -/** - * An implementation of the Calculator service. - */ -public class CalculatorServiceImpl implements CalculatorService { - - private AddService addService; - private SubtractService subtractService; - private MultiplyService multiplyService; - private DivideService divideService; - - @Reference - public void setAddService(AddService addService) { - this.addService = addService; - } - - @Reference - public void setSubtractService(SubtractService subtractService) { - this.subtractService = subtractService; - } - - @Reference - public void setDivideService(DivideService divideService) { - this.divideService = divideService; - } - - @Reference - public void setMultiplyService(MultiplyService multiplyService) { - this.multiplyService = multiplyService; - } - - public double add(double n1, double n2) { - return addService.add(n1, n2); - } - - public double subtract(double n1, double n2) { - return subtractService.subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return multiplyService.multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return divideService.divide(n1, n2); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/DivideService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/DivideService.java deleted file mode 100644 index ef6a8b375b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The divide service interface - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java deleted file mode 100644 index cd91935f08..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Divide service. - */ -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2); - return n1 / n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/MultiplyService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index db568cc762..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index c85357fcd8..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Multiply service. - */ -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2); - return n1 * n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/SubtractService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/SubtractService.java deleted file mode 100644 index 56ee372fc4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 1b669084d9..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the subtract service. - */ -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2); - return n1 - n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/resources/Calculator.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/resources/Calculator.composite deleted file mode 100644 index 3688ebcb85..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/resources/Calculator.composite +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 3a7548cd47..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java deleted file mode 100644 index 1952eb4a6e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -/** - * A unit test of the basic Java implementation classes in this contribution - * without using SCA - */ -public class CalculatorTestCase { - - @Test - public void testCalculator() throws Exception { - AddService add = new AddServiceImpl(); - SubtractService subtract = new SubtractServiceImpl(); - MultiplyService multiply = new MultiplyServiceImpl(); - DivideService divide = new DivideServiceImpl(); - - CalculatorServiceImpl calculator = new CalculatorServiceImpl(); - - calculator.setAddService(add); - calculator.setSubtractService(subtract); - calculator.setMultiplyService(multiply); - calculator.setDivideService(divide); - - assertEquals(calculator.add(3, 2), 5.0, 0); - assertEquals(calculator.subtract(3, 2), 1.0, 0); - assertEquals(calculator.multiply(3, 2), 6.0, 0); - assertEquals(calculator.divide(3, 2), 1.5, 0); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/README deleted file mode 100644 index be947b1923..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/README +++ /dev/null @@ -1,214 +0,0 @@ -Hello World Web Service References using SDO Sample -=================================================== -This sample demonstrates an SCA reference that uses a web service binding which works with SDO. - -The README in the samples directory (the directory above this) provides -general instructions about building and running samples. Take a look there -first. - -To run this sample ------------------- -This sample is dependent on helloworld-ws-service. Open a command prompt to start -the service. If you are running ant do the following: - -cd helloworld-ws-service -ant run - -if you don't have ant, issue one of the following commands for windows or *nix: - -java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-helloworld-ws-service.jar helloworld.HelloWorldServer - -and on *nix do - -java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-helloworld-ws-service.jar helloworld.HelloWorldServer - -You should see the following output: - -Buildfile: build.xml - -run-server: - [java] log4j:WARN No appenders could be found for logger (org.apache.axiom. -om.util.StAXUtils). - [java] log4j:WARN Please initialize the log4j system properly. - [java] Aug 24, 2007 11:17:33 AM org.apache.catalina.core.StandardEngine sta -rt - [java] INFO: Starting Servlet Engine: Apache Tomcat/6.0.10 - [java] Aug 24, 2007 11:17:34 AM org.apache.catalina.startup.ContextConfig d -efaultWebConfig - [java] INFO: No default web.xml - [java] Aug 24, 2007 11:17:34 AM org.apache.catalina.startup.DigesterFactory - register - [java] WARNING: Could not get url for /javax/servlet/jsp/resources/jsp_2_0. -xsd - [java] Aug 24, 2007 11:17:34 AM org.apache.catalina.startup.DigesterFactory - register - [java] WARNING: Could not get url for /javax/servlet/jsp/resources/web-jspt -aglibrary_1_1.dtd - [java] Aug 24, 2007 11:17:34 AM org.apache.catalina.startup.DigesterFactory - register - [java] WARNING: Could not get url for /javax/servlet/jsp/resources/web-jspt -aglibrary_1_2.dtd - [java] Aug 24, 2007 11:17:34 AM org.apache.catalina.startup.DigesterFactory - register - [java] WARNING: Could not get url for /javax/servlet/jsp/resources/web-jspt -aglibrary_2_0.xsd - [java] Aug 24, 2007 11:17:34 AM org.apache.catalina.startup.DigesterFactory - register - [java] WARNING: Could not get url for /javax/servlet/resources/j2ee_web_ser -vices_1_1.xsd - [java] Aug 24, 2007 11:17:34 AM org.apache.coyote.http11.Http11Protocol ini -t - [java] INFO: Initializing Coyote HTTP/1.1 on http-8085 - [java] Aug 24, 2007 11:17:34 AM org.apache.coyote.http11.Http11Protocol sta -rt - [java] INFO: Starting Coyote HTTP/1.1 on http-8085 - [java] Aug 24, 2007 11:17:34 AM org.apache.tuscany.sca.http.tomcat.TomcatSe -rver addServletMapping - [java] INFO: Added Servlet mapping: http://localhost:8085/HelloWorldService - - [java] HelloWorld server started (press enter to shutdown) - -The server is now ready. - - -Now, open another command window to run the client. - -cd helloworld-ws-sdo -ant run - -OR if you don't have ant, on Windows do - -java -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-helloworld-ws-sdo.jar helloworld.HelloWorldClient - -and on *nix do - -java -cp ../../lib/tuscany-sca-manifest.jar:target/sample-helloworld-ws-sdo.jar helloworl.HelloWorldClient - -You should be able to see the following result: - -Buildfile: build.xml - -run: - [java] log4j:WARN No appenders could be found for logger (org.apache.axiom. -om.util.StAXUtils). - [java] log4j:WARN Please initialize the log4j system properly. - [java] Injected helloWorldService - [java] Called getGreetings - [java] Hello David Haney - -BUILD SUCCESSFUL -Total time: 9 seconds - - -Sample Overview ---------------- -The sample provides a single component that is wired to a reference with a -web service binding. The binding refers to WSDL that identifies the service -exposed by the helloworld-ws-service sample. - -helloworld-ws-sdo/ - src/ - main/ - java/ - helloworld/ - HelloWorldService.java - interface description for - HelloWorldServiceComponent - HelloWorldServiceComponent.java - component implementation - HelloWorldClient.java - starts the SCA Runtime and - deploys the helloworldwsclient - .composite. It then calls the - HelloWorldServiceComponent - resources/ - wsdl - helloworld.wsdl - the service description that the - SCA reference uses to bind to service. - - test/ - java/ - helloworld/ - HelloWorldClientTestCase.java - JUnit test case - helloworld-ws-sdo.png - a pictorial representation of the - sample .composite file - build.xml - the Ant build file - pom.xml - the Maven build file - -Building And Running The Sample Using Ant ------------------------------------------ -You can build and run the sample with the binary distribution using Ant. -Make sure that you have started helloworld-ws-service which this sample is dependent on -in a separate command window. You can either follow the instruction at the begining of this -sample file or if you want to build and run the service, follow the README under helloworld-ws-service. - -Now, let's build and run helloworld-ws-sdo sample: - -cd helloworld-ws-sdo -ant -ant run - -You should see the following output from the run target. - -run: - [java] log4j:WARN No appenders could be found for logger (org.apache.axiom. -om.util.StAXUtils). - [java] log4j:WARN Please initialize the log4j system properly. - [java] Injected helloWorldService - [java] Called getGreetings - [java] Hello World - -Building And Running The Sample Using Maven -------------------------------------------- -You can build and run the sample with either the binary or source distributions using Maven. Please note that you do not need to start helloworld-ws-service in this case since Maven does this for you. - -cd helloworld-ws-sdo -mvn - -You should see the following output from the test phase. - -------------------------------------------------------- - T E S T S -------------------------------------------------------- -Running helloworld.HelloWorldClientTestCase -log4j:WARN No appenders could be found for logger (org.apache.axiom.om.util.StAX -Utils). -log4j:WARN Please initialize the log4j system properly. -log4j:WARN No appenders could be found for logger (org.apache.axiom.om.util.StAX -Utils). -log4j:WARN Please initialize the log4j system properly. -Aug 23, 2007 2:27:32 PM org.apache.catalina.core.StandardEngine start -INFO: Starting Servlet Engine: Apache Tomcat/6.0.10 -Aug 23, 2007 2:27:32 PM org.apache.catalina.startup.ContextConfig defaultWebConf -ig -INFO: No default web.xml -Aug 23, 2007 2:27:32 PM org.apache.catalina.startup.DigesterFactory register -WARNING: Could not get url for /javax/servlet/jsp/resources/jsp_2_0.xsd -Aug 23, 2007 2:27:32 PM org.apache.catalina.startup.DigesterFactory register -WARNING: Could not get url for /javax/servlet/jsp/resources/web-jsptaglibrary_1_ -1.dtd -Aug 23, 2007 2:27:32 PM org.apache.catalina.startup.DigesterFactory register -WARNING: Could not get url for /javax/servlet/jsp/resources/web-jsptaglibrary_1_ -2.dtd -Aug 23, 2007 2:27:32 PM org.apache.catalina.startup.DigesterFactory register -WARNING: Could not get url for /javax/servlet/jsp/resources/web-jsptaglibrary_2_ -0.xsd -Aug 23, 2007 2:27:32 PM org.apache.catalina.startup.DigesterFactory register -WARNING: Could not get url for /javax/servlet/resources/j2ee_web_services_1_1.xs -d -Aug 23, 2007 2:27:32 PM org.apache.coyote.http11.Http11Protocol init -INFO: Initializing Coyote HTTP/1.1 on http-8085 -Aug 23, 2007 2:27:32 PM org.apache.coyote.http11.Http11Protocol start -INFO: Starting Coyote HTTP/1.1 on http-8085 -Aug 23, 2007 2:27:32 PM org.apache.tuscany.sca.http.tomcat.TomcatServer addServl -etMapping -INFO: Added Servlet mapping: http://localhost:8085/HelloWorldService -Injected helloWorldService -Called getGreetings -Aug 23, 2007 2:27:34 PM org.apache.coyote.http11.Http11Protocol destroy -INFO: Stopping Coyote HTTP/1.1 on http-8085 -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 8.502 sec - -Results : - -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 - - -This shows that the Junit test cases have run successfully. diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/build.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/build.xml deleted file mode 100644 index 401315d424..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/build.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/helloworld-ws-sdo.png b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/helloworld-ws-sdo.png deleted file mode 100644 index bd2bba41db..0000000000 Binary files a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/helloworld-ws-sdo.png and /dev/null differ diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/maven-eclipse.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/maven-eclipse.xml deleted file mode 100644 index 3adfca89f4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/maven-eclipse.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/pom.xml deleted file mode 100644 index d9213e46fa..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/pom.xml +++ /dev/null @@ -1,180 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-binding-ws-helloworld-ws-sdo-contribution - Apache Tuscany SCA Sample binding.ws HelloWorld Web Service SDO Contribution - - - - org.apache.tuscany.sca - tuscany-node-api - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-node-impl - 2.0-Beta2-SNAPSHOT - runtime - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 2.0-Beta2-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-ws-runtime-axis2 - 2.0-Beta2-SNAPSHOT - runtime - - - - org.apache.tuscany.sdo - tuscany-sdo-lib - 1.1.1 - - - org.apache.tuscany.sdo - tuscany-sdo-impl - 1.1.1 - - - backport-util-concurrent - backport-util-concurrent - - - - - backport-util-concurrent - backport-util-concurrent - 3.1 - - - org.apache.tuscany.sca - tuscany-databinding-sdo - 2.0-Beta2-SNAPSHOT - compile - - - - org.apache.tuscany.sca - tuscany-host-jetty - 2.0-Beta2-SNAPSHOT - runtime - - - - junit - junit - 4.5 - test - - - - - - ${artifactId} - - - - - - org.apache.tuscany.maven.plugins - maven-tuscany-plugin - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-databinding-sdo - 2.0-Beta2-SNAPSHOT - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.0 - - - add-source - generate-sources - - add-test-source - - - - target/sdo-source - - - - - - - org.apache.tuscany.sdo - tuscany-sdo-plugin - 1.1.1 - - - generate-helloworld-sdo - generate-sources - - ${basedir}/src/main/resources/wsdl/helloworld.wsdl - helloworld - Helloworld - true - true - true - - - generate - - - - generate-helloworld-sdo1 - generate-sources - - ${basedir}/src/main/resources/test.xsd - model.sdo - Entity - true - true - true - - - generate - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldClient.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldClient.java deleted file mode 100644 index ebc270811f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldClient.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package helloworld; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -/** - * This client program shows how to create an SCA runtime, start it, locate the - * HelloWorld service and invoke it. - */ -public class HelloWorldClient { - - public final static void main(String[] args) throws Exception { - - NodeFactory factory = NodeFactory.newInstance(); - String contribution = ContributionLocationHelper.getContributionLocation(HelloWorldClient.class); - Node node = - factory.createNode("helloworldwsclient.composite", new Contribution("helloworld", contribution)).start(); - - HelloWorldService helloWorldService = node.getService(HelloWorldService.class, "HelloWorldServiceComponent"); - - Name name = HelloworldFactory.INSTANCE.createName(); - - name.setFirst("David"); - name.setLast("Haney"); - - String value = helloWorldService.getGreetings(name); - System.out.println(value); - - node.stop(); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldImpl.java deleted file mode 100644 index c42a4d59c3..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package helloworld; - -import org.oasisopen.sca.annotation.Service; - -/** - * This class implements the HelloWorld service. - */ -@Service(HelloWorldService.class) -public class HelloWorldImpl implements HelloWorldService { - - public String getGreetings(Name name) { - return "Hello " + name.getFirst() + " " + name.getLast(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldServer.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldServer.java deleted file mode 100644 index ff5cb4ceda..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldServer.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package helloworld; - -import java.io.IOException; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -/** - * This server program shows how to create an SCA runtime, and start it which - * activates the helloworld Web service endpoint. - */ -public class HelloWorldServer { - - public static void main(String[] args) { - - NodeFactory factory = NodeFactory.newInstance(); - String contribution = ContributionLocationHelper.getContributionLocation(HelloWorldServer.class); - Node node = factory.createNode("helloworldws.composite", new Contribution("helloworld", contribution)).start(); - - try { - System.out.println("HelloWorld server started (press enter to shutdown)"); - System.in.read(); - } catch (IOException e) { - e.printStackTrace(); - } - - node.stop(); - System.out.println("HelloWorld server stopped"); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldService.java deleted file mode 100644 index fa257a0605..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldService.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package helloworld; - -import javax.xml.ws.RequestWrapper; -import javax.xml.ws.ResponseWrapper; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the helloworld service - */ -@Remotable -public interface HelloWorldService { - @RequestWrapper(className="helloworld.getGreetings") - @ResponseWrapper(className="helloworld.getGreetingsResponse") - public String getGreetings(Name name); -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldServiceComponent.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldServiceComponent.java deleted file mode 100644 index 711eef63b5..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/helloworld/HelloWorldServiceComponent.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package helloworld; - -/** - * The HelloWorld service implementation - */ -public class HelloWorldServiceComponent implements HelloWorldService { - - HelloWorldService helloWorldService; - - public String getGreetings(Name name) { - System.out.println("Called getGreetings"); - return helloWorldService.getGreetings(name); - } - - public HelloWorldService getHelloWorldService() { - System.out.println("Got Injected helloWorldService"); - return helloWorldService; - } - - public void setHelloWorldService(HelloWorldService helloWorldService) { - System.out.println("Injected helloWorldService"); - this.helloWorldService = helloWorldService; - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/services/bcircle/BioTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/services/bcircle/BioTestCase.java deleted file mode 100644 index d222d77b3b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/services/bcircle/BioTestCase.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services.bcircle; - -import model.sdo.EntityFactory; -import model.sdo.Laboratory; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -public class BioTestCase { - - /** - * @param args - */ - public static void main(String[] args) { - BiochemicalCircle biochemicalCircl = new BiochemicalCircleImpl(); - Laboratory lab2 = biochemicalCircl.getLaboratory("Lab2"); //This invocation without use SCA works ok. - - NodeFactory factory = NodeFactory.newInstance(); - String contribution = ContributionLocationHelper.getContributionLocation(BioTestCase.class); - Node node = - factory.createNode("resources/clinicalLaboratory.composite", new Contribution("clinical", contribution)) - .start(); - - BiochemicalCircle biochemicalCircle = node.getService(BiochemicalCircle.class, "BiochemicalCircleComponent"); - - Laboratory lab = EntityFactory.INSTANCE.createLaboratory(); - lab.setName("lab2"); - biochemicalCircle.setLaboratory(lab); // this invocation works ok too - - lab = biochemicalCircle.getLaboratory("Lab2"); // here I have an exception posted below. - - //here I wait a moment before close scaDomain - System.out.println(lab.getName()); - - node.stop(); - - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/services/bcircle/BiochemicalCircle.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/services/bcircle/BiochemicalCircle.java deleted file mode 100644 index a988a4156c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/services/bcircle/BiochemicalCircle.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services.bcircle; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface BiochemicalCircle { - void setLaboratory(model.sdo.Laboratory lab); - - model.sdo.Laboratory getLaboratory(String name); -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/services/bcircle/BiochemicalCircleImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/services/bcircle/BiochemicalCircleImpl.java deleted file mode 100644 index b609f58373..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/java/services/bcircle/BiochemicalCircleImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package services.bcircle; -import model.sdo.EntityFactory; -import model.sdo.Laboratory; - -import org.oasisopen.sca.annotation.Service; - - -@Service(BiochemicalCircle.class) -public class BiochemicalCircleImpl implements BiochemicalCircle{ - public Laboratory getLaboratory(String name) { - - Laboratory lab = EntityFactory.INSTANCE.createLaboratory(); - lab.setName("Main Laboratory"); - return lab; - } - - public void setLaboratory(Laboratory lab) { - //sad method - System.out.println(lab.getName()); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index f8b2a60f6a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/helloworldws.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/helloworldws.composite deleted file mode 100644 index 46c819d08c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/helloworldws.composite +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/helloworldwsclient.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/helloworldwsclient.composite deleted file mode 100644 index 65b0e294a8..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/helloworldwsclient.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/logging.properties b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/logging.properties deleted file mode 100644 index 3dca310cdb..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/logging.properties +++ /dev/null @@ -1,30 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# $Rev$ $Date$ -# - -# Custom logging configuration for Tuscany samples -# By default, only INFO level logging is enabled and ALL messages get sent to the console -# For more messages from the runtime, uncomment specific settings at the end of this file -handlers = java.util.logging.ConsoleHandler -java.util.logging.ConsoleHandler.level = ALL -java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter -.level=INFO - -# Uncomment the next setting to get all Tuscany messages (this will be a lot) -#org.apache.tuscany.level=FINEST diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/resources/clinicalLaboratory.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/resources/clinicalLaboratory.composite deleted file mode 100644 index 0451cee24c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/resources/clinicalLaboratory.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/test.xsd b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/test.xsd deleted file mode 100644 index 7fd9aa0013..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/test.xsd +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/wsdl/helloworld.wsdl b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/wsdl/helloworld.wsdl deleted file mode 100644 index 882819110f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/main/resources/wsdl/helloworld.wsdl +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/test/java/helloworld/HelloWorldClientTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/test/java/helloworld/HelloWorldClientTestCase.java deleted file mode 100644 index 3918f9a4a5..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/test/java/helloworld/HelloWorldClientTestCase.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package helloworld; - -import junit.framework.Assert; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * Test case for helloworld web service client - */ -public class HelloWorldClientTestCase { - - private HelloWorldService helloWorldService; - private static Node node; - - private TestCaseRunner server; - - @Before - public void startClient() throws Exception { - try { - - NodeFactory factory = NodeFactory.newInstance(); - String contribution = ContributionLocationHelper.getContributionLocation(HelloWorldClient.class); - node = - factory.createNode("helloworldwsclient.composite", new Contribution("helloworld", contribution)) - .start(); - - helloWorldService = node.getService(HelloWorldService.class, "HelloWorldServiceComponent"); - - server = new TestCaseRunner(HelloWorldTestServer.class); - server.before(); - - } catch (Throwable e) { - e.printStackTrace(); - } - } - - @Test - public void testWSClient() throws Exception { - Name name = HelloworldFactory.INSTANCE.createName(); - name.setFirst("John"); - name.setLast("Smith"); - String msg = helloWorldService.getGreetings(name); - Assert.assertEquals("Hello John Smith", msg); - } - - @After - public void stopClient() throws Exception { - server.after(); - node.stop(); - } - - public static void main(String[] args) throws Exception { - HelloWorldClientTestCase test = new HelloWorldClientTestCase(); - test.startClient(); - test.testWSClient(); - - System.in.read(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/test/java/helloworld/HelloWorldTestServer.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/test/java/helloworld/HelloWorldTestServer.java deleted file mode 100644 index 98487ad88b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/test/java/helloworld/HelloWorldTestServer.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package helloworld; - -import java.io.IOException; -import java.net.Socket; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * Starts up the SCA runtime which starts listening for service requests - */ -public class HelloWorldTestServer { - - private Node node; - - @Before - public void startServer() throws Exception { - try { - - NodeFactory factory = NodeFactory.newInstance(); - String contribution = ContributionLocationHelper.getContributionLocation(HelloWorldService.class); - node = factory.createNode("helloworldws.composite", new Contribution("helloworld", contribution)).start(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Test - public void testPing() throws IOException { - new Socket("127.0.0.1", 8085); - } - - @After - public void stopServer() throws Exception { - node.stop(); - } - - public static void main(String[] args) throws Exception { - - HelloWorldTestServer test = new HelloWorldTestServer(); - test.startServer(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/test/java/helloworld/TestCaseRunner.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/test/java/helloworld/TestCaseRunner.java deleted file mode 100644 index b6b4ed2254..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/helloworld-ws-sdo-contribution/src/test/java/helloworld/TestCaseRunner.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package helloworld; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Constructor; -import java.lang.reflect.Method; -import java.net.URL; -import java.net.URLClassLoader; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -/** - * A helper class that can be used to run an SCA JUnit test case. The test case will run in an isolated class loader. - * - * @version $Rev$ $Date$ - */ -public class TestCaseRunner { - - private ClassLoader classLoader; - private Class testSuiteClass; - private Object testSuite; - private Class testResultClass; - private Class testCaseClass; - private Object testCase; - - private Class beforeAnnotation; - private Class beforeClassAnnotation; - private Class afterAnnotation; - private Class afterClassAnnotation; - private Class junit4AdapterClass; - private Class junit3TestCaseClass; - - /** - * Constructs a new TestCase runner. - * - * @param testClass - */ - public TestCaseRunner(Class testClass, String... isolatedClasses) { - try { - ClassLoader tccl = setupClassLoader(testClass, isolatedClasses); - - try { - // Thread.currentThread().setContextClassLoader(classLoader); - // Allow privileged access to set class loader. Requires RuntimePermission - // setContextClassLoader in security policy. - final ClassLoader finalClassLoader = classLoader; - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - Thread.currentThread().setContextClassLoader(finalClassLoader); - return null; - } - }); - - testCaseClass = Class.forName(testClass.getName(), true, classLoader); - testCase = testCaseClass.newInstance(); - ClassLoader testClassLoader = testCaseClass.getClassLoader(); - - junit3TestCaseClass = Class.forName("junit.framework.TestCase", true, testClassLoader); - - testSuiteClass = Class.forName("junit.framework.TestSuite", true, testClassLoader); - Constructor testSuiteConstructor = testSuiteClass.getConstructor(Class.class); - testSuite = testSuiteConstructor.newInstance(testCaseClass); - - testResultClass = Class.forName("junit.framework.TestResult", true, testClassLoader); - - try { - beforeAnnotation = Class.forName("org.junit.Before", true, testClassLoader); - afterAnnotation = Class.forName("org.junit.After", true, testClassLoader); - beforeClassAnnotation = Class.forName("org.junit.BeforeClass", true, testClassLoader); - afterClassAnnotation = Class.forName("org.junit.AfterClass", true, testClassLoader); - junit4AdapterClass = Class.forName("junit.framework.JUnit4TestAdapter", true, testClassLoader); - } catch (Exception e) { - // Unexpected - throw new AssertionError(e); - } - } catch (Throwable e) { - e.printStackTrace(); - } finally { - // Thread.currentThread().setContextClassLoader(tccl); - // Allow privileged access to set class loader. Requires RuntimePermission - // setContextClassLoader in security policy. - final ClassLoader finaltccl = tccl; - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - Thread.currentThread().setContextClassLoader(finaltccl); - return null; - } - }); - } - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - private ClassLoader setupClassLoader(Class testClass, String... isolatedClasses) { - ClassLoader tccl = Thread.currentThread().getContextClassLoader(); - classLoader = testClass.getClassLoader(); - if (classLoader instanceof URLClassLoader) { - URL[] urls = ((URLClassLoader)classLoader).getURLs(); - classLoader = new ClassLoaderImpl(urls, classLoader, isolatedClasses); - } else if (classLoader == tccl || classLoader.getParent() == tccl) { - classLoader = new URLClassLoader(new URL[0], classLoader); - } else { - classLoader = tccl; - } - return tccl; - } - - /** - * Run the test case - */ - public void run() { - ClassLoader tccl = Thread.currentThread().getContextClassLoader(); - try { - // Thread.currentThread().setContextClassLoader(classLoader); - // Allow privileged access to set class loader. Requires RuntimePermission - // setContextClassLoader in security policy. - final ClassLoader finalClassLoader = classLoader; - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - Thread.currentThread().setContextClassLoader(finalClassLoader); - return null; - } - }); - - if (junit3TestCaseClass.isAssignableFrom(testCaseClass)) { - Object testResult = testResultClass.newInstance(); - Method runMethod = testSuiteClass.getMethod("run", testResultClass); - runMethod.invoke(testSuite, testResult); - } else { - Object junit4Adapter = junit4AdapterClass.getConstructor(Class.class).newInstance(testCaseClass); - Object testResult = testResultClass.newInstance(); - Method runMethod = junit4AdapterClass.getMethod("run", testResultClass); - runMethod.invoke(junit4Adapter, testResult); - } - } catch (Exception e) { - throw new RuntimeException(e); - } finally { - // Thread.currentThread().setContextClassLoader(tccl); - // Allow privileged access to set class loader. Requires RuntimePermission - // setContextClassLoader in security policy. - final ClassLoader finaltccl = tccl; - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - Thread.currentThread().setContextClassLoader(finaltccl); - return null; - } - }); - } - } - - /** - * Invoke the setUp method - */ - public void setUp() { - execute("setUp"); - } - - /** - * Invoke the before methods - */ - public void before() { - execute(beforeAnnotation); - } - - /** - * Invoke the beforeClass methods - */ - public void beforeClass() { - execute(beforeClassAnnotation); - } - - /** - * Invoke the tearDown method - */ - public void tearDown() { - execute("tearDown"); - } - - /** - * Invoke the after methods - */ - public void after() { - execute(afterAnnotation); - } - - /** - * Invoke the afterClass methods - */ - public void afterClass() { - execute(afterClassAnnotation); - } - - /** - * Invoke the specified test method. - */ - public void run(String methodName) { - execute(methodName); - } - - /** - * Invoke the methods annotated with the specified annotation. - */ - private void execute(Class annotationClass) { - if (annotationClass == null) { - throw new RuntimeException(new NoSuchMethodException()); - } - ClassLoader tccl = Thread.currentThread().getContextClassLoader(); - try { - // Thread.currentThread().setContextClassLoader(classLoader); - // Allow privileged access to set class loader. Requires RuntimePermission - // setContextClassLoader in security policy. - final ClassLoader finalClassLoader = classLoader; - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - Thread.currentThread().setContextClassLoader(finalClassLoader); - return null; - } - }); - - for (Method method : testCaseClass.getDeclaredMethods()) { - for (Annotation annotation : method.getAnnotations()) { - if (annotation.annotationType() == annotationClass) { - method.invoke(testCase); - } - } - } - } catch (Exception e) { - throw new RuntimeException(e); - } finally { - // Thread.currentThread().setContextClassLoader(tccl); - // Allow privileged access to set class loader. Requires RuntimePermission - // setContextClassLoader in security policy. - final ClassLoader finaltccl = tccl; - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - Thread.currentThread().setContextClassLoader(finaltccl); - return null; - } - }); - } - } - - /** - * Invoke the specified method - */ - private void execute(String methodName) { - ClassLoader tccl = Thread.currentThread().getContextClassLoader(); - try { - // Thread.currentThread().setContextClassLoader(classLoader); - // Allow privileged access to set class loader. Requires RuntimePermission - // setContextClassLoader in security policy. - final ClassLoader finalClassLoader = classLoader; - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - Thread.currentThread().setContextClassLoader(finalClassLoader); - return null; - } - }); - Method setUpMethod = testCaseClass.getDeclaredMethod(methodName); - setUpMethod.setAccessible(true); - setUpMethod.invoke(testCase); - } catch (Exception e) { - throw new RuntimeException(e); - } finally { - // Thread.currentThread().setContextClassLoader(tccl); - // Allow privileged access to set class loader. Requires RuntimePermission - // setContextClassLoader in security policy. - final ClassLoader finaltccl = tccl; - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - Thread.currentThread().setContextClassLoader(finaltccl); - return null; - } - }); - } - } - - public static class ClassLoaderImpl extends URLClassLoader { - private Set isolatedClasses = new HashSet(); - - /** - * @param urls - * @param parent - */ - public ClassLoaderImpl(URL[] urls, ClassLoader parent, String... sharedClasses) { - super(urls, parent); - this.isolatedClasses.addAll(Arrays.asList(sharedClasses)); - } - - @Override - protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException { - if (!isolatedClasses.contains(name)) { - return super.loadClass(name, resolve); - } else { - Class cls = findLoadedClass(name); - if (cls == null) { - cls = findClass(name); - } - if (resolve) { - resolveClass(cls); - } - return cls; - } - } - - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/pom.xml deleted file mode 100644 index 7b48f4fc6b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/pom.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - - jar - sample-holder-ws-service - Apache Tuscany SCA Holder Input/Output Web Service Sample - - - - - org.apache.tuscany.sca - tuscany-assembly - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-sca-api - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-node-api - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-node-impl - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 2.0-Beta2-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-ws - 2.0-Beta2-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-ws-wsdlgen - 2.0-Beta2-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-host-http - 2.0-Beta2-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-host-jetty - 2.0-Beta2-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-policy-security - 2.0-Beta2-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-ws-runtime-axis2 - 2.0-Beta2-SNAPSHOT - runtime - - - - junit - junit - 4.8.1 - test - - - - - ${artifactId} - - - org.apache.tuscany.maven.plugins - maven-tuscany-plugin - 2.0-Beta2-SNAPSHOT - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/ObjectFactory.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/ObjectFactory.java deleted file mode 100644 index c812c53eeb..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/ObjectFactory.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.example.orderservice; - -import javax.xml.bind.annotation.XmlRegistry; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the org.example.orderservice package. - *

An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.example.orderservice - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link ReviewOrderResponse } - * - */ - public ReviewOrderResponse createReviewOrderResponse() { - return new ReviewOrderResponse(); - } - - /** - * Create an instance of {@link Order } - * - */ - public Order createOrder() { - return new Order(); - } - - /** - * Create an instance of {@link ReviewOrder } - * - */ - public ReviewOrder createReviewOrder() { - return new ReviewOrder(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/Order.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/Order.java deleted file mode 100644 index 2a4bb26858..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/Order.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.example.orderservice; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for order complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="order">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="customerId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         <element name="status" type="{http://www.example.org/OrderService/}status" minOccurs="0"/>
- *         <element name="total" type="{http://www.w3.org/2001/XMLSchema}double"/>
- *         <element name="orderId" type="{http://www.w3.org/2001/XMLSchema}int"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "order", propOrder = { - "customerId", - "status", - "total", - "orderId" -}) -public class Order { - - protected String customerId; - protected Status status; - protected double total; - protected int orderId; - - /** - * Gets the value of the customerId property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getCustomerId() { - return customerId; - } - - /** - * Sets the value of the customerId property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setCustomerId(String value) { - this.customerId = value; - } - - /** - * Gets the value of the status property. - * - * @return - * possible object is - * {@link Status } - * - */ - public Status getStatus() { - return status; - } - - /** - * Sets the value of the status property. - * - * @param value - * allowed object is - * {@link Status } - * - */ - public void setStatus(Status value) { - this.status = value; - } - - /** - * Gets the value of the total property. - * - */ - public double getTotal() { - return total; - } - - /** - * Sets the value of the total property. - * - */ - public void setTotal(double value) { - this.total = value; - } - - /** - * Gets the value of the orderId property. - * - */ - public int getOrderId() { - return orderId; - } - - /** - * Sets the value of the orderId property. - * - */ - public void setOrderId(int value) { - this.orderId = value; - } - - // Added manually from wsimport generated class to improve debugging. - public String toString() { - return "Order[customerId=" + customerId + ",orderId=" + orderId + ",total=" + total + ",status=" + status.value() + "]"; - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/OrderService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/OrderService.java deleted file mode 100644 index b0990423b8..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/OrderService.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.example.orderservice; - -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.ws.Holder; -import javax.xml.ws.RequestWrapper; -import javax.xml.ws.ResponseWrapper; - - -/** - * This class was generated by the JAX-WS RI. - * JAX-WS RI 2.1.1 in JDK 6 - * Generated source version: 2.1 - * - */ -@WebService(name = "OrderService", targetNamespace = "http://www.example.org/OrderService/") -@XmlSeeAlso({ - ObjectFactory.class -}) -public interface OrderService { - - - /** - * - * @param myData - */ - @WebMethod(action = "http://www.example.org/OrderService/reviewOrder") - @RequestWrapper(localName = "reviewOrder", targetNamespace = "http://www.example.org/OrderService/", className = "org.example.orderservice.ReviewOrder") - @ResponseWrapper(localName = "reviewOrderResponse", targetNamespace = "http://www.example.org/OrderService/", className = "org.example.orderservice.ReviewOrderResponse") - public void reviewOrder( - @WebParam(name = "myData", targetNamespace = "", mode = WebParam.Mode.INOUT) - Holder myData); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/OrderServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/OrderServiceImpl.java deleted file mode 100644 index 7cb75ae843..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/OrderServiceImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.example.orderservice; - -// import org.osoa.sca.annotations.Service; -import java.util.Random; - -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.xml.ws.Holder; -import javax.xml.ws.RequestWrapper; -import javax.xml.ws.ResponseWrapper; - -/** - * This class implements the OrderService service. - */ -// @Service(OrderService.class) -public class OrderServiceImpl implements OrderService { - - /** This dummy implementation approves or rejects orders: - * < 100 - always approved. - * 100-1100 - randomly approved. Probability = (1100 - amount)/10 - * >1100 - always rejected. - */ - // public Order reviewOrder(Order order) { - @WebMethod(action = "http://www.example.org/OrderService/reviewOrder") - @RequestWrapper(localName = "reviewOrder", targetNamespace = "http://www.example.org/OrderService/", className = "org.example.orderservice.ReviewOrder") - @ResponseWrapper(localName = "reviewOrderResponse", targetNamespace = "http://www.example.org/OrderService/", className = "org.example.orderservice.ReviewOrderResponse") - public void reviewOrder( - @WebParam(name = "myData", targetNamespace = "", mode = WebParam.Mode.INOUT) - Holder myData) { - Order order = myData.value; - double total = order.getTotal(); - if ( total < 100.0 ) { - order.setStatus( Status.APPROVED ); - } else if ( total > 1100.0 ) { - order.setStatus( Status.REJECTED ); - } else { - int probability = (int) ((-100.0 + total) / 10.0); - Random approver = new Random(); - if ( approver.nextInt( 100 ) < probability ) - order.setStatus( Status.APPROVED ); - else - order.setStatus( Status.REJECTED ); - } - System.out.println( ">>> OrderService.reviewOrder return=" + order ); - // return order; - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/OrderServiceServer.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/OrderServiceServer.java deleted file mode 100644 index bbcfb3b961..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/OrderServiceServer.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.example.orderservice; - -import java.io.IOException; - -import javax.xml.ws.Holder; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -/** - * Tests that the order server responds. - */ -public class OrderServiceServer { - - private Node node; - - public static void main(String[] args) throws Exception { - OrderServiceServer oss = new OrderServiceServer(); - - oss.startServer(); - oss.testOrderReviewApproved(); - oss.testOrderReviewRejected(); - oss.testOrderReviewRandom(); - oss.stopServer(); - } - - - public void startServer() throws Exception { - try { - - NodeFactory factory = NodeFactory.newInstance(); - String contribution = ContributionLocationHelper.getContributionLocation(OrderService_Service.class); - node = factory.createNode("orderws.composite", new Contribution("order", contribution)).start(); - } catch (Exception e) { - e.printStackTrace(); - } - - } - - public void testOrderReviewApproved() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceComponent/OrderService"); - - Order order = new Order(); - order.setStatus( Status.CREATED ); - order.setCustomerId("cust1234"); - order.setTotal( 50.0 ); - - System.out.println( ">>> Order submitted=" + order ); - Holder holder = new Holder( order ); - orderService.reviewOrder( holder ); - System.out.println( ">>> Order returned=" + holder.value ); - } - - - public void testOrderReviewRejected() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceComponent/OrderService"); - - Order order = new Order(); - order.setStatus( Status.CREATED ); - order.setCustomerId("cust2345"); - order.setTotal( 50000.0 ); - - System.out.println( ">>> Order submitted=" + order ); - Holder holder = new Holder( order ); - orderService.reviewOrder( holder ); - System.out.println( ">>> Order returned=" + holder.value ); - } - - public void testOrderReviewRandom() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceComponent/OrderService"); - - Order order = new Order(); - order.setStatus( Status.CREATED ); - order.setCustomerId("cust3456"); - order.setTotal( 600.0 ); - - System.out.println( ">>> Order submitted=" + order ); - Holder holder = new Holder( order ); - orderService.reviewOrder( holder ); - System.out.println( ">>> Order returned=" + holder.value ); - } - - - public void stopServer() throws Exception { - if (node != null) - node.stop(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/OrderService_Service.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/OrderService_Service.java deleted file mode 100644 index fbcdff735d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/OrderService_Service.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.example.orderservice; - -import java.net.MalformedURLException; -import java.net.URL; -import javax.xml.namespace.QName; -import javax.xml.ws.Service; -import javax.xml.ws.WebEndpoint; -import javax.xml.ws.WebServiceClient; -import javax.xml.ws.WebServiceFeature; - - -/** - * This class was generated by the JAX-WS RI. - * JAX-WS RI 2.1.1 in JDK 6 - * Generated source version: 2.1 - * - */ -@WebServiceClient(name = "OrderService", targetNamespace = "http://www.example.org/OrderService/", wsdlLocation = "META-INF/sca-deployables/orderservice.wsdl") -public class OrderService_Service - extends Service -{ - - private final static URL ORDERSERVICE_WSDL_LOCATION; - - static { - URL url = null; - try { - url = new URL("META-INF/sca-deployables/orderservice.wsdl"); - } catch (MalformedURLException e) { - e.printStackTrace(); - } - ORDERSERVICE_WSDL_LOCATION = url; - } - - public OrderService_Service(URL wsdlLocation, QName serviceName) { - super(wsdlLocation, serviceName); - } - - public OrderService_Service() { - super(ORDERSERVICE_WSDL_LOCATION, new QName("http://www.example.org/OrderService/", "OrderService")); - } - - /** - * - * @return - * returns OrderService - */ - @WebEndpoint(name = "OrderServiceSOAP") - public OrderService getOrderServiceSOAP() { - return (OrderService)super.getPort(new QName("http://www.example.org/OrderService/", "OrderServiceSOAP"), OrderService.class); - } - - /** - * - * @param features - * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the features parameter will have their default values. - * @return - * returns OrderService - */ - @WebEndpoint(name = "OrderServiceSOAP") - public OrderService getOrderServiceSOAP(WebServiceFeature... features) { - return (OrderService)super.getPort(new QName("http://www.example.org/OrderService/", "OrderServiceSOAP"), OrderService.class, features); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/ReviewOrder.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/ReviewOrder.java deleted file mode 100644 index ea00efb42e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/ReviewOrder.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.example.orderservice; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="myData" type="{http://www.example.org/OrderService/}order"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "myData" -}) -@XmlRootElement(name = "reviewOrder") -public class ReviewOrder { - - @XmlElement(required = true) - protected Order myData; - - /** - * Gets the value of the myData property. - * - * @return - * possible object is - * {@link Order } - * - */ - public Order getMyData() { - return myData; - } - - /** - * Sets the value of the myData property. - * - * @param value - * allowed object is - * {@link Order } - * - */ - public void setMyData(Order value) { - this.myData = value; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/ReviewOrderResponse.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/ReviewOrderResponse.java deleted file mode 100644 index 7b27c7d4b5..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/ReviewOrderResponse.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.example.orderservice; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType>
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="myData" type="{http://www.example.org/OrderService/}order"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "", propOrder = { - "myData" -}) -@XmlRootElement(name = "reviewOrderResponse") -public class ReviewOrderResponse { - - @XmlElement(required = true) - protected Order myData; - - /** - * Gets the value of the myData property. - * - * @return - * possible object is - * {@link Order } - * - */ - public Order getMyData() { - return myData; - } - - /** - * Sets the value of the myData property. - * - * @param value - * allowed object is - * {@link Order } - * - */ - public void setMyData(Order value) { - this.myData = value; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/Status.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/Status.java deleted file mode 100644 index 83b198ab35..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/Status.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.example.orderservice; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for status. - * - *

The following schema fragment specifies the expected content contained within this class. - *

- *

- * <simpleType name="status">
- *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- *     <enumeration value="Created"/>
- *     <enumeration value="Submitted"/>
- *     <enumeration value="Approved"/>
- *     <enumeration value="Rejected"/>
- *   </restriction>
- * </simpleType>
- * 
- * - */ -@XmlType(name = "status") -@XmlEnum -public enum Status { - - @XmlEnumValue("Created") - CREATED("Created"), - @XmlEnumValue("Submitted") - SUBMITTED("Submitted"), - @XmlEnumValue("Approved") - APPROVED("Approved"), - @XmlEnumValue("Rejected") - REJECTED("Rejected"); - private final String value; - - Status(String v) { - value = v; - } - - public String value() { - return value; - } - - public static Status fromValue(String v) { - for (Status c: Status.values()) { - if (c.value.equals(v)) { - return c; - } - } - throw new IllegalArgumentException(v); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/package-info.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/package-info.java deleted file mode 100644 index 4acc5af9b0..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/java/org/example/orderservice/package-info.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.example.org/OrderService/") -package org.example.orderservice; diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/resources/orderws.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/resources/orderws.composite deleted file mode 100644 index eeba5ac050..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/resources/orderws.composite +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/resources/wsdl/orderservice.wsdl b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/resources/wsdl/orderservice.wsdl deleted file mode 100644 index d016994679..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/main/resources/wsdl/orderservice.wsdl +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/test/java/org/example/orderservice/OrderServiceTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/test/java/org/example/orderservice/OrderServiceTestCase.java deleted file mode 100644 index bb135adb26..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/holder-ws-service/src/test/java/org/example/orderservice/OrderServiceTestCase.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.example.orderservice; - -import static junit.framework.Assert.assertNotNull; -import static junit.framework.Assert.assertTrue; - -import java.io.IOException; - -import javax.xml.ws.Holder; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -/** - * Tests that the order server responds. - */ -public class OrderServiceTestCase { - - private Node node; - - @Before - public void startServer() throws Exception { - try { - - NodeFactory factory = NodeFactory.newInstance(); - String contribution = ContributionLocationHelper.getContributionLocation(OrderService_Service.class); - node = factory.createNode("orderws.composite", new Contribution("order", contribution)).start(); - } catch (Exception e) { - e.printStackTrace(); - } - - } - - @Test - public void testOrderReviewApproved() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceComponent/OrderService"); - assertNotNull(orderService); - - Order order = new Order(); - order.setStatus( Status.CREATED ); - order.setCustomerId("cust1234"); - order.setTotal( 50.0 ); - - System.out.println( ">>> Order submitted=" + order ); - Holder holder = new Holder( order ); - orderService.reviewOrder( holder ); - System.out.println( ">>> Order returned=" + holder.value ); - assertTrue( holder.value.getStatus() == Status.APPROVED ); - } - - @Test - public void testOrderReviewRejected() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceComponent/OrderService"); - assertNotNull(orderService); - - Order order = new Order(); - order.setStatus( Status.CREATED ); - order.setCustomerId("cust2345"); - order.setTotal( 50000.0 ); - - System.out.println( ">>> Order submitted=" + order ); - Holder holder = new Holder( order ); - orderService.reviewOrder( holder ); - System.out.println( ">>> Order returned=" + holder.value ); - assertTrue( holder.value.getStatus() == Status.REJECTED ); - } - - @Test - public void testOrderReviewRandom() throws IOException { - OrderService orderService = - node.getService(OrderService.class, "OrderServiceComponent/OrderService"); - assertNotNull(orderService); - - Order order = new Order(); - order.setStatus( Status.CREATED ); - order.setCustomerId("cust3456"); - order.setTotal( 600.0 ); - - System.out.println( ">>> Order submitted=" + order ); - Holder holder = new Holder( order ); - orderService.reviewOrder( holder ); - System.out.println( ">>> Order returned=" + holder.value ); - assertTrue( holder.value.getStatus() != Status.CREATED ); - } - - @After - public void stopServer() throws Exception { - if (node != null) - node.stop(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/pom.xml deleted file mode 100644 index 7342b71013..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/binding-ws/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-sample-binding-ws - pom - Apache Tuscany SCA Sample binding.ws - - - - default - - true - - - calculator-contribution - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/LICENSE b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/LICENSE deleted file mode 100644 index 6e529a25c4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/META-INF/MANIFEST.MF b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/META-INF/MANIFEST.MF deleted file mode 100644 index cea4e2ff79..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/META-INF/MANIFEST.MF +++ /dev/null @@ -1,23 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: calculator.dosgi.operations;version="1.0.1" -Bundle-Version: 1.0.0 -Bundle-Name: calculator.dosgi.dynamic.operations -Bundle-Activator: calculator.dosgi.operations.impl.OperationsActivator -Bundle-ManifestVersion: 2 -Import-Package: calculator.dosgi.operations;version="[1.0.1,1.0.1]", - org.oasisopen.sca.annotation;version="2.0.0", - org.osgi.framework, - org.osgi.service.component;resolution:=optional, - org.osgi.service.packageadmin -Bundle-SymbolicName: calculator.dosgi.dynamic.operations -Bundle-Vendor: The Apache Software Foundation -Bundle-ActivationPolicy: lazy -Eclipse-LazyStart: true -Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt -Bundle-DocURL: http://www.apache.org/ -Service-Component-Disabled: OSGI-INF/add-component.xml, - OSGI-INF/subtract-component.xml, - OSGI-INF/multiply-component.xml, - OSGI-INF/divide-component.xml -Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6 -SCA-Configuration: OSGI-INF/sca-config/*.xml diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/NOTICE b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/NOTICE deleted file mode 100644 index 9ddba06a32..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2010 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/add-component.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/add-component.xml deleted file mode 100644 index 99845257ff..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/add-component.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/blueprint/operations-module.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/blueprint/operations-module.xml deleted file mode 100644 index f6b5f4690e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/blueprint/operations-module.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/divide-component.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/divide-component.xml deleted file mode 100644 index 322d4daf2f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/divide-component.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/multiply-component.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/multiply-component.xml deleted file mode 100644 index b9ca777bd8..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/multiply-component.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/sca-config/operations-config.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/sca-config/operations-config.xml deleted file mode 100644 index 1965b571a9..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/sca-config/operations-config.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/subtract-component.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/subtract-component.xml deleted file mode 100644 index 1472f5a976..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/OSGI-INF/subtract-component.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/README deleted file mode 100644 index 52afa44559..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/README +++ /dev/null @@ -1,6 +0,0 @@ -Distributed OSGi Calculator Sample -================================== -This sample implements a distributed calculator using Distributed OSGi (RFC 119) over SCA. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/pom.xml deleted file mode 100644 index bbd7ce4760..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/pom.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - - sample-dosgi-dynamic-calculator-operations - Apache Tuscany SCA Sample OSGi Remote Services Dynamic Calculator Operations - - - - org.apache.tuscany.sca - tuscany-feature-all - 2.0-Beta2-SNAPSHOT - pom - - - - org.apache.tuscany.sca - tuscany-node-launcher-equinox - 2.0-Beta2-SNAPSHOT - test - - - - org.apache.tuscany.sca - tuscany-node-impl-osgi - 2.0-Beta2-SNAPSHOT - runtime - - - - org.eclipse.osgi - services - 3.2.0-v20090520-1800 - test - - - - - org.eclipse.equinox - ds - 1.1.0-v20090601 - test - - - - org.eclipse.equinox - util - 1.0.100-v20090520-1800 - test - - - - junit - junit - 4.8.1 - test - - - - - - ${artifactId} - - - maven-eclipse-plugin - 2.5.1 - - - org.eclipse.pde.ManifestBuilder - org.eclipse.jdt.core.javabuilder - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - - org.eclipse.jdt.launching.JRE_CONTAINER - - - - - - - maven-jar-plugin - - - ${basedir}/META-INF/MANIFEST.MF - - - - - - org.apache.tuscany.maven.plugins - maven-osgi-junit-plugin - 1.0 - - - org.apache.tuscany.sca - tuscany-node-launcher-equinox - ${pom.version} - - - - - osgi-test - test - - test - - - - - osgi.configuration.area - ${project.build.directory}/equinox - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java deleted file mode 100644 index 971500782f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the add service - */ -@Remotable -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java deleted file mode 100644 index 49b8a1c0bf..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the divide service - */ -@Remotable -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java deleted file mode 100644 index f4e59d12ea..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the multiply service - */ -@Remotable -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java deleted file mode 100644 index bfb9b820f7..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the subtract service - */ -@Remotable -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java deleted file mode 100644 index 66b2977241..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations.impl; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import calculator.dosgi.operations.AddService; - -/** - * An implementation of the Add service - */ -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.INFO, "Adding " + n1 + " and " + n2); - return n1 + n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java deleted file mode 100644 index a3c21b2b96..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations.impl; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import calculator.dosgi.operations.DivideService; - -/** - * An implementation of the Divide service. - */ -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.INFO, "Dividing " + n1 + " with " + n2); - return n1 / n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java deleted file mode 100644 index 7922d2d392..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations.impl; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import calculator.dosgi.operations.MultiplyService; - -/** - * An implementation of the Multiply service. - */ -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.INFO, "Multiplying " + n1 + " with " + n2); - return n1 * n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java deleted file mode 100644 index f75cc6444e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.operations.impl; - -import java.util.Dictionary; -import java.util.Hashtable; -import java.util.logging.Logger; - -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.service.packageadmin.PackageAdmin; - -import calculator.dosgi.operations.AddService; -import calculator.dosgi.operations.DivideService; -import calculator.dosgi.operations.MultiplyService; -import calculator.dosgi.operations.SubtractService; - -/** - * - */ -public class OperationsActivator implements BundleActivator { - private Logger logger = Logger.getLogger(OperationsActivator.class.getName()); - - public void start(BundleContext context) throws Exception { - logger.info("Starting " + context.getBundle()); - - Dictionary props = new Hashtable(); - props.put("service.exported.configs", new String[] {"org.osgi.sca"}); - props.put("service.exported.interfaces", new String[] {"*"}); - - logger.info("Registering " + AddService.class.getName()); - props.put("sca.service", "AddComponent#service-name(Add)"); - props.put("org.osgi.sca.bindings", new String[] {"{http://sample}Add"}); - context.registerService(AddService.class.getName(), new AddServiceImpl(), props); - - logger.info("Registering " + SubtractService.class.getName()); - props.put("sca.service", "SubtractComponent#service-name(Subtract)"); - props.put("org.osgi.sca.bindings", new String[] {"{http://sample}Subtract"}); - context.registerService(SubtractService.class.getName(), new SubtractServiceImpl(), props); - - logger.info("Registering " + MultiplyService.class.getName()); - props.put("sca.service", "MultiplyComponent#service-name(Multiply)"); - props.put("org.osgi.sca.bindings", new String[] {"{http://sample}Multiply"}); - context.registerService(MultiplyService.class.getName(), new MultiplyServiceImpl(), props); - - logger.info("Registering " + DivideService.class.getName()); - props.put("sca.service", "DivideComponent#service-name(Divide)"); - props.put("org.osgi.sca.bindings", new String[] {"{http://sample}Divide"}); - context.registerService(DivideService.class.getName(), new DivideServiceImpl(), props); - - getBundle(context, AddService.class); - } - - public void stop(BundleContext context) throws Exception { - logger.info("Stopping " + context.getBundle()); - // Registered services will be automatically unregistered - } - - private Bundle getBundle(BundleContext bundleContext, Class cls) { - PackageAdmin packageAdmin = null; - // PackageAdmin is used to resolve bundles - ServiceReference ref = bundleContext.getServiceReference("org.osgi.service.packageadmin.PackageAdmin"); - if (ref != null) { - packageAdmin = (PackageAdmin)bundleContext.getService(ref); - Bundle bundle = packageAdmin.getBundle(cls); - if (bundle != null) { - logger.info(cls.getName() + " is loaded by bundle: " + bundle.getSymbolicName()); - } - bundleContext.ungetService(ref); - return bundle; - } - return null; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java deleted file mode 100644 index 4bbe83b14f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations.impl; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import calculator.dosgi.operations.SubtractService; - -/** - * An implementation of the subtract service. - */ -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.INFO, "Subtracting " + n1 + " from " + n2); - return n1 - n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java deleted file mode 100644 index cd92989da1..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.operations.test; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; - -import org.osgi.framework.Bundle; - -/** - * - * Utility class to create OSGi bundles - * - * @version $Rev$ $Date$ - */ -public class OSGiTestUtils { - private static class InvocationHandlerImpl implements InvocationHandler { - private Object instance; - - public InvocationHandlerImpl(Object instance) { - super(); - this.instance = instance; - } - - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - Method m = instance.getClass().getMethod(method.getName(), method.getParameterTypes()); - return m.invoke(instance, args); - } - - } - - /** - * Returns a string representation of the given bundle. - * - * @param b - * @param verbose - * @return - */ - public static String bundleStatus(Bundle bundle, boolean verbose) { - StringBuffer sb = new StringBuffer(); - sb.append(bundle.getBundleId()).append(" ").append(bundle.getSymbolicName()); - int s = bundle.getState(); - if ((s & Bundle.UNINSTALLED) != 0) { - sb.append(" UNINSTALLED"); - } - if ((s & Bundle.INSTALLED) != 0) { - sb.append(" INSTALLED"); - } - if ((s & Bundle.RESOLVED) != 0) { - sb.append(" RESOLVED"); - } - if ((s & Bundle.STARTING) != 0) { - sb.append(" STARTING"); - } - if ((s & Bundle.STOPPING) != 0) { - sb.append(" STOPPING"); - } - if ((s & Bundle.ACTIVE) != 0) { - sb.append(" ACTIVE"); - } - - if (verbose) { - sb.append(" ").append(bundle.getLocation()); - sb.append(" ").append(bundle.getHeaders()); - } - return sb.toString(); - } - - /** - * A utility to cast the object to the given interface. If the class for the object - * is loaded by a different classloader, a proxy will be created. - * - * @param - * @param obj - * @param cls - * @return - */ - public static T cast(Object obj, Class cls) { - if (cls.isInstance(obj)) { - return cls.cast(obj); - } else { - return cls.cast(Proxy.newProxyInstance(cls.getClassLoader(), - new Class[] {cls}, - new InvocationHandlerImpl(obj))); - } - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java deleted file mode 100644 index 02007c385c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.operations.test; - -import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher; - -/** - * - */ -public class OperationsNode { - - /** - * @param args - */ - public static void main(String[] args) { - if (args.length == 0) { - args = new String[] {"-bundles"}; - } - try { - NodeLauncher.main(args); - } catch (Exception e) { - e.printStackTrace(); - } - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java deleted file mode 100644 index eee64bf86f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.operations.test; - -import static calculator.dosgi.operations.test.OSGiTestUtils.bundleStatus; - -import java.rmi.registry.LocateRegistry; -import java.rmi.registry.Registry; - -import org.apache.tuscany.sca.node.equinox.launcher.EquinoxHost; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.Constants; - -import calculator.dosgi.operations.AddService; - -/** - * - */ -public class OperationsOSGiNodeTestCase { - private static EquinoxHost host; - private static BundleContext context; - private static Bundle operationsBundle; - - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - try { - host = new EquinoxHost(); - context = host.start(); - - for (Bundle b : context.getBundles()) { - if (b.getSymbolicName().equals("org.eclipse.equinox.ds") || b.getSymbolicName() - .startsWith("org.apache.tuscany.sca.")) { - try { - if (b.getHeaders().get(Constants.FRAGMENT_HOST) == null) { - // Start the non-fragment bundle - b.start(); - } - } catch (Exception e) { - e.printStackTrace(); - } - System.out.println(bundleStatus(b, false)); - } - if ("calculator.dosgi.dynamic.operations".equals(b.getSymbolicName())) { - operationsBundle = b; - } - } - - if (operationsBundle != null) { - operationsBundle.start(); - System.out.println(bundleStatus(operationsBundle, false)); - } - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testOSGi() throws Exception { - Registry registry = LocateRegistry.getRegistry(8085); - Object add = registry.lookup("AddService"); - AddService addService = OSGiTestUtils.cast(add, AddService.class); - double sum = addService.add(1.0, 2.0); - Assert.assertEquals(3.0, sum, 0.0); - } - - /** - * @throws java.lang.Exception - */ - @AfterClass - public static void tearDownAfterClass() throws Exception { - if (host != null) { - host.stop(); - context = null; - } - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/LICENSE b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/LICENSE deleted file mode 100644 index 6e529a25c4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/META-INF/MANIFEST.MF b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/META-INF/MANIFEST.MF deleted file mode 100644 index 6ce24a4a32..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/META-INF/MANIFEST.MF +++ /dev/null @@ -1,23 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: calculator.dosgi;version="1.0.1", - calculator.dosgi.operations;version="1.0.1" -Bundle-Version: 1.0.0 -Bundle-Name: calculator.dosgi.dynamic -Bundle-Activator: calculator.dosgi.impl.CalculatorActivator -Bundle-ManifestVersion: 2 -Import-Package: org.oasisopen.sca.annotation;version="2.0.0", - org.osgi.framework, - org.osgi.service.component;resolution:=optional, - org.osgi.service.packageadmin, - org.osgi.util.tracker -Bundle-SymbolicName: calculator.dosgi.dynamic -Bundle-Vendor: The Apache Software Foundation -Bundle-ActivationPolicy: lazy -Eclipse-LazyStart: true -Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt -Bundle-DocURL: http://www.apache.org/ -Service-Component-Disabled: OSGI-INF/calculator-component.xml -Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6 -SCA-Configuration: OSGI-INF/sca-config/calculator-config.xml -Remote-Service: OSGI-INF/remote-service/*.xml - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/NOTICE b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/NOTICE deleted file mode 100644 index 9ddba06a32..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2010 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/blueprint/calculator-module.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/blueprint/calculator-module.xml deleted file mode 100644 index fd834e12ef..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/blueprint/calculator-module.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/calculator-component.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/calculator-component.xml deleted file mode 100644 index 5daaa59aae..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/calculator-component.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml deleted file mode 100644 index 195fa9e4e9..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/remote-service/calculator-service-descriptions.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - {http://sample}Add - - - - - - - - - - - - - - {http://sample}Subtract - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/sca-config/calculator-config.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/sca-config/calculator-config.xml deleted file mode 100644 index f10b577e87..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/OSGI-INF/sca-config/calculator-config.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/README deleted file mode 100644 index 52afa44559..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/README +++ /dev/null @@ -1,6 +0,0 @@ -Distributed OSGi Calculator Sample -================================== -This sample implements a distributed calculator using Distributed OSGi (RFC 119) over SCA. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/dosgi-calculator.png b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/dosgi-calculator.png deleted file mode 100644 index 805baa54d2..0000000000 Binary files a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/dosgi-calculator.png and /dev/null differ diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/pom.xml deleted file mode 100644 index 8c0f85fbf9..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/pom.xml +++ /dev/null @@ -1,153 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - - sample-dosgi-dynamic-calculator - Apache Tuscany SCA Sample OSGi Remote Services Dynamic Calculator - - - - org.apache.tuscany.sca - tuscany-feature-ejava - 2.0-Beta2-SNAPSHOT - pom - - - org.apache.tuscany.sca - tuscany-feature-webservice - 2.0-Beta2-SNAPSHOT - pom - runtime - - - org.apache.tuscany.sca - tuscany-node-launcher-equinox - 2.0-Beta2-SNAPSHOT - test - - - - org.apache.tuscany.sca - tuscany-node-impl-osgi - 2.0-Beta2-SNAPSHOT - runtime - - - - org.eclipse.osgi - services - 3.2.0-v20090520-1800 - - - - junit - junit - 4.8.1 - test - - - - - org.eclipse.equinox - ds - 1.1.0-v20090601 - test - - - - org.eclipse.equinox - util - 1.0.100-v20090520-1800 - test - - - - - - ${artifactId} - - - maven-eclipse-plugin - 2.5.1 - - - org.eclipse.pde.ManifestBuilder - org.eclipse.jdt.core.javabuilder - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - - org.eclipse.jdt.launching.JRE_CONTAINER - - - - - - - maven-jar-plugin - - - ${basedir}/META-INF/MANIFEST.MF - - - - - - org.apache.tuscany.maven.plugins - maven-osgi-junit-plugin - 1.0 - - - org.apache.tuscany.sca - tuscany-node-launcher-equinox - ${pom.version} - - - - - osgi-test - test - - test - - - - - osgi.configuration.area - ${project.build.directory}/equinox - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/CalculatorService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/CalculatorService.java deleted file mode 100644 index cc562b7c2f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/CalculatorService.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The Calculator service interface. - */ -@Remotable -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java deleted file mode 100644 index 6228afcd53..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.impl; - -import java.util.Dictionary; -import java.util.Hashtable; -import java.util.logging.Logger; - -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.service.packageadmin.PackageAdmin; - -import calculator.dosgi.CalculatorService; -import calculator.dosgi.operations.AddService; - -/** - * - */ -public class CalculatorActivator implements BundleActivator { - private Logger logger = Logger.getLogger(CalculatorActivator.class.getName()); - - private Bundle getBundle(BundleContext bundleContext, Class cls) { - PackageAdmin packageAdmin = null; - // PackageAdmin is used to resolve bundles - ServiceReference ref = bundleContext.getServiceReference("org.osgi.service.packageadmin.PackageAdmin"); - if (ref != null) { - packageAdmin = (PackageAdmin)bundleContext.getService(ref); - Bundle bundle = packageAdmin.getBundle(cls); - if (bundle != null) { - logger.info(cls.getName() + " is loaded by bundle: " + bundle.getSymbolicName()); - } - bundleContext.ungetService(ref); - return bundle; - } - return null; - } - - public void start(BundleContext context) throws Exception { - logger.info("Starting " + context.getBundle()); - Dictionary props = new Hashtable(); - props.put("sca.service", "CalculatorComponent#service-name(Calculator)"); - props.put("calculator", "Calculator"); - props.put("service.exported.configs", new String[] {"org.osgi.sca"}); - props.put("org.osgi.sca.bindings", new String[] {"{http://sample}Calculator"}); - props.put("service.exported.interfaces", new String[] {"*"}); - logger.info("Registering " + CalculatorService.class.getName()); - CalculatorService calculator = new CalculatorServiceImpl(context); - context.registerService(CalculatorService.class.getName(), calculator, props); - - getBundle(context, AddService.class); - - } - - public void stop(BundleContext context) throws Exception { - logger.info("Stopping " + context.getBundle()); - // Registered services will be automatically unregistered - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java deleted file mode 100644 index 5f9db16ca9..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.impl; - -import org.osgi.service.component.ComponentContext; - -import calculator.dosgi.CalculatorService; -import calculator.dosgi.operations.AddService; -import calculator.dosgi.operations.DivideService; -import calculator.dosgi.operations.MultiplyService; -import calculator.dosgi.operations.SubtractService; - -/** - * An implementation of the Calculator service. - */ -public class CalculatorServiceDSImpl implements CalculatorService { - private AddService addService; - private SubtractService subtractService; - private MultiplyService multiplyService; - private DivideService divideService; - - public CalculatorServiceDSImpl() { - super(); - System.out.println("CalculatorServiceDSImpl()"); - } - - protected void activate(ComponentContext context) { - System.out.println("Activating " + context); - } - - protected void deactivate(ComponentContext context) { - System.out.println("Deactivating " + context); - } - - /* - * The following setters can be used for DS injection - */ - public void setAddService(AddService addService) { - System.out.println("setAddService()"); - this.addService = addService; - } - - public void setSubtractService(SubtractService subtractService) { - this.subtractService = subtractService; - } - - public void setDivideService(DivideService divideService) { - this.divideService = divideService; - } - - public void setMultiplyService(MultiplyService multiplyService) { - this.multiplyService = multiplyService; - } - - /* - * The following setters can be used for DS injection - */ - public void unsetAddService(AddService addService) { - System.out.println("unsetAddService()"); - this.addService = null; - } - - public void unsetSubtractService(SubtractService subtractService) { - this.subtractService = null; - } - - public void unsetDivideService(DivideService divideService) { - this.divideService = null; - } - - public void unsetMultiplyService(MultiplyService multiplyService) { - this.multiplyService = null; - } - private T getService(Class cls) { - for (Object s : new Object[] {addService, subtractService, multiplyService, divideService}) { - if (cls.isInstance(s)) { - return cls.cast(s); - } - } - throw new IllegalStateException(cls.getSimpleName() + " is not available"); - } - - public double add(double n1, double n2) { - return getService(AddService.class).add(n1, n2); - } - - public double subtract(double n1, double n2) { - return getService(SubtractService.class).subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return getService(MultiplyService.class).multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return getService(DivideService.class).divide(n1, n2); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java deleted file mode 100644 index aa09b27139..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.impl; - -import static org.osgi.framework.Constants.OBJECTCLASS; - -import java.util.HashMap; -import java.util.Map; - -import org.osgi.framework.BundleContext; -import org.osgi.framework.Filter; -import org.osgi.framework.InvalidSyntaxException; -import org.osgi.util.tracker.ServiceTracker; - -import calculator.dosgi.CalculatorService; -import calculator.dosgi.operations.AddService; -import calculator.dosgi.operations.DivideService; -import calculator.dosgi.operations.MultiplyService; -import calculator.dosgi.operations.SubtractService; - -/** - * An implementation of the Calculator service. - */ -public class CalculatorServiceImpl implements CalculatorService { - private Map, ServiceTracker> remoteServices = new HashMap, ServiceTracker>(); - - public CalculatorServiceImpl() { - super(); - } - - public CalculatorServiceImpl(BundleContext context) { - super(); - for (Class cls : new Class[] {AddService.class, SubtractService.class, MultiplyService.class, - DivideService.class}) { - Filter remoteFilter = null; - try { - remoteFilter = - context.createFilter("(&(" + OBJECTCLASS + "=" + cls.getName() + ") (service.imported=*))"); - } catch (InvalidSyntaxException e) { - e.printStackTrace(); - } - ServiceTracker tracker = new ServiceTracker(context, remoteFilter, null); - this.remoteServices.put(cls, tracker); - tracker.open(); - } - } - - private T getService(Class cls) { - ServiceTracker tracker = remoteServices.get(cls); - try { - // Wait for 10 seconds until the remote services are imported - tracker.waitForService(10000); - } catch (InterruptedException e) { - throw new IllegalStateException(cls.getSimpleName() + " is not available"); - } - Object[] remoteObjects = tracker.getServices(); - if (remoteObjects != null) { - for (Object s : remoteObjects) { - if (cls.isInstance(s)) { - System.out.println("Remote service: " + s); - return cls.cast(s); - } - } - } - throw new IllegalStateException(cls.getSimpleName() + " is not available"); - } - - public double add(double n1, double n2) { - return getService(AddService.class).add(n1, n2); - } - - public double subtract(double n1, double n2) { - return getService(SubtractService.class).subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return getService(MultiplyService.class).multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return getService(DivideService.class).divide(n1, n2); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/AddService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/AddService.java deleted file mode 100644 index 971500782f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/AddService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the add service - */ -@Remotable -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/DivideService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/DivideService.java deleted file mode 100644 index 49b8a1c0bf..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/DivideService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the divide service - */ -@Remotable -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java deleted file mode 100644 index f4e59d12ea..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the multiply service - */ -@Remotable -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java deleted file mode 100644 index bfb9b820f7..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the subtract service - */ -@Remotable -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java deleted file mode 100644 index a4fc52694e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.rmi; - -import java.io.Serializable; -import java.rmi.Remote; -import java.rmi.RemoteException; -import java.rmi.registry.LocateRegistry; -import java.rmi.registry.Registry; -import java.rmi.server.UnicastRemoteObject; - -/** - * - */ -public class OperationsRMIServer implements OperationsRemote, Serializable { - - private static final long serialVersionUID = 6081008315263103012L; - private transient Registry registry; - - public OperationsRMIServer() throws RemoteException { - super(); - } - - public double add(double n1, double n2) { - return n1 + n2; - } - - public double subtract(double n1, double n2) { - return n1 - n2; - } - - public double divide(double n1, double n2) { - return n1 / n2; - } - - public double multiply(double n1, double n2) { - return n1 * n2; - } - - public void start() throws RemoteException { - Thread thread = new Thread() { - public void run() { - try { - System.out.println("Starting the RMI server for calculator operations..."); - Remote stub = UnicastRemoteObject.exportObject(OperationsRMIServer.this); - registry = LocateRegistry.createRegistry(8085); - registry.bind("AddService", stub); - registry.bind("SubtractService", stub); - registry.bind("MultiplyService", stub); - registry.bind("DivideService", stub); - System.out.println("RMI server for calculator operations is now started."); - } catch (Exception e) { - e.printStackTrace(); - } - } - }; - thread.start(); - } - - public void stop() { - if (registry != null) { - try { - registry.unbind("AddService"); - registry.unbind("SubtractService"); - registry.unbind("MultiplyService"); - registry.unbind("DivideService"); - UnicastRemoteObject.unexportObject(this, false); - UnicastRemoteObject.unexportObject(registry, false); - registry = null; - } catch (Exception e) { - e.printStackTrace(); - } - } - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java deleted file mode 100644 index a813dfb6f3..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -// Stub class generated by rmic, do not edit. -// Contents subject to change without notice. -package calculator.rmi; - -public final class OperationsRMIServer_Stub extends java.rmi.server.RemoteStub implements calculator.rmi.OperationsRemote { - private static final long serialVersionUID = 2; - - private static java.lang.reflect.Method $method_add_0; - private static java.lang.reflect.Method $method_divide_1; - private static java.lang.reflect.Method $method_multiply_2; - private static java.lang.reflect.Method $method_subtract_3; - - static { - try { - $method_add_0 = - calculator.rmi.OperationsRemote.class.getMethod("add", new java.lang.Class[] {double.class, double.class}); - $method_divide_1 = - calculator.rmi.OperationsRemote.class.getMethod("divide", - new java.lang.Class[] {double.class, double.class}); - $method_multiply_2 = - calculator.rmi.OperationsRemote.class.getMethod("multiply", new java.lang.Class[] {double.class, - double.class}); - $method_subtract_3 = - calculator.rmi.OperationsRemote.class.getMethod("subtract", new java.lang.Class[] {double.class, - double.class}); - } catch (java.lang.NoSuchMethodException e) { - throw new java.lang.NoSuchMethodError("stub class initialization failed"); - } - } - - // constructors - public OperationsRMIServer_Stub(java.rmi.server.RemoteRef ref) { - super(ref); - } - - // methods from remote interfaces - - // implementation of add(double, double) - public double add(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException { - try { - Object $result = - ref.invoke(this, - $method_add_0, - new java.lang.Object[] {new java.lang.Double($param_double_1), - new java.lang.Double($param_double_2)}, - 864055858262779977L); - return ((java.lang.Double)$result).doubleValue(); - } catch (java.lang.RuntimeException e) { - throw e; - } catch (java.rmi.RemoteException e) { - throw e; - } catch (java.lang.Exception e) { - throw new java.rmi.UnexpectedException("undeclared checked exception", e); - } - } - - // implementation of divide(double, double) - public double divide(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException { - try { - Object $result = - ref.invoke(this, - $method_divide_1, - new java.lang.Object[] {new java.lang.Double($param_double_1), - new java.lang.Double($param_double_2)}, - 8097593626497421928L); - return ((java.lang.Double)$result).doubleValue(); - } catch (java.lang.RuntimeException e) { - throw e; - } catch (java.rmi.RemoteException e) { - throw e; - } catch (java.lang.Exception e) { - throw new java.rmi.UnexpectedException("undeclared checked exception", e); - } - } - - // implementation of multiply(double, double) - public double multiply(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException { - try { - Object $result = - ref.invoke(this, - $method_multiply_2, - new java.lang.Object[] {new java.lang.Double($param_double_1), - new java.lang.Double($param_double_2)}, - -346155016949350695L); - return ((java.lang.Double)$result).doubleValue(); - } catch (java.lang.RuntimeException e) { - throw e; - } catch (java.rmi.RemoteException e) { - throw e; - } catch (java.lang.Exception e) { - throw new java.rmi.UnexpectedException("undeclared checked exception", e); - } - } - - // implementation of subtract(double, double) - public double subtract(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException { - try { - Object $result = - ref.invoke(this, - $method_subtract_3, - new java.lang.Object[] {new java.lang.Double($param_double_1), - new java.lang.Double($param_double_2)}, - -610707357620578750L); - return ((java.lang.Double)$result).doubleValue(); - } catch (java.lang.RuntimeException e) { - throw e; - } catch (java.rmi.RemoteException e) { - throw e; - } catch (java.lang.Exception e) { - throw new java.rmi.UnexpectedException("undeclared checked exception", e); - } - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRemote.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRemote.java deleted file mode 100644 index 955e386ad8..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/main/java/calculator/rmi/OperationsRemote.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.rmi; - -import java.rmi.Remote; -import java.rmi.RemoteException; - -/** - * RMI Remote interface - */ -public interface OperationsRemote extends Remote { - double add(double n1, double n2) throws RemoteException; - - double subtract(double n1, double n2) throws RemoteException; - - double multiply(double n1, double n2) throws RemoteException; - - double divide(double n1, double n2) throws RemoteException; - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java deleted file mode 100644 index 565a314d85..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.test; - -import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher; - -/** - * - */ -public class CalculatorNode { - - /** - * @param args - */ - public static void main(String[] args) { - if (args.length == 0) { - args = new String[] {"-bundles"}; - } - try { - NodeLauncher.main(args); - } catch (Exception e) { - e.printStackTrace(); - } - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java deleted file mode 100644 index 4015c7bbc2..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/dosgi-dynamic-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.test; - -import static calculator.dosgi.test.OSGiTestUtils.bundleStatus; - -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.net.URL; - -import org.apache.tuscany.sca.node.equinox.launcher.EquinoxHost; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.Constants; -import org.osgi.framework.ServiceReference; - -import calculator.dosgi.CalculatorService; -import calculator.rmi.OperationsRMIServer; - -/** - * - */ -public class CalculatorOSGiNodeTestCase { - private static EquinoxHost host; - private static BundleContext context; - private static Bundle calculatorBundle; - private static OperationsRMIServer rmiServer; - - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - try { - rmiServer = new OperationsRMIServer(); - rmiServer.start(); - - host = new EquinoxHost(); - context = host.start(); - - for (Bundle b : context.getBundles()) { - System.out.println(b); - if (b.getSymbolicName().equals("org.eclipse.equinox.ds") || b.getSymbolicName() - .startsWith("org.apache.tuscany.sca.")) { - try { - if (b.getHeaders().get(Constants.FRAGMENT_HOST) == null) { - // Start the non-fragment bundle - b.start(); - } - } catch (Exception e) { - e.printStackTrace(); - } - System.out.println(bundleStatus(b, false)); - } - if ("calculator.dosgi.dynamic".equals(b.getSymbolicName())) { - calculatorBundle = b; - } - } - - if (calculatorBundle != null) { - calculatorBundle.start(); - System.out.println(bundleStatus(calculatorBundle, false)); - } - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testOSGi() { - ServiceReference ref = - calculatorBundle.getBundleContext().getServiceReference(CalculatorService.class.getName()); - Assert.assertNotNull(ref); - Object service = context.getService(ref); - Assert.assertNotNull(service); - CalculatorService calculator = OSGiTestUtils.cast(service, CalculatorService.class); - System.out.println("2.0 + 1.0 = " + calculator.add(2.0, 1.0)); - System.out.println("2.0 - 1.0 = " + calculator.subtract(2.0, 1.0)); - System.out.println("2.0 * 1.0 = " + calculator.multiply(2.0, 1.0)); - System.out.println("2.0 / 1.0 = " + calculator.divide(2.0, 1.0)); - } - - @Test - /** - * Test the Web service exposed by the Calculator - */ - public void testWS() throws Exception { - URL url = new URL("http://localhost:8086/CalculatorService?wsdl"); - InputStream is = url.openStream(); - Reader reader = new InputStreamReader(is); - char[] content = new char[10240]; // 10k - int len = 0; - while (true) { - int size = reader.read(content, len, content.length - len); - if (size < 0) { - break; - } - len += size; - } - Assert.assertTrue(len > 0); - String str = new String(content, 0, len); - System.out.println(str); - Assert.assertTrue(str.indexOf(" - * @param obj - * @param cls - * @return - */ - public static T cast(Object obj, Class cls) { - if (cls.isInstance(obj)) { - return cls.cast(obj); - } else { - return cls.cast(Proxy.newProxyInstance(cls.getClassLoader(), - new Class[] {cls}, - new InvocationHandlerImpl(obj))); - } - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/pom.xml deleted file mode 100644 index 66bf644ced..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/distributed-osgi/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-samples-distributed-osgi - pom - Apache Tuscany SCA Distributed OSGI Samples - - - - default - - true - - - dosgi-dynamic-calculator - dosgi-dynamic-calculator-operations - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/README deleted file mode 100644 index c84dba22f4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/README +++ /dev/null @@ -1,31 +0,0 @@ -Hello World BPEL Sample -====================================== -This sample demonstrates an SCA service implemented by a BPEL process. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information - -=============== OLD INFO ====================== - -mkdir target\classes -mkdir target\wsdl2java-source -java -cp ..\..\lib\tuscany-sca-manifest.jar org.apache.tuscany.sdo.generate.XSD2JavaGenerator -targetDirectory target/wsdl2java-source -prefix HelloWorld -noContainment -noUnsettable src/main/resources/helloworld.wsdl -java -cp ..\..\lib\tuscany-sca-manifest.jar org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator -targetDirectory target/wsdl2java-source src/main/resources/helloworld.wsdl -unzip ..\..\lib\ode-dao-jpa-ojpa-derby-1.1.zip -d target\database -javac -d target\classes -cp target\classes;..\..\lib\tuscany-sca-manifest.jar -sourcepath src\main\java;target\wsdl2java-source -target 1.5 -g -source 1.5 src\main\java\helloworld\BPELClient.java -copy src\main\resources\* target\classes -java -cp ..\..\lib\tuscany-sca-manifest.jar;target\classes;target\database helloworld.BPELClient - -and on *nix do - -mkdir target/classes -mkdir target/wsdl2java-source -java -cp ../../lib/tuscany-sca-manifest.jar org.apache.tuscany.sdo.generate.XSD2JavaGenerator -targetDirectory target/wsdl2java-source -prefix HelloWorld -noContainment -noUnsettable src/main/resources/helloworld.wsdl -java -cp ../../lib/tuscany-sca-manifest.jar org.apache.tuscany.tools.wsdl2java.generate.WSDL2JavaGenerator -targetDirectory target/wsdl2java-source src/main/resources/helloworld.wsdl -unzip ../../lib/ode-dao-jpa-ojpa-derby-1.1.zip -d target/database -javac -d target/classes -cp target/classes;../../lib/tuscany-sca-manifest.jar -sourcepath src/main/java;target/wsdl2java-source -target 1.5 -g -source 1.5 src/main/java/helloworld/BPELClient.java -cp src/main/resources/* target/classes -java -cp ../../lib/tuscany-sca-manifest.jar:target/classes:target/database helloworld.BPELClient - -The sample will start an embedded BPEL engine, deploy a process and invoke it. - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/build.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/build.xml deleted file mode 100644 index d94388f466..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/build.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/helloworld-bpel.png b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/helloworld-bpel.png deleted file mode 100644 index 5f53a3c5d1..0000000000 Binary files a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/helloworld-bpel.png and /dev/null differ diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/helloworld-bpel.svg b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/helloworld-bpel.svg deleted file mode 100644 index 5a98f1a07c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/helloworld-bpel.svg +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - helloworldws - - HelloWorldServiceComponent - - HelloWorldWebService - - implementation.bpel helloworld.bpel - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/pom.xml deleted file mode 100644 index e90928e2ab..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/pom.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - - zip - sample-implementation-bpel-helloworld-contribution - Apache Tuscany SCA Sample implementation.bpel HelloWorld Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 2.0-Beta2-SNAPSHOT - provided - - - junit - junit - 4.8.1 - test - - - - - ${artifactId} - - - - - org.apache.tuscany.maven.plugins - maven-zip-plugin - alpha2 - true - - - - - org.apache.tuscany.maven.plugins - maven-tuscany-plugin - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-implementation-bpel-runtime - 2.0-Beta2-SNAPSHOT - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/java/helloworld/Hello.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/java/helloworld/Hello.java deleted file mode 100644 index dbd3854d7c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/java/helloworld/Hello.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package helloworld; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Hello { - - String hello(String name); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 4a56523adb..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/helloworld.bpel b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/helloworld.bpel deleted file mode 100644 index d58768adfa..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/helloworld.bpel +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - concat($helloMessage.TestPart/test:arg0/text(), ' World') - - - - - - - - - Dummy - - - - - - - - $helloMessageResponse.TestResponse/test:messageResponse - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/helloworld.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/helloworld.composite deleted file mode 100644 index 08350e8417..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/helloworld.composite +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/helloworld.wsdl b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/helloworld.wsdl deleted file mode 100644 index cf966264ef..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/helloworld.wsdl +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/log4j.properties b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/log4j.properties deleted file mode 100644 index 8649a71550..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-contribution/src/main/resources/log4j.properties +++ /dev/null @@ -1,35 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# Set root logger level to WARN and its only appender to CONSOLE -log4j.rootLogger=OFF, CONSOLE - -# log4j properties to work with commandline tools. -log4j.category.org.mortbay=OFF -log4j.category.org.hibernate.type=OFF -log4j.category.org.objectweb=OFF -log4j.category.org.apache.ode.sql=OFF -log4j.category.org.apache.ode.axis2=OFF -log4j.category.org.apache.ode.bpel.engine=OFF -log4j.category.org.apache.ode.daohib.bpel.CorrelatorDaoImpl=OFF -log4j.category.org.apache.ode.bpel.epr=OFF -log4j.category.org.apache.openjpa.kernel=OFF - -# Console appender -log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender -log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout -log4j.appender.CONSOLE.layout.ConversionPattern=%p - %C{1}.%M(%L) | %m%n \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/README deleted file mode 100644 index 2576b0ff13..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/README +++ /dev/null @@ -1,6 +0,0 @@ -Hello World BPEL WebApp Sample -====================================== -This sample demonstrates an SCA service implemented by a BPEL process. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/pom.xml deleted file mode 100644 index b87dd6963b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/pom.xml +++ /dev/null @@ -1,160 +0,0 @@ - - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../../pom.xml - - - sample-implementation-bpel-helloworld-webapp - war - Apache Tuscany SCA Sample implementation.bpel Helloworld WebApp - - - 2.0-Beta2-SNAPSHOT - 6.1.18 - - - - - - org.apache.tuscany.sca - tuscany-sca-api - ${tuscany.version} - - - - org.apache.tuscany.sca - tuscany-implementation-web-runtime - ${tuscany.version} - runtime - - - - org.apache.tuscany.sca - tuscany-implementation-bpel-runtime - ${tuscany.version} - runtime - - - - - junit - junit - 4.8.1 - test - - - - - org.mortbay.jetty - jetty - ${jetty.version} - provided - - - org.mortbay.jetty - jetty-util - ${jetty.version} - provided - - - org.mortbay.jetty - jetty-management - ${jetty.version} - provided - - - - - helloworld-bpel - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack - compile - - unpack - - - - - org.apache.ode - ode-dao-jpa-ojpa-derby - 1.1.1 - zip - false - ${project.build.directory}/classes - **/* - - - - - - - - - org.mortbay.jetty - maven-jetty-plugin - 6.1.18 - - helloworld-bpel - foo - 9999 - - - - start-jetty - process-test-classes - - run - - - 0 - true - - - 8085 - - - - - - stop-jetty - prepare-package - - stop - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/java/sample/HelloworldService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/java/sample/HelloworldService.java deleted file mode 100644 index c1a50d9be5..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/java/sample/HelloworldService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface HelloworldService { - - String hello(String name); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/resources/helloworld.bpel b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/resources/helloworld.bpel deleted file mode 100644 index f1e8895f76..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/resources/helloworld.bpel +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - concat('Hello ', $myVar.TestPart/test:message/text()) - - - - $tmpVar - $myVar.TestPart/test:message - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/resources/helloworld.wsdl b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/resources/helloworld.wsdl deleted file mode 100644 index 46cf381577..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/resources/helloworld.wsdl +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/webapp/WEB-INF/web.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/webapp/WEB-INF/web.composite deleted file mode 100644 index 3d36adadeb..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/webapp/WEB-INF/web.composite +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/webapp/WEB-INF/web.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index bf01a7b759..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - helloworld-bpel - - - tuscany.helloworld-bpel - org.apache.tuscany.sca.host.webapp.TuscanyServletFilter - - - - tuscany.helloworld-bpel - /* - - - - hello.jsp - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/webapp/hello.jsp b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/webapp/hello.jsp deleted file mode 100644 index c52d7b1cb2..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/helloworld-bpel-webapp/src/main/webapp/hello.jsp +++ /dev/null @@ -1,36 +0,0 @@ -<%-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. ---%> -<%@ page contentType="text/html;charset=UTF-8" language="java" %> -<%@ taglib uri="http://www.osoa.org/sca/sca_jsp.tld" prefix="sca" %> - - - - - - -

helloworld-bpel

- - Calling HelloworldService sayHello("world") returns: - -

- - <%= service.hello("world") %> - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/pom.xml deleted file mode 100644 index 6901855d3f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-bpel/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-samples-implememtation-bpel - pom - Apache Tuscany SCA Implementation BPEL Samples - - - - default - - true - - - helloworld-bpel-contribution - helloworld-bpel-webapp - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive-ws/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive-ws/README deleted file mode 100644 index 58422d84cf..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive-ws/README +++ /dev/null @@ -1,7 +0,0 @@ -Hello implementation.composite helloworld-ws-contribution Sample -============================================================= -This sample demonstrates nested composition using implementation.composite and -binding.ws - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive-ws/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive-ws/pom.xml deleted file mode 100644 index 88eddda35d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive-ws/pom.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - - zip - sample-implementation-composite-helloworld-ws-contribution - Apache Tuscany SCA Sample implemenation.composite Helloworld WS Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 2.0-Beta2-SNAPSHOT - provided - - - org.apache.tuscany.sca - sample-helloworld-contribution - 2.0-Beta2-SNAPSHOT - provided - - - junit - junit - 4.8.1 - test - - - - - ${artifactId} - - - - - org.apache.tuscany.maven.plugins - maven-zip-plugin - alpha2 - true - - - - - org.apache.tuscany.maven.plugins - maven-tuscany-plugin - 2.0-Beta2-SNAPSHOT - - - - ..\helloworld-recursive\target\sample-helloworld-recursive.jar - ..\..\..\getting-started\helloworld\target\helloworld-contribution.jar - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive-ws/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive-ws/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index ffc35bb553..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive-ws/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive-ws/src/main/resources/helloworld-ws.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive-ws/src/main/resources/helloworld-ws.composite deleted file mode 100644 index 719754224d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive-ws/src/main/resources/helloworld-ws.composite +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive/README deleted file mode 100644 index 1ad09620f3..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive/README +++ /dev/null @@ -1,6 +0,0 @@ -Hello implementation.composite helloworld-contribution Sample -============================================================= -This sample demonstrates nested composition using implementation.composite - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive/pom.xml deleted file mode 100644 index 25c9c536dc..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive/pom.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - - zip - sample-implementation-composite-helloworld-contribution - Apache Tuscany SCA Sample implementation.composite Helloworld Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 2.0-Beta2-SNAPSHOT - provided - - - junit - junit - 4.8.1 - test - - - - - ${artifactId} - - - - - - org.apache.tuscany.maven.plugins - maven-zip-plugin - alpha2 - true - - - - - org.apache.tuscany.maven.plugins - maven-tuscany-plugin - 2.0-Beta2-SNAPSHOT - - - - ..\helloworld\target\sample-helloworld.jar - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 15d9304d05..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive/src/main/resources/helloworld-recursive.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive/src/main/resources/helloworld-recursive.composite deleted file mode 100644 index 1094fea85e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/helloworld-recursive/src/main/resources/helloworld-recursive.composite +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/pom.xml deleted file mode 100644 index 2caabf853a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-composite/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-samples-implememtation-composite - pom - Apache Tuscany SCA Implementation Composite Samples - - - - default - - true - - - helloworld-recursive - helloworld-recursive-ws - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/README deleted file mode 100644 index 18ba62d494..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/README +++ /dev/null @@ -1 +0,0 @@ -Please look at the README files in the subdirectories of this directory for descriptions of the sample contributions. diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/README deleted file mode 100644 index 45c339d370..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/README +++ /dev/null @@ -1,8 +0,0 @@ -Calculator Sample Contribution -============================== - -This sample implements a simple calculator using SCA components. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/build.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/build.xml deleted file mode 100644 index 21dd4db482..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/build.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - ${tuscany.home} - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/pom.xml deleted file mode 100644 index 8b0650a57b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-implementation-java-calculator-contribution - Apache Tuscany SCA Sample implementation.java Calculator Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 2.0-Beta2-SNAPSHOT - - - - junit - junit - 4.8.1 - test - - - - - ${artifactId} - - - org.apache.tuscany.maven.plugins - maven-tuscany-plugin - 2.0-Beta2-SNAPSHOT - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/AddService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/AddService.java deleted file mode 100644 index 5a1e7a638a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The Add service interface - */ -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/AddServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/AddServiceImpl.java deleted file mode 100644 index caf4d358df..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Add service - */ -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Adding " + n1 + " and " + n2); - return n1 + n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorClient.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorClient.java deleted file mode 100644 index 2b791a8e1f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorClient.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -import org.oasisopen.sca.annotation.EagerInit; -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; - -/** - * This client program shows how to create an SCA runtime, start it, - * and locate and invoke a SCA component - */ -@Scope("COMPOSITE") @EagerInit -public class CalculatorClient { - - private CalculatorService calculatorService; - - @Reference - public void setCalculatorService(CalculatorService calculatorService) { - this.calculatorService = calculatorService; - } - - @Init - public void calculate() { - - // Calculate - System.out.println("SCA API ClassLoader: " + print(Reference.class.getClassLoader())); - System.out.println("3 + 2=" + calculatorService.add(3, 2)); - System.out.println("3 - 2=" + calculatorService.subtract(3, 2)); - System.out.println("3 * 2=" + calculatorService.multiply(3, 2)); - System.out.println("3 / 2=" + calculatorService.divide(3, 2)); - } - - private static String print(ClassLoader cl) { - StringBuffer buf = new StringBuffer(); - for (; cl != null;) { - buf.append(cl.toString()); - buf.append(' '); - cl = cl.getParent(); - } - return buf.toString(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index 78eea39c71..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The Calculator service interface. - */ -@Remotable -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index d3fa7a8f41..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Reference; - - -/** - * An implementation of the Calculator service. - */ -public class CalculatorServiceImpl implements CalculatorService { - - private AddService addService; - private SubtractService subtractService; - private MultiplyService multiplyService; - private DivideService divideService; - - @Reference - public void setAddService(AddService addService) { - this.addService = addService; - } - - @Reference - public void setSubtractService(SubtractService subtractService) { - this.subtractService = subtractService; - } - - @Reference - public void setDivideService(DivideService divideService) { - this.divideService = divideService; - } - - @Reference - public void setMultiplyService(MultiplyService multiplyService) { - this.multiplyService = multiplyService; - } - - public double add(double n1, double n2) { - return addService.add(n1, n2); - } - - public double subtract(double n1, double n2) { - return subtractService.subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return multiplyService.multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return divideService.divide(n1, n2); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/DivideService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/DivideService.java deleted file mode 100644 index ef6a8b375b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The divide service interface - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java deleted file mode 100644 index cd91935f08..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Divide service. - */ -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2); - return n1 / n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/MultiplyService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index db568cc762..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index c85357fcd8..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Multiply service. - */ -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2); - return n1 * n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/SubtractService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/SubtractService.java deleted file mode 100644 index 56ee372fc4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 1b669084d9..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the subtract service. - */ -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2); - return n1 - n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/resources/Calculator.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/resources/Calculator.composite deleted file mode 100644 index 370e1cf315..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/resources/Calculator.composite +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/resources/CalculatorClient.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/resources/CalculatorClient.composite deleted file mode 100644 index dfd32761be..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/resources/CalculatorClient.composite +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 70aab0e051..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java deleted file mode 100644 index c1cd131f40..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -/** - * This shows how to test the Calculator composition. - */ -public class CalculatorTestCase { - - @Test - public void testCalculator() throws Exception { - AddService add = new AddServiceImpl(); - SubtractService subtract = new SubtractServiceImpl(); - MultiplyService multiply = new MultiplyServiceImpl(); - DivideService divide = new DivideServiceImpl(); - - CalculatorServiceImpl calculator = new CalculatorServiceImpl(); - - calculator.setAddService(add); - calculator.setSubtractService(subtract); - calculator.setMultiplyService(multiply); - calculator.setDivideService(divide); - - assertEquals(calculator.add(3, 2), 5.0, 0); - assertEquals(calculator.subtract(3, 2), 1.0, 0); - assertEquals(calculator.multiply(3, 2), 6.0, 0); - assertEquals(calculator.divide(3, 2), 1.5, 0); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/pom.xml deleted file mode 100644 index 4f124ab359..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-java/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-sample-implementation-java - pom - Apache Tuscany SCA Sample implementation.java - - - - default - - true - - - calculator-contribution - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/LICENSE b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/LICENSE deleted file mode 100644 index 6e529a25c4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/META-INF/MANIFEST.MF b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/META-INF/MANIFEST.MF deleted file mode 100644 index 82a803e3a6..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/META-INF/MANIFEST.MF +++ /dev/null @@ -1,22 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: calculator.dosgi.operations;version="1.0.0" -Bundle-Version: 1.0.0 -Bundle-Name: calculator.dosgi.operations -Bundle-Activator: calculator.dosgi.operations.impl.OperationsActivator -Bundle-ManifestVersion: 2 -Import-Package: calculator.dosgi.operations;version="[1.0.0,1.0.0]", - org.oasisopen.sca.annotation;version="2.0.0", - org.osgi.framework, - org.osgi.service.component;resolution:=optional, - org.osgi.service.packageadmin -Bundle-SymbolicName: calculator.dosgi.operations -Bundle-Vendor: The Apache Software Foundation -Bundle-ActivationPolicy: lazy -Eclipse-LazyStart: true -Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt -Bundle-DocURL: http://www.apache.org/ -Service-Component-Disabled: OSGI-INF/add-component.xml, - OSGI-INF/subtract-component.xml, - OSGI-INF/multiply-component.xml, - OSGI-INF/divide-component.xml -Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6 diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/NOTICE b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/NOTICE deleted file mode 100644 index 9ddba06a32..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2010 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/add-component.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/add-component.xml deleted file mode 100644 index 99845257ff..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/add-component.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/blueprint/operations-module.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/blueprint/operations-module.xml deleted file mode 100644 index f6b5f4690e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/blueprint/operations-module.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/divide-component.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/divide-component.xml deleted file mode 100644 index 322d4daf2f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/divide-component.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/multiply-component.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/multiply-component.xml deleted file mode 100644 index b9ca777bd8..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/multiply-component.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/sca/bundle.componentType b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/sca/bundle.componentType deleted file mode 100644 index fced5b7840..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/sca/bundle.componentType +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - 1 - ABC - - - - - - 1 - ABC - - - - - - 1 - ABC - - - - - - 1 - ABC - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/sca/bundle.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/sca/bundle.composite deleted file mode 100644 index c7250912b0..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/sca/bundle.composite +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/subtract-component.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/subtract-component.xml deleted file mode 100644 index 1472f5a976..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/OSGI-INF/subtract-component.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/README deleted file mode 100644 index 52afa44559..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/README +++ /dev/null @@ -1,6 +0,0 @@ -Distributed OSGi Calculator Sample -================================== -This sample implements a distributed calculator using Distributed OSGi (RFC 119) over SCA. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/pom.xml deleted file mode 100644 index b47d7b3ba9..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/pom.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - - sample-dosgi-calculator-operations - Apache Tuscany SCA Sample OSGi Remote Services Calculator Operations - - - - org.apache.tuscany.sca - tuscany-feature-all - 2.0-Beta2-SNAPSHOT - pom - - - - org.apache.tuscany.sca - tuscany-node-launcher-equinox - 2.0-Beta2-SNAPSHOT - test - - - - org.apache.tuscany.sca - tuscany-node-impl-osgi - 2.0-Beta2-SNAPSHOT - runtime - - - - org.eclipse.osgi - services - 3.2.0-v20090520-1800 - test - - - - - org.eclipse.equinox - ds - 1.1.0-v20090601 - test - - - - org.eclipse.equinox - util - 1.0.100-v20090520-1800 - test - - - - junit - junit - 4.8.1 - test - - - - - - ${artifactId} - - - maven-eclipse-plugin - 2.5.1 - - - org.eclipse.pde.ManifestBuilder - org.eclipse.jdt.core.javabuilder - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - - org.eclipse.jdt.launching.JRE_CONTAINER - - - - - - - maven-jar-plugin - - - ${basedir}/META-INF/MANIFEST.MF - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java deleted file mode 100644 index 971500782f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/AddService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the add service - */ -@Remotable -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java deleted file mode 100644 index 49b8a1c0bf..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/DivideService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the divide service - */ -@Remotable -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java deleted file mode 100644 index f4e59d12ea..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/MultiplyService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the multiply service - */ -@Remotable -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java deleted file mode 100644 index bfb9b820f7..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/SubtractService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the subtract service - */ -@Remotable -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java deleted file mode 100644 index 66b2977241..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/AddServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations.impl; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import calculator.dosgi.operations.AddService; - -/** - * An implementation of the Add service - */ -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.INFO, "Adding " + n1 + " and " + n2); - return n1 + n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java deleted file mode 100644 index a3c21b2b96..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/DivideServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations.impl; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import calculator.dosgi.operations.DivideService; - -/** - * An implementation of the Divide service. - */ -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.INFO, "Dividing " + n1 + " with " + n2); - return n1 / n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java deleted file mode 100644 index 7922d2d392..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/MultiplyServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations.impl; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import calculator.dosgi.operations.MultiplyService; - -/** - * An implementation of the Multiply service. - */ -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.INFO, "Multiplying " + n1 + " with " + n2); - return n1 * n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java deleted file mode 100644 index da2ce9063a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/OperationsActivator.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.operations.impl; - -import java.util.Dictionary; -import java.util.Hashtable; -import java.util.logging.Logger; - -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.service.packageadmin.PackageAdmin; - -import calculator.dosgi.operations.AddService; -import calculator.dosgi.operations.DivideService; -import calculator.dosgi.operations.MultiplyService; -import calculator.dosgi.operations.SubtractService; - -/** - * - */ -public class OperationsActivator implements BundleActivator { - private Logger logger = Logger.getLogger(OperationsActivator.class.getName()); - - public void start(BundleContext context) throws Exception { - logger.info("Starting " + context.getBundle()); - - Dictionary props = new Hashtable(); - - logger.info("Registering " + AddService.class.getName()); - props.put("sca.service", "AddComponent#service-name(Add)"); - context.registerService(AddService.class.getName(), new AddServiceImpl(), props); - - logger.info("Registering " + SubtractService.class.getName()); - props.put("sca.service", "SubtractComponent#service-name(Subtract)"); - context.registerService(SubtractService.class.getName(), new SubtractServiceImpl(), props); - - logger.info("Registering " + MultiplyService.class.getName()); - props.put("sca.service", "MultiplyComponent#service-name(Multiply)"); - context.registerService(MultiplyService.class.getName(), new MultiplyServiceImpl(), props); - - logger.info("Registering " + DivideService.class.getName()); - props.put("sca.service", "DivideComponent#service-name(Divide)"); - context.registerService(DivideService.class.getName(), new DivideServiceImpl(), props); - - getBundle(context, AddService.class); - } - - public void stop(BundleContext context) throws Exception { - logger.info("Stopping " + context.getBundle()); - // Registered services will be automatically unregistered - } - - private Bundle getBundle(BundleContext bundleContext, Class cls) { - PackageAdmin packageAdmin = null; - // PackageAdmin is used to resolve bundles - ServiceReference ref = bundleContext.getServiceReference("org.osgi.service.packageadmin.PackageAdmin"); - if (ref != null) { - packageAdmin = (PackageAdmin)bundleContext.getService(ref); - Bundle bundle = packageAdmin.getBundle(cls); - if (bundle != null) { - logger.info(cls.getName() + " is loaded by bundle: " + bundle.getSymbolicName()); - } - bundleContext.ungetService(ref); - return bundle; - } - return null; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java deleted file mode 100644 index 4bbe83b14f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/java/calculator/dosgi/operations/impl/SubtractServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations.impl; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import calculator.dosgi.operations.SubtractService; - -/** - * An implementation of the subtract service. - */ -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.INFO, "Subtracting " + n1 + " from " + n2); - return n1 - n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index d24999ab3e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java deleted file mode 100644 index cd92989da1..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OSGiTestUtils.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.operations.test; - -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; - -import org.osgi.framework.Bundle; - -/** - * - * Utility class to create OSGi bundles - * - * @version $Rev$ $Date$ - */ -public class OSGiTestUtils { - private static class InvocationHandlerImpl implements InvocationHandler { - private Object instance; - - public InvocationHandlerImpl(Object instance) { - super(); - this.instance = instance; - } - - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - Method m = instance.getClass().getMethod(method.getName(), method.getParameterTypes()); - return m.invoke(instance, args); - } - - } - - /** - * Returns a string representation of the given bundle. - * - * @param b - * @param verbose - * @return - */ - public static String bundleStatus(Bundle bundle, boolean verbose) { - StringBuffer sb = new StringBuffer(); - sb.append(bundle.getBundleId()).append(" ").append(bundle.getSymbolicName()); - int s = bundle.getState(); - if ((s & Bundle.UNINSTALLED) != 0) { - sb.append(" UNINSTALLED"); - } - if ((s & Bundle.INSTALLED) != 0) { - sb.append(" INSTALLED"); - } - if ((s & Bundle.RESOLVED) != 0) { - sb.append(" RESOLVED"); - } - if ((s & Bundle.STARTING) != 0) { - sb.append(" STARTING"); - } - if ((s & Bundle.STOPPING) != 0) { - sb.append(" STOPPING"); - } - if ((s & Bundle.ACTIVE) != 0) { - sb.append(" ACTIVE"); - } - - if (verbose) { - sb.append(" ").append(bundle.getLocation()); - sb.append(" ").append(bundle.getHeaders()); - } - return sb.toString(); - } - - /** - * A utility to cast the object to the given interface. If the class for the object - * is loaded by a different classloader, a proxy will be created. - * - * @param - * @param obj - * @param cls - * @return - */ - public static T cast(Object obj, Class cls) { - if (cls.isInstance(obj)) { - return cls.cast(obj); - } else { - return cls.cast(Proxy.newProxyInstance(cls.getClassLoader(), - new Class[] {cls}, - new InvocationHandlerImpl(obj))); - } - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java deleted file mode 100644 index 02007c385c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsNode.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.operations.test; - -import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher; - -/** - * - */ -public class OperationsNode { - - /** - * @param args - */ - public static void main(String[] args) { - if (args.length == 0) { - args = new String[] {"-bundles"}; - } - try { - NodeLauncher.main(args); - } catch (Exception e) { - e.printStackTrace(); - } - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java deleted file mode 100644 index 07f6aad01a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator-operations/src/test/java/calculator/dosgi/operations/test/OperationsOSGiNodeTestCase.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.operations.test; - -import static calculator.dosgi.operations.test.OSGiTestUtils.bundleStatus; - -import java.rmi.registry.LocateRegistry; -import java.rmi.registry.Registry; - -import org.apache.tuscany.sca.node.equinox.launcher.EquinoxHost; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.Constants; - -import calculator.dosgi.operations.AddService; - -/** - * - */ -public class OperationsOSGiNodeTestCase { - private static EquinoxHost host; - private static BundleContext context; - private static Bundle operationsBundle; - - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - try { - host = new EquinoxHost(); - context = host.start(); - - for (Bundle b : context.getBundles()) { - if (b.getSymbolicName().equals("org.eclipse.equinox.ds") || b.getSymbolicName() - .startsWith("org.apache.tuscany.sca.")) { - try { - if (b.getHeaders().get(Constants.FRAGMENT_HOST) == null) { - // Start the non-fragment bundle - b.start(); - } - } catch (Exception e) { - System.out.println("Error for bundle: " + b.getSymbolicName()); - e.printStackTrace(); - } - System.out.println(bundleStatus(b, false)); - } - if ("calculator.dosgi.operations".equals(b.getSymbolicName())) { - operationsBundle = b; - } - } - - if (operationsBundle != null) { - operationsBundle.start(); - System.out.println(bundleStatus(operationsBundle, false)); - } - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testOSGi() throws Exception { - Registry registry = LocateRegistry.getRegistry(8085); - Object add = registry.lookup("AddService"); - AddService addService = OSGiTestUtils.cast(add, AddService.class); - double sum = addService.add(1.0, 2.0); - Assert.assertEquals(3.0, sum, 0.0); - } - - /** - * @throws java.lang.Exception - */ - @AfterClass - public static void tearDownAfterClass() throws Exception { - if (host != null) { - host.stop(); - context = null; - } - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/LICENSE b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/LICENSE deleted file mode 100644 index 6e529a25c4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/LICENSE +++ /dev/null @@ -1,205 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/META-INF/MANIFEST.MF b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/META-INF/MANIFEST.MF deleted file mode 100644 index 542b53b085..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/META-INF/MANIFEST.MF +++ /dev/null @@ -1,20 +0,0 @@ -Manifest-Version: 1.0 -Export-Package: calculator.dosgi;version="1.0.0", - calculator.dosgi.operations;version="1.0.0" -Bundle-Version: 1.0.0 -Bundle-Name: calculator.dosgi -Bundle-Activator: calculator.dosgi.impl.CalculatorActivator -Bundle-ManifestVersion: 2 -Import-Package: org.oasisopen.sca.annotation;version="2.0.0", - org.osgi.framework, - org.osgi.service.component;resolution:=optional, - org.osgi.service.packageadmin, - org.osgi.util.tracker -Bundle-SymbolicName: calculator.dosgi -Bundle-Vendor: The Apache Software Foundation -Bundle-ActivationPolicy: lazy -Eclipse-LazyStart: true -Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt -Bundle-DocURL: http://www.apache.org/ -Service-Component-Disabled: OSGI-INF/calculator-component.xml -Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6 diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/NOTICE b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/NOTICE deleted file mode 100644 index 9ddba06a32..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -${pom.name} -Copyright (c) 2005 - 2010 The Apache Software Foundation - -This product includes software developed by -The Apache Software Foundation (http://www.apache.org/). - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml deleted file mode 100644 index fd834e12ef..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/blueprint/calculator-module.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/calculator-component.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/calculator-component.xml deleted file mode 100644 index 5daaa59aae..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/calculator-component.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/sca/bundle.componentType b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/sca/bundle.componentType deleted file mode 100644 index 1dff21ab6b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/sca/bundle.componentType +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - 1 - ABC - - - - - - - - 1 - ABC - - - - - - 1 - ABC - - - - - - 1 - ABC - - - - - - 1 - ABC - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/sca/bundle.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/sca/bundle.composite deleted file mode 100644 index c64e999fc6..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/OSGI-INF/sca/bundle.composite +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/README deleted file mode 100644 index 52afa44559..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/README +++ /dev/null @@ -1,6 +0,0 @@ -Distributed OSGi Calculator Sample -================================== -This sample implements a distributed calculator using Distributed OSGi (RFC 119) over SCA. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/dosgi-calculator.png b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/dosgi-calculator.png deleted file mode 100644 index 805baa54d2..0000000000 Binary files a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/dosgi-calculator.png and /dev/null differ diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/pom.xml deleted file mode 100644 index a95c56fd16..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/pom.xml +++ /dev/null @@ -1,153 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - - sample-dosgi-calculator - Apache Tuscany SCA Sample OSGi Remote Services Calculator - - - - org.apache.tuscany.sca - tuscany-feature-ejava - 2.0-Beta2-SNAPSHOT - pom - - - org.apache.tuscany.sca - tuscany-feature-webservice - 2.0-Beta2-SNAPSHOT - pom - runtime - - - org.apache.tuscany.sca - tuscany-node-launcher-equinox - 2.0-Beta2-SNAPSHOT - test - - - - org.apache.tuscany.sca - tuscany-node-impl-osgi - 2.0-Beta2-SNAPSHOT - runtime - - - - org.eclipse.osgi - services - 3.2.0-v20090520-1800 - - - - junit - junit - 4.8.1 - test - - - - - org.eclipse.equinox - ds - 1.1.0-v20090601 - test - - - - org.eclipse.equinox - util - 1.0.100-v20090520-1800 - test - - - - - - ${artifactId} - - - maven-eclipse-plugin - 2.5.1 - - - org.eclipse.pde.ManifestBuilder - org.eclipse.jdt.core.javabuilder - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - - org.eclipse.jdt.launching.JRE_CONTAINER - - - - - - - maven-jar-plugin - - - ${basedir}/META-INF/MANIFEST.MF - - - - - - org.apache.tuscany.maven.plugins - maven-osgi-junit-plugin - 1.0 - - - org.apache.tuscany.sca - tuscany-node-launcher-equinox - ${pom.version} - - - - - osgi-test - test - - test - - - - - osgi.configuration.area - ${project.build.directory}/equinox - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java deleted file mode 100644 index cc562b7c2f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/CalculatorService.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The Calculator service interface. - */ -@Remotable -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java deleted file mode 100644 index 6b42645f69..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorActivator.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.impl; - -import java.util.Dictionary; -import java.util.Hashtable; -import java.util.logging.Logger; - -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.service.packageadmin.PackageAdmin; - -import calculator.dosgi.CalculatorService; -import calculator.dosgi.operations.AddService; - -/** - * - */ -public class CalculatorActivator implements BundleActivator { - private Logger logger = Logger.getLogger(CalculatorActivator.class.getName()); - - private Bundle getBundle(BundleContext bundleContext, Class cls) { - PackageAdmin packageAdmin = null; - // PackageAdmin is used to resolve bundles - ServiceReference ref = bundleContext.getServiceReference("org.osgi.service.packageadmin.PackageAdmin"); - if (ref != null) { - packageAdmin = (PackageAdmin)bundleContext.getService(ref); - Bundle bundle = packageAdmin.getBundle(cls); - if (bundle != null) { - logger.info(cls.getName() + " is loaded by bundle: " + bundle.getSymbolicName()); - } - bundleContext.ungetService(ref); - return bundle; - } - return null; - } - - public void start(BundleContext context) throws Exception { - logger.info("Starting " + context.getBundle()); - Dictionary props = new Hashtable(); - props.put("sca.service", "CalculatorComponent#service-name(Calculator)"); - props.put("calculator", "Calculator"); - - logger.info("Registering " + CalculatorService.class.getName()); - CalculatorService calculator = new CalculatorServiceImpl(context); - context.registerService(CalculatorService.class.getName(), calculator, props); - - getBundle(context, AddService.class); - - } - - public void stop(BundleContext context) throws Exception { - logger.info("Stopping " + context.getBundle()); - // Registered services will be automatically unregistered - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java deleted file mode 100644 index 5f9db16ca9..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceDSImpl.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.impl; - -import org.osgi.service.component.ComponentContext; - -import calculator.dosgi.CalculatorService; -import calculator.dosgi.operations.AddService; -import calculator.dosgi.operations.DivideService; -import calculator.dosgi.operations.MultiplyService; -import calculator.dosgi.operations.SubtractService; - -/** - * An implementation of the Calculator service. - */ -public class CalculatorServiceDSImpl implements CalculatorService { - private AddService addService; - private SubtractService subtractService; - private MultiplyService multiplyService; - private DivideService divideService; - - public CalculatorServiceDSImpl() { - super(); - System.out.println("CalculatorServiceDSImpl()"); - } - - protected void activate(ComponentContext context) { - System.out.println("Activating " + context); - } - - protected void deactivate(ComponentContext context) { - System.out.println("Deactivating " + context); - } - - /* - * The following setters can be used for DS injection - */ - public void setAddService(AddService addService) { - System.out.println("setAddService()"); - this.addService = addService; - } - - public void setSubtractService(SubtractService subtractService) { - this.subtractService = subtractService; - } - - public void setDivideService(DivideService divideService) { - this.divideService = divideService; - } - - public void setMultiplyService(MultiplyService multiplyService) { - this.multiplyService = multiplyService; - } - - /* - * The following setters can be used for DS injection - */ - public void unsetAddService(AddService addService) { - System.out.println("unsetAddService()"); - this.addService = null; - } - - public void unsetSubtractService(SubtractService subtractService) { - this.subtractService = null; - } - - public void unsetDivideService(DivideService divideService) { - this.divideService = null; - } - - public void unsetMultiplyService(MultiplyService multiplyService) { - this.multiplyService = null; - } - private T getService(Class cls) { - for (Object s : new Object[] {addService, subtractService, multiplyService, divideService}) { - if (cls.isInstance(s)) { - return cls.cast(s); - } - } - throw new IllegalStateException(cls.getSimpleName() + " is not available"); - } - - public double add(double n1, double n2) { - return getService(AddService.class).add(n1, n2); - } - - public double subtract(double n1, double n2) { - return getService(SubtractService.class).subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return getService(MultiplyService.class).multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return getService(DivideService.class).divide(n1, n2); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java deleted file mode 100644 index a9ea37585a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/impl/CalculatorServiceImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.impl; - -import static org.osgi.framework.Constants.OBJECTCLASS; - -import org.osgi.framework.BundleContext; -import org.osgi.framework.Filter; -import org.osgi.framework.InvalidSyntaxException; -import org.osgi.util.tracker.ServiceTracker; - -import calculator.dosgi.CalculatorService; -import calculator.dosgi.operations.AddService; -import calculator.dosgi.operations.DivideService; -import calculator.dosgi.operations.MultiplyService; -import calculator.dosgi.operations.SubtractService; - -/** - * An implementation of the Calculator service. - */ -public class CalculatorServiceImpl implements CalculatorService { - private ServiceTracker remoteServices; - private ServiceTracker localServices; - - public CalculatorServiceImpl() { - super(); - } - - public CalculatorServiceImpl(BundleContext context) { - super(); - Filter remoteFilter = null, localFilter = null; - try { - remoteFilter = - context.createFilter("(&(" + OBJECTCLASS + "=calculator.dosgi.operations.*) (service.imported=*))"); - localFilter = - context.createFilter("(&(" + OBJECTCLASS + "=calculator.dosgi.operations.*) (!(service.imported=*)))"); - } catch (InvalidSyntaxException e) { - e.printStackTrace(); - } - this.remoteServices = new ServiceTracker(context, remoteFilter, null); - remoteServices.open(); - this.localServices = new ServiceTracker(context, localFilter, null); - localServices.open(); - } - - private T getService(Class cls) { - try { - // Wait for 10 seconds until the remote services are imported - remoteServices.waitForService(10000); - } catch (InterruptedException e) { - throw new IllegalStateException(cls.getSimpleName() + " is not available"); - } - Object[] remoteObjects = remoteServices.getServices(); - if (remoteObjects != null) { - for (Object s : remoteObjects) { - if (cls.isInstance(s)) { - System.out.println("Remote service: " + s); - return cls.cast(s); - } - } - } - Object[] localObjects = localServices.getServices(); - if (localObjects != null) { - for (Object s : localObjects) { - if (cls.isInstance(s)) { - System.out.println("Local service: " + s); - return cls.cast(s); - } - } - } - throw new IllegalStateException(cls.getSimpleName() + " is not available"); - } - - public double add(double n1, double n2) { - return getService(AddService.class).add(n1, n2); - } - - public double subtract(double n1, double n2) { - return getService(SubtractService.class).subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return getService(MultiplyService.class).multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return getService(DivideService.class).divide(n1, n2); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/AddService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/AddService.java deleted file mode 100644 index 971500782f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/AddService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the add service - */ -@Remotable -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/DivideService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/DivideService.java deleted file mode 100644 index 49b8a1c0bf..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/DivideService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the divide service - */ -@Remotable -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java deleted file mode 100644 index f4e59d12ea..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/MultiplyService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the multiply service - */ -@Remotable -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java deleted file mode 100644 index bfb9b820f7..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/dosgi/operations/SubtractService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator.dosgi.operations; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The interface for the subtract service - */ -@Remotable -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java deleted file mode 100644 index a4fc52694e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.rmi; - -import java.io.Serializable; -import java.rmi.Remote; -import java.rmi.RemoteException; -import java.rmi.registry.LocateRegistry; -import java.rmi.registry.Registry; -import java.rmi.server.UnicastRemoteObject; - -/** - * - */ -public class OperationsRMIServer implements OperationsRemote, Serializable { - - private static final long serialVersionUID = 6081008315263103012L; - private transient Registry registry; - - public OperationsRMIServer() throws RemoteException { - super(); - } - - public double add(double n1, double n2) { - return n1 + n2; - } - - public double subtract(double n1, double n2) { - return n1 - n2; - } - - public double divide(double n1, double n2) { - return n1 / n2; - } - - public double multiply(double n1, double n2) { - return n1 * n2; - } - - public void start() throws RemoteException { - Thread thread = new Thread() { - public void run() { - try { - System.out.println("Starting the RMI server for calculator operations..."); - Remote stub = UnicastRemoteObject.exportObject(OperationsRMIServer.this); - registry = LocateRegistry.createRegistry(8085); - registry.bind("AddService", stub); - registry.bind("SubtractService", stub); - registry.bind("MultiplyService", stub); - registry.bind("DivideService", stub); - System.out.println("RMI server for calculator operations is now started."); - } catch (Exception e) { - e.printStackTrace(); - } - } - }; - thread.start(); - } - - public void stop() { - if (registry != null) { - try { - registry.unbind("AddService"); - registry.unbind("SubtractService"); - registry.unbind("MultiplyService"); - registry.unbind("DivideService"); - UnicastRemoteObject.unexportObject(this, false); - UnicastRemoteObject.unexportObject(registry, false); - registry = null; - } catch (Exception e) { - e.printStackTrace(); - } - } - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java deleted file mode 100644 index a813dfb6f3..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRMIServer_Stub.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -// Stub class generated by rmic, do not edit. -// Contents subject to change without notice. -package calculator.rmi; - -public final class OperationsRMIServer_Stub extends java.rmi.server.RemoteStub implements calculator.rmi.OperationsRemote { - private static final long serialVersionUID = 2; - - private static java.lang.reflect.Method $method_add_0; - private static java.lang.reflect.Method $method_divide_1; - private static java.lang.reflect.Method $method_multiply_2; - private static java.lang.reflect.Method $method_subtract_3; - - static { - try { - $method_add_0 = - calculator.rmi.OperationsRemote.class.getMethod("add", new java.lang.Class[] {double.class, double.class}); - $method_divide_1 = - calculator.rmi.OperationsRemote.class.getMethod("divide", - new java.lang.Class[] {double.class, double.class}); - $method_multiply_2 = - calculator.rmi.OperationsRemote.class.getMethod("multiply", new java.lang.Class[] {double.class, - double.class}); - $method_subtract_3 = - calculator.rmi.OperationsRemote.class.getMethod("subtract", new java.lang.Class[] {double.class, - double.class}); - } catch (java.lang.NoSuchMethodException e) { - throw new java.lang.NoSuchMethodError("stub class initialization failed"); - } - } - - // constructors - public OperationsRMIServer_Stub(java.rmi.server.RemoteRef ref) { - super(ref); - } - - // methods from remote interfaces - - // implementation of add(double, double) - public double add(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException { - try { - Object $result = - ref.invoke(this, - $method_add_0, - new java.lang.Object[] {new java.lang.Double($param_double_1), - new java.lang.Double($param_double_2)}, - 864055858262779977L); - return ((java.lang.Double)$result).doubleValue(); - } catch (java.lang.RuntimeException e) { - throw e; - } catch (java.rmi.RemoteException e) { - throw e; - } catch (java.lang.Exception e) { - throw new java.rmi.UnexpectedException("undeclared checked exception", e); - } - } - - // implementation of divide(double, double) - public double divide(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException { - try { - Object $result = - ref.invoke(this, - $method_divide_1, - new java.lang.Object[] {new java.lang.Double($param_double_1), - new java.lang.Double($param_double_2)}, - 8097593626497421928L); - return ((java.lang.Double)$result).doubleValue(); - } catch (java.lang.RuntimeException e) { - throw e; - } catch (java.rmi.RemoteException e) { - throw e; - } catch (java.lang.Exception e) { - throw new java.rmi.UnexpectedException("undeclared checked exception", e); - } - } - - // implementation of multiply(double, double) - public double multiply(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException { - try { - Object $result = - ref.invoke(this, - $method_multiply_2, - new java.lang.Object[] {new java.lang.Double($param_double_1), - new java.lang.Double($param_double_2)}, - -346155016949350695L); - return ((java.lang.Double)$result).doubleValue(); - } catch (java.lang.RuntimeException e) { - throw e; - } catch (java.rmi.RemoteException e) { - throw e; - } catch (java.lang.Exception e) { - throw new java.rmi.UnexpectedException("undeclared checked exception", e); - } - } - - // implementation of subtract(double, double) - public double subtract(double $param_double_1, double $param_double_2) throws java.rmi.RemoteException { - try { - Object $result = - ref.invoke(this, - $method_subtract_3, - new java.lang.Object[] {new java.lang.Double($param_double_1), - new java.lang.Double($param_double_2)}, - -610707357620578750L); - return ((java.lang.Double)$result).doubleValue(); - } catch (java.lang.RuntimeException e) { - throw e; - } catch (java.rmi.RemoteException e) { - throw e; - } catch (java.lang.Exception e) { - throw new java.rmi.UnexpectedException("undeclared checked exception", e); - } - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.java deleted file mode 100644 index 955e386ad8..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/java/calculator/rmi/OperationsRemote.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.rmi; - -import java.rmi.Remote; -import java.rmi.RemoteException; - -/** - * RMI Remote interface - */ -public interface OperationsRemote extends Remote { - double add(double n1, double n2) throws RemoteException; - - double subtract(double n1, double n2) throws RemoteException; - - double multiply(double n1, double n2) throws RemoteException; - - double divide(double n1, double n2) throws RemoteException; - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index b48c048000..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java deleted file mode 100644 index 565a314d85..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorNode.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.test; - -import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher; - -/** - * - */ -public class CalculatorNode { - - /** - * @param args - */ - public static void main(String[] args) { - if (args.length == 0) { - args = new String[] {"-bundles"}; - } - try { - NodeLauncher.main(args); - } catch (Exception e) { - e.printStackTrace(); - } - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java deleted file mode 100644 index 2f37da0707..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/dosgi-calculator/src/test/java/calculator/dosgi/test/CalculatorOSGiNodeTestCase.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator.dosgi.test; - -import static calculator.dosgi.test.OSGiTestUtils.bundleStatus; - -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.net.URL; - -import org.apache.tuscany.sca.node.equinox.launcher.EquinoxHost; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.Constants; -import org.osgi.framework.ServiceReference; - -import calculator.dosgi.CalculatorService; -import calculator.rmi.OperationsRMIServer; - -/** - * - */ -public class CalculatorOSGiNodeTestCase { - private static EquinoxHost host; - private static BundleContext context; - private static Bundle calculatorBundle; - private static OperationsRMIServer rmiServer; - - /** - * @throws java.lang.Exception - */ - @BeforeClass - public static void setUpBeforeClass() throws Exception { - try { - rmiServer = new OperationsRMIServer(); - rmiServer.start(); - - host = new EquinoxHost(); - context = host.start(); - - for (Bundle b : context.getBundles()) { - System.out.println(b); - // debug to print out exported packages - // handy if you want to find aplit packages - //Object exports = b.getHeaders().get(Constants.EXPORT_PACKAGE); - //if (exports != null){ - // System.out.println(exports.toString()); - //} - if (b.getSymbolicName().equals("org.eclipse.equinox.ds") || b.getSymbolicName() - .startsWith("org.apache.tuscany.sca.")) { - try { - if (b.getHeaders().get(Constants.FRAGMENT_HOST) == null) { - // Start the non-fragment bundle - b.start(); - } - } catch (Exception e) { - e.printStackTrace(); - } - System.out.println(bundleStatus(b, false)); - } else { - System.out.println(bundleStatus(b, false)); - } - if ("calculator.dosgi".equals(b.getSymbolicName())) { - calculatorBundle = b; - } - } - - if (calculatorBundle != null) { - calculatorBundle.start(); - System.out.println(bundleStatus(calculatorBundle, false)); - } - - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testOSGi() { - ServiceReference ref = - calculatorBundle.getBundleContext().getServiceReference(CalculatorService.class.getName()); - Assert.assertNotNull(ref); - Object service = context.getService(ref); - Assert.assertNotNull(service); - CalculatorService calculator = OSGiTestUtils.cast(service, CalculatorService.class); - System.out.println("2.0 + 1.0 = " + calculator.add(2.0, 1.0)); - System.out.println("2.0 - 1.0 = " + calculator.subtract(2.0, 1.0)); - System.out.println("2.0 * 1.0 = " + calculator.multiply(2.0, 1.0)); - System.out.println("2.0 / 1.0 = " + calculator.divide(2.0, 1.0)); - } - - @Test - /** - * Test the Web service exposed by the Calculator - */ - public void testWS() throws Exception { - URL url = new URL("http://localhost:8086/CalculatorService?wsdl"); - InputStream is = url.openStream(); - Reader reader = new InputStreamReader(is); - char[] content = new char[10240]; // 10k - int len = 0; - while (true) { - int size = reader.read(content, len, content.length - len); - if (size < 0) { - break; - } - len += size; - } - Assert.assertTrue(len > 0); - String str = new String(content, 0, len); - System.out.println(str); - Assert.assertTrue(str.indexOf(" - * @param obj - * @param cls - * @return - */ - public static T cast(Object obj, Class cls) { - if (cls.isInstance(obj)) { - return cls.cast(obj); - } else { - return cls.cast(Proxy.newProxyInstance(cls.getClassLoader(), - new Class[] {cls}, - new InvocationHandlerImpl(obj))); - } - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/pom.xml deleted file mode 100644 index f366a8d49a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-osgi/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-samples-distributed-osgi-static - pom - Apache Tuscany SCA Distributed OSGI Statically Configured Samples - - - - default - - true - - - dosgi-calculator - dosgi-calculator-operations - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/README deleted file mode 100644 index 18ba62d494..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/README +++ /dev/null @@ -1 +0,0 @@ -Please look at the README files in the subdirectories of this directory for descriptions of the sample contributions. diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/README deleted file mode 100644 index fe9aac7f3c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/README +++ /dev/null @@ -1,8 +0,0 @@ -Calculator Sample Contribution -============================== - -This sample contribution implements a simple calculator using SCA components. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/build.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/build.xml deleted file mode 100644 index cfb163955e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/build.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - ${tuscany.home} - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/pom.xml deleted file mode 100644 index e31eb6ec0e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-implementation-script-calculator-contribution - Apache Tuscany SCA Sample implementation.script Calculator Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 2.0-Beta2-SNAPSHOT - - - - junit - junit - 4.8.1 - test - - - - - - ${artifactId} - - - org.apache.tuscany.maven.plugins - maven-tuscany-plugin - 2.0-Beta2-SNAPSHOT - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/AddService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/AddService.java deleted file mode 100644 index 5a1e7a638a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The Add service interface - */ -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorClient.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorClient.java deleted file mode 100644 index 1df1f31c48..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorClient.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -import org.oasisopen.sca.annotation.EagerInit; -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; - -/** - * This client program shows how to create an SCA runtime, start it, - * and locate and invoke a SCA component - */ -@Scope("COMPOSITE") -@EagerInit -public class CalculatorClient { - - private CalculatorService calculatorService; - - @Reference - public void setCalculatorService(CalculatorService calculatorService) { - this.calculatorService = calculatorService; - } - - @Init - public void calculate() { - // Calculate - System.out.println("SCA API ClassLoader: " + Reference.class.getClassLoader()); - System.out.println("3 + 2=" + calculatorService.add(3, 2)); - System.out.println("3 - 2=" + calculatorService.subtract(3, 2)); - System.out.println("3 * 2=" + calculatorService.multiply(3, 2)); - System.out.println("3 / 2=" + calculatorService.divide(3, 2)); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index 78eea39c71..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The Calculator service interface. - */ -@Remotable -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index 8e4b082d14..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Service; - - -/** - * An implementation of the Calculator service. - */ -@Service(CalculatorService.class) -public class CalculatorServiceImpl implements CalculatorService { - - private AddService addService; - private SubtractService subtractService; - private MultiplyService multiplyService; - private DivideService divideService; - - @Reference - public void setAddService(AddService addService) { - this.addService = addService; - } - - @Reference - public void setSubtractService(SubtractService subtractService) { - this.subtractService = subtractService; - } - - @Reference - public void setDivideService(DivideService divideService) { - this.divideService = divideService; - } - - @Reference - public void setMultiplyService(MultiplyService multiplyService) { - this.multiplyService = multiplyService; - } - - public double add(double n1, double n2) { - return addService.add(n1, n2); - } - - public double subtract(double n1, double n2) { - return subtractService.subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return multiplyService.multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return divideService.divide(n1, n2); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/DivideService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/DivideService.java deleted file mode 100644 index ef6a8b375b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The divide service interface - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/MultiplyService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index db568cc762..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/SubtractService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/SubtractService.java deleted file mode 100644 index 56ee372fc4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/Calculator.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/Calculator.composite deleted file mode 100644 index d441aa0aea..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/Calculator.composite +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/CalculatorClient.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/CalculatorClient.composite deleted file mode 100644 index dfd32761be..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/CalculatorClient.composite +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 70aab0e051..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/AddServiceImpl.componentType b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/AddServiceImpl.componentType deleted file mode 100644 index 5f6d88454c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/AddServiceImpl.componentType +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/AddServiceImpl.js b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/AddServiceImpl.js deleted file mode 100644 index 6f11106ddd..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/AddServiceImpl.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -function add(n1, n2) { - return n1 + n2; -} \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/DivideServiceImpl.componentType b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/DivideServiceImpl.componentType deleted file mode 100644 index f4bb4e3471..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/DivideServiceImpl.componentType +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/DivideServiceImpl.groovy b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/DivideServiceImpl.groovy deleted file mode 100644 index c31c1e8fd6..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/DivideServiceImpl.groovy +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -def divide(n1, n2) { - return n1 / n2 -} \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/MultiplyServiceImpl.componentType b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/MultiplyServiceImpl.componentType deleted file mode 100644 index 35dc5721b2..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/MultiplyServiceImpl.componentType +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/MultiplyServiceImpl.py b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/MultiplyServiceImpl.py deleted file mode 100644 index cce0b5b3ec..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/MultiplyServiceImpl.py +++ /dev/null @@ -1,20 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -def multiply(n1, n2): - return n1 * n2 \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/SubtractServiceImpl.componentType b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/SubtractServiceImpl.componentType deleted file mode 100644 index ee768f73f2..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/SubtractServiceImpl.componentType +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/SubtractServiceImpl.rb b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/SubtractServiceImpl.rb deleted file mode 100644 index 132a1d13b0..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/calculator-contribution/src/main/resources/calculator/SubtractServiceImpl.rb +++ /dev/null @@ -1,21 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -def subtract(n1, n2) - return n1 - n2 -end \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/pom.xml deleted file mode 100644 index 5ebafcbe24..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-script/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-sample-implementation-script - pom - Apache Tuscany SCA Sample implementation.script - - - - default - - true - - - calculator-contribution - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/README deleted file mode 100644 index 50e3b874ba..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/README +++ /dev/null @@ -1,8 +0,0 @@ -Sample implementation.spring Contribution -========================================== - -This sample contribution shows SCA components implemented using Spring. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/pom.xml deleted file mode 100644 index fe8f7447b8..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/pom.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - - sample-implementation-spring-helloworld-contribution - Apache Tuscany SCA Sample implemenation.spring HelloWorld Contribution - - - - org.apache.tuscany.sca - tuscany-sca-api - 2.0-Beta2-SNAPSHOT - provided - - - junit - junit - 4.8.1 - test - - - - - ${artifactId} - - - - - org.apache.tuscany.maven.plugins - maven-tuscany-plugin - 2.0-Beta2-SNAPSHOT - - - org.apache.tuscany.sca - tuscany-implementation-spring-runtime - 2.0-Beta2-SNAPSHOT - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/DateService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/DateService.java deleted file mode 100644 index 7c50d66a9c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/DateService.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample; - -import java.util.Date; - -/** - * - */ -public interface DateService { - Date getDate(); -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/DateServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/DateServiceImpl.java deleted file mode 100644 index 64bdd86f7c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/DateServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample; - -import java.util.Date; - -import org.oasisopen.sca.annotation.Service; - -/** - * - */ -@Service(DateService.class) -public class DateServiceImpl implements DateService { - - public Date getDate() { - System.out.println("DateServiceImpl.getDate()"); - return new Date(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/Helloworld.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/Helloworld.java deleted file mode 100644 index f4e8c50448..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/Helloworld.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Helloworld { - - String sayHello(String name); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/HelloworldClientImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/HelloworldClientImpl.java deleted file mode 100644 index ddcb1d9bc3..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/HelloworldClientImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Reference; - -public class HelloworldClientImpl implements Helloworld { - private Helloworld helloworld; - - // SCA reference - @Reference(required = false) - private DateService dateService; - - public HelloworldClientImpl() { - System.out.println("HelloworldClientImpl()"); - } - - public String sayHello(String name) { - System.out.println("HelloworldClientImpl.sayHello(" + name + ")"); - if (dateService == null) { - return "Hello " + name; - } - return "[" + dateService.getDate() + "] " + helloworld.sayHello(name); - } - - // Setter for spring injection - public void setHelloworld(Helloworld helloworld) { - System.out.println("Injected with " + helloworld); - this.helloworld = helloworld; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/HelloworldImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/HelloworldImpl.java deleted file mode 100644 index 125c333ddc..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/java/sample/HelloworldImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - - -public class HelloworldImpl implements Helloworld { - - public HelloworldImpl() { - super(); - System.out.println("HelloworldImpl()"); - } - - public String sayHello(String name) { - System.out.println("HelloworldImpl.sayHello(" + name + ")"); - return "Hello " + name; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 552d100638..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld-client-context.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld-client-context.xml deleted file mode 100644 index 15e9647bb0..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld-client-context.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld-context.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld-context.xml deleted file mode 100644 index 9ecd09974e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld-context.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld.composite deleted file mode 100644 index 6d356758ae..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/main/resources/helloworld.composite +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/test/java/sample/HelloworldTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/test/java/sample/HelloworldTestCase.java deleted file mode 100644 index 7e679ec0e9..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-contribution/src/test/java/sample/HelloworldTestCase.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -public class HelloworldTestCase { - - @Test - public void testSayHello() { - HelloworldImpl helloworld = new HelloworldImpl(); - assertEquals("Hello Petra", helloworld.sayHello("Petra")); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/README deleted file mode 100644 index c3e2ceed03..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/README +++ /dev/null @@ -1,9 +0,0 @@ -Sample implementation.spring WebApp -========================================== - -This sample contribution shows SCA components implemented using Spring and -wrapped in a webapp - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/pom.xml deleted file mode 100644 index 7dd7c2081d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/pom.xml +++ /dev/null @@ -1,185 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../../pom.xml - - - sample-implementation-spring-helloworld-webapp - Apache Tuscany SCA Sample implementation.spring Helloworld WebApp - war - - - - org.apache.tuscany.sca - tuscany-base-runtime - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-spring-webapp - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-spring-runtime - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-binding-jsonrpc-runtime - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - sample-implementation-spring-helloworld-contribution - 2.0-Beta2-SNAPSHOT - provided - - - - junit - junit - 4.8.1 - test - - - httpunit - httpunit - 1.6.1 - test - - - - - helloworld-spring - - - - org.apache.maven.plugins - maven-surefire-plugin - - - true - - - - - integration-test - - test - - - - true - false - - - - - - - org.apache.maven.plugins - maven-war-plugin - - - - org.apache.tuscany.sca - sample-implementation-spring-helloworld-contribution - jar - WEB-INF/classes - - META-INF/**/* - - - - - org.apache.tuscany.sca - sample-implementation-spring-helloworld-contribution - jar - - META-INF/**/* - - - - - org.apache.tuscany.sca - tuscany-implementation-spring-webapp - jar - WEB-INF/classes - - org/apache/tuscany/sca/implementation/spring/webapp/spring-webapp-context.xml - - - - - - - - org.mortbay.jetty - maven-jetty-plugin - 6.1.18 - - helloworld - foo - 9999 - - - - start-jetty - pre-integration-test - - run - - - src/test/resources/test-web.xml - ${project.build.directory}/${project.build.finalName} - ${project.build.directory}/${project.build.finalName}/WEB-INF/web.xml - ${project.build.directory}/${project.build.finalName}/WEB-INF/classes - 0 - true - - - 8085 - - - - - - stop-jetty - post-integration-test - - stop - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/main/webapp/WEB-INF/web.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 49590e00a2..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - Apache Tuscany Helloworld Spring Sample - - - contextConfigLocation - - /WEB-INF/classes/helloworld-context.xml - /WEB-INF/classes/org/apache/tuscany/sca/implementation/spring/webapp/spring-webapp-context.xml - - - - - org.springframework.web.context.ContextLoaderListener - - - - org.apache.tuscany.sca.host.webapp.TuscanyContextListener - - - - tuscany - org.apache.tuscany.sca.host.webapp.TuscanyServletFilter - - - - tuscany - /* - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/test/java/sample/HelloworldClientTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/test/java/sample/HelloworldClientTestCase.java deleted file mode 100644 index fa77f08ee2..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/test/java/sample/HelloworldClientTestCase.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample; - -import java.io.ByteArrayInputStream; - -import junit.framework.Assert; - -import org.json.JSONObject; -import org.junit.Test; - -import com.meterware.httpunit.PostMethodWebRequest; -import com.meterware.httpunit.WebConversation; -import com.meterware.httpunit.WebRequest; -import com.meterware.httpunit.WebResponse; - - -/** - * - */ -public class HelloworldClientTestCase { - private static final String SERVICE_URL = - "http://localhost:8085/helloworld/HelloworldClientComponent/HelloworldClientBean"; - - @Test - public void testJSONRPCBinding() throws Exception { - JSONObject jsonRequest = new JSONObject("{ \"method\": \"sayHello\", \"params\": [\"Ray\"], \"id\": 1}"); - - WebConversation wc = new WebConversation(); - WebRequest request = - new PostMethodWebRequest(SERVICE_URL, new ByteArrayInputStream(jsonRequest.toString().getBytes("UTF-8")), - "application/json"); - WebResponse response = wc.getResource(request); - - Assert.assertEquals(200, response.getResponseCode()); - - JSONObject jsonResp = new JSONObject(response.getText()); - String text = jsonResp.getString("result"); - Assert.assertTrue(text.endsWith("Hello Ray")); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/test/resources/test-web.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/test/resources/test-web.xml deleted file mode 100644 index 0ad2ed49c1..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/helloworld-spring-webapp/src/test/resources/test-web.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/pom.xml deleted file mode 100644 index a322c09d85..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-spring/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-samples-implememtation-spring - pom - Apache Tuscany SCA Implementation Spring Samples - - - - default - - true - - - helloworld-spring-contribution - helloworld-spring-webapp - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/README deleted file mode 100644 index 82c3349c85..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/README +++ /dev/null @@ -1,8 +0,0 @@ -Sample implementation.web JAXRS WebApp -========================================== - -This sample contribution shows SCA components implemented in a webapp and -accessed using JAXRS. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/pom.xml deleted file mode 100644 index b001abcadd..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/pom.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../../pom.xml - - - sample-implementation-web-helloworld-jaxrs-webapp - war - Apache Tuscany SCA Sample implemenation.web Helloworld JAX-RS WebApp - - - - - - org.apache.tuscany.sca - tuscany-base-runtime-nodep - 2.0-Beta2-SNAPSHOT - - - - - org.apache.wink - wink-common - 1.1.2-incubating - - - org.apache.wink - wink-server - 1.1.2-incubating - - - javax.xml.bind - jaxb-api - - - com.sun.xml.bind - jaxb-impl - - - org.slf4j - slf4j-api - - - - - - org.slf4j - slf4j-api - 1.6.0 - - - - junit - junit - 4.8.1 - test - - - - net.sourceforge.htmlunit - htmlunit - 2.6 - test - - - - - - helloworld-jaxrs - - - org.mortbay.jetty - maven-jetty-plugin - 6.1.18 - - helloworld-jaxrs - foo - 9999 - - - - start-jetty - process-test-classes - - run - - - 0 - true - - - 8085 - - - - - - stop-jetty - prepare-package - - stop - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/java/sample/HelloWorldResource.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/java/sample/HelloWorldResource.java deleted file mode 100644 index 42625b8a78..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/java/sample/HelloWorldResource.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - *******************************************************************************/ - -package sample; - -import java.util.Date; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; - -import org.oasisopen.sca.annotation.Reference; - -/** - * Simple example - Hello World! - *

- * The SDK dispatches HTTP requests for URI - * http://[host]:[port]/helloworld-jaxrs/rest/world, where - * helloworld-jaxrs is the context root, to this class. A simple - * plain text entry is returned in HTTP response. - *

- * The service document is available at URI - * http://[host]:[port]/helloworld-jaxrs/rest but it is empty because - * this simple demo doesn't contain any collection of resources. - *

- * This resource must be registered within a JAX-RS application, this example - * uses the default usage of application /WEB-INF/application - */ -@Path("/world") -public class HelloWorldResource { - - @Reference - protected HelloworldService service; - - - /** - * This method is called by the SDK for HTTP GET method requests where the - * Accept header allows the Atom media type application/atom+xml. A - * SyndEntry is created with basic information. Serialization of the - * SyndEntry to Atom entry is performed by the SDK automatically. The - * default status code of 200 (OK) is returned in the response. - * - * @return SyndEntry of the requested resource - */ - @GET - @Produces("text/plain") - public String getClichedMessage() { - return service == null ? "SCA reference not injected" : service.sayHello("World"); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/java/sample/HelloworldService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/java/sample/HelloworldService.java deleted file mode 100644 index 123774b936..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/java/sample/HelloworldService.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -public interface HelloworldService { - - String sayHello(String name); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/java/sample/HelloworldServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/java/sample/HelloworldServiceImpl.java deleted file mode 100644 index 66cef71a25..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/java/sample/HelloworldServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - - -public class HelloworldServiceImpl implements HelloworldService { - - public String sayHello(String name) { - return "Hello " + name; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/webapp/WEB-INF/application b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/webapp/WEB-INF/application deleted file mode 100644 index 8ce781d6c8..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/webapp/WEB-INF/application +++ /dev/null @@ -1,14 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to you under the Apache License, Version -# 2.0 (the "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 Unless required by -# applicable law or agreed to in writing, software distributed under the -# License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -# CONDITIONS OF ANY KIND, either express or implied. See the License for -# the specific language governing permissions and limitations under the -# License. -sample.HelloWorldResource \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/webapp/WEB-INF/web.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/webapp/WEB-INF/web.composite deleted file mode 100644 index 7ff71519e9..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/webapp/WEB-INF/web.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/webapp/WEB-INF/web.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 3c5726a818..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Apache Tuscany Helloworld JAX-RS Sample - - - org.apache.tuscany.sca.host.webapp.TuscanyContextListener - - - - restSdkService - org.apache.wink.server.internal.servlet.RestServlet - - applicationConfigLocation - /WEB-INF/application - - - - deploymentConfiguration - org.apache.tuscany.sca.wink.TuscanyDeploymentConfiguration - - - - restSdkService - /rest/* - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/test/java/itest/HelloworldTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/test/java/itest/HelloworldTestCase.java deleted file mode 100644 index 50197cdfcb..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jaxrs/src/test/java/itest/HelloworldTestCase.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package itest; - -import static org.junit.Assert.assertEquals; - -import java.io.IOException; -import java.net.MalformedURLException; - -import org.junit.Test; - -import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; -import com.gargoylesoftware.htmlunit.TextPage; -import com.gargoylesoftware.htmlunit.WebClient; - -/** - */ -public class HelloworldTestCase { - - @Test - public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException { - TextPage page = (TextPage)new WebClient().getPage("http://localhost:8085/helloworld-jaxrs/rest/world"); - assertEquals("Hello World", page.getContent()); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/README deleted file mode 100644 index 455a56b815..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/README +++ /dev/null @@ -1,8 +0,0 @@ -Sample implementation.web JS WebApp -========================================== - -This sample contribution shows SCA components implemented in a webapp and -accessed using Javascript. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/pom.xml deleted file mode 100644 index 1f4a415664..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/pom.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../../pom.xml - - - sample-implementation-web-helloworld-js-client-webapp - war - Apache Tuscany SCA Sample implemenation.web Helloworld Javascript Client WebApp - - - - - org.apache.tuscany.sca - tuscany-base-runtime - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-databinding-json - 2.0-Beta2-SNAPSHOT - - - - junit - junit - 4.8.1 - test - - - - net.sourceforge.htmlunit - htmlunit - 2.6 - test - - - - - - helloworld-js-client - - - org.mortbay.jetty - maven-jetty-plugin - 6.1.18 - - helloworld-js-client - foo - 9999 - - - - start-jetty - process-test-classes - - run - - - 0 - true - - - 8085 - - - - - - stop-jetty - prepare-package - - stop - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/java/sample/HelloworldService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/java/sample/HelloworldService.java deleted file mode 100644 index 123774b936..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/java/sample/HelloworldService.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -public interface HelloworldService { - - String sayHello(String name); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/java/sample/HelloworldServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/java/sample/HelloworldServiceImpl.java deleted file mode 100644 index 66cef71a25..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/java/sample/HelloworldServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - - -public class HelloworldServiceImpl implements HelloworldService { - - public String sayHello(String name) { - return "Hello " + name; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/webapp/WEB-INF/web.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/webapp/WEB-INF/web.composite deleted file mode 100644 index d41a8535e2..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/webapp/WEB-INF/web.composite +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/webapp/WEB-INF/web.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index babeb7b203..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Apache Tuscany Helloworld JSP Sample - - - tuscany - org.apache.tuscany.sca.host.webapp.TuscanyServletFilter - - - - tuscany - /* - - - - hello.html - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/webapp/hello.html b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/webapp/hello.html deleted file mode 100644 index 12024cc4d3..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/main/webapp/hello.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - Apache Tuscany Helloworld Javascript Client Sample - - - - - - - - - -

Apache Tuscany Helloworld Javascript Client Sample

- - - - - -
- - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/test/java/itest/HelloworldTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/test/java/itest/HelloworldTestCase.java deleted file mode 100644 index de41997a59..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-js-client/src/test/java/itest/HelloworldTestCase.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package itest; - -import static org.junit.Assert.assertTrue; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLConnection; -import java.net.URLEncoder; - -import org.junit.Ignore; -import org.junit.Test; - -/** - * Verfiy the serverside code is working, not sure how to easily itest the browser javascript code - */ -@Ignore("TUSCANY-3688") -public class HelloworldTestCase { - - @Test - public void testA() throws MalformedURLException, IOException { - - URL url = new URL("http://localhost:8085/helloworld-js-client/org.oasisopen.sca.componentContext.js/foo/call/plaincall/service.sayHello.dwr"); - URLConnection conn = url.openConnection(); - conn.setDoOutput(true); - OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream()); - - // to find this run the sample through TCPMON to capture the messages - - String data = URLEncoder.encode("callCount", "UTF-8") + "=" + URLEncoder.encode("1", "UTF-8"); - data += "&" + URLEncoder.encode("page", "UTF-8") + "=" + URLEncoder.encode("/helloworld-js-client/", "UTF-8"); - data += "&" + URLEncoder.encode("httpSessionId", "UTF-8") + "=" + URLEncoder.encode("", "UTF-8"); - data += "&" + URLEncoder.encode("scriptSessionId", "UTF-8") + "=" + URLEncoder.encode("A023DA664E56F075491BE1B87B37B02671", "UTF-8"); - data += "&" + URLEncoder.encode("c0-scriptName", "UTF-8") + "=" + URLEncoder.encode("service", "UTF-8"); - data += "&" + URLEncoder.encode("c0-methodName", "UTF-8") + "=" + URLEncoder.encode("sayHello", "UTF-8"); - data += "&" + URLEncoder.encode("c0-id", "UTF-8") + "=" + URLEncoder.encode("0", "UTF-8"); - data += "&" + URLEncoder.encode("c0-param0", "UTF-8") + "=" + URLEncoder.encode("string:petra", "UTF-8"); - data += "&" + URLEncoder.encode("batchId", "UTF-8") + "=" + URLEncoder.encode("0", "UTF-8"); - - wr.write(data); - wr.flush(); - - BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); - rd.readLine(); // throw 'allowScriptTagRemoting is false.'; - rd.readLine(); //#DWR-INSERT - rd.readLine(); //#DWR-REPLY - String line = rd.readLine(); // dwr.engine._remoteHandleCallback('0','0',"Hello petra"); - wr.close(); - rd.close(); - - assertTrue(line.endsWith("\"Hello petra\");")); - - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/README deleted file mode 100644 index c845341743..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/README +++ /dev/null @@ -1,8 +0,0 @@ -Sample implementation.web JSF WebApp -========================================== - -This sample contribution shows SCA components implemented in a webapp and -accessed using Java Server Faces. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/pom.xml deleted file mode 100644 index ae01ccba97..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/pom.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../../pom.xml - - - sample-implementation-web-helloworld-jsf-webapp - Apache Tuscany SCA Sample implemenation.web Helloworld JSF WebApp - war - - - - - org.apache.tuscany.sca - tuscany-sca-api - 2.0-Beta2-SNAPSHOT - compile - - - - org.apache.tuscany.sca - tuscany-implementation-web-runtime - 2.0-Beta2-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-myfaces - 2.0-Beta2-SNAPSHOT - runtime - - - - - - helloworld-jsf - - - org.mortbay.jetty - maven-jetty-plugin - 6.1.18 - - helloworld-jsf - foo - 9999 - - - - start-jetty - process-test-classes - - run - - - 0 - true - - - 8085 - - - - - - stop-jetty - prepare-package - - stop - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/java/sample/HelloWorldController.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/java/sample/HelloWorldController.java deleted file mode 100644 index 9c9f541997..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/java/sample/HelloWorldController.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Reference; - -/** - * - */ -public class HelloWorldController { - - @Reference - protected HelloworldService service; - - private String name; - - public HelloWorldController() { - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /** - * Method that is backed to a submit button of a form. - */ - public String send() { - if (service == null) { - name = "reference not injected!"; - } else { - name = service.sayHello(name); - } - return "success"; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/java/sample/HelloworldService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/java/sample/HelloworldService.java deleted file mode 100644 index 53ff7a5ca1..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/java/sample/HelloworldService.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -public interface HelloworldService { - - String sayHello(String name); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/java/sample/HelloworldServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/java/sample/HelloworldServiceImpl.java deleted file mode 100644 index 23925d6c69..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/java/sample/HelloworldServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -public class HelloworldServiceImpl implements HelloworldService { - - public String sayHello(String name) { - return "Hello " + name; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/WEB-INF/faces-config.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/WEB-INF/faces-config.xml deleted file mode 100644 index 99cee9faeb..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/WEB-INF/faces-config.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - helloWorld - sample.HelloWorldController - request - - - - - /helloWorld.jsp - - success - /page2.jsp - - - - - - /page2.jsp - - back - /helloWorld.jsp - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/WEB-INF/web.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/WEB-INF/web.composite deleted file mode 100644 index 8976adde3c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/WEB-INF/web.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/WEB-INF/web.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index fecbd7c79b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,191 +0,0 @@ - - - - - MyProject web.xml - - - - org.apache.tuscany.sca.host.webapp.TuscanyContextListener - - - org.apache.myfaces.config.annotation.LifecycleProvider - org.apache.tuscany.sca.myfaces.TuscanyAnnotationLifecycleProvider - - - - - State saving method: "client" or "server" (= default) - See JSF Specification 2.5.3 - javax.faces.STATE_SAVING_METHOD - client - - - Only applicable if state saving method is "server" (= default). - Defines the amount (default = 20) of the latest views are stored in session. - org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION - 20 - - - Only applicable if state saving method is "server" (= default). - If true (default) the state will be serialized to a byte stream before it - is written to the session. - If false the state will not be serialized to a byte stream. - org.apache.myfaces.SERIALIZE_STATE_IN_SESSION - true - - - Only applicable if state saving method is "server" (= default) and if - org.apache.myfaces.SERIALIZE_STATE_IN_SESSION is true (= default) - If true (default) the serialized state will be compressed before it - is written to the session. If false the state will not be compressed. - org.apache.myfaces.COMPRESS_STATE_IN_SESSION - true - - - This parameter tells MyFaces if javascript code should be allowed in the - rendered HTML output. - If javascript is allowed, command_link anchors will have javascript code - that submits the corresponding form. - If javascript is not allowed, the state saving info and nested parameters - will be added as url parameters. - Default: "true" - org.apache.myfaces.ALLOW_JAVASCRIPT - true - - - org.apache.myfaces.DETECT_JAVASCRIPT - false - - - If true, rendered HTML code will be formatted, so that it is "human readable". - i.e. additional line separators and whitespace will be written, that do not - influence the HTML code. - Default: "true" - org.apache.myfaces.PRETTY_HTML - true - - - If true, a javascript function will be rendered that is able to restore the - former vertical scroll on every request. Convenient feature if you have pages - with long lists and you do not want the browser page to always jump to the top - if you trigger a link or button action that stays on the same page. - Default: "false" - org.apache.myfaces.AUTO_SCROLL - true - - - - Used for encrypting view state. Only relevant for client side - state saving. See MyFaces wiki/web site documentation for instructions - on how to configure an application for diffenent encryption strengths. - - org.apache.myfaces.SECRET - NzY1NDMyMTA= - - - - - Validate managed beans, navigation rules and ensure that forms are not nested. - - org.apache.myfaces.VALIDATE - true - - - - - Treat readonly same as if disabled attribute was set for select elements. - - org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS - true - - - - - Use the defined class as the class which will be called when a resource is added to the - ExtensionFilter handling. Using StreamingAddResource here helps with performance. If you want to add - custom components and want to use the ExtensionFilter, you need to provide your custom implementation here. - - org.apache.myfaces.ADD_RESOURCE_CLASS - org.apache.myfaces.renderkit.html.util.DefaultAddResource - - - - - Virtual path in the URL which triggers loading of resources for the MyFaces extended components - in the ExtensionFilter. - - org.apache.myfaces.RESOURCE_VIRTUAL_PATH - /faces/myFacesExtensionResource - - - - - Check if the extensions-filter has been properly configured. - - org.apache.myfaces.CHECK_EXTENSIONS_FILTER - true - - - - - Define partial state saving as true/false. - - javax.faces.PARTIAL_STATE_SAVING_METHOD - false - - - - - org.apache.myfaces.webapp.StartupServletContextListener - - - - - Faces Servlet - javax.faces.webapp.FacesServlet - 1 - - - - - Faces Servlet - *.jsf - - - - - index.jsp - index.html - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/helloWorld.jsp b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/helloWorld.jsp deleted file mode 100644 index 189c142c99..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/helloWorld.jsp +++ /dev/null @@ -1,40 +0,0 @@ - - -<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> - - - - Apache Tuscany Helloworld JSF sample - - -

Apache Tuscany Helloworld JSF sample

- - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/index.jsp b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/index.jsp deleted file mode 100644 index 5ca296e115..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/index.jsp +++ /dev/null @@ -1,23 +0,0 @@ - - -<%@ page session="false"%> -<% -response.sendRedirect("helloWorld.jsf"); -%> diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/page2.jsp b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/page2.jsp deleted file mode 100644 index 89259021c7..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsf/src/main/webapp/page2.jsp +++ /dev/null @@ -1,38 +0,0 @@ - - -<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> -<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> - - - Apache Tuscany Helloworld JSF sample - - -

Apache Tuscany Helloworld JSF sample

- - - -
- - - -
-
- - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/README deleted file mode 100644 index 828aadb0f1..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/README +++ /dev/null @@ -1,7 +0,0 @@ -The README in the /samples directory provides -general instructions about building and running samples. (where -distribution-unpack-dir is the directory in which you unpacked the tuscany -binary distribution archive). Take a look there first (noting at you read it that this sample -is not a new style sample). - -TODO - finish \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/pom.xml deleted file mode 100644 index 370df5c8a4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/pom.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../../pom.xml - - - sample-implementation-web-helloworld-jsp-webapp - war - Apache Tuscany SCA Sample implemenation-web Helloworld JSP WebApp - - - - - org.apache.tuscany.sca - tuscany-base-runtime - 2.0-Beta2-SNAPSHOT - - - - junit - junit - 4.8.1 - test - - - - net.sourceforge.htmlunit - htmlunit - 2.6 - test - - - - - - helloworld-jsp - - - org.mortbay.jetty - maven-jetty-plugin - 6.1.18 - - helloworld-jsp - foo - 9999 - - - - start-jetty - process-test-classes - - run - - - 0 - true - - - 8085 - - - - - - stop-jetty - prepare-package - - stop - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/java/sample/HelloworldService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/java/sample/HelloworldService.java deleted file mode 100644 index 53ff7a5ca1..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/java/sample/HelloworldService.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -public interface HelloworldService { - - String sayHello(String name); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/java/sample/HelloworldServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/java/sample/HelloworldServiceImpl.java deleted file mode 100644 index a22c095f29..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/java/sample/HelloworldServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - - -public class HelloworldServiceImpl implements HelloworldService { - - public String sayHello(String name) { - return "Hello " + name; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/webapp/WEB-INF/web.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/webapp/WEB-INF/web.composite deleted file mode 100644 index 8976adde3c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/webapp/WEB-INF/web.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/webapp/WEB-INF/web.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index fa1f7ad7b9..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Apache Tuscany Helloworld JSP Sample - - - tuscany - org.apache.tuscany.sca.host.webapp.TuscanyServletFilter - - - - tuscany - /* - - - - hello.jsp - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/webapp/hello.jsp b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/webapp/hello.jsp deleted file mode 100644 index ffd01cca73..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/main/webapp/hello.jsp +++ /dev/null @@ -1,37 +0,0 @@ - - -<%@ page contentType="text/html;charset=UTF-8" language="java" %> -<%@ taglib uri="http://www.osoa.org/sca/sca_jsp.tld" prefix="sca" %> - - - - - - -

Apache Tuscany Helloworld JSP Sample

- - Calling HelloworldService sayHello("world") returns: - -

- - <%= service.sayHello("world") %> - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/test/java/itest/HelloworldTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/test/java/itest/HelloworldTestCase.java deleted file mode 100644 index 665957b0eb..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-jsp/src/test/java/itest/HelloworldTestCase.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package itest; - -import static org.junit.Assert.assertEquals; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.Iterator; - -import org.junit.Test; - -import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; -import com.gargoylesoftware.htmlunit.WebClient; -import com.gargoylesoftware.htmlunit.html.HtmlElement; -import com.gargoylesoftware.htmlunit.html.HtmlPage; -import com.gargoylesoftware.htmlunit.html.HtmlParagraph; - -/** - */ -public class HelloworldTestCase { - - @Test - public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException { - HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-jsp"); - Iterator ss = page.getAllHtmlChildElements().iterator(); - while(ss.hasNext()) { - HtmlElement htmlElement = (HtmlElement) ss.next(); - if( htmlElement instanceof HtmlParagraph) { - assertEquals("Hello world", htmlElement.asText()); - break; - } - } - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/README deleted file mode 100644 index 6874bcaddc..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/README +++ /dev/null @@ -1,8 +0,0 @@ -Sample implementation.web Servlet WebApp -========================================== - -This sample contribution shows SCA components implemented in a webapp and -accessed using a Servlet. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/pom.xml deleted file mode 100644 index 5398358221..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/pom.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../../pom.xml - - - sample-implementation-web-helloworld-servlet-webapp - war - Apache Tuscany SCA Sample implementation.web Helloworld Servlet WebApp - - - - - org.apache.tuscany.sca - tuscany-base-runtime-nodep - 2.0-Beta2-SNAPSHOT - - - - javax.servlet - servlet-api - 2.5 - provided - - - - junit - junit - 4.8.1 - test - - - - net.sourceforge.htmlunit - htmlunit - 2.6 - test - - - - - - helloworld-servlet - - - org.mortbay.jetty - maven-jetty-plugin - 6.1.18 - - helloworld-servlet - foo - 9999 - - - - start-jetty - process-test-classes - - run - - - 0 - true - - - 8085 - - - - - - stop-jetty - prepare-package - - stop - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/java/sample/HelloworldService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/java/sample/HelloworldService.java deleted file mode 100644 index 2e43e09897..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/java/sample/HelloworldService.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -public interface HelloworldService { - - String sayHello(String name); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/java/sample/HelloworldServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/java/sample/HelloworldServiceImpl.java deleted file mode 100644 index 9e79276704..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/java/sample/HelloworldServiceImpl.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -public class HelloworldServiceImpl implements HelloworldService { - - public String sayHello(String name) { - return "Hello " + name; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/java/sample/HelloworldServlet.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/java/sample/HelloworldServlet.java deleted file mode 100644 index bb72c50f6a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/java/sample/HelloworldServlet.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import java.io.IOException; -import java.io.Writer; - -import javax.servlet.ServletConfig; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.oasisopen.sca.ComponentContext; -import org.oasisopen.sca.annotation.Reference; - -/** - */ -public class HelloworldServlet extends HttpServlet { - private static final long serialVersionUID = 1L; - - @Reference - protected HelloworldService service; - - @Override - public void init(ServletConfig servletConfig) throws ServletException { - if (service == null) { - System.out.println("HelloworldServlet reference injection failed, using ComponentContext"); - ComponentContext cc = (ComponentContext)servletConfig.getServletContext().getAttribute("org.oasisopen.sca.ComponentContext"); - service = cc.getService(HelloworldService.class, "service"); - } - } - - @Override - protected void service(HttpServletRequest request, HttpServletResponse response) throws IOException { - - String name = request.getParameter("name"); - String greeting = service.sayHello(name); - - Writer out = response.getWriter(); - out.write("Apache Tuscany Helloworld Servlet Sample"); - out.write("

Apache Tuscany Helloworld Servlet Sample

"); - out.write("
Result: " + greeting); - out.write(""); - out.flush(); - out.close(); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/webapp/WEB-INF/web.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/webapp/WEB-INF/web.composite deleted file mode 100644 index 8976adde3c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/webapp/WEB-INF/web.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/webapp/WEB-INF/web.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index a91b3fc96b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - Apache Tuscany Helloworld Servlet Sample - - org.apache.tuscany.sca.host.webapp.TuscanyContextListener - - - HelloworldServlet - sample.HelloworldServlet - - - - HelloworldServlet - /HelloworldServlet - - - - hello.html - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/webapp/hello.html b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/webapp/hello.html deleted file mode 100644 index c4484916aa..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/main/webapp/hello.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - -Apache Tuscany Helloworld Servlet Sample - - - - -

Apache Tuscany Helloworld Servlet Sample

- -
- - - - - - - - -
Enter your name: - -
- -
-
- - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/test/java/itest/HelloworldTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/test/java/itest/HelloworldTestCase.java deleted file mode 100644 index 61d722da1f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-servlet/src/test/java/itest/HelloworldTestCase.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package itest; -import static org.junit.Assert.assertTrue; - -import java.io.IOException; -import java.net.MalformedURLException; - -import org.junit.Test; - -import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; -import com.gargoylesoftware.htmlunit.WebClient; -import com.gargoylesoftware.htmlunit.html.HtmlButton; -import com.gargoylesoftware.htmlunit.html.HtmlForm; -import com.gargoylesoftware.htmlunit.html.HtmlInput; -import com.gargoylesoftware.htmlunit.html.HtmlPage; - -/** - */ -public class HelloworldTestCase { - - @Test - public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException { - HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-servlet"); - - HtmlForm form = (HtmlForm) page.getForms().get(0); - - HtmlInput textField = form.getInputByName("name"); - textField.setValueAttribute("petra"); - - HtmlButton button = (HtmlButton) form.getButtonsByName("submit").get(0); - - HtmlPage pageResponse = (HtmlPage) button.click(); - - assertTrue(pageResponse.getWebResponse().getContentAsString().endsWith("Hello petra")); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/README deleted file mode 100644 index f331fb036c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/README +++ /dev/null @@ -1,8 +0,0 @@ -Sample implementation.web Stripes WebApp -========================================== - -This sample contribution shows SCA components implemented in a webapp and -accessed using a Stripes. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/pom.xml deleted file mode 100644 index 37a9ce7233..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/pom.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../../pom.xml - - - sample-implementation-web-helloworld-stripes-webapp - war - Apache Tuscany SCA Sample implementation.web Helloworld Stripes WebApp - - - - - - org.apache.tuscany.sca - tuscany-base-runtime - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-stripes - 2.0-Beta2-SNAPSHOT - - - - - net.sourceforge.stripes - stripes - 1.5.2 - - - - taglibs - standard - 1.1.2 - - - - junit - junit - 4.8.1 - test - - - - net.sourceforge.htmlunit - htmlunit - 2.6 - test - - - - - - helloworld-stripes - - - org.mortbay.jetty - maven-jetty-plugin - 6.1.18 - - helloworld-stripes - foo - 9999 - - - - start-jetty - process-test-classes - - run - - - 0 - true - - - 8085 - - - - - - stop-jetty - prepare-package - - stop - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/mystripes/action/BaseActionBean.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/mystripes/action/BaseActionBean.java deleted file mode 100644 index 0ab02682ac..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/mystripes/action/BaseActionBean.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package mystripes.action; - -import net.sourceforge.stripes.action.ActionBean; -import net.sourceforge.stripes.action.ActionBeanContext; - -public class BaseActionBean implements ActionBean { - private ActionBeanContext context; - - public ActionBeanContext getContext() { - return context; - } - public void setContext(ActionBeanContext context) { - this.context = context; - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/mystripes/action/HomeActionBean.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/mystripes/action/HomeActionBean.java deleted file mode 100644 index 0385c92369..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/mystripes/action/HomeActionBean.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package mystripes.action; - -import net.sourceforge.stripes.action.DefaultHandler; -import net.sourceforge.stripes.action.ForwardResolution; -import net.sourceforge.stripes.action.Resolution; -import net.sourceforge.stripes.action.UrlBinding; - -import org.oasisopen.sca.annotation.Reference; - -import sample.HelloworldService; - -@UrlBinding("/Home.htm") -public class HomeActionBean extends BaseActionBean { - - @Reference - HelloworldService service; - - @DefaultHandler - public Resolution view() { - return new ForwardResolution("/WEB-INF/jsp/home.jsp"); - } - - public String getHello() { - return service.sayHello("world"); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/sample/HelloworldService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/sample/HelloworldService.java deleted file mode 100644 index 53ff7a5ca1..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/sample/HelloworldService.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -public interface HelloworldService { - - String sayHello(String name); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/sample/HelloworldServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/sample/HelloworldServiceImpl.java deleted file mode 100644 index a22c095f29..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/java/sample/HelloworldServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - - -public class HelloworldServiceImpl implements HelloworldService { - - public String sayHello(String name) { - return "Hello " + name; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/resources/StripesResources.properties b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/resources/StripesResources.properties deleted file mode 100644 index 902842a19e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/resources/StripesResources.properties +++ /dev/null @@ -1,73 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# Resource strings used by the tag when there are no nested tags -stripes.errors.header=
Please fix the following errors:
    -stripes.errors.beforeError=
  1. -stripes.errors.afterError=
  2. -stripes.errors.footer=
- -# Resource strings used by the tag when displaying errors for a -# specific field (e.g. ). If not supplied the -# values above will be used instead. -stripes.fieldErrors.header= -stripes.fieldErrors.beforeError= -stripes.fieldErrors.afterError=
-stripes.fieldErrors.footer= - -# Resource strings used by the stripes:messages tag -stripes.messages.header=
    -stripes.messages.beforeMessage=
  • -stripes.messages.afterMessage=
  • -stripes.messages.footer=
- -# Validation error messages produced by Stripes' built-in converter classes. These -# are default error messages and can be overridden on per-field and per-form levels. -# Using the 'invalidNumber' error for a field 'age' of a form posting to -# '/user/Profile.action', the keys looked for (in order) would be: -# 1: /user/Profile.action.age.invalidNumber -# 2: /user/Profile.action.age.errorMessage -# 3: age.errorMessage -# 4: /user/Profile.action.invalidNumber -# 5: converter.number.invalidNumber -converter.number.invalidNumber=The value ({1}) entered in field {0} must be a valid number -converter.byte.outOfRange=The value ({1}) entered in field {0} was out of the range {2} to {3} -converter.short.outOfRange=The value ({1}) entered in field {0} was out of the range {2} to {3} -converter.integer.outOfRange=The value ({1}) entered in field {0} was out of the range {2} to {3} -converter.float.outOfRange=The value ({1}) entered in field {0} was out of the range {2} to {3} -converter.enum.notAnEnumeratedValue=The value "{1}" is not a valid value for field {0} -converter.date.invalidDate=The value ({1}) entered in field {0} must be a valid date -converter.email.invalidEmail=The value ({1}) entered is not a valid email address -converter.creditCard.invalidCreditCard=The value ({1}) entered is not a valid credit card number - -# Validation error messages produced by Stripes' annotation based validations. These -# are default error messages and can be overridden on per-field and per-form levels. -# Using the 'valueNotPresent' required field error for a field 'username' of a form -# posting to '/user/Register.action', the keys looked for (in order) would be: -# 1: /user/Register.action.username.valueNotPresent -# 2: /user/Register.action.username.errorMessage -# 3: username.errorMessage -# 4: /user/Register.action.valueNotPresent -# 5: validation.required.valueNotPresent -validation.required.valueNotPresent={0} is a required field -validation.minlength.valueTooShort={0} must be at least {2} characters long -validation.maxlength.valueTooLong={0} must be no more than {2} characters long -validation.minvalue.valueBelowMinimum=The minimum allowed value for {0} is {2} -validation.maxvalue.valueAboveMaximum=The maximum allowed value for {0} is {2} -validation.mask.valueDoesNotMatch={1} is not a valid {0} -validation.expression.valueFailedExpression=The value supplied ({1}) for field {0} is invalid -validation.file.postBodyTooBig=Total upload size of {3} KB exceeds the maximum size of {2} KB diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/resources/log4j.properties b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/resources/log4j.properties deleted file mode 100644 index 2741999098..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/resources/log4j.properties +++ /dev/null @@ -1,48 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# log4j.properties - -# Set up a logger to the console -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=[%d{HH:mm:ss}] %-5p %c %x - %m%n - -# Use this to only see log messages beyond a certain threshold in the console -#log4j.appender.stdout.Threshold=WARN - -# Set up a logger to a log file -log4j.appender.logfile=org.apache.log4j.DailyRollingFileAppender -log4j.appender.logfile.layout=org.apache.log4j.PatternLayout -log4j.appender.logfile.layout.ConversionPattern=[%d{HH:mm:ss}] %-5p %c %x - %m%n -log4j.appender.logfile.File=${user.home}/stripesquick.log -log4j.appender.logfile.DatePattern='.'yyyy-MM-dd - -# Use this to only see log messages beyond a certain threshold in the log file -#log4j.appender.logfile.Threshold=WARN - -# Logger settings -log4j.rootLogger=INFO, stdout, logfile - -# Valid levels are TRACE, DEBUG, INFO, WARN, ERROR, FATAL -# Change to TRACE or DEBUG to see more log messages -log4j.logger.net.sourceforge.stripes=WARN -log4j.logger.org.stripesbook.quickstart=INFO -log4j.logger.org.mortbay.log=INFO -log4j.logger.org=WARN -log4j.logger.com=WARN -log4j.logger.net=WARN diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/jsp/home.jsp b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/jsp/home.jsp deleted file mode 100644 index 0681c1f2bf..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/jsp/home.jsp +++ /dev/null @@ -1,26 +0,0 @@ - -<%@ include file="/WEB-INF/jsp/taglibs.jsp" %> - - - -

sayHello returns: ${actionBean.hello}

-

Congratulations, you've set up a Stripes SCA project!

-
-
diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/jsp/layout.jsp b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/jsp/layout.jsp deleted file mode 100644 index d0fb716b80..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/jsp/layout.jsp +++ /dev/null @@ -1,39 +0,0 @@ - -<%@ include file="/WEB-INF/jsp/taglibs.jsp" %> - - - - - - - ${title} - - - - - -
- - -
- - - -
\ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/jsp/taglibs.jsp b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/jsp/taglibs.jsp deleted file mode 100644 index f85602fcfa..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/jsp/taglibs.jsp +++ /dev/null @@ -1,29 +0,0 @@ - -<%-- Stripes TLD --%> -<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %> -<%@ taglib prefix="sdyn" uri="http://stripes.sourceforge.net/stripes-dynattr.tld" %> - -<%-- JSTL TLDs --%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> - -<%-- This is so that you can conveniently refer to the context path with ${contextPath} --%> - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/web.composite b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/web.composite deleted file mode 100644 index 8976adde3c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/web.composite +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/web.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index f01584cc2f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - Apache Tuscany Helloworld Stripes Sample - - - org.apache.tuscany.sca.host.webapp.TuscanyContextListener - - - - StripesFilter - net.sourceforge.stripes.controller.StripesFilter - - ActionResolver.Packages - mystripes.action - - - Extension.Packages - org.apache.tuscany.sca.stripes - - - - - DispatcherServlet - net.sourceforge.stripes.controller.DispatcherServlet - 1 - - - - StripesFilter - DispatcherServlet - REQUEST - FORWARD - - - - DispatcherServlet - *.htm - - - - index.html - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/index.html b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/index.html deleted file mode 100644 index c79d29e6a5..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/main/webapp/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/test/java/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/test/java/README deleted file mode 100644 index 828aadb0f1..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/test/java/README +++ /dev/null @@ -1,7 +0,0 @@ -The README in the /samples directory provides -general instructions about building and running samples. (where -distribution-unpack-dir is the directory in which you unpacked the tuscany -binary distribution archive). Take a look there first (noting at you read it that this sample -is not a new style sample). - -TODO - finish \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/test/java/itest/HelloworldTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/test/java/itest/HelloworldTestCase.java deleted file mode 100644 index 7f4359fa43..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/helloworld-stripes/src/test/java/itest/HelloworldTestCase.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package itest; - -import static org.junit.Assert.assertEquals; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.Iterator; - -import org.junit.Test; - -import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException; -import com.gargoylesoftware.htmlunit.WebClient; -import com.gargoylesoftware.htmlunit.html.HtmlElement; -import com.gargoylesoftware.htmlunit.html.HtmlPage; -import com.gargoylesoftware.htmlunit.html.HtmlParagraph; - -/** - */ -public class HelloworldTestCase { - - @Test - public void testA() throws FailingHttpStatusCodeException, MalformedURLException, IOException { - HtmlPage page = (HtmlPage)new WebClient().getPage("http://localhost:8085/helloworld-stripes"); - Iterator ss = page.getAllHtmlChildElements().iterator(); - while(ss.hasNext()) { - HtmlElement htmlElement = (HtmlElement) ss.next(); - if( htmlElement instanceof HtmlParagraph) { - assertEquals("sayHello returns: Hello world", htmlElement.asText()); - break; - } - } - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/pom.xml deleted file mode 100644 index fd0d42d8f8..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/implementation-web/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-samples-implementation-webapp - pom - Apache Tuscany SCA Sample Web Applications - - - - default - - true - - - helloworld-jaxrs - helloworld-js-client - helloworld-jsf - - helloworld-servlet - helloworld-stripes - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/pom.xml deleted file mode 100644 index aaa05c8d5b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/pom.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - org.apache.tuscany.sca - tuscany-samples-learning-more - 2.0-Beta2-SNAPSHOT - pom - Apache Tuscany SCA Learning More Sample Contributions - - - - default - - true - - - binding-jms - binding-rmi - binding-sca - binding-ws - - binding-jsonrpc - implementation-bpel - implementation-composite - implementation-java - implementation-script - implementation-spring - implementation-osgi - implementation-web - distributed-osgi - sca-client - async - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/calculator-scaclient/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/calculator-scaclient/README deleted file mode 100644 index 59dd5f1759..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/calculator-scaclient/README +++ /dev/null @@ -1,19 +0,0 @@ -Calculator SCA Client -===================== - -To run an application that uses the SCA client API to send messages to the -Calculator service running in the domain do the following - -First start one of the Calculator based contributions. For example, - -cd samples/learning-more/binding-sca/contribution-calculator -follow the instructions in the README there - -Then run the the SCA client by doing the following: - -cd samples/learning-more/scaclient-calculator -mvn exec:java - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/calculator-scaclient/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/calculator-scaclient/pom.xml deleted file mode 100644 index a7ee300151..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/calculator-scaclient/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - - sample-sca-client-calculator - Apache Tuscany SCA Sample SCA Client Calculator - - - - - org.apache.tuscany.sca - tuscany-base-runtime - 2.0-Beta2-SNAPSHOT - - - - junit - junit - 4.8.1 - test - - - - - - ${artifactId} - - - org.codehaus.mojo - exec-maven-plugin - 1.1.1 - - - - java - - - - - sample.CalculatorSCAClient - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/calculator-scaclient/src/main/java/calculator/CalculatorService.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/calculator-scaclient/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index 12d80ffd1c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/calculator-scaclient/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Remotable; - - -/** - * The Calculator service interface. - */ -@Remotable -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/calculator-scaclient/src/main/java/sample/CalculatorSCAClient.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/calculator-scaclient/src/main/java/sample/CalculatorSCAClient.java deleted file mode 100644 index edbf528517..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/calculator-scaclient/src/main/java/sample/CalculatorSCAClient.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import java.net.URI; - -import org.oasisopen.sca.NoSuchDomainException; -import org.oasisopen.sca.NoSuchServiceException; -import org.oasisopen.sca.client.SCAClientFactory; - -import calculator.CalculatorService; - -public class CalculatorSCAClient { - - public static void main(String[] args) throws NoSuchDomainException, NoSuchServiceException { - - String domainURI = "default"; - String name = "world"; - - if (args.length == 2) { - domainURI= args[0]; - name = args[1]; - } else if (args.length == 1) { - domainURI= args[0]; - } - - System.out.println("using domain uri: " + domainURI); - System.out.println("using name: " + name); - - SCAClientFactory factory = SCAClientFactory.newInstance(URI.create(domainURI)); - CalculatorService calculator = factory.getService(CalculatorService.class, "CalculatorServiceComponent"); - - System.out.println("Calling CalculatorService.add(2, 3)"); - System.out.println(calculator.add(3, 2)); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/README b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/README deleted file mode 100644 index 895716cd98..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/README +++ /dev/null @@ -1,19 +0,0 @@ -Helloworld SCA Client -===================== - -To run an application that uses the SCA client API to send messages to the -Helloworld service running in the domain do the following - -First start one of the Helloworld based contributions. For example, - -cd samples/getting-started/helloworld-contribution -follow the instructions in the README there - -Then run the the SCA client by doing the following: - -cd samples/learning-more/scaclient-helloworld -mvn exec:java - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/pom.xml deleted file mode 100644 index e30d83e9b4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - - sample-sca-client-helloworld - Apache Tuscany SCA Sample SCA Client Helloworld - - - - - org.apache.tuscany.sca - tuscany-base-runtime - 2.0-Beta2-SNAPSHOT - - - - junit - junit - 4.8.1 - test - - - - - - ${artifactId} - - - org.codehaus.mojo - exec-maven-plugin - 1.1.1 - - - - java - - - - - sample.HelloworldSCAClient - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/src/main/java/sample/Helloworld.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/src/main/java/sample/Helloworld.java deleted file mode 100644 index f4e8c50448..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/src/main/java/sample/Helloworld.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import org.oasisopen.sca.annotation.Remotable; - -@Remotable -public interface Helloworld { - - String sayHello(String name); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java deleted file mode 100644 index c2c9c4e44e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/src/main/java/sample/HelloworldSCAClient.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import java.net.URI; - -import org.oasisopen.sca.NoSuchDomainException; -import org.oasisopen.sca.NoSuchServiceException; -import org.oasisopen.sca.client.SCAClientFactory; - -public class HelloworldSCAClient { - - public static void main(String[] args) throws NoSuchDomainException, NoSuchServiceException { - - String domainURI = "default"; - String name = "world"; - - if (args.length == 2) { - domainURI= args[0]; - name = args[1]; - } else if (args.length == 1) { - domainURI= args[0]; - } - - System.out.println("using domain uri: " + domainURI); - System.out.println("using name: " + name); - - SCAClientFactory factory = SCAClientFactory.newInstance(URI.create(domainURI)); - Helloworld service = factory.getService(Helloworld.class, "HelloworldComponent"); - - System.out.println("Calling HelloworldComponent.sayHello(\"" + name + "\")"); - System.out.println(service.sayHello(name)); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/src/test/java/sample/HelloworldTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/src/test/java/sample/HelloworldTestCase.java deleted file mode 100644 index 13e08de692..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/helloworld-scaclient/src/test/java/sample/HelloworldTestCase.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import static org.junit.Assert.assertEquals; - -import org.junit.Test; - -public class HelloworldTestCase { - - @Test - public void testSayHello() { - HelloworldSCAClient helloworld = new HelloworldSCAClient(); -// assertEquals("Hello Petra", helloworld.sayHello("Petra")); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/pom.xml deleted file mode 100644 index aef0ccf3e2..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/learning-more/sca-client/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - org.apache.tuscany.sca - 2.0-Beta2-SNAPSHOT - tuscany-samples-sca-client - pom - Apache Tuscany SCA SCAClient Samples - - - - default - - true - - - helloworld-scaclient - calculator-scaclient - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/pom.xml deleted file mode 100644 index 7ef757bd6b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-samples - org.apache.tuscany.sca - 2.0-Beta2-SNAPSHOT - pom - Apache Tuscany SCA Samples - - - getting-started - learning-more - running-tuscany - applications - extending-tuscany - - - - - - - true - maven-deploy-plugin - 2.4 - - true - - - - - true - maven-remote-resources-plugin - - true - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/command-line/README b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/command-line/README deleted file mode 100644 index bf963ea98e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/command-line/README +++ /dev/null @@ -1,13 +0,0 @@ -To execute a sample contribution from the command line - -on Windows, from a command prompt in the samples directory, run the command ... - -..\bin\tuscany.bat "contribution-name" - -for example - -..\bin\tuscany.bat contribution-binding-sca-calculator - -or on *nix platforms, from a shell prompt in the samples directory, run the command ... - -../bin/tuscany.sh contribution-binding-sca-calculator diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/eclipse/README b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/eclipse/README deleted file mode 100644 index a2460ec294..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/eclipse/README +++ /dev/null @@ -1,15 +0,0 @@ -To import sample contributions into Eclipse you first need to import the -Tuscany runtime. You then need to import the sample contribution into Eclipse -as a project. Instructions for doing both of these things can be found here - -http://tuscany.apache.org/import-existing-tuscany-sca-projects-into-eclipse.html - -Note. these instructions refer to our 1.x code base but it holds true for -our 2.x code base. - -Once you have a contribution imported into Eclipse and cleanly compiling -against the Tuscany runtime jars you probably want to be able to run and -debug it. The easiest way to do this is with a simple Java launcher. If you -import the running-tuscany/embedded-jse project into Eclipse you'll see a -number of such launcher programs which you can copy to launch the -contribution(s) of your choice. diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/README b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/README deleted file mode 100644 index 467791b069..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/README +++ /dev/null @@ -1,10 +0,0 @@ -JSE Sample Launchers -==================== - -This directory contains sample java launchers for the -Tuscany sample contributions. The launchers use the Tuscany Node API -to embed the Tuscany runtime. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/build.xml b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/build.xml deleted file mode 100644 index f76fd2df1a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/build.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - Root of Tuscany binary distribution is - ${tuscany.home} - - - - - - - - - - - - - - - - - - - - - - - - - - - Please use 'ant run-name-of-sample-contribution-to-run' for example, try one of - 'ant sample-binding-sca-calculator-contribution' - 'ant sample-binding-ws-calculator-contribution' - 'ant sample-binding-rmi-calculator-contribution' - 'ant sample-implementation-java-calculator-contribution' - 'ant sample-implementation-java-calculator-async-contribution' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/pom.xml deleted file mode 100644 index 5a990b7431..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/pom.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-launcher-embedded-jse - Apache Tuscany SCA Sample Launcher Embedded JSE - - - - org.apache.tuscany.sca - tuscany-base-runtime - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-binding-rmi-runtime - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-binding-ws-runtime-axis2 - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-host-jetty - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-script-runtime - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-binding-jsonrpc-runtime - 2.0-Beta2-SNAPSHOT - - - - junit - junit - 4.8.1 - test - - - - - - ${artifactId} - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/calculator/CalculatorService.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index 12d80ffd1c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Remotable; - - -/** - * The Calculator service interface. - */ -@Remotable -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingJSONRPCCalculator.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingJSONRPCCalculator.java deleted file mode 100644 index 257065036c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingJSONRPCCalculator.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package launcher; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -import calculator.CalculatorService; - -/** - * This client program shows how to create an embedded SCA runtime, load a contribution, - * start it and locate and invoke an SCA component - */ -public class JSELauncherBindingJSONRPCCalculator { - - public static void main(String[] args) throws Exception { - JSELauncherBindingJSONRPCCalculator launcher = new JSELauncherBindingJSONRPCCalculator(); - launcher.launchBindingSCACalculator(); - } - - /* - * Using the Tuscany Node API to load a contribution. - * Using the Tuscany Node API to get a local service proxy - */ - public void launchBindingSCACalculator(){ - Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/binding-jsonrpc/calculator-contribution/target/sample-binding-jsonrpc-calculator-contribution.jar")); - node.start(); - - CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent"); - - // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script - double result = calculator.add(3, 2); - System.out.println("3 + 2 = " + result); - if (result != 5.0){ - throw new SampleLauncherException(); - } - - node.stop(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingRMICalculator.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingRMICalculator.java deleted file mode 100644 index b3c99edfa1..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingRMICalculator.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package launcher; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -import calculator.CalculatorService; - -/** - * This client program shows how to create an embedded SCA runtime, load a contribution, - * start it and locate and invoke an SCA component - */ -public class JSELauncherBindingRMICalculator { - - public static void main(String[] args) throws Exception { - JSELauncherBindingRMICalculator launcher = new JSELauncherBindingRMICalculator(); - launcher.launchBindingRMICalculator(); - } - - - public void launchBindingRMICalculator(){ - - Node node1 = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/binding-rmi/calculator-service-contribution/target/sample-binding-rmi-calculator-service-contribution.jar")); - Node node2 = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/binding-rmi/calculator-reference-contribution/target/sample-binding-rmi-calculator-reference-contribution.jar")); - - node1.start(); - node2.start(); - - CalculatorService calculator = node2.getService(CalculatorService.class, "CalculatorServiceComponent"); - - double result = calculator.add(3, 2); - System.out.println("3 + 2 = " + result); - if (result != 5.0){ - throw new SampleLauncherException(); - } - - node1.stop(); - node2.stop(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingSCACalculator.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingSCACalculator.java deleted file mode 100644 index 43de9e646f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingSCACalculator.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package launcher; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -import calculator.CalculatorService; - -/** - * This client program shows how to create an embedded SCA runtime, load a contribution, - * start it and locate and invoke an SCA component - */ -public class JSELauncherBindingSCACalculator { - - public static void main(String[] args) throws Exception { - JSELauncherBindingSCACalculator launcher = new JSELauncherBindingSCACalculator(); - launcher.launchBindingSCACalculator(); - } - - /* - * Using the Tuscany Node API to load a contribution. - * Using the Tuscany Node API to get a local service proxy - */ - public void launchBindingSCACalculator(){ - Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/binding-sca/calculator-contribution/target/sample-binding-sca-calculator-contribution.jar")); - node.start(); - - CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent"); - - // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script - double result = calculator.add(3, 2); - System.out.println("3 + 2 = " + result); - if (result != 5.0){ - throw new SampleLauncherException(); - } - - node.stop(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingWSCalculator.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingWSCalculator.java deleted file mode 100644 index 7c212a75dd..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherBindingWSCalculator.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package launcher; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -import calculator.CalculatorService; - -/** - * This client program shows how to create an embedded SCA runtime, load a contribution, - * start it and locate and invoke an SCA component - */ -public class JSELauncherBindingWSCalculator { - - public static void main(String[] args) throws Exception { - JSELauncherBindingWSCalculator launcher = new JSELauncherBindingWSCalculator(); - launcher.launchBindingWSCalculator(); - } - - /* - * Using the Tuscany Node API to load a contribution. - * Using the Tuscany Node API to get a local service proxy - */ - public void launchBindingWSCalculator(){ - Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/binding-ws/calculator-contribution/target/sample-binding-ws-calculator-contribution.jar")); - node.start(); - - CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent"); - - // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script - double result = calculator.add(3, 2); - System.out.println("3 + 2 = " + result); - if (result != 5.0){ - throw new SampleLauncherException(); - } - - node.stop(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationJavaCalculator.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationJavaCalculator.java deleted file mode 100644 index 6e865f3822..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationJavaCalculator.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package launcher; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -import calculator.CalculatorService; - -/** - * This client program shows how to create an embedded SCA runtime, load a contribution, - * start it and locate and invoke an SCA component - */ -public class JSELauncherImplementationJavaCalculator { - - public static void main(String[] args) throws Exception { - JSELauncherImplementationJavaCalculator launcher = new JSELauncherImplementationJavaCalculator(); - launcher.launchImplementationJavaCalculator(); - } - - public void launchImplementationJavaCalculator(){ - Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/implementation-java/calculator-contribution/target/sample-implementation-java-calculator-contribution.jar")); - node.start(); - - node.stop(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationJavaCalculatorAsync.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationJavaCalculatorAsync.java deleted file mode 100644 index 98cab93b5f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationJavaCalculatorAsync.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package launcher; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -/** - * This client program shows how to create an embedded SCA runtime, load a contribution, - * start it and locate and invoke an SCA component - */ -public class JSELauncherImplementationJavaCalculatorAsync { - - public static void main(String[] args) throws Exception { - JSELauncherImplementationJavaCalculatorAsync launcher = new JSELauncherImplementationJavaCalculatorAsync(); - launcher.launchImplementationJavaCalculator(); - } - - public void launchImplementationJavaCalculator(){ - Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/async/calculator-contribution/target/sample-implementation-java-calculator-async-contribution.jar")); - node.start(); - - node.stop(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationScriptCalculator.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationScriptCalculator.java deleted file mode 100644 index 4f6e951671..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/JSELauncherImplementationScriptCalculator.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package launcher; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -import calculator.CalculatorService; - -/** - * This client program shows how to create an embedded SCA runtime, load a contribution, - * start it and locate and invoke an SCA component - */ -public class JSELauncherImplementationScriptCalculator { - - public static void main(String[] args) throws Exception { - JSELauncherImplementationScriptCalculator launcher = new JSELauncherImplementationScriptCalculator(); - launcher.launchImplementationScriptCalculator(); - } - - /* - * Using the Tuscany Node API to load a contribution. - * Using the Tuscany Node API to get a local service proxy - */ - public void launchImplementationScriptCalculator(){ - Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "../../learning-more/implementation-script/calculator-contribution/target/sample-implementation-script-calculator-contribution.jar")); - node.start(); - - CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent"); - - // TODO - could use JUnit assertions but don't want to have to handle JUnit dependency from Ant script - double result = calculator.add(3, 2); - System.out.println("3 + 2 = " + result); - if (result != 5.0){ - throw new SampleLauncherException(); - } - - node.stop(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/SampleLauncherException.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/SampleLauncherException.java deleted file mode 100644 index f2ed3d421d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/main/java/launcher/SampleLauncherException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package launcher; - -/** - * This exception signals problems in the management of SCA component execution. - */ -public class SampleLauncherException extends RuntimeException { - /** - * Constructs a SampleLauncherException with no detail message. - */ - public SampleLauncherException() { - super(); - } - - /** - * Constructs a SampleLauncherException with the specified detail - * message. - * - * @param message the detail message - */ - public SampleLauncherException(String message) { - super(message); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/test/java/launcher/LauncherTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/test/java/launcher/LauncherTestCase.java deleted file mode 100644 index 41b5e086ff..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-jse/src/test/java/launcher/LauncherTestCase.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package launcher; - -import org.junit.Test; - -/** - * Test sample contributions. - */ -public class LauncherTestCase { - - @Test - public void testBindingJSONRPCCalculator() throws Exception { - JSELauncherBindingJSONRPCCalculator.main(null); - } - - @Test - public void testBindingSCACalculator() throws Exception { - JSELauncherBindingSCACalculator.main(null); - } - - @Test - public void testBindingWSCalculator() throws Exception { - JSELauncherBindingWSCalculator.main(null); - } - - @Test - public void testBindingRMICalculator() throws Exception { - JSELauncherBindingRMICalculator.main(null); - } - - @Test - public void testImplementationJavaCalculator() throws Exception { - JSELauncherImplementationJavaCalculator.main(null); - } - - @Test - public void testImplementationScriptCalculator() throws Exception { - JSELauncherImplementationScriptCalculator.main(null); - } - - @Test - public void testImplementationJavaCalculatorAsync() throws Exception { - JSELauncherImplementationJavaCalculatorAsync.main(null); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/README b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/README deleted file mode 100644 index 362d6032d2..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/README +++ /dev/null @@ -1,24 +0,0 @@ -OSGI Sample Launcher -=================== - -This directory contains a sample launcher for the running the -tuscany sample contributions in an OSGI environment. - -The difference between this sample and the sample with the name without the --base suffix is that this one uses the Tuscany aggregated jar to minimize the -jars a user needs to use. - -The README file in the /samples directory provides -general instructions about building and running sample contributions using the -tuscany sample launchers. ( where -distribution-unpack-dir is the directory in which you unpacked the tuscany -binary distribution archive) - -To use this sample OSGI launcher with ant excute the command - -ant run- - -where run- is one of the targets in the build.xml file - -To use this sample launcher to run all of the contributions as junit test cases, -execute the command "mvn" in the launcher directory. diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/build.xml b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/build.xml deleted file mode 100644 index 352ab46883..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/build.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - ${tuscany.home} - - - - - - - - - - - - - - - - - - - - - - - - - - - - Please use 'ant run-name-of-sample-contribution-to-run' for example, try one of - 'ant run-contribution-binding-sca-calculator' - - - - - - - - - - - - - - - and ant run - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/pom.xml deleted file mode 100644 index a25a54039c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/pom.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-launcher-embedded-osgi-base - Apache Tuscany SCA Sample Launcher Embedded OSGi using base jar - - - - org.apache.tuscany.sca - tuscany-base-runtime-nodep - 2.0-Beta2-SNAPSHOT - - - commons-cli - commons-cli - 1.2 - - - org.eclipse - osgi - 3.5.0-v20090520 - compile - - - org.eclipse.osgi - services - 3.2.0-v20090520-1800 - compile - - - - junit - junit - 4.8.1 - test - - - - - - ${artifactId} - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/main/java/calculator/CalculatorService.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index a59a7c3b16..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Remotable; - - -/** - * The Calculator service interface. - */ -@Remotable -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/main/java/launcher/RuntimeIntegration.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/main/java/launcher/RuntimeIntegration.java deleted file mode 100644 index 2c1cdf187a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/main/java/launcher/RuntimeIntegration.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package launcher; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.equinox.launcher.LauncherException; -import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher; - - -/** - * OSGi launcher function - */ -public class RuntimeIntegration { - - public Node startNode(Contribution... contributions){ - NodeLauncher launcher = NodeLauncher.newInstance(); - - // TODO - why do we have 3 different versions of the Contribution class? - org.apache.tuscany.sca.node.equinox.launcher.Contribution equinoxContributions[] = - new org.apache.tuscany.sca.node.equinox.launcher.Contribution[contributions.length]; - int i = 0; - for (Contribution inContrib : contributions) { - org.apache.tuscany.sca.node.equinox.launcher.Contribution outContrib = - new org.apache.tuscany.sca.node.equinox.launcher.Contribution(inContrib.getURI(), inContrib.getLocation()); - equinoxContributions[i] = outContrib; - i++; - } - Node node = null; - - try { - node = launcher.createNode(null, equinoxContributions); - } catch (LauncherException ex) { - throw new SampleLauncherException(ex.getMessage()); - } - node.start(); - return node; - } - - public void stopNode(Node node){ - node.stop(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/main/java/launcher/SampleJSELauncher.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/main/java/launcher/SampleJSELauncher.java deleted file mode 100644 index 4d8ea7f86a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/main/java/launcher/SampleJSELauncher.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package launcher; - -import java.net.URI; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.oasisopen.sca.NoSuchDomainException; -import org.oasisopen.sca.NoSuchServiceException; -import org.oasisopen.sca.client.SCAClientFactory; - -import calculator.CalculatorService; - - -/** - * This client program shows how to create an embedded SCA runtime, start it, - * and locate and invoke a SCA component - */ -public class SampleJSELauncher extends RuntimeIntegration { - - public static void main(String[] args) throws Exception { - SampleJSELauncher launcher = new SampleJSELauncher(); - - String contribution = null; - - if (args == null || args.length != 1){ - System.out.println("Please provide the name of the sample contribution to run as a parameter"); - System.out.println("Running binding-sca-calculator by default"); - contribution = "contribution-binding-sca-calculator"; - } else { - contribution = args[0]; - } - - if (contribution.equals("contribution-binding-sca-calculator")){ - launcher.launchBindingSCACalculator(); - } else if (contribution.equals("contribution-binding-ws-calculator")){ - launcher.launchBindingWSCalculator(); - } else { - System.out.println("Sample contribution " + contribution + "not found"); - } - - } - - /** - * The contribution-binding-sca-calculator contribution includes a client component - * that calls the CalculatorServiceComponent from an operation marked by @Init. - */ - public void launchBindingSCACalculator(){ - Node node = startNode(new Contribution("c1", "../../learning-more/binding-sca/calculator-contribution/target/sample-binding-sca-calculator-contribution.jar")); - - stopNode(node); - } - - /* - * Using a Tuscany specific mechanism for getting at local service proxies - */ - public void launchBindingWSCalculator() throws NoSuchDomainException, NoSuchServiceException{ - Node node = startNode(new Contribution("c1", "../../learning-more/binding-ws/calculator-contribution/target/sample-binding-ws-calculator-contribution.jar")); - - CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent"); - - double result = calculator.add(3, 2); - System.out.println("3 + 2 = " + result); - if (result != 5.0){ - throw new SampleLauncherException(); - } - - stopNode(node); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/main/java/launcher/SampleLauncherException.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/main/java/launcher/SampleLauncherException.java deleted file mode 100644 index 1eacb94b19..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/main/java/launcher/SampleLauncherException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package launcher; - -/** - * This exception signals problems in the management of SCA component execution. - */ -public class SampleLauncherException extends RuntimeException { - /** - * Constructs a SampleLauncherException with no detail message. - */ - public SampleLauncherException() { - super(); - } - - /** - * Constructs a SampleLauncherException with the specified detail - * message. - * - * @param message the detail message - */ - public SampleLauncherException(String message) { - super(message); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/test/java/launcher/LauncherTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/test/java/launcher/LauncherTestCase.java deleted file mode 100644 index 9228d33018..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi-base/src/test/java/launcher/LauncherTestCase.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package launcher; - -import org.junit.Test; - - - -/** - * Test the Calculator composition. - */ -public class LauncherTestCase { - - @Test - public void testContributionBindingSCACalculator() throws Exception { - SampleJSELauncher.main(new String[] {"contribution-binding-sca-calculator"}); - } - - @Test - public void testContributionBindingWSCalculator() throws Exception { - SampleJSELauncher.main(new String[] {"contribution-binding-ws-calculator"}); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/README b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/README deleted file mode 100644 index e7961a6eee..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/README +++ /dev/null @@ -1,8 +0,0 @@ -OSGI Sample Launcher -=================== - -This directory contains sample launchers for the running some of the -Tuscany sample contributions in an OSGI environment. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/build.xml b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/build.xml deleted file mode 100644 index 6b1f5912ef..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/build.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - ${tuscany.home} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Please use 'ant run-name-of-sample-contribution-to-run' for example, try one of - 'ant sample-binding-sca-calculator-contribution' - - - - - - - - - - - - - - - and ant run - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/pom.xml deleted file mode 100644 index c231f054f9..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-launcher-embedded-osgi - Apache Tuscany SCA Sample Launcher Embedded OSGi - - - - org.apache.tuscany.sca - tuscany-base-runtime-pom - 2.0-Beta2-SNAPSHOT - pom - - - - org.apache.tuscany.sca - tuscany-osgi-runtime-pom - 2.0-Beta2-SNAPSHOT - pom - - - - org.apache.tuscany.sca - tuscany-binding-ws-runtime-axis2 - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-host-jetty - 2.0-Beta2-SNAPSHOT - - - - junit - junit - 4.8.1 - test - - - - - - - ${artifactId} - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/calculator/CalculatorService.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index 12d80ffd1c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Remotable; - - -/** - * The Calculator service interface. - */ -@Remotable -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/launcher/RuntimeIntegration.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/launcher/RuntimeIntegration.java deleted file mode 100644 index f4a2f0780c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/launcher/RuntimeIntegration.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package launcher; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.equinox.launcher.LauncherException; -import org.apache.tuscany.sca.node.equinox.launcher.NodeLauncher; - - -/** - * OSGi launcher function - */ -public class RuntimeIntegration { - - public Node startNode(Contribution... contributions){ - NodeLauncher launcher = NodeLauncher.newInstance(); - - // TODO - why do we have 3 different versions of the Contribution class? - org.apache.tuscany.sca.node.equinox.launcher.Contribution equinoxContributions[] = - new org.apache.tuscany.sca.node.equinox.launcher.Contribution[contributions.length]; - int i = 0; - for (Contribution inContrib : contributions) { - org.apache.tuscany.sca.node.equinox.launcher.Contribution outContrib = - new org.apache.tuscany.sca.node.equinox.launcher.Contribution(inContrib.getURI(), inContrib.getLocation()); - equinoxContributions[i] = outContrib; - i++; - } - Node node = null; - - try { - node = launcher.createNode(null, equinoxContributions); - } catch (LauncherException ex) { - throw new SampleLauncherException(ex.getMessage()); - } - node.start(); - return node; - } - - public void stopNode(Node node){ - node.stop(); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleLauncherException.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleLauncherException.java deleted file mode 100644 index f2ed3d421d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleLauncherException.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package launcher; - -/** - * This exception signals problems in the management of SCA component execution. - */ -public class SampleLauncherException extends RuntimeException { - /** - * Constructs a SampleLauncherException with no detail message. - */ - public SampleLauncherException() { - super(); - } - - /** - * Constructs a SampleLauncherException with the specified detail - * message. - * - * @param message the detail message - */ - public SampleLauncherException(String message) { - super(message); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleOSGILauncherBindingSCA.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleOSGILauncherBindingSCA.java deleted file mode 100644 index 66830622fe..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleOSGILauncherBindingSCA.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package launcher; - -import java.net.URI; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.oasisopen.sca.NoSuchDomainException; -import org.oasisopen.sca.NoSuchServiceException; -import org.oasisopen.sca.client.SCAClientFactory; - -import calculator.CalculatorService; - - -/** - * This client program shows how to create an embedded SCA runtime, start it, - * and locate and invoke a SCA component - */ -public class SampleOSGILauncherBindingSCA extends RuntimeIntegration { - - public static void main(String[] args) throws Exception { - SampleOSGILauncherBindingSCA launcher = new SampleOSGILauncherBindingSCA(); - - - Node node = launcher.startNode(new Contribution("c1", "../../learning-more/binding-sca/calculator-contribution/target/sample-binding-sca-calculator-contribution.jar")); - launcher.stopNode(node); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleOSGILauncherBindingWS.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleOSGILauncherBindingWS.java deleted file mode 100644 index c9299f79b8..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/main/java/launcher/SampleOSGILauncherBindingWS.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package launcher; - -import java.net.URI; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.oasisopen.sca.NoSuchDomainException; -import org.oasisopen.sca.NoSuchServiceException; -import org.oasisopen.sca.client.SCAClientFactory; - -import calculator.CalculatorService; - - -/** - * This client program shows how to create an embedded SCA runtime, start it, - * and locate and invoke a SCA component - */ -public class SampleOSGILauncherBindingWS extends RuntimeIntegration { - - public static void main(String[] args) throws Exception { - SampleOSGILauncherBindingWS launcher = new SampleOSGILauncherBindingWS(); - - // launcher.launchBindingWSCalculator(); - - Node node = launcher.startNode(new Contribution("c1", "../../learning-more/binding-ws/calculator-contribution/target/sample-binding-ws-calculator-contribution.jar")); - - CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent"); - - double result = calculator.add(3, 2); - System.out.println("3 + 2 = " + result); - if (result != 5.0){ - throw new SampleLauncherException(); - } - - launcher.stopNode(node); - } - - /** - * The contribution-binding-sca-calculator contribution includes a client component - * that calls the CalculatorServiceComponent from an operation marked by @Init. - */ - public void launchBindingSCACalculator(){ - Node node = startNode(new Contribution("c1", "../../learning-more/binding-sca/contribution-calculator/target/sample-contribution-binding-sca-calculator.jar")); - - stopNode(node); - } - - /* - * Using a Tuscany specific mechanism for getting at local service proxies - */ - public void launchBindingWSCalculator() throws NoSuchDomainException, NoSuchServiceException{ - Node node = startNode(new Contribution("c1", "../../learning-more/binding-ws/contribution-calculator/target/sample-contribution-binding-ws-calculator.jar")); - - CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent"); - - double result = calculator.add(3, 2); - System.out.println("3 + 2 = " + result); - if (result != 5.0){ - throw new SampleLauncherException(); - } - - stopNode(node); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/test/java/launcher/LauncherTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/test/java/launcher/LauncherTestCase.java deleted file mode 100644 index 789484ceec..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/embedded-osgi/src/test/java/launcher/LauncherTestCase.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package launcher; - -import org.junit.Test; - - - -/** - * Test the Calculator composition. - */ -public class LauncherTestCase { - - - @Test - public void testContributionBindingSCACalculator2() throws Exception { - SampleOSGILauncherBindingSCA.main(null); - } - - - @Test - public void testContributionBindingWSCalculator() throws Exception { - SampleOSGILauncherBindingWS.main(null); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/README b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/README deleted file mode 100644 index 3f8a9fe0aa..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/README +++ /dev/null @@ -1,9 +0,0 @@ -Calculator Sample Contribution -============================== - -This sample contribution implements a simple calculator using SCA components. The -contribution is tested automatically using the maven-tuscany-plugin - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/build.xml b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/build.xml deleted file mode 100644 index bd06210755..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/build.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - ${tuscany.home} - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/pom.xml deleted file mode 100644 index 88342a5e68..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-maven-junit-calculator-contribution - Apache Tuscany SCA Sample Maven JUnit Calculator Contribution - - - - org.apache.tuscany.sca - tuscany-base-runtime - 2.0-Beta2-SNAPSHOT - - - - junit - junit - 4.8.1 - test - - - - - - ${artifactId} - - - org.apache.tuscany.maven.plugins - maven-tuscany-plugin - 2.0-Beta2-SNAPSHOT - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/AddService.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/AddService.java deleted file mode 100644 index 5a1e7a638a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The Add service interface - */ -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/AddServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/AddServiceImpl.java deleted file mode 100644 index b3671cc795..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the Add service - */ -@Service(AddService.class) -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Adding " + n1 + " and " + n2); - return n1 + n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorClient.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorClient.java deleted file mode 100644 index 1df1f31c48..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorClient.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -import org.oasisopen.sca.annotation.EagerInit; -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; - -/** - * This client program shows how to create an SCA runtime, start it, - * and locate and invoke a SCA component - */ -@Scope("COMPOSITE") -@EagerInit -public class CalculatorClient { - - private CalculatorService calculatorService; - - @Reference - public void setCalculatorService(CalculatorService calculatorService) { - this.calculatorService = calculatorService; - } - - @Init - public void calculate() { - // Calculate - System.out.println("SCA API ClassLoader: " + Reference.class.getClassLoader()); - System.out.println("3 + 2=" + calculatorService.add(3, 2)); - System.out.println("3 - 2=" + calculatorService.subtract(3, 2)); - System.out.println("3 * 2=" + calculatorService.multiply(3, 2)); - System.out.println("3 / 2=" + calculatorService.divide(3, 2)); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorService.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index 78eea39c71..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The Calculator service interface. - */ -@Remotable -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index 8e4b082d14..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Service; - - -/** - * An implementation of the Calculator service. - */ -@Service(CalculatorService.class) -public class CalculatorServiceImpl implements CalculatorService { - - private AddService addService; - private SubtractService subtractService; - private MultiplyService multiplyService; - private DivideService divideService; - - @Reference - public void setAddService(AddService addService) { - this.addService = addService; - } - - @Reference - public void setSubtractService(SubtractService subtractService) { - this.subtractService = subtractService; - } - - @Reference - public void setDivideService(DivideService divideService) { - this.divideService = divideService; - } - - @Reference - public void setMultiplyService(MultiplyService multiplyService) { - this.multiplyService = multiplyService; - } - - public double add(double n1, double n2) { - return addService.add(n1, n2); - } - - public double subtract(double n1, double n2) { - return subtractService.subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return multiplyService.multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return divideService.divide(n1, n2); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/DivideService.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/DivideService.java deleted file mode 100644 index ef6a8b375b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The divide service interface - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java deleted file mode 100644 index ddd7b9cc6e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the Divide service. - */ -@Service(DivideService.class) -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2); - return n1 / n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/MultiplyService.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index db568cc762..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index cc0de498d3..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the Multiply service. - */ -@Service(MultiplyService.class) -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2); - return n1 * n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/SubtractService.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/SubtractService.java deleted file mode 100644 index 56ee372fc4..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 22e95f7f54..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.oasisopen.sca.annotation.Service; - -/** - * An implementation of the subtract service. - */ -@Service(SubtractService.class) -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2); - return n1 - n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/resources/Calculator.composite b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/resources/Calculator.composite deleted file mode 100644 index 370e1cf315..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/resources/Calculator.composite +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/resources/CalculatorClient.composite b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/resources/CalculatorClient.composite deleted file mode 100644 index dfd32761be..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/resources/CalculatorClient.composite +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml deleted file mode 100644 index 70aab0e051..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/main/resources/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java deleted file mode 100644 index ba269182eb..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/calculator-contribution/src/test/java/calculator/CalculatorTestCase.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import static org.junit.Assert.assertEquals; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.Test; - -/** - * A unit test of the basic Java implementation classes in this contribution - * without using SCA - */ -public class CalculatorTestCase { - - @Test - public void testCalculator() throws Exception { - - Node node = NodeFactory.newInstance().createNode(new Contribution("c1", "./target/classes")); - node.start(); - - CalculatorService calculator = node.getService(CalculatorService.class, "CalculatorServiceComponent"); - - assertEquals(calculator.add(3, 2), 5.0, 0); - assertEquals(calculator.subtract(3, 2), 1.0, 0); - assertEquals(calculator.multiply(3, 2), 6.0, 0); - assertEquals(calculator.divide(3, 2), 1.5, 0); - - node.stop(); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/pom.xml deleted file mode 100644 index 98116a16c7..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-junit/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-sample-maven-junit - pom - Apache Tuscany SCA Sample Maven Junit - - - - default - - true - - - calculator-contribution - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/META-INF/MANIFEST.MF b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/META-INF/MANIFEST.MF deleted file mode 100644 index 1ebd35b30a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/META-INF/MANIFEST.MF +++ /dev/null @@ -1,19 +0,0 @@ -Manifest-Version: 1.0 -Private-Package: calculator;version="2.0.0" -Tool: Bnd-0.0.255 -Bundle-Name: Apache Tuscany SCA Calculator OSGi Sample -Created-By: 1.6.0_07 (Sun Microsystems Inc.) -Bundle-Vendor: The Apache Software Foundation -Eclipse-LazyStart: false -Bundle-Version: 2.0.0 -Bnd-LastModified: 1223949424781 -Bundle-Activator: calculator.CalculatorActivator -Bundle-ManifestVersion: 2 -Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt -Bundle-Description: Apache Tuscany SCA Calculator OSGi Sample -Import-Package: org.apache.tuscany.sca.node;version="2.0.0", - org.oasisopen.sca.annotation;version="2.0.0", - org.osgi.framework;version="1.4" -Bundle-SymbolicName: sample-calculator-osgi -Bundle-DocURL: http://www.apache.org/ -Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6 diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/README b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/README deleted file mode 100644 index bc1e6298a7..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/README +++ /dev/null @@ -1,8 +0,0 @@ -Calculator Sample Contribution -============================== - -This sample contribution implements a simple calculator using SCA components. The -contribution is tested automatically under OSGi using the maven-osgi-junit-plugin - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/build.xml b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/build.xml deleted file mode 100644 index 7dbc5c3bd3..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/build.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/logging.properties b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/logging.properties deleted file mode 100644 index cf452e7812..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/logging.properties +++ /dev/null @@ -1,25 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -handlers= java.util.logging.ConsoleHandler - -.level = INFO - -java.util.logging.ConsoleHandler.level = FINE -java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter - -org.apache.tuscany.sca.level = INFO diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/pom.xml deleted file mode 100644 index e477fd652b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/pom.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-maven-osgi-junit-calculator-osgi - Apache Tuscany SCA Sample Maven OSGI JUnit Calculator OSGi - - - - org.apache.tuscany.sca - tuscany-feature-api - 2.0-Beta2-SNAPSHOT - pom - - - - org.apache.tuscany.sca - tuscany-feature-all - 2.0-Beta2-SNAPSHOT - pom - - - - junit - junit - 4.8.1 - test - - - - - ${artifactId} - - - maven-eclipse-plugin - 2.5.1 - - - org.eclipse.pde.ManifestBuilder - org.eclipse.jdt.core.javabuilder - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - - org.eclipse.jdt.launching.JRE_CONTAINER - - - - - - - maven-jar-plugin - - - ${basedir}/META-INF/MANIFEST.MF - - - - - - org.apache.tuscany.maven.plugins - maven-osgi-junit-plugin - 1.0 - - - org.apache.tuscany.sca - tuscany-node-launcher-equinox - ${pom.version} - - - - - osgi-test - test - - test - - - - - osgi.configuration.area - ${project.build.directory}/equinox - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/AddService.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/AddService.java deleted file mode 100644 index 188451ebac..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The Add service interface - */ -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/AddServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/AddServiceImpl.java deleted file mode 100644 index 7ca8fb04b5..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Add service - */ -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Adding " + n1 + " and " + n2); - return n1 + n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorActivator.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorActivator.java deleted file mode 100644 index 4408568629..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorActivator.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -/** - * Bundle Activator for Calculator - * - */ -public class CalculatorActivator implements BundleActivator { - private Node node; - - public void start(BundleContext context) throws Exception { - try { - NodeFactory factory = NodeFactory.newInstance(); - String url = ContributionLocationHelper.getContributionLocation(getClass()); - Contribution contrib = new Contribution("c1", url); - node = factory.createNode("Calculator.composite", contrib); - node.start(); - } catch (Throwable e) { - e.printStackTrace(); - } - } - - public void stop(BundleContext context) throws Exception { - if (node != null) { - node.stop(); - node = null; - } - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorClient.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorClient.java deleted file mode 100644 index afd5ea48fc..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorClient.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package calculator; - -import org.oasisopen.sca.annotation.EagerInit; -import org.oasisopen.sca.annotation.Init; -import org.oasisopen.sca.annotation.Reference; -import org.oasisopen.sca.annotation.Scope; - -/** - * This client program shows how to create an SCA runtime, start it, - * and locate and invoke a SCA component - */ -@Scope("COMPOSITE") -@EagerInit -public class CalculatorClient { - - private CalculatorService calculatorService; - - @Reference - public void setCalculatorService(CalculatorService calculatorService) { - this.calculatorService = calculatorService; - } - - @Init - public void calculate() { - // Calculate - System.out.println("SCA API ClassLoader: " + Reference.class.getClassLoader()); - System.out.println("3 + 2=" + calculatorService.add(3, 2)); - System.out.println("3 - 2=" + calculatorService.subtract(3, 2)); - System.out.println("3 * 2=" + calculatorService.multiply(3, 2)); - System.out.println("3 / 2=" + calculatorService.divide(3, 2)); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorService.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index c89043276e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The Calculator service interface. - */ -public interface CalculatorService { - - double add(double n1, double n2); - - double subtract(double n1, double n2); - - double multiply(double n1, double n2); - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index 39f55ca31f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Reference; - -/** - * An implementation of the Calculator service. - */ -public class CalculatorServiceImpl implements CalculatorService { - - private AddService addService; - private SubtractService subtractService; - private MultiplyService multiplyService; - private DivideService divideService; - - @Reference - public void setAddService(AddService addService) { - this.addService = addService; - } - - @Reference - public void setSubtractService(SubtractService subtractService) { - this.subtractService = subtractService; - } - - @Reference - public void setDivideService(DivideService divideService) { - this.divideService = divideService; - } - - @Reference - public void setMultiplyService(MultiplyService multiplyService) { - this.multiplyService = multiplyService; - } - - public double add(double n1, double n2) { - return addService.add(n1, n2); - } - - public double subtract(double n1, double n2) { - return subtractService.subtract(n1, n2); - } - - public double multiply(double n1, double n2) { - return multiplyService.multiply(n1, n2); - } - - public double divide(double n1, double n2) { - return divideService.divide(n1, n2); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/DivideService.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/DivideService.java deleted file mode 100644 index 30d248208b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The divide service interface - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/DivideServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/DivideServiceImpl.java deleted file mode 100644 index 1323edf55a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Divide service. - */ -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2); - return n1 / n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/MultiplyService.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index 5290605938..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/MultiplyServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index 91b803bc9e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Multiply service. - */ -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2); - return n1 * n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/SubtractService.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/SubtractService.java deleted file mode 100644 index bf0d1882b6..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/SubtractServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 58cc4a3547..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the subtract service. - */ -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2); - return n1 - n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/resources/Calculator.composite b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/resources/Calculator.composite deleted file mode 100644 index c5e636f769..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/main/resources/Calculator.composite +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java deleted file mode 100644 index d6a3ccb24e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-osgi/src/test/java/calculator/CalculatorTestCase.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * This shows how to test the Calculator composition. - */ -public class CalculatorTestCase { - - private static Node node; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - String location = ContributionLocationHelper.getContributionLocation(CalculatorClient.class); - node = NodeFactory.newInstance().createNode("Calculator.composite", new Contribution("test", location)); - System.out.println("SCA Node API ClassLoader: " + node.getClass().getClassLoader()); - node.start(); - } - - @AfterClass - public static void tearDownAfterClass() throws Exception { - if (node != null) { - node.stop(); - } - } - - @Test - public void testDummy() throws Exception { - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/META-INF/MANIFEST.MF b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/META-INF/MANIFEST.MF deleted file mode 100644 index 1ebd35b30a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/META-INF/MANIFEST.MF +++ /dev/null @@ -1,19 +0,0 @@ -Manifest-Version: 1.0 -Private-Package: calculator;version="2.0.0" -Tool: Bnd-0.0.255 -Bundle-Name: Apache Tuscany SCA Calculator OSGi Sample -Created-By: 1.6.0_07 (Sun Microsystems Inc.) -Bundle-Vendor: The Apache Software Foundation -Eclipse-LazyStart: false -Bundle-Version: 2.0.0 -Bnd-LastModified: 1223949424781 -Bundle-Activator: calculator.CalculatorActivator -Bundle-ManifestVersion: 2 -Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt -Bundle-Description: Apache Tuscany SCA Calculator OSGi Sample -Import-Package: org.apache.tuscany.sca.node;version="2.0.0", - org.oasisopen.sca.annotation;version="2.0.0", - org.osgi.framework;version="1.4" -Bundle-SymbolicName: sample-calculator-osgi -Bundle-DocURL: http://www.apache.org/ -Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6 diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/README b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/README deleted file mode 100644 index 426f80062c..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/README +++ /dev/null @@ -1,9 +0,0 @@ -Calculator REST Sample Contribution -=================================== - -This sample contribution implements a simple calculator using SCA components. The -Calculator component is made avaible over a REST style interface using JAXRS. The -contribution is tested automatically under OSGi using the maven-osgi-junit-plugin - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/pom.xml deleted file mode 100644 index ce590fe710..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/pom.xml +++ /dev/null @@ -1,171 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-maven-osgi-junit-calculator-rest-osgi - Apache Tuscany SCA Sample Maven OSGi JUnit Calculator REST OSGi - - - - org.apache.tuscany.sca - tuscany-core-runtime-pom - 2.0-Beta2-SNAPSHOT - pom - - - - org.apache.tuscany.sca - tuscany-osgi-runtime-pom - 2.0-Beta2-SNAPSHOT - pom - - - - org.apache.tuscany.sca - tuscany-binding-rest-runtime - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-base-runtime-pom - 2.0-Beta2-SNAPSHOT - test - pom - - - - javax.servlet - servlet-api - 2.5 - test - - - - - org.slf4j - slf4j-api - 1.6.1 - test - - - - org.apache.tuscany.sca - tuscany-host-jetty - 2.0-Beta2-SNAPSHOT - test - - - - httpunit - httpunit - 1.6.1 - test - - - - junit - junit - 4.8.1 - test - - - - - ${artifactId} - - - maven-eclipse-plugin - 2.5.1 - - - org.eclipse.pde.ManifestBuilder - org.eclipse.jdt.core.javabuilder - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - - - org.eclipse.jdt.launching.JRE_CONTAINER - - - - - - maven-jar-plugin - - - ${basedir}/META-INF/MANIFEST.MF - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.5 - - true - - never - - - - - - org.apache.tuscany.maven.plugins - maven-osgi-junit-plugin - 1.0 - - - org.apache.tuscany.sca - tuscany-node-launcher-equinox - ${pom.version} - - - - - osgi-test - test - - test - - - - - osgi.configuration.area - ${project.build.directory}/equinox - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/AddService.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/AddService.java deleted file mode 100644 index 188451ebac..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/AddService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The Add service interface - */ -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/AddServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/AddServiceImpl.java deleted file mode 100644 index 193a7d6636..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Add service - */ -public class AddServiceImpl implements AddService { - - public double add(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Adding " + n1 + " and " + n2); - - return n1 + n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorActivator.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorActivator.java deleted file mode 100644 index 4408568629..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorActivator.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -/** - * Bundle Activator for Calculator - * - */ -public class CalculatorActivator implements BundleActivator { - private Node node; - - public void start(BundleContext context) throws Exception { - try { - NodeFactory factory = NodeFactory.newInstance(); - String url = ContributionLocationHelper.getContributionLocation(getClass()); - Contribution contrib = new Contribution("c1", url); - node = factory.createNode("Calculator.composite", contrib); - node.start(); - } catch (Throwable e) { - e.printStackTrace(); - } - } - - public void stop(BundleContext context) throws Exception { - if (node != null) { - node.stop(); - node = null; - } - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorService.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorService.java deleted file mode 100644 index 2d14bbd49f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorService.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -import org.oasisopen.sca.annotation.Remotable; - -/** - * The Calculator service interface. - */ -@Remotable -public interface CalculatorService { - - @GET - @Path("add/{n1}/{n2}") - @Consumes(MediaType.TEXT_PLAIN) - @Produces(MediaType.TEXT_PLAIN) - String add(@PathParam("n1") String n1, @PathParam("n2") String n2); - - @GET - @Path("subtract/{n1}/{n2}") - @Consumes(MediaType.TEXT_PLAIN) - @Produces(MediaType.TEXT_PLAIN) - String subtract(@PathParam("n1") String n1, @PathParam("n2") String n2); - - @GET - @Path("multiply/{n1}/{n2}") - @Consumes(MediaType.TEXT_PLAIN) - @Produces(MediaType.TEXT_PLAIN) - String multiply(@PathParam("n1") String n1, @PathParam("n2") String n2); - - @GET - @Path("divide/{n1}/{n2}") - @Consumes(MediaType.TEXT_PLAIN) - @Produces(MediaType.TEXT_PLAIN) - String divide(@PathParam("n1") String n1, @PathParam("n2") String n2); - - @GET - @Path("calculate/{formula}") - @Consumes(MediaType.TEXT_PLAIN) - @Produces(MediaType.TEXT_PLAIN) - String calculate(@PathParam("formula") String formula); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index 55aabdb56f..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import org.oasisopen.sca.annotation.Reference; - -/** - * An implementation of the Calculator service. - */ -public class CalculatorServiceImpl implements CalculatorService { - - private AddService addService; - private SubtractService subtractService; - private MultiplyService multiplyService; - private DivideService divideService; - - @Reference - public void setAddService(AddService addService) { - this.addService = addService; - } - - @Reference - public void setSubtractService(SubtractService subtractService) { - this.subtractService = subtractService; - } - - @Reference - public void setDivideService(DivideService divideService) { - this.divideService = divideService; - } - - @Reference - public void setMultiplyService(MultiplyService multiplyService) { - this.multiplyService = multiplyService; - } - - public String add(String n1, String n2) { - //System.out.println("ADD Operation ==> " + n1 + " + " + n2 + " = " + addService.add(Double.parseDouble(n1), Double.parseDouble(n2))); - return String.valueOf(addService.add(Double.parseDouble(n1), Double.parseDouble(n2))); - } - - public String subtract(String n1, String n2) { - //System.out.println("SUBTRACT Operation ==> " + n1 + " + " + n2 + " = " + subtractService.subtract(Double.parseDouble(n1), Double.parseDouble(n2))); - return String.valueOf(subtractService.subtract(Double.parseDouble(n1), Double.parseDouble(n2))); - } - - public String multiply(String n1, String n2) { - //System.out.println("MULTIPLY Operation ==> " + n1 + " + " + n2 + " = " + multiplyService.multiply(Double.parseDouble(n1), Double.parseDouble(n2))); - return String.valueOf(multiplyService.multiply(Double.parseDouble(n1), Double.parseDouble(n2))); - } - - public String divide(String n1, String n2) { - //System.out.println("DIVIDE Operation ==> " + n1 + " + " + n2 + " = " + divideService.divide(Double.parseDouble(n1), Double.parseDouble(n2))); - return String.valueOf(divideService.divide(Double.parseDouble(n1), Double.parseDouble(n2))); - } - - public String calculate(String formula) { - String[] operands = formula.split("[\\+\\-\\*\\:]"); - if(formula.contains("+")) { - return add( operands[0], operands[1]); - } else if(formula.contains("-")) { - return subtract( operands[0], operands[1]); - } else if(formula.contains("*")) { - return multiply( operands[0], operands[1]); - } else if(formula.contains(":")) { - return divide( operands[0], operands[1]); - } else { - throw new IllegalArgumentException("Invalid formula: " + formula ); - } - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/DivideService.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/DivideService.java deleted file mode 100644 index 30d248208b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The divide service interface - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/DivideServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/DivideServiceImpl.java deleted file mode 100644 index 1323edf55a..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Divide service. - */ -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Dividing " + n1 + " with " + n2); - return n1 / n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/MultiplyService.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/MultiplyService.java deleted file mode 100644 index 5290605938..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/MultiplyServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index 91b803bc9e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the Multiply service. - */ -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Multiplying " + n1 + " with " + n2); - return n1 * n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/SubtractService.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/SubtractService.java deleted file mode 100644 index bf0d1882b6..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/SubtractService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -/** - * The interface for the multiply service - */ -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/SubtractServiceImpl.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index 58cc4a3547..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * An implementation of the subtract service. - */ -public class SubtractServiceImpl implements SubtractService { - - public double subtract(double n1, double n2) { - Logger logger = Logger.getLogger("calculator"); - logger.log(Level.FINEST, "Subtracting " + n1 + " from " + n2); - return n1 - n2; - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/resources/Calculator.composite b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/resources/Calculator.composite deleted file mode 100644 index c428ce93d6..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/main/resources/Calculator.composite +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/test/java/calculator/CalculatorTestCase.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/test/java/calculator/CalculatorTestCase.java deleted file mode 100644 index 406d190624..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/calculator-rest-osgi/src/test/java/calculator/CalculatorTestCase.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package calculator; - -import javax.ws.rs.core.MediaType; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.ContributionLocationHelper; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -import com.meterware.httpunit.GetMethodWebRequest; -import com.meterware.httpunit.WebConversation; -import com.meterware.httpunit.WebRequest; -import com.meterware.httpunit.WebResponse; - -/** - * This shows how to test the Calculator composition. - */ -public class CalculatorTestCase { - private final static String SERVICE_URL = "http://localhost:8085/calculator/"; - - private static Node node; - - @BeforeClass - public static void setUpBeforeClass() throws Exception { - String location = ContributionLocationHelper.getContributionLocation("Calculator.composite"); - node = NodeFactory.newInstance().createNode("Calculator.composite", new Contribution("calculator", location)); - System.out.println("SCA Node API ClassLoader: " + node.getClass().getClassLoader()); - node.start(); - } - - @AfterClass - public static void tearDownAfterClass() throws Exception { - if (node != null) { - node.stop(); - } - } - - @Test - public void testAdd() throws Exception { - String queryString = "/add/3/2"; - - WebConversation wc = new WebConversation(); - WebRequest request = new GetMethodWebRequest(SERVICE_URL + queryString); - request.setHeaderField("Content-Type", MediaType.TEXT_PLAIN); - WebResponse response = wc.getResource(request); - - Assert.assertEquals(200, response.getResponseCode()); - Assert.assertEquals("5.0", response.getText()); - } - - @Test - public void testSubtract() throws Exception { - String queryString = "/subtract/3/2"; - - WebConversation wc = new WebConversation(); - WebRequest request = new GetMethodWebRequest(SERVICE_URL + queryString); - request.setHeaderField("Content-Type", MediaType.TEXT_PLAIN); - WebResponse response = wc.getResource(request); - - Assert.assertEquals(200, response.getResponseCode()); - Assert.assertEquals("1.0", response.getText()); - } - - @Test - public void testMultiply() throws Exception { - String queryString = "/multiply/3/2"; - - WebConversation wc = new WebConversation(); - WebRequest request = new GetMethodWebRequest(SERVICE_URL + queryString); - request.setHeaderField("Content-Type", MediaType.TEXT_PLAIN); - WebResponse response = wc.getResource(request); - - Assert.assertEquals(200, response.getResponseCode()); - Assert.assertEquals("6.0", response.getText()); - } - - @Test - public void testDivide() throws Exception { - String queryString = "/divide/3/2"; - - WebConversation wc = new WebConversation(); - WebRequest request = new GetMethodWebRequest(SERVICE_URL + queryString); - request.setHeaderField("Content-Type", MediaType.TEXT_PLAIN); - WebResponse response = wc.getResource(request); - - Assert.assertEquals(200, response.getResponseCode()); - Assert.assertEquals("1.5", response.getText()); - } - - @Test - public void testFormula() throws Exception { - String queryString = "/calculate/3+2"; - - WebConversation wc = new WebConversation(); - WebRequest request = new GetMethodWebRequest(SERVICE_URL + queryString); - request.setHeaderField("Content-Type", MediaType.TEXT_PLAIN); - WebResponse response = wc.getResource(request); - - Assert.assertEquals(200, response.getResponseCode()); - Assert.assertEquals("5.0", response.getText()); - } - -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/pom.xml deleted file mode 100644 index b384a50f74..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven-osgi-junit/pom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-maven-osgi-junit - org.apache.tuscany.sca - 2.0-Beta2-SNAPSHOT - pom - Apache Tuscany SCA Maven OSGI Junit plugin Samples - - - - default - - true - - - calculator-osgi - calculator-rest-osgi - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven/README b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven/README deleted file mode 100644 index ff976c3515..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/maven/README +++ /dev/null @@ -1,18 +0,0 @@ -To execute a sample contribution from Maven - -look for contributions that have the following configuration in their pom.xml file: - - - org.apache.tuscany.maven.plugins - maven-tuscany-plugin - 2.0-SNAPSHOT - - -For contributions that have this, for example, binding-sca/contribution-calculator, do the following - -cd samples/binding-sca/contribution-calculator -mvn tuscany:run - -This will launch the contribution in the Tuscany runtime and then wait. At this point you can use -other clients to send messages to services that the running SCA applcation exposes, -for example, try calculator-scaclient. diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/osgi/README b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/osgi/README deleted file mode 100644 index 6df2c1d2f2..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/osgi/README +++ /dev/null @@ -1,33 +0,0 @@ -The Tuscany runtime can be run in and OSGi container. - -Running in Equinox ------------------- - -On Windows, run -java -jar ..\..\modules\osgi-3.5.0-v20090520.jar -configuration ..\..\features\configuration -clean -console - -On *Unix, run -java -jar ../../modules/osgi-3.5.0-v20090520.jar -configuration ../../features/configuration -clean -console - -You should see the osgi console: - -osgi> - -osgi> Jun 22, 2009 1:32:27 PM org.apache.tuscany.sca.extensibility.equinox.EquinoxServiceDiscoveryActivator start -INFO: Equinox-based service discoverer is now configured. - -You can run "ss" command under the osgi> to see the status of the bundles. -osgi> ss - -Then you can install and start contributions as bundles by doing the following: - -osgi> install file:./path/to/contribution_bundle.jar - -Note that contribution_bundle.jar will need an activator in order to register the bundle as a SCA contribution -see samples/???? -TODO is this still true - -Running on Felix ----------------- - -See http://tuscany.apache.org/documentation-2x/running-tuscany-sca-2x-with-equinox-and-felix.html diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/pom.xml b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/pom.xml deleted file mode 100644 index 5daeefff59..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - tuscany-samples-running-tuscany - pom - Apache Tuscany SCA Running Tuscany Samples - - - - default - - true - - - - embedded-jse - embedded-osgi - - maven-osgi-junit - maven-junit - shell - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/README b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/README deleted file mode 100644 index 5c6b14cd87..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/README +++ /dev/null @@ -1,37 +0,0 @@ -Sample Tuscany Shell -==================== - -This directory contains a sample shell program supporting simple commands to -start and stop SCA composites. - -See http://tuscany.apache.org/documentation-2x/20-beta-samples-documentation.html -for more information - -To build the sample shell do this: -mvn install - -To run it: -./sca - -at the prompt: -start myNode ../../applications/store/target/sample-store.jar - -or: -start myNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar - -also try: -status -stop myNode -bye - -Starting and stopping composites is pretty fast. To see that, try the following -two scripts, which start/stop the sample store composite 10 times. - -./sca - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-samples - 2.0-Beta2-SNAPSHOT - ../pom.xml - - sample-launcher-shell - Apache Tuscany SCA Sample Launcher Shell - war - - - - org.apache.tuscany.sca - tuscany-feature-api - pom - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-feature-core - pom - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-feature-webservice - pom - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-feature-web20 - pom - 2.0-Beta2-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-host-webapp - 2.0-Beta2-SNAPSHOT - - - - junit - junit - 4.8.1 - test - - - - - - scashell - - - org.codehaus.mojo - tomcat-maven-plugin - 1.0 - - - tomcat - - /scashell - - - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/sca b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/sca deleted file mode 100755 index 8f6cf268b3..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/sca +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations - -java -classpath target/classes:`ls target/scashell/WEB-INF/lib/*.jar | awk '{ printf "%s:", $1}'` sample.Shell - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/sca.bat b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/sca.bat deleted file mode 100644 index 5110effc25..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/sca.bat +++ /dev/null @@ -1,30 +0,0 @@ -@echo off -rem Licensed to the Apache Software Foundation (ASF) under one -rem or more contributor license agreements. See the NOTICE file -rem distributed with this work for additional information -rem regarding copyright ownership. The ASF licenses this file -rem to you under the Apache License, Version 2.0 (the -rem "License"); you may not use this file except in compliance -rem with the License. You may obtain a copy of the License at -rem -rem http://www.apache.org/licenses/LICENSE-2.0 -rem -rem Unless required by applicable law or agreed to in writing, -rem software distributed under the License is distributed on an -rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -rem KIND, either express or implied. See the License for the -rem specific language governing permissions and limitations - -rem cd to target to reduce the length of the classpath. It blows up cmd.exe without this -cd target -set _CLASSPATH=.\classes -for %%i in (.\scashell\WEB-INF\lib\*.jar) do call:setClasspath %%i -set CLASSPATH=%_CLASSPATH% -@echo on -java sample.Shell -cd .. -goto:eof - -:setClasspath -set _CLASSPATH=%_CLASSPATH%;%1 -goto:eof \ No newline at end of file diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test-remote.txt b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test-remote.txt deleted file mode 100644 index dc13e5c401..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test-remote.txt +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations - -start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar -stop testNode -start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar -stop testNode -start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar -stop testNode -start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar -stop testNode -start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar -stop testNode -start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar -stop testNode -start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar -stop testNode -start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar -stop testNode -start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar -stop testNode -start testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar -stop testNode diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test-start.txt b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test-start.txt deleted file mode 100644 index 2514a9058d..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test-start.txt +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations - -restart testNode http://people.apache.org/~jsdelfino/tuscany/java/test/sample-store.jar -status diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test-status.txt b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test-status.txt deleted file mode 100644 index 4df56e85e8..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test-status.txt +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations - -status diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test-stop.txt b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test-stop.txt deleted file mode 100644 index 39eb36aa77..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test-stop.txt +++ /dev/null @@ -1,17 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations - -stop testNode diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test.txt b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test.txt deleted file mode 100644 index bf489a46a5..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/scripts/test.txt +++ /dev/null @@ -1,36 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations - -start testNode ../../applications/store/target/sample-store.jar -stop testNode -start testNode ../../applications/store/target/sample-store.jar -stop testNode -start testNode ../../applications/store/target/sample-store.jar -stop testNode -start testNode ../../applications/store/target/sample-store.jar -stop testNode -start testNode ../../applications/store/target/sample-store.jar -stop testNode -start testNode ../../applications/store/target/sample-store.jar -stop testNode -start testNode ../../applications/store/target/sample-store.jar -stop testNode -start testNode ../../applications/store/target/sample-store.jar -stop testNode -start testNode ../../applications/store/target/sample-store.jar -stop testNode -start testNode ../../applications/store/target/sample-store.jar -stop testNode diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/src/main/java/sample/Shell.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/src/main/java/sample/Shell.java deleted file mode 100644 index d0d8fb5dfe..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/src/main/java/sample/Shell.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package sample; - -import static java.lang.System.in; -import static java.lang.System.out; -import static java.util.Collections.emptyList; -import static java.util.Collections.singletonList; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.Callable; - -import org.apache.tuscany.sca.node.Contribution; -import org.apache.tuscany.sca.node.Node; -import org.apache.tuscany.sca.node.NodeFactory; - -/** - * A little SCA command shell. - */ -public class Shell { - final NodeFactory nf; - - public static class Nodeconf { - final String name; - final String cloc; - final String dcuri; - final Node node; - - Nodeconf(final String name, final String cloc, final String dcuri, final Node node) { - this.name = name; - this.cloc = cloc; - this.dcuri = dcuri; - this.node = node; - } - - public String toString() { - return name + " " + cloc + (dcuri != null? " " + dcuri : ""); - } - } - - final Map nodes = new HashMap(); - final List history = new ArrayList(); - - public Shell(NodeFactory nf) { - this.nf = nf; - } - - List start(final String name, final String cloc, final String dcuri) { - if(nodes.containsKey(name)) - return emptyList(); - final Node node = dcuri != null? nf.createNode(dcuri, new Contribution(cloc, cloc)) : nf.createNode(new Contribution(cloc, cloc)); - nodes.put(name, new Nodeconf(name, cloc, dcuri, node)); - node.start(); - return emptyList(); - } - - List stop(final String name) { - final Nodeconf ninfo = nodes.get(name); - if(ninfo == null) - return emptyList(); - ninfo.node.stop(); - nodes.remove(name); - return emptyList(); - } - - List stop() { - for(Nodeconf ninfo: nodes.values()) - ninfo.node.stop(); - nodes.clear(); - return emptyList(); - } - - List restart(final String name, final String cloc, final String dcuri) { - final Nodeconf ninfo = nodes.get(name); - if(ninfo == null) - return start(name, cloc, dcuri); - ninfo.node.stop(); - nodes.remove(name); - if (cloc == null) - return start(ninfo.name, ninfo.cloc, ninfo.dcuri); - return start(name, cloc, dcuri); - } - - List status() { - return new ArrayList(nodes.values()); - } - - List history() { - return history; - } - - List bye() { - return null; - } - - List read(final BufferedReader r) throws IOException { - final String l = r.readLine(); - history.add(l); - return l != null ? Arrays.asList(l.split(" ")) : singletonList("bye"); - } - - Callable> eval(final List toks) { - final String op = toks.get(0); - if(op.equals("start")) - return new Callable>() { - public List call() { - return start(toks.get(1), toks.get(2), toks.size() >= 4? toks.get(3) : null); - } - }; - if(op.equals("stop")) - return new Callable>() { - public List call() { - if(toks.size() == 1) - return stop(); - return stop(toks.get(1)); - } - }; - if(op.equals("restart")) - return new Callable>() { - public List call() { - return restart(toks.get(1), toks.size() >= 3? toks.get(2) : null, toks.size() >= 4? toks.get(3) : null); - } - }; - if(op.equals("status")) - return new Callable>() { - public List call() { - return status(); - } - }; - if(op.equals("history")) - return new Callable>() { - public List call() { - return history(); - } - }; - if(op.equals("bye")) - return new Callable>() { - public List call() { - return bye(); - } - }; - return new Callable>() { - public List call() { - return emptyList(); - } - }; - } - - List apply(final Callable> func) { - try { - return func.call(); - } catch(Exception e) { - StringWriter sw = new StringWriter(); - e.printStackTrace(new PrintWriter(sw)); - return singletonList(sw); - } - } - - boolean print(final List l, PrintWriter w) { - if(l == null) - return false; - for(Object o: l) - w.println(o); - return true; - } - - public Map run(final BufferedReader r, final PrintWriter w) throws IOException { - while(print(apply(eval(read(r))), w)) - ; - r.close(); - return nodes; - } - - public static void main(final String[] args) throws Exception { - new Shell(NodeFactory.newInstance()).run(new BufferedReader(new InputStreamReader(in)), new PrintWriter(out, true)); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/src/main/java/sample/ShellServlet.java b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/src/main/java/sample/ShellServlet.java deleted file mode 100644 index 55aadbd09b..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/src/main/java/sample/ShellServlet.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package sample; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.URL; - -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.tuscany.sca.host.webapp.WebAppHelper; - -public class ShellServlet extends HttpServlet { - static final long serialVersionUID = 1L; - - Shell shell; - - public void init() { - shell = new Shell(WebAppHelper.getNodeFactory()); - } - - public void destroy() { - shell.stop(); - } - - protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws IOException { - shell.run(new BufferedReader(new InputStreamReader(new URL(req.getParameter("conf")).openStream())), resp.getWriter()); - } -} diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/src/main/webapp/WEB-INF/web.xml b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index ac1ad1cc8e..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - scashell - - org.apache.tuscany.sca.host.webapp.TuscanyContextListener - - - tuscany - org.apache.tuscany.sca.host.webapp.TuscanyServletFilter - - - - tuscany - /* - - - - ShellServlet - sample.ShellServlet - - - - ShellServlet - /run - - - - index.html - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/src/main/webapp/index.html b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/src/main/webapp/index.html deleted file mode 100644 index 7d8a8568e8..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/shell/src/main/webapp/index.html +++ /dev/null @@ -1,42 +0,0 @@ - - - -Sample Runtime Shell - - -

It works

- -

This Web app runs a sample Tuscany runtime shell similar to samples/launcher-shell.
-To see how it works and what configuration commands are supported, just read the Shell program's source code.

- -

Configuration commands can be provided through a text document served from a Web location, for example:
-http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/running-tuscany/launcher-shell/scripts/test-start.txt

- -

To run that particular configuration script just point your Web browser to:
-http://localhost:8080/scashell/run?conf=http://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk/samples/running-tuscany/launcher-shell/scripts/test-start.txt
-To run the script again and refresh the runtime shell, just refresh that page in your Web browser. -

- -

This script starts the Tuscany sample store application. Click here to use that application after you've started it.

- -

Sample configuration script samples are available in the Tuscany Subversion repository there. - - - diff --git a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/webapp/README b/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/webapp/README deleted file mode 100644 index 2d80e36a79..0000000000 --- a/sca-java-2.x/branches/2.0-Beta2/samples/running-tuscany/webapp/README +++ /dev/null @@ -1,59 +0,0 @@ -The Tuscany SCA Java runtime can run inside a webapp (a WAR) and expose -services when the webapp is started. In order for this to work -a number of things have to be in place in the webapp: - -1. The Tuscany runtime jars have to be packaed in the webapp WEB-INF/lib - directory -2. The Tuscany HTTP filter servlet has to be configured in the - WEB-INF/web.xml file using something like: - - - tuscany - org.apache.tuscany.sca.host.webapp.TuscanyServletFilter - - - - tuscany - /* - - -3. The composite application has to packaged in the WAR file. When the - TuscanyServletFilter started it effectvely reads its own WAR file as - the contribution. As an alternative you can package complete - contribution archives in the WEB-INF/sca-contributions directory. - -In the getting-started/helloworl-webapp sample we provided a Maven -build script that perform these WAR packaging steps. - -To execute a webapp based contributions (sample contributions that have webapp -at the end of their name) you can build the contribution using maven and then -copy the resulting war file to your web container of choice - -For example, for learning-more/binding-jsonrpc/contribution-calculator-webapp, -do the following - -cd learning-more/binding-jsonrpc/contribution-calculator-webapp -mvn -cp target/sample-contribution-binding-jsonrpc-calculator-webapp.war your_container_deployment-dir - - -As an alternative sample webapp based contributions can be run within Jetty directly from Maven, look for -webapp contributions that have the following configuration in their pom.xml file: - - - org.mortbay.jetty - maven-jetty-plugin - 6.1.18 - - -For contributions that have this, for example, -learning-more/binding-jsonrpc/contribution-calculator-webapp, do the following - -cd learning-more/binding-jsonrpc/contribution-calculator-webapp -mvn jetty:run - -This will launch the contribution in the Jetty runtime and then wait. At this point you can use -HTTP clients to send messages to services that the running SCA applcation exposes. For this -example try pointing your browser at: - -http://localhost:8080/sample-contribution-binding-jsonrpc-calculator-webapp/ -- cgit v1.2.3