From 725006d4c47e63986ac042ade23a4d193298b1fe Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:08:29 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835131 13f79535-47bb-0310-9956-ffa450edef68 --- .../samples/binding-notification-producer/README | 134 --------------------- .../binding-notification-producer.png | Bin 21631 -> 0 bytes .../binding-notification-producer/build.xml | 75 ------------ .../samples/binding-notification-producer/pom.xml | 127 ------------------- .../notification/producer/TestCaseProducer.java | 24 ---- .../notification/producer/TrafficAdvisory.java | 30 ----- .../producer/TrafficAdvisoryProducer.java | 36 ------ .../producer/TrafficAdvisoryServer.java | 57 --------- .../TrafficAdvisoryNotification.componentType | 34 ------ .../TrafficAdvisoryNotification.composite | 44 ------- .../src/main/resources/wsdl/TrafficAdvisory.wsdl | 50 -------- .../producer/TrafficAdvisoryTestCase.java | 78 ------------ 12 files changed, 689 deletions(-) delete mode 100644 branches/sca-java-1.4/samples/binding-notification-producer/README delete mode 100644 branches/sca-java-1.4/samples/binding-notification-producer/binding-notification-producer.png delete mode 100644 branches/sca-java-1.4/samples/binding-notification-producer/build.xml delete mode 100644 branches/sca-java-1.4/samples/binding-notification-producer/pom.xml delete mode 100644 branches/sca-java-1.4/samples/binding-notification-producer/src/main/java/notification/producer/TestCaseProducer.java delete mode 100644 branches/sca-java-1.4/samples/binding-notification-producer/src/main/java/notification/producer/TrafficAdvisory.java delete mode 100644 branches/sca-java-1.4/samples/binding-notification-producer/src/main/java/notification/producer/TrafficAdvisoryProducer.java delete mode 100644 branches/sca-java-1.4/samples/binding-notification-producer/src/main/java/notification/producer/TrafficAdvisoryServer.java delete mode 100644 branches/sca-java-1.4/samples/binding-notification-producer/src/main/resources/TrafficAdvisoryNotification.componentType delete mode 100644 branches/sca-java-1.4/samples/binding-notification-producer/src/main/resources/TrafficAdvisoryNotification.composite delete mode 100644 branches/sca-java-1.4/samples/binding-notification-producer/src/main/resources/wsdl/TrafficAdvisory.wsdl delete mode 100644 branches/sca-java-1.4/samples/binding-notification-producer/src/test/java/notification/producer/TrafficAdvisoryTestCase.java (limited to 'branches/sca-java-1.4/samples/binding-notification-producer') diff --git a/branches/sca-java-1.4/samples/binding-notification-producer/README b/branches/sca-java-1.4/samples/binding-notification-producer/README deleted file mode 100644 index 3d927a0a50..0000000000 --- a/branches/sca-java-1.4/samples/binding-notification-producer/README +++ /dev/null @@ -1,134 +0,0 @@ -Notification Producer Binding Sample -=============================== - -This sample illustrates the use of with a -remote producer. - -The README in the samples directory (the directory above this) provides -general instructions about building and running samples. Take a look there -first. - -Sample Overview ---------------- - -This sample illustrates the use of a notification producer that is located in a -separate (and remote) composite with respect to any consumers. As such, this sample -is run in conjunction with the binding-notification-consumer sample, the -binding-notification-broker sample, or both. Take a look at the composite file -or the .svg file which shows the composite file in pictorial form. The composite -reference, referred to by the notification component, has a -that handles the remote communication. This binding includes an 'ntm' attribute -that refers to the notification type manager, which manages the connectivity of -producers, consumers and brokers, and which (for this sample) is assumed to be -running on http://localhost:8083. The ntm is a system component that is included in -and runs as part of the binding-notification module. -This sample also illustrates the use of a wsdl interface in the notification -component's . This allows messages sent and received -via to be transported as literal xml over http. - -Sample Usage ------------- - -This sample is run using the tuscany binary distribution. To run it, navigate to this sample's directory and - -on Wondows, use following command: - -java -Dnotification.httpPort=8083 -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-binding-notification-producer.jar notification.producer.TrafficAdvisoryServer - -on *nix, use following command: - -java -Dnotification.httpPort=8083 -cp ../../lib/tuscany-sca-manifest.jar:target/sample-binding-notification-producer.jar notification.producer.TrafficAdvisoryServer - -this should bring up the following prompt: - -Send a report value, ^C or to end - -at this point you should be able to type a message to send, for instance: - -Traffic congestion - -Notice that before you try to send any message, you should bring up the -consumer sample or the broker sample. When you have finished using this -sample, type 'end' or ^C to end. - -Also notice that '-Dnotification.httpPort=8083' is used in the java command. -This indicates the port the sample should use. This also says that this server -is going to play the role of ntm, given our previous assumption. It is important -that the first one of the producer, consumer or broker sample that is run be the -one that uses '-Dnotification.httpPort=8083', otherwise there is no ntm to talk -to and an exception will be thrown. - -Sample directory structure: ---------------------------- - -binding-notification-producer/ - src/ - main/ - java/ - notification.producer/ - TestCaseProducer.java - interface for the producer component - TrafficAdvisory.java - remote interface referred to by the producer component - TrafficAdvisoryProducer.java - implementation for the producer component - TrafficAdvisoryServer.java - server class including main entry point - resources/ - wsdl/ - TrafficAdvisory.wsdl - remote interface for the notification component - TrafficAdvisoryNotification.componentType - the component type referred to by - - TrafficAdvisoryNotification.composite - the main composite including producer and - notification components, and composite reference - test/ - java/ - notification.producer/ - TrafficAdvisoryTestCase.java - JUnit test case - resources/ - wsdl/ - TrafficAdvisory.wsdl - remote interface for the notification component - TrafficAdvisoryNotification.componentType - the component type referred to by - - TrafficAdvisoryNotification.composite - the main composite including producer and - notification components, and composite reference - binding-notification-producer.png - a pictorial representation of the sample .composite file - build.xml - the Ant build file - pom.xml - the Maven build file - -Building And Running The Sample Using Ant ------------------------------------------ -With the binary distribution the sample can be built and run using Ant as -follows - -cd binding-notification-producer -ant compile -ant run - -You should see the following output from the run target. - -run: - [java] Sep 14, 2007 10:31:45 AM org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping - [java] INFO: Added Servlet mapping: http://localhost:8083/ntm/trafficAdvisory - [java] Sep 14, 2007 10:31:45 AM org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping - [java] INFO: Added Servlet mapping: http://localhost:8083/producer/trafficAdvisory - -Building And Running The Sample Using Maven -------------------------------------------- -With either the binary or source distributions the sample can be built and run -using Maven as follows. - -cd binding-notification-producer -mvn - -You should see the following output from the test phase. - -------------------------------------------------------- - T E S T S -------------------------------------------------------- -Running notification.producer.TrafficAdvisoryTestCase -Only instantiating and closing domain ... -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.252 sec - -Results : - -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 - -This shows that the Junit test cases have run successfully. - diff --git a/branches/sca-java-1.4/samples/binding-notification-producer/binding-notification-producer.png b/branches/sca-java-1.4/samples/binding-notification-producer/binding-notification-producer.png deleted file mode 100644 index 34c347c893..0000000000 Binary files a/branches/sca-java-1.4/samples/binding-notification-producer/binding-notification-producer.png and /dev/null differ diff --git a/branches/sca-java-1.4/samples/binding-notification-producer/build.xml b/branches/sca-java-1.4/samples/binding-notification-producer/build.xml deleted file mode 100644 index d13e4c8a6c..0000000000 --- a/branches/sca-java-1.4/samples/binding-notification-producer/build.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.4/samples/binding-notification-producer/pom.xml b/branches/sca-java-1.4/samples/binding-notification-producer/pom.xml deleted file mode 100644 index dd98946f0f..0000000000 --- a/branches/sca-java-1.4/samples/binding-notification-producer/pom.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - 4.0.0 - - org.apache.tuscany.sca - tuscany-sca - 1.4.1-SNAPSHOT - ../../pom.xml - - sample-binding-notification-producer - Apache Tuscany SCA Sample Notification Binding Producer - 1.4.1-SNAPSHOT - A sample illustrating use of binding.notification - - - - org.apache.tuscany.sca - tuscany-implementation-notification - 1.4.1-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-binding-notification - 1.4.1-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-host-embedded - 1.4.1-SNAPSHOT - - - - org.apache.tuscany.sca - tuscany-implementation-java-runtime - 1.4.1-SNAPSHOT - runtime - - - - org.apache.tuscany.sca - tuscany-interface-wsdl-xml - 1.4.1-SNAPSHOT - runtime - - - - javax.servlet - servlet-api - 2.5 - provided - - - - org.apache.tuscany.sca - tuscany-host-jetty - 1.4.1-SNAPSHOT - runtime - - - - junit - junit - 4.5 - test - - - - - ${artifactId} - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - - - org.apache.maven.plugins - maven-jar-plugin - - - - org.apache.tuscany.notification.remoteProducer.TrafficAdvisoryServer - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - notification.httpPort - 8083 - - - - - - install - - diff --git a/branches/sca-java-1.4/samples/binding-notification-producer/src/main/java/notification/producer/TestCaseProducer.java b/branches/sca-java-1.4/samples/binding-notification-producer/src/main/java/notification/producer/TestCaseProducer.java deleted file mode 100644 index be80e71249..0000000000 --- a/branches/sca-java-1.4/samples/binding-notification-producer/src/main/java/notification/producer/TestCaseProducer.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package notification.producer; - -public interface TestCaseProducer { - - public void produceTrafficNotification(String report); -} diff --git a/branches/sca-java-1.4/samples/binding-notification-producer/src/main/java/notification/producer/TrafficAdvisory.java b/branches/sca-java-1.4/samples/binding-notification-producer/src/main/java/notification/producer/TrafficAdvisory.java deleted file mode 100644 index 39f06d5dde..0000000000 --- a/branches/sca-java-1.4/samples/binding-notification-producer/src/main/java/notification/producer/TrafficAdvisory.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 notification.producer; - -import org.osoa.sca.annotations.Remotable; - -/** - * @version $Rev$ $Date$ - */ -@Remotable -public interface TrafficAdvisory { - - void trafficNotification(String report); -} diff --git a/branches/sca-java-1.4/samples/binding-notification-producer/src/main/java/notification/producer/TrafficAdvisoryProducer.java b/branches/sca-java-1.4/samples/binding-notification-producer/src/main/java/notification/producer/TrafficAdvisoryProducer.java deleted file mode 100644 index 7d49b00607..0000000000 --- a/branches/sca-java-1.4/samples/binding-notification-producer/src/main/java/notification/producer/TrafficAdvisoryProducer.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 notification.producer; - -import org.osoa.sca.annotations.Reference; -import org.osoa.sca.annotations.Scope; -import org.osoa.sca.annotations.Service; - -@Service(TestCaseProducer.class) -@Scope("COMPOSITE") -public class TrafficAdvisoryProducer implements TestCaseProducer { - - @Reference - protected TrafficAdvisory destination; - - public void produceTrafficNotification(String report) { - - destination.trafficNotification(report); - } -} diff --git a/branches/sca-java-1.4/samples/binding-notification-producer/src/main/java/notification/producer/TrafficAdvisoryServer.java b/branches/sca-java-1.4/samples/binding-notification-producer/src/main/java/notification/producer/TrafficAdvisoryServer.java deleted file mode 100644 index efd3657dc3..0000000000 --- a/branches/sca-java-1.4/samples/binding-notification-producer/src/main/java/notification/producer/TrafficAdvisoryServer.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 notification.producer; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; - -import org.apache.tuscany.sca.host.embedded.SCADomain; - -public class TrafficAdvisoryServer { - - public static void main(String[] args) { - try { - SCADomain domain = SCADomain.newInstance("TrafficAdvisoryNotification.composite"); - TestCaseProducer testCaseProducer = domain.getService(TestCaseProducer.class, "TrafficAdvisoryProducer"); - BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); - String value = ""; - if (args.length == 1) { - value = args[0]; - } - do { - if(value == null || value.equals("end")) { - break; - } - try { - System.out.println("Send a report value, ^C or to end"); - value = reader.readLine(); - } catch (IOException e) { - e.printStackTrace(); - } - testCaseProducer.produceTrafficNotification("Report value [" + value + "]"); - } - while(true); - - domain.close(); - } catch(Throwable e) { - e.printStackTrace(); - } - } -} diff --git a/branches/sca-java-1.4/samples/binding-notification-producer/src/main/resources/TrafficAdvisoryNotification.componentType b/branches/sca-java-1.4/samples/binding-notification-producer/src/main/resources/TrafficAdvisoryNotification.componentType deleted file mode 100644 index 2dc70f8ed1..0000000000 --- a/branches/sca-java-1.4/samples/binding-notification-producer/src/main/resources/TrafficAdvisoryNotification.componentType +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.4/samples/binding-notification-producer/src/main/resources/TrafficAdvisoryNotification.composite b/branches/sca-java-1.4/samples/binding-notification-producer/src/main/resources/TrafficAdvisoryNotification.composite deleted file mode 100644 index 2db6ea655b..0000000000 --- a/branches/sca-java-1.4/samples/binding-notification-producer/src/main/resources/TrafficAdvisoryNotification.composite +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.4/samples/binding-notification-producer/src/main/resources/wsdl/TrafficAdvisory.wsdl b/branches/sca-java-1.4/samples/binding-notification-producer/src/main/resources/wsdl/TrafficAdvisory.wsdl deleted file mode 100644 index b823bbebcc..0000000000 --- a/branches/sca-java-1.4/samples/binding-notification-producer/src/main/resources/wsdl/TrafficAdvisory.wsdl +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.4/samples/binding-notification-producer/src/test/java/notification/producer/TrafficAdvisoryTestCase.java b/branches/sca-java-1.4/samples/binding-notification-producer/src/test/java/notification/producer/TrafficAdvisoryTestCase.java deleted file mode 100644 index d3901ee407..0000000000 --- a/branches/sca-java-1.4/samples/binding-notification-producer/src/test/java/notification/producer/TrafficAdvisoryTestCase.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 notification.producer; - -import java.io.BufferedReader; -import java.io.InputStreamReader; - -import notification.producer.TestCaseProducer; - -import org.apache.tuscany.sca.host.embedded.SCADomain; -//import org.apache.tuscany.sca.notification.remoteProducer.TestCaseProducer; - -import junit.framework.TestCase; - -public class TrafficAdvisoryTestCase extends TestCase { - - private SCADomain domain; - - public void testTrafficAdvisoryNotification() throws Exception { - System.out.println("Only instantiating and closing domain ..."); - TestCaseProducer testCaseProducer = domain.getService(TestCaseProducer.class, "TrafficAdvisoryProducer"); - - /* Uncomment to test with consumer - BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); - String value = "foo"; - do { - try { - System.out.println("Send a report value, ^C or to end"); - value = reader.readLine(); - } catch (Exception e) { - e.printStackTrace(); - } - if(value == null || value.equals("end")) { - break; - } - testCaseProducer.produceTrafficNotification("Report value [" + value + "]"); - value = "end"; - } - while(true); - */ - } - - @Override - protected void setUp() throws Exception { - try { - domain = SCADomain.newInstance("TrafficAdvisoryNotification.composite"); - } catch(Throwable e) { - e.printStackTrace(); - if (e instanceof Exception) { - throw (Exception)e; - } - else { - throw new Exception(e); - } - } - } - - @Override - protected void tearDown() throws Exception { - domain.close(); - } -} -- cgit v1.2.3