From 074cc3cff2f00457318bd322a6bd58f65686ae5c Mon Sep 17 00:00:00 2001 From: nash Date: Tue, 16 Nov 2010 10:40:14 +0000 Subject: Tag for 1.6.1-RC2 git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1035578 13f79535-47bb-0310-9956-ffa450edef68 --- .../samples/binding-notification-broker/README | 128 +++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 sca-java-1.x/tags/1.6.1-RC2/samples/binding-notification-broker/README (limited to 'sca-java-1.x/tags/1.6.1-RC2/samples/binding-notification-broker/README') diff --git a/sca-java-1.x/tags/1.6.1-RC2/samples/binding-notification-broker/README b/sca-java-1.x/tags/1.6.1-RC2/samples/binding-notification-broker/README new file mode 100644 index 0000000000..d73d296bee --- /dev/null +++ b/sca-java-1.x/tags/1.6.1-RC2/samples/binding-notification-broker/README @@ -0,0 +1,128 @@ +Notification Broker Binding Sample +================================== + +This sample illustrates the use of with a +broker. + +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 broker that is located in a +separate (and remote) composite with respect to any producers or consumers. As +such, this sample is run in conjunction with the binding-notification-producer +sample, the binding-notification-consumer sample, or both. Take a look at the +composite file or the .svg file which shows the composite file in pictorial form. +The composite service and composite reference each have 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 +------------ + +These instructions assume that you will start the notification samples in the +following order: + binding-notification-consumer + binding-notification-broker + binding-notification-producer + +For a clean shutdown without exceptions, you should end the notification samples +in the following order: + binding-notification-producer + binding-notification-broker + binding-notification-consumer + +This sample is run using the tuscany binary distribution. To see what it does, +first start the consumer sample. When this is running, open a command prompt, +navigate to this sample's directory and do + +ant run + +OR if you don't have ant, + +on Windows, use the following command: + +java -Dnotification.httpPort=8082 -cp ..\..\lib\tuscany-sca-manifest.jar;target\sample-binding-notification-broker.jar notification.broker.TrafficAdvisoryServer + +on *nix, use the following command: + +java -Dnotification.httpPort=8082 -cp ../../lib/tuscany-sca-manifest.jar:target/sample-binding-notification-broker.jar notification.broker.TrafficAdvisoryServer + +this should bring up the following prompt: + +Send a report value, ^C or 'end' 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 receive any message, you should bring up the +consumer sample or another broker sample. When you have finished using this +sample, type 'end' or ^C to end. + +Also notice that '-Dnotification.httpPort=8082' is used in the java command. +This indicates the port the sample should use. This also says that this server +is not 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-broker/ + src/ + main/ + java/ + notification.broker/ + TestCaseProducer.java - interface for the producer component + TrafficAdvisory.java - remote interface referred to by the producer component + and for the consumer component + TrafficAdvisoryConsumer.java - implementation for the consumer components + 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, consumer and + notification components, and composite service and reference + binding-notification-broker.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-broker +ant compile +ant run + +You should see the following output from the run target. + +run: + [java] Sep 14, 2007 11:14:24 AM org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping + [java] INFO: Added Servlet mapping: http://localhost:8082/consumer/trafficAdvisory + [java] Sep 14, 2007 11:14:24 AM org.apache.tuscany.sca.http.jetty.JettyServer addServletMapping + [java] INFO: Added Servlet mapping: http://localhost:8082/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-broker +mvn -- cgit v1.2.3