You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by la...@apache.org on 2013/07/21 21:02:13 UTC

[41/44] applied 0001-Moved-cloud-controller-1.0.1-to-products-and-removed.patch

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0ab7c4aa/products/cloud_controller/docs/xdoc/samples/jms_topic_sample.xml
----------------------------------------------------------------------
diff --git a/products/cloud_controller/docs/xdoc/samples/jms_topic_sample.xml b/products/cloud_controller/docs/xdoc/samples/jms_topic_sample.xml
new file mode 100644
index 0000000..d58dba4
--- /dev/null
+++ b/products/cloud_controller/docs/xdoc/samples/jms_topic_sample.xml
@@ -0,0 +1,252 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+~ Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+~
+~ WSO2 Inc. licenses this file to you under the Apache License,
+~ Version 2.0 (the "License"); you may not use this file except
+~ in compliance with the License.
+~ You may obtain a copy of the License at
+~
+~ http://www.apache.org/licenses/LICENSE-2.0
+~
+~ Unless required by applicable law or agreed to in writing,
+~ software distributed under the License is distributed on an
+~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~ KIND, either express or implied. See the License for the
+~ specific language governing permissions and limitations
+~ under the License.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+    <head>
+        <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
+        <title>WSO2 MB Samples - JMS Topic Sample</title>
+        <link href="../css/mb-docs.css" rel="stylesheet"/>
+        <link href="../styles/dist-docs.css" rel="stylesheet" type="text/css"
+              media="all"/>
+    </head>
+
+    <body>
+        <p>[<a href="../docs_index.html">Documentation Index</a>]  </p>
+            <h1>WSO2 MB - Samples :JMS Topic Sample</h1>
+
+            <p>This guide demonstrates how topics can be created and used in Message
+                Broker using JMS API.
+            </p>
+
+            <h2>Contents</h2>
+
+            <div class="toc">
+                <ul>
+                    <li>
+                        <a href="#jms_queue_sample">JMS Topic Sample</a>
+                    </li>
+                </ul>
+            </div>
+
+            <h2 id="jms_queue_sample">JMS Topic Sample</h2>
+
+            <p>Following code is used to create a topic, subscribe to it and publish messages. To
+                run this code sample, you need to have dependencies located at
+                $CARBON_HOME/client-lib in class path.
+                To try out following code fragment, Run the Topic Subscriber first and then run
+                Topic Publisher code. You should see, published message in Topic subscriber console.
+
+                You can see created topics in management console as well.
+            </p>
+
+            <p>Topic Publisher: This code is used to publish messages to a given topic.</p>
+
+            <pre xml:space="preserve">
+                package com.org.wso2.mb.jms.sample;
+                /**
+                 * Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+                 *
+                 * 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.
+                 */
+
+                import javax.jms.JMSException;
+                import javax.jms.QueueSession;
+                import javax.jms.TextMessage;
+                import javax.jms.Topic;
+                import javax.jms.TopicConnection;
+                import javax.jms.TopicConnectionFactory;
+                import javax.jms.TopicSession;
+                import javax.naming.Context;
+                import javax.naming.InitialContext;
+                import javax.naming.NamingException;
+                import java.util.Properties;
+
+
+                public class TopicPublisher {
+                    public static final String QPID_ICF = "org.wso2.andes.jndi.PropertiesFileInitialContextFactory";
+                    private static final String CF_NAME_PREFIX = "connectionfactory.";
+                    private static final String CF_NAME = "qpidConnectionfactory";
+                    String userName = "admin";
+                    String password = "admin";
+
+                    private static String CARBON_CLIENT_ID = "carbon";
+                    private static String CARBON_VIRTUAL_HOST_NAME = "carbon";
+                    private static String CARBON_DEFAULT_HOSTNAME = "localhost";
+                    private static String CARBON_DEFAULT_PORT = "5672";
+                    String topicName = "MYTopic";
+
+
+                    public static void main(String[] args) throws NamingException, JMSException {
+                        TopicPublisher topicPublisher = new TopicPublisher();
+                        topicPublisher.publishMessage();
+                    }
+
+                    public void publishMessage() throws NamingException, JMSException {
+                        Properties properties = new Properties();
+                        properties.put(Context.INITIAL_CONTEXT_FACTORY, QPID_ICF);
+                        properties.put(CF_NAME_PREFIX + CF_NAME, getTCPConnectionURL(userName, password));
+
+                        System.out.println("getTCPConnectionURL(userName,password) = " + getTCPConnectionURL(userName, password));
+
+                        InitialContext ctx = new InitialContext(properties);
+                        // Lookup connection factory
+                        TopicConnectionFactory connFactory = (TopicConnectionFactory) ctx.lookup(CF_NAME);
+                        TopicConnection topicConnection = connFactory.createTopicConnection();
+                        topicConnection.start();
+                        TopicSession topicSession =
+                                topicConnection.createTopicSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+
+                        // Send message
+                        Topic topic = topicSession.createTopic(topicName);
+
+                        // create the message to send
+                        TextMessage textMessage = topicSession.createTextMessage("Test Message");
+
+                        javax.jms.TopicPublisher topicPublisher = topicSession.createPublisher(topic);
+                        topicPublisher.publish(textMessage);
+
+                        topicSession.close();
+                        topicConnection.close();
+                    }
+
+                    public String getTCPConnectionURL(String username, String password) {
+                        // amqp://{username}:{password}@carbon/carbon?brokerlist='tcp://{hostname}:{port}'
+                        return new StringBuffer()
+                                .append("amqp://").append(username).append(":").append(password)
+                                .append("@").append(CARBON_CLIENT_ID)
+                                .append("/").append(CARBON_VIRTUAL_HOST_NAME)
+                                .append("?brokerlist='tcp://").append(CARBON_DEFAULT_HOSTNAME).append(":").append(CARBON_DEFAULT_PORT).append("'")
+                                .toString();
+                    }
+
+                }
+
+
+            </pre>
+
+            <p>Topic Subscriber: This code is used to Subscribe for topics.
+                topicSubscriber.receive() will wait till a message is received and exit the main
+                thread.
+            </p>
+            <pre xml:space="preserve">
+                package com.org.wso2.mb.jms.sample;
+                /**
+                 * Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+                 *
+                 * 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.
+                 */
+
+                import javax.jms.JMSException;
+                import javax.jms.Message;
+                import javax.jms.QueueSession;
+                import javax.jms.TextMessage;
+                import javax.jms.Topic;
+                import javax.jms.TopicConnection;
+                import javax.jms.TopicConnectionFactory;
+                import javax.jms.TopicSession;
+                import javax.naming.Context;
+                import javax.naming.InitialContext;
+                import javax.naming.NamingException;
+                import java.util.Properties;
+
+
+                public class TopicSubscriber {
+                    public static final String QPID_ICF = "org.wso2.andes.jndi.PropertiesFileInitialContextFactory";
+                    private static final String CF_NAME_PREFIX = "connectionfactory.";
+                    private static final String CF_NAME = "qpidConnectionfactory";
+                    String userName = "admin";
+                    String password = "admin";
+
+                    private static String CARBON_CLIENT_ID = "carbon";
+                    private static String CARBON_VIRTUAL_HOST_NAME = "carbon";
+                    private static String CARBON_DEFAULT_HOSTNAME = "localhost";
+                    private static String CARBON_DEFAULT_PORT = "5672";
+                    String topicName = "MYTopic";
+
+
+                    public static void main(String[] args) throws NamingException, JMSException {
+                        TopicSubscriber topicSubscriber = new TopicSubscriber();
+                        topicSubscriber.subscribe();
+                    }
+
+                    public void subscribe() throws NamingException, JMSException {
+                        Properties properties = new Properties();
+                        properties.put(Context.INITIAL_CONTEXT_FACTORY, QPID_ICF);
+                        properties.put(CF_NAME_PREFIX + CF_NAME, getTCPConnectionURL(userName, password));
+
+                        System.out.println("getTCPConnectionURL(userName,password) = " + getTCPConnectionURL(userName, password));
+
+                        InitialContext ctx = new InitialContext(properties);
+                        // Lookup connection factory
+                        TopicConnectionFactory connFactory = (TopicConnectionFactory) ctx.lookup(CF_NAME);
+                        TopicConnection topicConnection = connFactory.createTopicConnection();
+                        topicConnection.start();
+                        TopicSession topicSession =
+                                topicConnection.createTopicSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+
+                        // Send message
+                        Topic topic = topicSession.createTopic(topicName);
+                        javax.jms.TopicSubscriber topicSubscriber = topicSession.createSubscriber(topic);
+                        Message message = topicSubscriber.receive();
+                        if (message instanceof TextMessage) {
+                            TextMessage textMessage = (TextMessage) message;
+                            System.out.println("textMessage.getText() = " + textMessage.getText());
+                        }
+                        topicSession.close();
+                        topicConnection.close();
+                    }
+
+                    public String getTCPConnectionURL(String username, String password) {
+                        // amqp://{username}:{password}@carbon/carbon?brokerlist='tcp://{hostname}:{port}'
+                        return new StringBuffer()
+                                .append("amqp://").append(username).append(":").append(password)
+                                .append("@").append(CARBON_CLIENT_ID)
+                                .append("/").append(CARBON_VIRTUAL_HOST_NAME)
+                                .append("?brokerlist='tcp://").append(CARBON_DEFAULT_HOSTNAME).append(":").append(CARBON_DEFAULT_PORT).append("'")
+                                .toString();
+                    }
+
+                }
+
+
+            </pre>
+        <p>Also note that a MessageListener can be set to topicSubscriber to receive messages asynchronously.</p>
+    </body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0ab7c4aa/products/cloud_controller/docs/xdoc/samples/jms_transport_sample.xml
----------------------------------------------------------------------
diff --git a/products/cloud_controller/docs/xdoc/samples/jms_transport_sample.xml b/products/cloud_controller/docs/xdoc/samples/jms_transport_sample.xml
new file mode 100644
index 0000000..c0fab31
--- /dev/null
+++ b/products/cloud_controller/docs/xdoc/samples/jms_transport_sample.xml
@@ -0,0 +1,371 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+~ Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+~
+~ WSO2 Inc. licenses this file to you under the Apache License,
+~ Version 2.0 (the "License"); you may not use this file except
+~ in compliance with the License.
+~ You may obtain a copy of the License at
+~
+~ http://www.apache.org/licenses/LICENSE-2.0
+~
+~ Unless required by applicable law or agreed to in writing,
+~ software distributed under the License is distributed on an
+~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~ KIND, either express or implied. See the License for the
+~ specific language governing permissions and limitations
+~ under the License.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+    <head>
+        <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
+        <title>WSO2 MB Samples - JMS Transport Sample</title>
+        <link href="../css/mb-docs.css" rel="stylesheet"/>
+        <link href="../styles/dist-docs.css" rel="stylesheet" type="text/css"
+              media="all"/>
+    </head>
+
+    <body>
+        <p>[<a href="../docs_index.html">Documentation Index</a>]  </p>
+        <h1>WSO2 MB - Samples :JMS Transport Sample</h1>
+        <p>Apache AXIS2 support a JMS transport layer in addition to the existing HTTP transport. This allows Web
+            service clients and servers to communicate via JMS queues and topics instead of HTTP connections.
+            Both one-way and synchronous two-way requests are supported.</p>
+        <p>The benefits of using JMS as an alternative to HTTP include the following:</p>
+        <ul>
+            <li>
+                Request and response messages are sent by way of reliable messaging.
+            </li>
+            <li>One-way requests allow client and server to be more loosely-coupled (the server does not have to be
+                active when the client sends the one-way request).
+            </li>
+            <li>One-way requests can be sent to multiple servers simultaneously through the use of a topic.
+            </li>
+        </ul>
+        <p>If a web service is to be accessible on the JMS transport, then the corresponding WSDL document should include
+            a JMS binding and a SOAP address which specifies a JMS endpoint URL string. A JMS binding is simply
+            a <b>wsdl:binding </b> element which contains a <b
+            >wsdlsoap:binding</b> element whose transport attribute ends in soap/jms,
+            rather than the normal soap/http value. In addition to the JMS binding, a <b>wsdl:port</b> element which references
+            the JMS binding should be included in the <b>wsdl:service</b> element within the WSDL document. This <b>wsdl:port</b> element
+            should contain a <b>wsdlsoap:address</b> element whose location attribute specifies a JMS endpoint URL string.
+        </p>
+        <p>
+            You also need to decide on the names and types of JMS objects that your application will use. For example,
+            you must decide whether your web service will receive its requests from a queue or a topic. You also must
+            decide whether to use a secure destination (queue or topic). Finally, you will need to decide on the names
+            for your destination, connection factory, and listener port.   The following list provides an example of the
+            names that might be used for the sample MessageReceiveService web service:
+        </p>
+        <table>
+            <tr>
+                <td>Queue</td>  <td>MessageReceiveService, JNDI name: MessageReceiveService</td>
+            </tr>
+            <tr>
+                <td>QueueConnectionFactory</td> <td></td>
+            </tr>
+        </table>
+        <h2>Creating A Simple Service</h2>
+        <p>Following java class with its two operations are hosted in Axis2 server as a web service</p>
+        <pre xml:space="preserve">
+            /*
+            *  Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+            *
+            *  WSO2 Inc. licenses this file to you under the Apache License,
+            *  Version 2.0 (the "License"); you may not use this file except
+            *  in compliance with the License.
+            *  You may obtain a copy of the License at
+            *
+            *    http://www.apache.org/licenses/LICENSE-2.0
+            *
+            * Unless required by applicable law or agreed to in writing,
+            * software distributed under the License is distributed on an
+            * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+            * KIND, either express or implied.  See the License for the
+            * specific language governing permissions and limitations
+            * under the License.
+            */
+
+            public class MessageReceiveService {
+                public void receive(String message) {
+                    System.out.println("Got the message ==> " + message);
+                }
+                public String echo(String message) {
+                    System.out.println("Got the message ==> " + message);
+                    return message;
+                }
+            }
+        </pre>
+        <p>As WSDL of the service following will be used. Note how JMS bindings are defined. receive operation is an
+            "in only" operation having only input message. But echo is "in-out" operation which is having an output
+            message as well as an input message.
+        </p>
+
+        <pre xml:space="preserve">
+            &lt;wsdl:definitions xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot; xmlns:ns1=&quot;http://org.apache.axis2/xsd&quot; xmlns:ns=&quot;http://transport.sample.org&quot; xmlns:wsaw=&quot;http://www.w3.org/2006/05/addressing/wsdl&quot; xmlns:http=&quot;http://schemas.xmlsoap.org/wsdl/http/&quot; xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:mime=&quot;http://schemas.xmlsoap.org/wsdl/mime/&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot; xmlns:soap12=&quot;http://schemas.xmlsoap.org/wsdl/soap12/&quot; targetNamespace=&quot;http://transport.sample.org&quot;&gt;
+                &lt;wsdl:types&gt;
+                    &lt;xs:schema attributeFormDefault=&quot;qualified&quot; elementFormDefault=&quot;unqualified&quot; targetNamespace=&quot;http://transport.sample.org&quot;&gt;
+                        &lt;xs:element name=&quot;receive&quot;&gt;
+                            &lt;xs:complexType&gt;
+                                &lt;xs:sequence&gt;
+                                    &lt;xs:element minOccurs=&quot;0&quot; name=&quot;message&quot; nillable=&quot;true&quot; type=&quot;xs:string&quot;/&gt;
+                                &lt;/xs:sequence&gt;
+                            &lt;/xs:complexType&gt;
+                        &lt;/xs:element&gt;
+                        &lt;xs:element name=&quot;echo&quot;&gt;
+                            &lt;xs:complexType&gt;
+                                &lt;xs:sequence&gt;
+                                    &lt;xs:element minOccurs=&quot;0&quot; name=&quot;message&quot; nillable=&quot;true&quot; type=&quot;xs:string&quot;/&gt;
+                                &lt;/xs:sequence&gt;
+                            &lt;/xs:complexType&gt;
+                        &lt;/xs:element&gt;
+                        &lt;xs:element name=&quot;echoResponse&quot;&gt;
+                            &lt;xs:complexType&gt;
+                                &lt;xs:sequence&gt;
+                                    &lt;xs:element minOccurs=&quot;0&quot; name=&quot;return&quot; nillable=&quot;true&quot; type=&quot;xs:string&quot;/&gt;
+                                &lt;/xs:sequence&gt;
+                            &lt;/xs:complexType&gt;
+                        &lt;/xs:element&gt;
+                    &lt;/xs:schema&gt;
+                &lt;/wsdl:types&gt;
+                &lt;wsdl:message name=&quot;echoRequest&quot;&gt;
+                    &lt;wsdl:part name=&quot;parameters&quot; element=&quot;ns:echo&quot;/&gt;
+                &lt;/wsdl:message&gt;
+                &lt;wsdl:message name=&quot;echoResponse&quot;&gt;
+                    &lt;wsdl:part name=&quot;parameters&quot; element=&quot;ns:echoResponse&quot;/&gt;
+                &lt;/wsdl:message&gt;
+                &lt;wsdl:message name=&quot;receiveRequest&quot;&gt;
+                    &lt;wsdl:part name=&quot;parameters&quot; element=&quot;ns:receive&quot;/&gt;
+                &lt;/wsdl:message&gt;
+                &lt;wsdl:portType name=&quot;MessageReceiveServicePortType&quot;&gt;
+                    &lt;wsdl:operation name=&quot;echo&quot;&gt;
+                        &lt;wsdl:input message=&quot;ns:echoRequest&quot; wsaw:Action=&quot;urn:echo&quot;/&gt;
+                        &lt;wsdl:output message=&quot;ns:echoResponse&quot; wsaw:Action=&quot;urn:echoResponse&quot;/&gt;
+                    &lt;/wsdl:operation&gt;
+                    &lt;wsdl:operation name=&quot;receive&quot;&gt;
+                        &lt;wsdl:input message=&quot;ns:receiveRequest&quot; wsaw:Action=&quot;urn:receive&quot;/&gt;
+                    &lt;/wsdl:operation&gt;
+                &lt;/wsdl:portType&gt;
+                &lt;wsdl:binding name=&quot;MessageReceiveServiceSoap11Binding&quot; type=&quot;ns:MessageReceiveServicePortType&quot;&gt;
+                    &lt;soap:binding transport=&quot;http://schemas.xmlsoap.org/soap/http&quot; style=&quot;document&quot;/&gt;
+                    &lt;wsdl:operation name=&quot;echo&quot;&gt;
+                        &lt;soap:operation soapAction=&quot;urn:echo&quot; style=&quot;document&quot;/&gt;
+                        &lt;wsdl:input&gt;
+                            &lt;soap:body use=&quot;literal&quot;/&gt;
+                        &lt;/wsdl:input&gt;
+                        &lt;wsdl:output&gt;
+                            &lt;soap:body use=&quot;literal&quot;/&gt;
+                        &lt;/wsdl:output&gt;
+                    &lt;/wsdl:operation&gt;
+                    &lt;wsdl:operation name=&quot;receive&quot;&gt;
+                        &lt;soap:operation soapAction=&quot;urn:receive&quot; style=&quot;document&quot;/&gt;
+                        &lt;wsdl:input&gt;
+                            &lt;soap:body use=&quot;literal&quot;/&gt;
+                        &lt;/wsdl:input&gt;
+                    &lt;/wsdl:operation&gt;
+                &lt;/wsdl:binding&gt;
+                &lt;wsdl:binding name=&quot;MessageReceiveServiceSoap12Binding&quot; type=&quot;ns:MessageReceiveServicePortType&quot;&gt;
+                    &lt;soap12:binding transport=&quot;http://schemas.xmlsoap.org/soap/http&quot; style=&quot;document&quot;/&gt;
+                    &lt;wsdl:operation name=&quot;echo&quot;&gt;
+                        &lt;soap12:operation soapAction=&quot;urn:echo&quot; style=&quot;document&quot;/&gt;
+                        &lt;wsdl:input&gt;
+                            &lt;soap12:body use=&quot;literal&quot;/&gt;
+                        &lt;/wsdl:input&gt;
+                        &lt;wsdl:output&gt;
+                            &lt;soap12:body use=&quot;literal&quot;/&gt;
+                        &lt;/wsdl:output&gt;
+                    &lt;/wsdl:operation&gt;
+                    &lt;wsdl:operation name=&quot;receive&quot;&gt;
+                        &lt;soap12:operation soapAction=&quot;urn:receive&quot; style=&quot;document&quot;/&gt;
+                        &lt;wsdl:input&gt;
+                            &lt;soap12:body use=&quot;literal&quot;/&gt;
+                        &lt;/wsdl:input&gt;
+                    &lt;/wsdl:operation&gt;
+                &lt;/wsdl:binding&gt;
+                &lt;wsdl:service name=&quot;MessageReceiveService&quot;&gt;
+                    &lt;wsdl:port name=&quot;MessageReceiveServiceJmsSoap11Endpoint&quot; binding=&quot;ns:MessageReceiveServiceSoap11Binding&quot;&gt;
+                        &lt;soap:address location=&quot;jms:/MessageReceiveService?transport.jms.DestinationType=queue&amp;amp;transport.jms.ContentTypeProperty=Content-Type&amp;amp;java.naming.provider.url=conf/jndi.properties&amp;amp;java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&amp;amp;transport.jms.ConnectionFactoryType=queue&amp;amp;transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&quot;/&gt;
+                    &lt;/wsdl:port&gt;
+                    &lt;wsdl:port name=&quot;MessageReceiveServiceJmsSoap12Endpoint&quot; binding=&quot;ns:MessageReceiveServiceSoap12Binding&quot;&gt;
+                        &lt;soap12:address location=&quot;jms:/MessageReceiveService?transport.jms.DestinationType=queue&amp;amp;transport.jms.ContentTypeProperty=Content-Type&amp;amp;java.naming.provider.url=conf/jndi.properties&amp;amp;java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&amp;amp;transport.jms.ConnectionFactoryType=queue&amp;amp;transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&quot;/&gt;
+                    &lt;/wsdl:port&gt;
+                &lt;/wsdl:service&gt;
+            &lt;/wsdl:definitions&gt;
+        </pre>
+
+         <h2>Axi2 Configurations</h2>
+        <p>axi2.xml file, which configures the axis2 server on which above service is hosted, should be enabled with JMS
+            transport.</p>
+        <pre xml:space="preserve">
+            &lt;transportReceiver name=&quot;jms&quot; class=&quot;org.apache.axis2.transport.jms.JMSListener&quot;&gt;
+                &lt;parameter name=&quot;default&quot; locked=&quot;false&quot;&gt;
+                &lt;parameter name=&quot;java.naming.factory.initial&quot; locked=&quot;false&quot;&gt;org.wso2.andes.jndi.PropertiesFileInitialContextFactory&lt;/parameter&gt;
+                &lt;parameter name=&quot;java.naming.provider.url&quot; locked=&quot;false&quot;&gt;conf/jndi.properties&lt;/parameter&gt;
+                &lt;parameter name=&quot;transport.jms.ConnectionFactoryJNDIName&quot; locked=&quot;false&quot;&gt;QueueConnectionFactory&lt;/parameter&gt;
+                &lt;parameter name=&quot;transport.jms.ConnectionFactoryType&quot; locked=&quot;false&quot;&gt;queue&lt;/parameter&gt;
+                &lt;/parameter&gt;
+            &lt;/transportReceiver&gt;
+        </pre>
+        <br></br>
+        <pre xml:space="preserve">
+            <transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/>
+        </pre>
+
+        <h2>Message Broker Bindings</h2>
+        <p>conf/jndi.properties file is having all JMS bindings (Queue/QueueConnectionFactory) mentioned above.</p>
+
+        <pre xml:space="preserve">
+
+            connectionfactory.QueueConnectionFactory=amqp://admin:admin@clientid/carbon?brokerlist='tcp://localhost:5672'
+            queue.MessageReceiveService=MessageReceiveService
+        </pre>
+        <p>Note that WSO2 Message Broker should be running at localhost port 5672 as per this sample.</p>
+        <h2>Start Axis2 Server</h2>
+        <p>Axis2 server is started with above configurations, hosting the above MessageReceiveService service.</p>
+        <pre xml:space="preserve">
+
+            private AxisServer axisServer;
+            public void start(){
+            try {
+                ConfigurationContext configurationContext =
+                ConfigurationContextFactory.createConfigurationContextFromFileSystem(null,"conf/axis2.xml");
+                this.axisServer = new AxisServer();
+                this.axisServer.setConfigurationContext(configurationContext);
+                this.axisServer.deployService(MessageReceiveService.class.getName());
+                try {
+                Thread.sleep(2000);
+                } catch (InterruptedException e) {
+                }
+                } catch (AxisFault axisFault) {
+                axisFault.printStackTrace();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            }
+        </pre>
+
+        <h2>Send A Message To MessageReceiveService Service</h2>
+        <p>Now using axis2_client.xml as the config file a ConfigurationContext can be created and a message can be sent
+            to the service. Note that fist "in-only" message is sent and then "in-out" message is sent. Client stub is
+            generated from the above WSDL using WSDL-To-Java tool (when complied using build.xml at &amp; MB_HOME &amp;
+            /Samples/jmstransport using ant this will be done).
+        </p>
+        <p>Using WSO2 MB management console you can see how  MessageReceiveService queue is created. See Message Broker
+            Queues - User Guide for more information.</p>
+        <pre xml:space="preserve">
+
+            public void sendMessage(){
+            try {
+
+            ConfigurationContext configurationContext =
+            ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, "conf/axis2_client.xml");
+            MessageReceiveServiceStub stub = new MessageReceiveServiceStub(configurationContext,"http://localhost:8080/axis2/services/MessageReceiveService.MessageReceiveServiceHttpSoap11Endpoint/");
+            //first send the in only message
+            stub.receive("Test message to receive ");
+            // inout message
+            String response = stub.echo("Test message to echo");
+            System.out.println("Response ==> " + response);
+
+            try {
+            Thread.sleep(10000);
+            } catch (InterruptedException e) {
+            e.printStackTrace();
+            }
+            } catch (AxisFault axisFault) {
+            axisFault.printStackTrace();
+            } catch (java.rmi.RemoteException e) {
+            e.printStackTrace();
+            }
+            }
+        </pre>
+        <p>
+            The complete sample code demonstrating the scenario will be as follows.
+        </p>
+        <pre xml:space="preserve">
+            /*
+*  Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+*
+*  WSO2 Inc. licenses this file to you under the Apache License,
+*  Version 2.0 (the "License"); you may not use this file except
+*  in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*    http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.engine.AxisServer;
+import org.sample.transport.stub.MessageReceiveServiceStub;
+
+public class JMSTransportClient {
+        private AxisServer axisServer;
+        public void start(){
+            try {
+                ConfigurationContext configurationContext =
+                        ConfigurationContextFactory.createConfigurationContextFromFileSystem(null,"conf/axis2.xml");
+                this.axisServer = new AxisServer();
+                this.axisServer.setConfigurationContext(configurationContext);
+                this.axisServer.deployService(MessageReceiveService.class.getName());
+                try {
+                    Thread.sleep(2000);
+                } catch (InterruptedException e) {
+                }
+            } catch (AxisFault axisFault) {
+                axisFault.printStackTrace();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        public void stop(){
+            try {
+                this.axisServer.stop();
+            } catch (AxisFault axisFault) {
+                axisFault.printStackTrace();
+            }
+        }
+        public void sendMessage(){
+            try {
+
+                ConfigurationContext configurationContext =
+                        ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, "conf/axis2_client.xml");
+                MessageReceiveServiceStub stub = new                    MessageReceiveServiceStub(configurationContext,"http://localhost:8080/axis2/services/MessageReceiveService.MessageReceiveServiceHttpSoap11Endpoint/");
+                //first send the in only message
+                stub.receive("Test message to receive ");
+                // inout message
+                String response = stub.echo("Test message to echo");
+                System.out.println("Response ==> " + response);
+
+                try {
+                    Thread.sleep(10000);
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                }
+            } catch (AxisFault axisFault) {
+                axisFault.printStackTrace();
+            } catch (java.rmi.RemoteException e) {
+                e.printStackTrace();
+            }
+        }
+        public static void main(String[] args) {
+
+            JMSTransportClient jmsTransportClient = new JMSTransportClient();
+            jmsTransportClient.start();
+            jmsTransportClient.sendMessage();
+            jmsTransportClient.stop();
+        }
+
+    }
+        </pre>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0ab7c4aa/products/cloud_controller/docs/xdoc/setting_java_home.xml
----------------------------------------------------------------------
diff --git a/products/cloud_controller/docs/xdoc/setting_java_home.xml b/products/cloud_controller/docs/xdoc/setting_java_home.xml
new file mode 100644
index 0000000..e3c073a
--- /dev/null
+++ b/products/cloud_controller/docs/xdoc/setting_java_home.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~  Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+  ~
+  ~  WSO2 Inc. licenses this file to you under the Apache License,
+  ~  Version 2.0 (the "License"); you may not use this file except
+  ~  in compliance with the License.
+  ~  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<!DOCTYPE html
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+    <head>
+        <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
+        <title>How to setup JAVA_HOME environment variable in Windows</title>
+        <link href="css/mb-docs.css" rel="stylesheet"/>
+        <link href="styles/dist-docs.css" rel="stylesheet" type="text/css" media="all"/>
+    </head>
+    <body>
+        <h2>How to setup JAVA_HOME environment variable in Windows</h2>
+
+        <p>Please follow the instructions to set up JAVA_HOME environment variable in your computer.
+            First find out the installation folder of Java development kit (JDK) in your machine.
+            Let's
+            assume it is installed in the folder "C:/j2sdk1.4.2"
+        </p>
+
+        <ol>
+            <li>Right click on the My Computer icon on your desktop and select properties</li>
+            <li>Click the Advanced Tab</li>
+            <li>Click the Environment Variables button</li>
+            <li>Under System Variable, click New</li>
+            <li>Enter the variable name as JAVA_HOME</li>
+            <li>Enter the variable value as the install path for the Development Kit</li>
+            <li>Click OK</li>
+            <li>Click Apply Changes</li>
+
+        </ol>
+
+        <img src="images/set-java-home.jpg" width="802" height="590" alt=""/>
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0ab7c4aa/products/cloud_controller/docs/xdoc/user_guide.xml
----------------------------------------------------------------------
diff --git a/products/cloud_controller/docs/xdoc/user_guide.xml b/products/cloud_controller/docs/xdoc/user_guide.xml
new file mode 100644
index 0000000..ae3e733
--- /dev/null
+++ b/products/cloud_controller/docs/xdoc/user_guide.xml
@@ -0,0 +1,416 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+~ Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+~
+~ WSO2 Inc. licenses this file to you under the Apache License,
+~ Version 2.0 (the "License"); you may not use this file except
+~ in compliance with the License.
+~ You may obtain a copy of the License at
+~
+~ http://www.apache.org/licenses/LICENSE-2.0
+~
+~ Unless required by applicable law or agreed to in writing,
+~ software distributed under the License is distributed on an
+~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~ KIND, either express or implied. See the License for the
+~ specific language governing permissions and limitations
+~ under the License.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+    <head>
+        <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
+        <title>WSO2 MB - User Guide</title>
+        <link href="css/mb-docs.css" rel="stylesheet"/>
+        <link href="styles/dist-docs.css" rel="stylesheet" type="text/css"
+              media="all"/>
+    </head>
+
+    <body>
+        <p>[<a href="docs_index.html">Documentation Index</a>]
+        </p>
+        <h1>WSO2 Message Broker(MB) User Guide</h1>
+
+        <p>The goal of this guide is to provide guidelines to be followed
+            in order to get familiar with WSO2 Message Broker and the procedure
+            of using the features provided by the product.
+        </p>
+
+        <h2>Contents</h2>
+
+        <div class="toc">
+            <ul>
+                <li>
+                    <a href="#Introduction">Introduction to Message Broker</a>
+                </li>
+                <!--li><a href="#Sample">Stock Quote Sample</a> </li-->
+                <li>
+                    <a href="#References">References</a>
+                </li>
+            </ul>
+        </div>
+
+        <h2 id="Introduction">Introduction to Message Broker</h2>
+        <p>This gives a brief introduction of how message broker can be used
+            in publishing and receiving messages.
+        </p>
+
+        <p>
+            WSO2 Message Broker is basically consist of two major features.They are:
+        </p>
+        <ul>
+            <li>Pub/ Sub Feature</li>
+            <li>Message Broker Clustering feature</li>
+        </ul>
+
+        <h3>
+            Pub/Sub Feature
+        </h3>
+
+        <p>This feature of the WSO2 Message Broker provides the facility for users to route messages
+            to the required users. If we are explaining deeply,
+            there is a concept called 'Topic' and message routing is done on the base of that
+            topic. When a particular user want to publish
+            a message to a particular sector , he creates a topic with a name related to the
+            messages that he is going to pulish. As an example, if a particular
+            user want to publish messages related with sports news, he can create a topic with the
+            name 'SportsNews' and publish the messages to that topic.
+        </p>
+
+        <p>
+            When another particular user is interested on any topic in the topic tree, he can
+            subscribe to that topic and receive messages which are published
+            to that topic by the publisher. As in the above example, when a particular user is
+            interested on sports, he can subscribed to the topic 'SportsNews'
+            and get messages published to that topic.
+        </p>
+
+        <p>
+            <img src="images/MessageFlowDiagram.jpg"
+                 alt="Pub/Sub Message Flow"/>
+        </p>
+        <h3>How to use Pub/Sub Feature</h3>
+
+        <p>In WSO2 Message Broker , Pub/Sub feature is one of the two major features. Inorder to use
+            this feature , it is needed to create a Topic and subscribe to it.
+        </p>
+        <ul>
+            <li>Step 01</li>
+
+            <p>Login to the server</p>
+
+            <li>Step 02</li>
+
+            <p>Click on the 'Add' menu item under the 'Topics' menu to create a topic. To create a
+                topic , the only thing needed to be provided is the name of the topic.
+            </p>
+
+            <p>
+                <img src="images/topic_add.png"
+                     alt="Add Topic"/>
+            </p>
+
+            <li>Step 03</li>
+
+            <p>When you add a topic using the 'add' button , you will be directed to the 'Topic
+                Browser' page and you will see the topic tree.
+            </p>
+            <p>
+                <img src="images/topic_browser.png"
+                     alt="Topic Browser"/>
+            </p>
+
+            <p>Once you click on a topic in the topic tree , it will display all the available
+                operations on a topic.
+                Once you click on the 'Help' link on that page you will find the information on all
+                the operations available on the topic
+            </p>
+
+            <p>If you click on details link , you will find following page.</p>
+
+            <p>
+                <img src="images/topic_details.png"
+                     alt="Topic Details"/>
+            </p>
+
+            <li>Step 04</li>
+
+            <p>Once you click on the topic , you will get the following page.</p>
+            <p>
+                <img src="images/topic_browser_clicked.png"
+                     alt="Topic Details"/>
+            </p>
+
+
+            <p>Once you click on 'Subscribe' link on the above page, you will be directed to Add
+                subscriptions page.
+            </p>
+
+            <p>
+                <img src="images/topic_addSubscription.png"
+                     alt="Subscribe to topics"/>
+            </p>
+
+            <p>You can create a subscription to the topic by provide the information on subscription
+            </p>
+            <li>Topic</li>
+            <p>User does not need to specify the topic here , since its automatically sets up.</p>
+
+            <li>Subscription Mode</li>
+
+            <p>This is the mode of the subscription and there are three modes.</p>
+
+            <p>The default mode for the subscription is "Topic Only". With this mode , user creates
+                the
+                subscription only to the topic. In this mode subscribers only receive events which
+                are published only to the that topic.
+            </p>
+
+            <p>Next mode of subscription is "Topic and Immediate child". In this mode subscribers of
+                the topic
+                receives events published not only the specified topic but also to the immediate
+                child of that topic.
+            </p>
+
+            <p>Last mode of subscription is "Topic and Children". In this mode subscribers of the
+                specified
+                topic will receive events published to the specified topic and all its children
+            </p>
+
+            <li>Event Sink URL</li>
+            <p>This is the URL which the subscriber should provide to receive events published. When
+                events are
+                published to the topic, they are sent to the specified URL here.
+            </p>
+
+            <li>Expiration Time</li>
+            <p>Here user can specify the expiration time of the subscription. This is not a required
+                parameter and
+                if user leave it alone, subscription will never be expired.
+            </p>
+
+            <p>Note : You can create a simple axis2service and use it's URL as the EventSinkURL .
+                Inorder to create an axis2service ,
+            </p>
+            <ul>
+                <li>Browse the location : /wso2mb-1.0.0/samples/services/EventSinkService
+                </li>
+                <li>Type the command : ant</li>
+
+                <P>(This ant task will create a simple axis2service 'EventSinkService' and deploy it
+                    in the location :
+                    /wso2mb-1.0.0/repository/deployment/server/axis2services/ )
+                </P>
+            </ul>
+
+            <p>Now you can create a subscription by providing the Event Sink URL :
+                https://localhost:9443/services/EventSinkService/getOMElement
+            </p>
+
+            <p>Click on the button 'Subscribe' and it will create the subscription and list it in
+                the subscription table of that topic in topic details page.
+            </p>
+
+
+            <p>
+                <img src="images/topic_subscriptionDetails.png"
+                     alt="Topic subscription details"/>
+            </p>
+
+
+            <li>Step 05</li>
+
+            <p>At the end of the subscribing process , you can test whether the topic and the
+                subscriptions created are working fine.
+                In order to do that what you have to do is type a XML message in the provided text
+                box and under the 'Publish' section
+                of Topic Details page and click on 'Publish button'
+            </p>
+
+            <p>Then check the command line and you will be able to see the XML Message that you
+                types in the provided space.
+            </p>
+            <h3>Clustering support of WSO2 Message Broker</h3>
+            <p>
+            	WSO2 MB  is now supporting clustering. That means high availability and failover support
+            	is there. You can setup several Message Broker nodes and configure them up to work as a cluster 
+            	so that if one node is down message routing and handling will be taken over by other nodes in the cluster.
+            	At the same time overhead of routing messages is distributed among the Message Broker cluster nodes so
+            	that overall performance of Message Brokering goes up. Thus, having a lot of publishers and subscribers will
+            	not be a problem anymore as there is no significant performance degrade with the number of publishers, 
+            	subscribers and exchanges. Scalability is beyond you with WSO2 MB with combined resources you have. 
+            	Fault tolerance brings you great benefits in deployment apart from the performance gain. 
+            </p>
+
+            <p>
+                There are several cluster deployment models supported by WSO2 Message Broker. Read on them at <a href="deployment_guide.html">
+                Deployment guide
+                </a>
+                and choose the suitable deployment pattern for your use-case and enable clustering as described there.
+            </p>
+
+            <li>   Sample Scenario - This sample is based on Clustering Scenario 1, <a href="cluster_scenario_01.html">'Starting external cassandra server
+                   and zoo keeper server and point all broker nodes to them'</a>:
+                <ul>
+                    <li>
+                        In your local machine setup two WSO2 MB instances running with external Cassandra server and Zookeeper server
+                        (note that you can setup Cassandra and Zookeeper to run on the same machine). In order to do that in the second WSO2 MB
+                        instance define a port offset changing &lt;MB Home&gt;/repository/conf/carbon.xml (eg: set port offset to 1).
+                    </li>
+                    <li>
+                        We will call first broker instance MB1 (runs on port 5672) and the other MB2 (runs on port 5673).
+                    </li>
+                    <li>
+                        Using following JMS client make subscriptions to a queue "myQueue" at MB1.
+                        <pre xml:space="preserve">
+
+                        import javax.jms.*;
+                        import javax.naming.InitialContext;
+                        import javax.naming.NamingException;
+                        import java.util.Properties;
+
+                        public class ConsumeClient {
+                            public void consumeMessage() {
+
+                                Properties initialContextProperties = new Properties();
+                                initialContextProperties.put("java.naming.factory.initial",
+                                        "org.wso2.andes.jndi.PropertiesFileInitialContextFactory");
+                                String connectionString = "amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5672'";
+                                initialContextProperties.put("connectionfactory.qpidConnectionfactory", connectionString);
+                                initialContextProperties.put("queue.myQueue", "myQueue");
+
+                                try {
+                                    InitialContext initialContext = new InitialContext(initialContextProperties);
+                                    QueueConnectionFactory queueConnectionFactory
+                                            = (QueueConnectionFactory) initialContext.lookup("qpidConnectionfactory");
+                                    QueueConnection queueConnection = queueConnectionFactory.createQueueConnection();
+                                    queueConnection.start();
+
+                                    QueueSession queueSession = queueConnection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+                                    Destination destination = (Destination) initialContext.lookup("myQueue");
+
+                                    MessageConsumer messageConsumer = queueSession.createConsumer(destination);
+
+                                    TextMessage textMessage = (TextMessage) messageConsumer.receive();
+                                    System.out.println("Got message ==> " + textMessage.getText());
+
+                                    try {
+                                        Thread.sleep(9000);
+                                    } catch (Exception e) {
+                                        System.out.println(e);
+                                    }
+
+                                    messageConsumer.close();
+
+                                    queueSession.close();
+                                    queueConnection.stop();
+                                    queueConnection.close();
+
+                                } catch (NamingException e) {
+                                    e.printStackTrace();
+                                } catch (JMSException e) {
+                                    e.printStackTrace();
+                                }
+
+
+                            }
+
+                            public static void main(String[] args) {
+                                ConsumeClient sendConsumeClient = new ConsumeClient();
+                                sendConsumeClient.consumeMessage();
+                            }
+                        }
+
+                        </pre>
+
+                    </li>
+                    <li>
+                        Now using Message Sender described below, send a message to "myQueue" at MB2.
+
+                        <pre xml:space="preserve">
+
+                        import javax.jms.*;
+                        import javax.naming.InitialContext;
+                        import javax.naming.NamingException;
+                        import java.util.Properties;
+
+                        public class SendClient {
+                            public static void main(String[] args) {
+                                SendClient sendClient = new SendClient();
+                                sendClient.sendMessage();
+                            }
+
+                            public void sendMessage() {
+
+                                Properties initialContextProperties = new Properties();
+                                initialContextProperties.put("java.naming.factory.initial",
+                                        "org.wso2.andes.jndi.PropertiesFileInitialContextFactory");
+                                String connectionString = "amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5673'";
+                                initialContextProperties.put("connectionfactory.qpidConnectionfactory", connectionString);
+                                initialContextProperties.put("queue.myQueue", "myQueue");
+
+
+                                try {
+                                    InitialContext initialContext = new InitialContext(initialContextProperties);
+                                    QueueConnectionFactory queueConnectionFactory
+                                            = (QueueConnectionFactory) initialContext.lookup("qpidConnectionfactory");
+
+                                    QueueConnection queueConnection = queueConnectionFactory.createQueueConnection();
+                                    queueConnection.start();
+
+                                    QueueSession queueSession = queueConnection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+
+                                    TextMessage textMessage = queueSession.createTextMessage();
+                                    textMessage.setText("Test message");
+                                    System.out.println("Sending Message : " + textMessage.getText().length());
+
+                                    // Send message
+                                    Queue queue = (Queue) initialContext.lookup("myQueue");
+
+                                    QueueSender queueSender = queueSession.createSender(queue);
+                                    queueSender.send(textMessage);
+
+                                    // Housekeeping
+                                    queueSender.close();
+                                    queueSession.close();
+                                    queueConnection.stop();
+                                    queueConnection.close();
+
+                                } catch (NamingException e) {
+                                    e.printStackTrace();
+                                } catch (JMSException e) {
+                                    e.printStackTrace();
+                                }
+
+                            }
+                        }
+                        </pre>
+                    </li>
+                    <li>
+                        Now you can run the consumer to receive messages from MB1. You will notice that the message you have
+                        sent to MB2 can be received by MB1. Even if MB2 instance was destroyed message will be consumed to the consumer.
+                    </li>
+                </ul>
+            </li>
+            <li>
+                <p>Following is a typical deployment diagram for a Message Broker cluster setup.</p>
+
+                <img src="images/Deployment_Diagram.jpg"
+                     alt="A typical cluster deployment"/>
+            </li>
+        </ul>
+        <h2 id="References">References</h2>
+        <ul>
+            <li>
+                <a href="http://zookeeper.apache.org/">Apache Zookeeper
+                </a>
+            </li>
+            <li>
+                <a href="http://cassandra.apache.org/">Apache Cassandra
+                </a>
+            </li>
+        </ul>
+
+    </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0ab7c4aa/products/cloud_controller/modules/distribution/lib/home/images/bottom.gif
----------------------------------------------------------------------
diff --git a/products/cloud_controller/modules/distribution/lib/home/images/bottom.gif b/products/cloud_controller/modules/distribution/lib/home/images/bottom.gif
new file mode 100644
index 0000000..5679266
Binary files /dev/null and b/products/cloud_controller/modules/distribution/lib/home/images/bottom.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0ab7c4aa/products/cloud_controller/modules/distribution/lib/home/images/feature-01-icon.gif
----------------------------------------------------------------------
diff --git a/products/cloud_controller/modules/distribution/lib/home/images/feature-01-icon.gif b/products/cloud_controller/modules/distribution/lib/home/images/feature-01-icon.gif
new file mode 100644
index 0000000..b4ea8cd
Binary files /dev/null and b/products/cloud_controller/modules/distribution/lib/home/images/feature-01-icon.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0ab7c4aa/products/cloud_controller/modules/distribution/lib/home/images/intro-bg.gif
----------------------------------------------------------------------
diff --git a/products/cloud_controller/modules/distribution/lib/home/images/intro-bg.gif b/products/cloud_controller/modules/distribution/lib/home/images/intro-bg.gif
new file mode 100644
index 0000000..a38a0df
Binary files /dev/null and b/products/cloud_controller/modules/distribution/lib/home/images/intro-bg.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0ab7c4aa/products/cloud_controller/modules/distribution/lib/home/images/logo.gif
----------------------------------------------------------------------
diff --git a/products/cloud_controller/modules/distribution/lib/home/images/logo.gif b/products/cloud_controller/modules/distribution/lib/home/images/logo.gif
new file mode 100644
index 0000000..ee9beef
Binary files /dev/null and b/products/cloud_controller/modules/distribution/lib/home/images/logo.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0ab7c4aa/products/cloud_controller/modules/distribution/lib/home/images/register.gif
----------------------------------------------------------------------
diff --git a/products/cloud_controller/modules/distribution/lib/home/images/register.gif b/products/cloud_controller/modules/distribution/lib/home/images/register.gif
new file mode 100644
index 0000000..98c5362
Binary files /dev/null and b/products/cloud_controller/modules/distribution/lib/home/images/register.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0ab7c4aa/products/cloud_controller/modules/distribution/lib/home/images/title-bg.gif
----------------------------------------------------------------------
diff --git a/products/cloud_controller/modules/distribution/lib/home/images/title-bg.gif b/products/cloud_controller/modules/distribution/lib/home/images/title-bg.gif
new file mode 100644
index 0000000..2d539a7
Binary files /dev/null and b/products/cloud_controller/modules/distribution/lib/home/images/title-bg.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0ab7c4aa/products/cloud_controller/modules/distribution/lib/home/images/top.gif
----------------------------------------------------------------------
diff --git a/products/cloud_controller/modules/distribution/lib/home/images/top.gif b/products/cloud_controller/modules/distribution/lib/home/images/top.gif
new file mode 100644
index 0000000..9ed482c
Binary files /dev/null and b/products/cloud_controller/modules/distribution/lib/home/images/top.gif differ

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0ab7c4aa/products/cloud_controller/modules/distribution/lib/home/index.html
----------------------------------------------------------------------
diff --git a/products/cloud_controller/modules/distribution/lib/home/index.html b/products/cloud_controller/modules/distribution/lib/home/index.html
new file mode 100644
index 0000000..cc82a56
--- /dev/null
+++ b/products/cloud_controller/modules/distribution/lib/home/index.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+	<head>  <script type="text/javascript" src="../../carbon/googleanalytics/js/jquery.min.js"></script>
+                <script type="text/javascript" src="../../carbon/googleanalytics/js/googleAnalyticsProcessor.js"></script>
+		<meta http-equiv="content-type" content="text/html;charset=utf-8" />
+		<title>StratosLive</title>
+		<link href="style.css" rel="stylesheet" type="text/css" media="all" />
+		<link rel="icon" href="images/favicon.ico" type="image/x-icon"/>
+		<meta name="description" content="WSO2 is the lean enterprise middleware company, delivering the only complete open source enterprise SOA middleware stack available internally and in the cloud." />
+		<meta name="keywords" content="cloud, platform-as-a-service, PaaS" />
+	</head>
+
+	<body>
+		<div id="main-content">
+			<div id="header">
+				<div class="logo"><img src="images/logo.gif"/></div>
+			</div>
+			<div id="content">
+				<div class="intro">
+					<div class="register">
+						<a href="https://stratoslive.wso2.com/carbon/tenant-register/select_domain.jsp"><img src="images/register.gif"/></a>
+						<a href="../carbon/sso-acs/redirect_ajaxprocessor.jsp"><img src="images/sign-in.gif"/></a>
+					</div>
+					<p>WSO2 MB brings Event Driven Architecture capabilities to WSO2 Carbon platform. It provides WS-Eventing, JMS and SQS interfaces to client. It uses Apache Qpid as the underling broker which supports AMQP.</p>
+				</div>
+				<div class="clear"></div>
+				<div class="features">
+					<h2>Features</h2>
+					<div class="feature feature-left">
+						<img src="images/feature-01-icon.gif"/>
+						<h2>Bring CEP to SOA</h2>
+						<p>
+							Bring CEP to SOA by processing XML events and produce results as XML events.
+						</p>
+					</div>
+					<div class="feature">
+						<img src="images/feature-02-icon.gif"/>
+						<h2>Registry Storage</h2>
+						<p>
+							Ability to define different event streams, queries and out put streams and store them in the registry as a bucket.
+						</p>
+					</div>
+					<div class="feature">
+					 	<img src="images/feature-03-icon.gif"/>
+						<h2>Esper and Fusion</h2>
+						<p>
+							Support Esper and fusion back end runtimes.
+						</p>
+					</div>
+					<div class="clear"></div>				
+				</div>
+				<div class="clear"></div>
+			</div>
+			<div id="footer">
+				<div class="footer-links">
+					<a href="http://www.wso2.com/cloud/services/terms-of-use" target="_blank">Terms of Service</a> | <a href="http://www.wso2.com/cloud/services/privacy-policy" target="_blank">Privacy Policy</a> | <a href="http://www.wso2.com/cloud/services/support" target="_blank">Support</a>
+				</div>
+				<div class="powered">
+						<span>Powered by</span><img src="images/powered-logo.gif" alt="ESB"/>
+					</div>
+					<span class="copyright">&copy;stratoslive.wso2.com copyright 2010-2011 WSO2, Inc. </span>
+				</div>
+			</div>
+		</div>
+	</body>
+
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0ab7c4aa/products/cloud_controller/modules/distribution/lib/home/style.css
----------------------------------------------------------------------
diff --git a/products/cloud_controller/modules/distribution/lib/home/style.css b/products/cloud_controller/modules/distribution/lib/home/style.css
new file mode 100644
index 0000000..f91a662
--- /dev/null
+++ b/products/cloud_controller/modules/distribution/lib/home/style.css
@@ -0,0 +1,46 @@
+body { font-family: "Calibri","Lucida Grande","Lucida Sans","Microsoft Sans Serif","Lucida Sans Unicode","Verdana","Sans-serif","trebuchet ms"; font-size: .85em; line-height: 135%; color: #434343; margin: 0px; padding: 0px; background-color: #94C8EC;}
+
+p { }
+
+td { }
+
+a:link { text-decoration: none; }
+
+a:visited { text-decoration: none; }
+
+a:hover { text-decoration: none; }
+
+a:active { text-decoration: none; }
+
+a img { border: 0px; }
+div
+.clear { clear: both; }
+
+div#main-content { width: 960px; margin: auto; background-image: url(images/top.gif); background-repeat: no-repeat; background-position: left top; }
+
+div#header { height: 125px; }
+div.logo { float: left; margin-top: 35px; }
+div.sign-in { float: right;  margin-top: 35px; }
+
+div#content { background-color: #ffffff; background-image: url(images/content-bg.gif); background-repeat: repeat-y; background-position: left top; }
+
+div.intro { padding: 35px; padding-top: 10px; padding-bottom: 20px; font-size: 125%; line-height: 130%; float: left; background-image: url(images/intro-bg.gif); background-position: left bottom; background-repeat: no-repeat; }
+div.intro p { margin-top: 0px; margin-bottom: 0px; }
+
+div.register { float: right; margin-left: 40px; margin-top: 0px; margin-right: 0px; width: 400px; text-align: center;}
+div.register a img { margin-bottom: 7px; }
+div.register a:hover img { opacity:0.7;filter:alpha(opacity=70) }
+
+div.features { margin-top: 20px; }
+div.features h2 { margin-top: 0px; margin-bottom: 0px; font-size: 24px; color: #003A63; margin-left: 35px; margin-right: 35px; border-bottom: solid 0px #79BDE8; padding-bottom: 10px; background-image: url(images/title-bg.gif); background-repeat: no-repeat; background-position: left bottom; }
+div.feature { float: left; width: 230px; margin-left: 30px; margin-top: 7px; padding: 20px; text-align: left; }
+div.feature img { float: left; margin-right: 10px; width: 64px; }
+div.feature h2 { margin-top: 0px; margin-bottom: 7px; color: #0499CC; font-size: 140%; line-height: 110%; font-weight: normal; border-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-bottom: 0px; background-image: none; }
+div.feature p { margin-top: 0px; padding-top: 0px; }
+div.feature-left { margin-left: 41px; }
+
+div#footer { height: 80px; background-image: url(images/bottom.gif); background-position: left top; background-repeat: no-repeat; padding-top: 25px; }
+div#footer div.powered { color: #333333; float: right; font-size: 85%; margin-right: 10px; }
+div#footer div.powered span { float: left; line-height: 23px; margin-right: 5px; }
+div.footer-links { padding-bottom: 5px; padding-left: 10px; border-bottom: solid 1px #4E84C4; margin-bottom: 10px; color: #4E84C4; }
+div#footer span.copyright { font-size: 90%; padding-left: 10px; }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/0ab7c4aa/products/cloud_controller/modules/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/products/cloud_controller/modules/distribution/pom.xml b/products/cloud_controller/modules/distribution/pom.xml
new file mode 100644
index 0000000..0f6d699
--- /dev/null
+++ b/products/cloud_controller/modules/distribution/pom.xml
@@ -0,0 +1,272 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~  Copyright (c) 2009, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+  ~
+  ~  WSO2 Inc. licenses this file to you under the Apache License,
+  ~  Version 2.0 (the "License"); you may not use this file except
+  ~  in compliance with the License.
+  ~  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~  Unless required by applicable law or agreed to in writing,
+  ~  software distributed under the License is distributed on an
+  ~  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  KIND, either express or implied.  See the License for the
+  ~  specific language governing permissions and limitations
+  ~  under the License.
+  -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <parent>
+        <groupId>org.wso2.cc</groupId>
+        <artifactId>cc-parent</artifactId>
+        <version>1.0.1</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>wso2cc</artifactId>
+    <packaging>pom</packaging>
+    <name>WSO2 Cloud Controller - Distribution</name>
+    <url>http://wso2.org/projects/mb/java</url>
+    <description>WSO2 Cloud Controller - Distribution</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.rampart</groupId>
+            <artifactId>rampart</artifactId>
+            <version>${rampart.mar.version}</version>
+            <type>mar</type>
+        </dependency>
+        <dependency>
+            <groupId>slf4j.wso2</groupId>
+            <artifactId>slf4j</artifactId>
+            <version>${slf4j.wso2.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>1.2.17</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.andes.wso2</groupId>
+            <artifactId>andes-client</artifactId>
+	    <version>0.13.wso2v6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs.wso2</groupId>
+            <artifactId>geronimo-jms_1.1_spec</artifactId>
+	    <version>1.1.0.wso2v1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.event.client</artifactId>
+	    <version>4.1.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.event.client.stub</artifactId>
+	     <version>4.1.0</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <version>2.0-alpha-4</version>
+                <inherited>false</inherited>
+                <executions>
+                    <execution>
+                        <id>unpack-wso2carbon</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>unpack</goal>
+                        </goals>
+                        <configuration>
+                            <artifactItems>
+                                <artifactItem>
+                                    <groupId>org.wso2.carbon</groupId>
+                                    <artifactId>wso2carbon-core</artifactId>
+                                    <version>${carbon.kernel.version}</version>
+                                    <type>zip</type>
+                                    <overWrite>true</overWrite>
+                                    <outputDirectory>target</outputDirectory>
+                                </artifactItem>
+                            </artifactItems>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>1.1</version>
+                <executions>
+                    <execution>
+                        <id>extract-docs-from-components</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <property name="tempdir" value="target/docs-temp"/>
+                                <mkdir dir="${tempdir}"/>
+                                <unzip dest="${tempdir}">
+                                    <fileset dir="target">
+                                        <include name="wso2cc-${project.version}.zip"/>
+                                    </fileset>
+                                </unzip>
+                                <copy todir="target/wso2carbon-core-${carbon.kernel.version}/repository/components/"
+                                      overwrite="false">
+                                    <fileset
+                                            dir="${tempdir}/wso2cc-${project.version}/repository/components/">
+                                    </fileset>
+                                </copy>
+                                <unzip dest="${tempdir}">
+                                    <fileset
+                                            dir="target/wso2carbon-core-${carbon.kernel.version}/repository/components/plugins/">
+                                        <include name="*.ui*.jar"/>
+                                    </fileset>
+                                </unzip>
+                                <move todir="${tempdir}/web/" includeemptydirs="false">
+                                    <fileset dir="${tempdir}/web/">
+                                        <exclude name="**/yui/**"/>
+                                        <!--<exclude name="**/tenant-login/**"/>-->
+                                        <exclude name="**/codepress/**"/>
+                                        <exclude name="**/editarea/**"/>
+                                        <exclude name="**/ajax/**"/>
+                                        <exclude name="**/WEB-INF/**"/>
+                                        <include name="**/*.html"/>
+                                    </fileset>
+                                    <mapper type="glob" from="*.html" to="*.xml"/>
+                                </move>
+                                <mkdir dir="src/site/xdoc"/>
+                                <copy todir="src/site/xdoc" overwrite="false"
+                                      includeemptydirs="false">
+                                    <fileset dir="${tempdir}/web">
+                                        <exclude name="**/yui/**"/>
+                                        <exclude name="**/codepress/**"/>
+                                        <exclude name="**/editarea/**"/>
+                                        <exclude name="**/ajax/**"/>
+                                        <exclude name="**/WEB-INF/**"/>
+                                        <exclude name="**/*.html"/>
+                                        <exclude name="**/*.js"/>
+                                        <exclude name="**/*.jsp"/>
+                                        <exclude name="**/*.xsl"/>
+                                        <exclude name="*.*"/>
+                                    </fileset>
+                                </copy>
+                                <copy todir="src/site" overwrite="false" includeemptydirs="false">
+                                    <fileset dir="../../docs">
+                                    </fileset>
+                                </copy>
+                                <copy todir="target/site/" overwrite="false"
+                                      includeemptydirs="false">
+                                    <fileset dir="src/site/xdoc/">
+                                        <include name="**/images/*.*"/>
+                                    </fileset>
+                                </copy>
+                                <!--<delete dir="${tempdir}"/>-->
+                            </tasks>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>clean_target</id>
+                        <phase>install</phase>
+                        <configuration>
+                            <tasks>
+                                <delete dir="target/archive-tmp"/>
+                                <delete dir="target/dependency-maven-plugin-markers"/>
+                                <delete dir="target/maven-archiver"/>
+                                <delete dir="target/wso2carbon-core-${carbon.kernel.version}"/>
+                                <delete dir="target/sources"/>
+                                <delete dir="target/site"/>
+                                <delete dir="src/site"/>
+                            </tasks>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-site-plugin</artifactId>
+                <version>3.0</version>
+                <configuration>
+                    <reportPlugins>
+                        <plugin>
+                            <groupId>org.apache.maven.plugins</groupId>
+                            <artifactId>maven-project-info-reports-plugin</artifactId>
+                            <version>2.4</version>
+                            <reportSets>
+                                <reportSet>
+                                    <reports>
+                                        <report>index</report>
+                                    </reports>
+                                </reportSet>
+                            </reportSets>
+                        </plugin>
+                    </reportPlugins>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>site</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>pre_dist</id>
+                        <phase>test</phase>
+                        <goals>
+                            <goal>attached</goal>
+                        </goals>
+                        <configuration>
+                            <filters>
+                                <filter>${basedir}/src/main/assembly/filter.properties</filter>
+                            </filters>
+                            <descriptors>
+                                <descriptor>src/main/assembly/dist.xml</descriptor>
+                            </descriptors>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>dist</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>attached</goal>
+                        </goals>
+                        <configuration>
+                            <filters>
+                                <filter>${basedir}/src/main/assembly/filter.properties</filter>
+                            </filters>
+                            <descriptors>
+                                <descriptor>src/main/assembly/bin.xml</descriptor>
+                                <!--descriptor>src/main/assembly/src.xml</descriptor>
+                                <descriptor>src/main/assembly/docs.xml</descriptor-->
+                            </descriptors>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>