You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ch...@apache.org on 2007/02/12 11:56:17 UTC

svn commit: r506412 - in /webservices/axis2/branches/java/clustering/modules: cluster/conf/ cluster/src/org/apache/axis2/cluster/handlers/ cluster/src/org/apache/axis2/cluster/tribes/ kernel/src/org/apache/axis2/cluster/ kernel/src/org/apache/axis2/con...

Author: chamikara
Date: Mon Feb 12 02:56:16 2007
New Revision: 506412

URL: http://svn.apache.org/viewvc?view=rev&rev=506412
Log:
1. Chnaged signatures of the addContext, removeContext, updateState methods to take an AbstractContext. 

This makes the methods more general. IDs can be always obtained by going through the passed contexts correctly.

2. Added a flush() method to the AbstractContexst which calls the clusterManager.updateState() method when clustering is enabled. 

This allows serviceAuthors to write their code in a transparent manner. I.e. if they hv done their state changes with flush() calles they will not have to do any changes to make their services clusterable.

3. Moved the replication point of the execution chain into a Handler.

There is no need to hardcode this into the AxisEngine or MessageReceiver. By placing the ReplicationHandler anyware in the handler chain we can change the replication point as needed. Most probably this will be placed at the end of the flows.
(please see the clustering/conf/axis2.xml).

4. Added a isContextClusterable (AbstractContext) method to the CM.

ClusterManagers can say what contexts they are interested in clustering, this will be useful to the Service authors.

5. Moved the addContext() method calls out of the constructors of the Context classes.

It seems like it's better to have these outside. When we are in the constructor we do not have a fully initiated context object. For e.g. the serviceGroupContextId does not get setted at the time the SGC get created. 
Currently, this made me call clusterManager methods from several places of the core. But I was talking to Deepal about introducing some factories to create Context classes, which will make things much cleaner.

6. Removed the NullClusterManager - as we discussed in the mailing list.

Added:
    webservices/axis2/branches/java/clustering/modules/cluster/conf/
    webservices/axis2/branches/java/clustering/modules/cluster/conf/axis2.xml
    webservices/axis2/branches/java/clustering/modules/cluster/conf/client_axis2.xml
    webservices/axis2/branches/java/clustering/modules/cluster/src/org/apache/axis2/cluster/handlers/
    webservices/axis2/branches/java/clustering/modules/cluster/src/org/apache/axis2/cluster/handlers/ReplicationHandler.java
Removed:
    webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/cluster/NullClusterManager.java
Modified:
    webservices/axis2/branches/java/clustering/modules/cluster/src/org/apache/axis2/cluster/tribes/TribesClusterManager.java
    webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/cluster/ClusterManager.java
    webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/AbstractContext.java
    webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
    webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java
    webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/OperationContext.java
    webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ServiceContext.java
    webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java
    webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
    webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/deployment/ClusterBuilder.java
    webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
    webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/util/Utils.java

Added: webservices/axis2/branches/java/clustering/modules/cluster/conf/axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/clustering/modules/cluster/conf/axis2.xml?view=auto&rev=506412
==============================================================================
--- webservices/axis2/branches/java/clustering/modules/cluster/conf/axis2.xml (added)
+++ webservices/axis2/branches/java/clustering/modules/cluster/conf/axis2.xml Mon Feb 12 02:56:16 2007
@@ -0,0 +1,329 @@
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * 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.
+ */
+ -->
+ 
+<axisconfig name="AxisJava2.0">
+    <!-- ================================================= -->
+    <!-- Parameters -->
+    <!-- ================================================= -->
+    <parameter name="hotdeployment" locked="false">true</parameter>
+    <parameter name="hotupdate" locked="false">false</parameter>
+    <parameter name="enableMTOM" locked="false">false</parameter>
+    <parameter name="enableSwA" locked="false">false</parameter>
+
+    <!--Uncomment if you want to enable file caching for attachments -->
+    <!--parameter name="cacheAttachments" locked="false">true</parameter>
+    <parameter name="attachmentDIR" locked="false"></parameter>
+    <parameter name="sizeThreshold" locked="false">4000</parameter-->
+
+    <!--This will give out the timout of the configuration contexts, in seconds-->
+    <parameter name="ConfigContextTimeoutInterval" locked="false">30</parameter>
+
+    <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
+    <!--that behaviour.-->
+    <parameter name="sendStacktraceDetailsWithFaults" locked="false">false</parameter>
+
+    <!--If there aren't any information available to find out the fault reason, we set the message of the expcetion-->
+    <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
+    <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
+    <!--is set then, Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
+    <parameter name="DrillDownToRootCauseForFaultReason" locked="false">false</parameter>
+
+    <parameter name="userName" locked="false">admin</parameter>
+    <parameter name="password" locked="false">axis2</parameter>
+
+    <!--To override repository/services you need to uncomment following parameter and value SHOULD be absolute file path.-->
+    <!--<parameter name="ServicesDirectory" locked="false">service</parameter>-->
+    <!--To override repository/modules you need to uncomment following parameter and value SHOULD be absolute file path-->
+    <!--<parameter name="ModulesDirectory" locked="false">modules</parameter>-->
+
+
+
+    <!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
+    <!--root which can configured using the following contextRoot parameter-->
+    <!--<parameter name="contextRoot" locked="false">axis2</parameter>-->
+
+    <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distingiush those endpoints-->
+    <!--In case of a servlet, if you change this you have to manually change the settings of your servlet container to map this -->
+    <!--context path to proper Axis2 servlets-->
+    <!--<parameter name="servicePath" locked="false">services</parameter>-->
+    <!--<parameter name="restPath" locked="false">rest</parameter>-->
+
+
+    <!--Set the flag to true if you want to enable transport level session mangment-->
+    <parameter name="manageTransportSession" locked="false">false</parameter>
+
+    <!-- Following parameter will completely disable REST handling in Axis2-->
+    <parameter name="disableREST" locked="true">false</parameter>
+
+
+
+    <!-- clustering -->
+    <cluster class="org.apache.axis2.cluster.tribes.TribesClusterManager">
+    	
+    </cluster>
+    
+    <!-- If you have a frontend host which exposes this webservice using a different public URL  -->
+    <!-- use this parameter to override autodetected url -->
+    <!--<parameter name="httpFrontendHostUrl" locked="false">https://someotherhost/context</parameter>-->
+
+
+    <!--    The way of adding listener to the system-->
+    <!--    <listener class="org.apache.axis2.ObserverIMPL">-->
+    <!--        <parameter name="RSS_URL" locked="false">http://127.0.0.1/rss</parameter>-->
+    <!--    </listener>-->
+
+    <!-- ================================================= -->
+    <!-- Message Receivers -->
+    <!-- ================================================= -->
+    <!--This is the Deafult Message Receiver for the system , if you want to have MessageReceivers for -->
+    <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
+    <!--any operation -->
+    <!--Note : You can ovride this for particular service by adding the same element with your requirement-->
+    <messageReceivers>
+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
+                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
+                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+    </messageReceivers>
+    <!-- ================================================= -->
+    <!-- Transport Ins -->
+    <!-- ================================================= -->
+    <transportReceiver name="http"
+                       class="org.apache.axis2.transport.http.SimpleHTTPServer">
+        <parameter name="port" locked="false">8080</parameter>
+        <!-- Here is the complete list of supported parameters (see example settings further below):
+            port: the port to listen on (default 6060)
+            hostname:  if non-null, url prefix used in reply-to endpoint references                                 (default null)
+            originServer:  value of http Server header in outgoing messages                                         (default "Simple-Server/1.1")
+            requestTimeout:  value in millis of time that requests can wait for data                                (default 20000)
+            requestTcpNoDelay:  true to maximize performance and minimize latency                                   (default true)
+                                false to minimize bandwidth consumption by combining segments
+            requestCoreThreadPoolSize:  number of threads available for request processing (unless queue fills up)  (default 25)
+            requestMaxThreadPoolSize:  number of threads available for request processing if queue fills us         (default 150)
+                                       note that default queue never fills up:  see HttpFactory
+            threadKeepAliveTime:  time to keep threads in excess of core size alive while inactive                  (default 180)
+                                  note that no such threads can exist with default unbounded request queue
+            threadKeepAliveTimeUnit:  TimeUnit of value in threadKeepAliveTime (default SECONDS)                    (default SECONDS)
+        -->
+        <!-- <parameter name="hostname"                  locked="false">http://www.myApp.com/ws</parameter> -->
+        <!-- <parameter name="originServer"              locked="false">My-Server/1.1</parameter>           -->
+        <!-- <parameter name="requestTimeout"            locked="false">10000</parameter>                   -->
+        <!-- <parameter name="requestTcpNoDelay"         locked="false">false</parameter>                   -->
+        <!-- <parameter name="requestCoreThreadPoolSize" locked="false">50</parameter>                      -->
+        <!-- <parameter name="RequestMaxThreadPoolSize"  locked="false">100</parameter>                     -->
+        <!-- <parameter name="threadKeepAliveTime"       locked="false">240000</parameter>                  -->
+        <!-- <parameter name="threadKeepAliveTimeUnit"   locked="false">MILLISECONDS</parameter>            -->
+    </transportReceiver>
+    
+    <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
+    <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
+        <parameter name="myTopicConnectionFactory" locked="false">        	        	
+        	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>        	
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
+        </parameter>
+
+        <parameter name="myQueueConnectionFactory" locked="false">        	        	
+        	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>        	
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
+        </parameter>
+
+        <parameter name="default" locked="false">        	        	
+        	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>        	
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
+        </parameter>
+    </transportReceiver>-->
+
+    <!--Uncomment if you want to have SMTP transport support-->
+    <!--<transportReceiver name="mail" class="org.apache.axis2.transport.mail.SimpleMailListener">-->
+    <!--<parameter name="transport.mail.pop3.host" locked="false">127.0.0.1</parameter>-->
+    <!--<parameter name="transport.mail.pop3.user" locked="false">axis2</parameter>-->
+    <!--<parameter name="transport.mail.pop3.password" locked="false">axis2</parameter>-->
+    <!--<parameter name="transport.mail.pop3.port" locked="false">110</parameter>-->
+    <!--<parameter name="transport.mail.replyToAddress" locked="false">axis2@127.0.0.1</parameter>-->
+    <!--</transportReceiver>-->
+
+	<!--Uncomment if you want to have TCP transport support-->
+    <!--transportReceiver name="tcp"
+                       class="org.apache.axis2.transport.tcp.TCPServer">
+        <parameter name="port" locked="false">6060</parameter-->>
+        <!--If you want to give your own host address for EPR generation-->
+        <!--uncommet following paramter , and set as you required.-->
+        <!--<parameter name="hostname" locked="false">tcp://myApp.com/ws</parameter>-->
+    <!-- /transportReceiver -->
+
+    <!-- ================================================= -->
+    <!-- Transport Outs -->
+    <!-- ================================================= -->
+
+    <transportSender name="tcp"
+                     class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
+    <transportSender name="local"
+                     class="org.apache.axis2.transport.local.LocalTransportSender"/>
+    <transportSender name="http"
+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
+    </transportSender>
+    <transportSender name="https"
+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
+    </transportSender>
+    <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
+    <transportSender name="jms"
+                     class="org.apache.axis2.transport.jms.JMSSender"/>
+    -->
+
+    <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
+   <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
+       <parameter name="transport.mail.smtp.host" locked="false">127.0.0.1</parameter>
+       <parameter name="transport.mail.smtp.user" locked="false">axis2</parameter>
+       <parameter name="transport.mail.smtp.password" locked="false">axis2</parameter>
+       <parameter name="transport.mail.smtp.port" locked="false">25</parameter>
+   </transportSender>
+   -->
+
+    <!-- ================================================= -->
+    <!-- Global Modules  -->
+    <!-- ================================================= -->
+    <!-- Comment this to disable Addressing -->
+    <module ref="addressing"/>
+
+    <!--Configuring module , providing parameters for modules whether they refer or not-->
+    <!--<moduleConfig name="addressing">-->
+    <!--<parameter name="addressingPara" locked="false">N/A</parameter>-->
+    <!--</moduleConfig>-->
+
+    <!-- ================================================= -->
+    <!-- Phases  -->
+    <!-- ================================================= -->
+    <phaseOrder type="InFlow">
+        <!--  System pre defined phases       -->
+        <phase name="Transport">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+        </phase>
+        <phase name="Security"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.engine.AddressingBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.engine.RequestURIOperationDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="InstanceDispatcher"
+                     class="org.apache.axis2.engine.InstanceDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+        </phase>
+        <!--  System pre defined phases       -->
+        <!--   After Postdispatch phase module author or or service author can add any phase he want      -->
+        <phase name="OperationInPhase"/>
+		<phase name="soapmonitorPhase"/>
+		
+		<!-- This is a point of replication  -->
+		<phase name="Replication">
+            <handler name="ReplicationHandler"
+                     class="org.apache.axis2.cluster.handlers.ReplicationHandler">
+                <order phase="Replication"/>
+            </handler>
+        </phase>
+        
+    </phaseOrder>
+    
+    <phaseOrder type="OutFlow">
+        <!--      user can add his own phases to this area  -->
+	<phase name="soapmonitorPhase"/>
+        <phase name="OperationOutPhase"/>
+        <!--system predefined phase-->
+        <!--these phase will run irrespective of the service-->
+        <phase name="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+        <phase name="Security"/>
+        
+        <!-- This is a point of replication  -->
+        <phase name="Replication">
+            <handler name="ReplicationHandler"
+                     class="org.apache.axis2.cluster.handlers.ReplicationHandler">
+                <order phase="Replication"/>
+            </handler>
+        </phase>
+        
+        
+    </phaseOrder>
+    <phaseOrder type="InFaultFlow">
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.engine.AddressingBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.engine.RequestURIOperationDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="InstanceDispatcher"
+                     class="org.apache.axis2.engine.InstanceDispatcher">
+                <order phase="PostDispatch"/>
+            </handler>
+        </phase>
+        <!--      user can add his own phases to this area  -->
+        <phase name="OperationInFaultPhase"/>
+	<phase name="soapmonitorPhase"/>
+    </phaseOrder>
+    <phaseOrder type="OutFaultFlow">
+        <!--      user can add his own phases to this area  -->
+	<phase name="soapmonitorPhase"/>
+        <phase name="OperationOutFaultPhase"/>
+        <phase name="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+    </phaseOrder>
+</axisconfig>
+

Added: webservices/axis2/branches/java/clustering/modules/cluster/conf/client_axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/clustering/modules/cluster/conf/client_axis2.xml?view=auto&rev=506412
==============================================================================
--- webservices/axis2/branches/java/clustering/modules/cluster/conf/client_axis2.xml (added)
+++ webservices/axis2/branches/java/clustering/modules/cluster/conf/client_axis2.xml Mon Feb 12 02:56:16 2007
@@ -0,0 +1,302 @@
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * 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.
+ */
+ -->
+ 
+<axisconfig name="AxisJava2.0">
+    <!-- ================================================= -->
+    <!-- Parameters -->
+    <!-- ================================================= -->
+    <parameter name="hotdeployment" locked="false">true</parameter>
+    <parameter name="hotupdate" locked="false">false</parameter>
+    <parameter name="enableMTOM" locked="false">false</parameter>
+    <parameter name="enableSwA" locked="false">false</parameter>
+
+    <!--Uncomment if you want to enable file caching for attachments -->
+    <!--parameter name="cacheAttachments" locked="false">true</parameter>
+    <parameter name="attachmentDIR" locked="false"></parameter>
+    <parameter name="sizeThreshold" locked="false">4000</parameter-->
+
+    <!--This will give out the timout of the configuration contexts, in seconds-->
+    <parameter name="ConfigContextTimeoutInterval" locked="false">30</parameter>
+
+    <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
+    <!--that behaviour.-->
+    <parameter name="sendStacktraceDetailsWithFaults" locked="false">false</parameter>
+
+    <!--If there aren't any information available to find out the fault reason, we set the message of the expcetion-->
+    <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
+    <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
+    <!--is set then, Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
+    <parameter name="DrillDownToRootCauseForFaultReason" locked="false">false</parameter>
+
+    <parameter name="userName" locked="false">admin</parameter>
+    <parameter name="password" locked="false">axis2</parameter>
+
+    <!--To override repository/services you need to uncomment following parameter and value SHOULD be absolute file path.-->
+    <!--<parameter name="ServicesDirectory" locked="false">service</parameter>-->
+    <!--To override repository/modules you need to uncomment following parameter and value SHOULD be absolute file path-->
+    <!--<parameter name="ModulesDirectory" locked="false">modules</parameter>-->
+
+
+
+    <!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
+    <!--root which can configured using the following contextRoot parameter-->
+    <!--<parameter name="contextRoot" locked="false">axis2</parameter>-->
+
+    <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distingiush those endpoints-->
+    <!--In case of a servlet, if you change this you have to manually change the settings of your servlet container to map this -->
+    <!--context path to proper Axis2 servlets-->
+    <!--<parameter name="servicePath" locked="false">services</parameter>-->
+    <!--<parameter name="restPath" locked="false">rest</parameter>-->
+
+
+    <!--Set the flag to true if you want to enable transport level session mangment-->
+    <parameter name="manageTransportSession" locked="false">false</parameter>
+
+    <!-- Following parameter will completely disable REST handling in Axis2-->
+    <parameter name="disableREST" locked="true">false</parameter>
+    
+    <!-- If you have a frontend host which exposes this webservice using a different public URL  -->
+    <!-- use this parameter to override autodetected url -->
+    <!--<parameter name="httpFrontendHostUrl" locked="false">https://someotherhost/context</parameter>-->
+
+
+    <!--    The way of adding listener to the system-->
+    <!--    <listener class="org.apache.axis2.ObserverIMPL">-->
+    <!--        <parameter name="RSS_URL" locked="false">http://127.0.0.1/rss</parameter>-->
+    <!--    </listener>-->
+
+    <!-- ================================================= -->
+    <!-- Message Receivers -->
+    <!-- ================================================= -->
+    <!--This is the Deafult Message Receiver for the system , if you want to have MessageReceivers for -->
+    <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
+    <!--any operation -->
+    <!--Note : You can ovride this for particular service by adding the same element with your requirement-->
+    <messageReceivers>
+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
+                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
+                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+    </messageReceivers>
+    <!-- ================================================= -->
+    <!-- Transport Ins -->
+    <!-- ================================================= -->
+    <transportReceiver name="http"
+                       class="org.apache.axis2.transport.http.SimpleHTTPServer">
+        <parameter name="port" locked="false">8080</parameter>
+        <!-- Here is the complete list of supported parameters (see example settings further below):
+            port: the port to listen on (default 6060)
+            hostname:  if non-null, url prefix used in reply-to endpoint references                                 (default null)
+            originServer:  value of http Server header in outgoing messages                                         (default "Simple-Server/1.1")
+            requestTimeout:  value in millis of time that requests can wait for data                                (default 20000)
+            requestTcpNoDelay:  true to maximize performance and minimize latency                                   (default true)
+                                false to minimize bandwidth consumption by combining segments
+            requestCoreThreadPoolSize:  number of threads available for request processing (unless queue fills up)  (default 25)
+            requestMaxThreadPoolSize:  number of threads available for request processing if queue fills us         (default 150)
+                                       note that default queue never fills up:  see HttpFactory
+            threadKeepAliveTime:  time to keep threads in excess of core size alive while inactive                  (default 180)
+                                  note that no such threads can exist with default unbounded request queue
+            threadKeepAliveTimeUnit:  TimeUnit of value in threadKeepAliveTime (default SECONDS)                    (default SECONDS)
+        -->
+        <!-- <parameter name="hostname"                  locked="false">http://www.myApp.com/ws</parameter> -->
+        <!-- <parameter name="originServer"              locked="false">My-Server/1.1</parameter>           -->
+        <!-- <parameter name="requestTimeout"            locked="false">10000</parameter>                   -->
+        <!-- <parameter name="requestTcpNoDelay"         locked="false">false</parameter>                   -->
+        <!-- <parameter name="requestCoreThreadPoolSize" locked="false">50</parameter>                      -->
+        <!-- <parameter name="RequestMaxThreadPoolSize"  locked="false">100</parameter>                     -->
+        <!-- <parameter name="threadKeepAliveTime"       locked="false">240000</parameter>                  -->
+        <!-- <parameter name="threadKeepAliveTimeUnit"   locked="false">MILLISECONDS</parameter>            -->
+    </transportReceiver>
+    
+    <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
+    <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
+        <parameter name="myTopicConnectionFactory" locked="false">        	        	
+        	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>        	
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
+        </parameter>
+
+        <parameter name="myQueueConnectionFactory" locked="false">        	        	
+        	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>        	
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
+        </parameter>
+
+        <parameter name="default" locked="false">        	        	
+        	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>        	
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
+        </parameter>
+    </transportReceiver>-->
+
+    <!--Uncomment if you want to have SMTP transport support-->
+    <!--<transportReceiver name="mail" class="org.apache.axis2.transport.mail.SimpleMailListener">-->
+    <!--<parameter name="transport.mail.pop3.host" locked="false">127.0.0.1</parameter>-->
+    <!--<parameter name="transport.mail.pop3.user" locked="false">axis2</parameter>-->
+    <!--<parameter name="transport.mail.pop3.password" locked="false">axis2</parameter>-->
+    <!--<parameter name="transport.mail.pop3.port" locked="false">110</parameter>-->
+    <!--<parameter name="transport.mail.replyToAddress" locked="false">axis2@127.0.0.1</parameter>-->
+    <!--</transportReceiver>-->
+
+	<!--Uncomment if you want to have TCP transport support-->
+    <!--transportReceiver name="tcp"
+                       class="org.apache.axis2.transport.tcp.TCPServer">
+        <parameter name="port" locked="false">6060</parameter-->>
+        <!--If you want to give your own host address for EPR generation-->
+        <!--uncommet following paramter , and set as you required.-->
+        <!--<parameter name="hostname" locked="false">tcp://myApp.com/ws</parameter>-->
+    <!-- /transportReceiver -->
+
+    <!-- ================================================= -->
+    <!-- Transport Outs -->
+    <!-- ================================================= -->
+
+    <transportSender name="tcp"
+                     class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
+    <transportSender name="local"
+                     class="org.apache.axis2.transport.local.LocalTransportSender"/>
+    <transportSender name="http"
+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
+    </transportSender>
+    <transportSender name="https"
+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
+    </transportSender>
+    <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
+    <transportSender name="jms"
+                     class="org.apache.axis2.transport.jms.JMSSender"/>
+    -->
+
+    <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
+   <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
+       <parameter name="transport.mail.smtp.host" locked="false">127.0.0.1</parameter>
+       <parameter name="transport.mail.smtp.user" locked="false">axis2</parameter>
+       <parameter name="transport.mail.smtp.password" locked="false">axis2</parameter>
+       <parameter name="transport.mail.smtp.port" locked="false">25</parameter>
+   </transportSender>
+   -->
+
+    <!-- ================================================= -->
+    <!-- Global Modules  -->
+    <!-- ================================================= -->
+    <!-- Comment this to disable Addressing -->
+    <module ref="addressing"/>
+
+    <!--Configuring module , providing parameters for modules whether they refer or not-->
+    <!--<moduleConfig name="addressing">-->
+    <!--<parameter name="addressingPara" locked="false">N/A</parameter>-->
+    <!--</moduleConfig>-->
+
+    <!-- ================================================= -->
+    <!-- Phases  -->
+    <!-- ================================================= -->
+    <phaseOrder type="InFlow">
+        <!--  System pre defined phases       -->
+        <phase name="Transport">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+        </phase>
+        <phase name="Security"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.engine.AddressingBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.engine.RequestURIOperationDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="InstanceDispatcher"
+                     class="org.apache.axis2.engine.InstanceDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+        </phase>
+        <!--  System pre defined phases       -->
+        <!--   After Postdispatch phase module author or or service author can add any phase he want      -->
+        <phase name="OperationInPhase"/>
+	<phase name="soapmonitorPhase"/>
+    </phaseOrder>
+    <phaseOrder type="OutFlow">
+        <!--      user can add his own phases to this area  -->
+	<phase name="soapmonitorPhase"/>
+        <phase name="OperationOutPhase"/>
+        <!--system predefined phase-->
+        <!--these phase will run irrespective of the service-->
+        <phase name="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+        <phase name="Security"/>
+    </phaseOrder>
+    <phaseOrder type="InFaultFlow">
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.engine.AddressingBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.engine.RequestURIOperationDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="InstanceDispatcher"
+                     class="org.apache.axis2.engine.InstanceDispatcher">
+                <order phase="PostDispatch"/>
+            </handler>
+        </phase>
+        <!--      user can add his own phases to this area  -->
+        <phase name="OperationInFaultPhase"/>
+	<phase name="soapmonitorPhase"/>
+    </phaseOrder>
+    <phaseOrder type="OutFaultFlow">
+        <!--      user can add his own phases to this area  -->
+	<phase name="soapmonitorPhase"/>
+        <phase name="OperationOutFaultPhase"/>
+        <phase name="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+    </phaseOrder>
+</axisconfig>
+

Added: webservices/axis2/branches/java/clustering/modules/cluster/src/org/apache/axis2/cluster/handlers/ReplicationHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/clustering/modules/cluster/src/org/apache/axis2/cluster/handlers/ReplicationHandler.java?view=auto&rev=506412
==============================================================================
--- webservices/axis2/branches/java/clustering/modules/cluster/src/org/apache/axis2/cluster/handlers/ReplicationHandler.java (added)
+++ webservices/axis2/branches/java/clustering/modules/cluster/src/org/apache/axis2/cluster/handlers/ReplicationHandler.java Mon Feb 12 02:56:16 2007
@@ -0,0 +1,52 @@
+package org.apache.axis2.cluster.handlers;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.cluster.ClusterManager;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.context.ServiceGroupContext;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.handlers.AbstractHandler;
+
+public class ReplicationHandler extends AbstractHandler {
+
+	public InvocationResponse invoke(MessageContext msgContext)
+			throws AxisFault {
+		
+		replicateState(msgContext);
+		
+		return InvocationResponse.CONTINUE;
+	}
+
+	public void flowComplete(MessageContext msgContext) {
+		super.flowComplete(msgContext);
+		
+		replicateState(msgContext);
+	}
+
+	private void replicateState (MessageContext message) {
+		
+        ConfigurationContext configurationContext = message.getConfigurationContext();
+        AxisConfiguration axisConfiguration = configurationContext.getAxisConfiguration();
+        ClusterManager clusterManager = axisConfiguration.getClusterManager();
+        
+		if (clusterManager != null){
+			ServiceContext serviceContext = message.getServiceContext();
+			ServiceGroupContext serviceGroupContext = message.getServiceGroupContext();
+			
+			clusterManager.updateState(configurationContext);
+			
+			if (serviceGroupContext!=null) {
+				clusterManager.updateState(serviceGroupContext);
+			}
+			
+			if (serviceContext!=null) {
+				clusterManager.updateState(serviceContext);
+			}
+			
+		}
+		
+	}
+	
+}

Modified: webservices/axis2/branches/java/clustering/modules/cluster/src/org/apache/axis2/cluster/tribes/TribesClusterManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/clustering/modules/cluster/src/org/apache/axis2/cluster/tribes/TribesClusterManager.java?view=diff&rev=506412&r1=506411&r2=506412
==============================================================================
--- webservices/axis2/branches/java/clustering/modules/cluster/src/org/apache/axis2/cluster/tribes/TribesClusterManager.java (original)
+++ webservices/axis2/branches/java/clustering/modules/cluster/src/org/apache/axis2/cluster/tribes/TribesClusterManager.java Mon Feb 12 02:56:16 2007
@@ -72,9 +72,12 @@
 		}		
 	}
 
-	public void addContext(String contextId, String parentContextId, AbstractContext context) {
+	public void addContext(AbstractContext context) {
 		TribesCommandMessage comMsg = null;
 		
+		String contextId = getContextID(context);
+		String parentContextId = getContextID(context.getParent());
+		
 		// The ServiceContex does not define a contextId
 		// therefore the service name is used
 		if (context instanceof ServiceContext){
@@ -143,8 +146,12 @@
 		}
 	}*/
 
-	public void removeContext(String contextId, String parentContextId, AbstractContext context) {
+	public void removeContext(AbstractContext context) {
 		TribesCommandMessage comMsg = null;
+
+		String contextId = getContextID(context);
+		String parentContextId = getContextID(context.getParent());
+
 		if (context instanceof ServiceContext){
 			ctxManager.removeServiceContext(parentContextId, contextId);
 			comMsg = new TribesCommandMessage(CommandConstants.CREATE_SERVICE_GROUP_CONTEXT,
@@ -168,27 +175,29 @@
 		}
 	}*/
 	
-	public void updateState(ServiceContext ctx) {
+	public void updateState(AbstractContext context) {
 		
-		String parentId = ctx.getServiceGroupContext().getId();
-		String contextId = ctx.getAxisService().getName();
-		Map props = ctx.getProperties();
+		String contextId = getContextID(context);
+		String parentContextId = getContextID(context.getParent());
 
-		List<TribesMapEntryMessage> mapEntryMsgs = ctxManager.updateStateOnServiceContext(parentId, contextId, props);
+		Map props = context.getProperties();
 
-		for(TribesMapEntryMessage msg : mapEntryMsgs){
-			send(msg);
+		List<TribesMapEntryMessage> mapEntryMsgs = null;
+		
+		if (context instanceof ServiceContext) {
+			mapEntryMsgs = ctxManager.updateStateOnServiceContext(parentContextId, contextId, props);
+		} else if (context instanceof ServiceGroupContext) {
+			mapEntryMsgs = ctxManager.updateStateOnServiceGroupContext(contextId,props);		
 		}
 		
-		Map serviceGrpProps = ctx.getServiceGroupContext().getProperties();
-		mapEntryMsgs = ctxManager.updateStateOnServiceGroupContext(parentId,serviceGrpProps);		
-
-		for(TribesMapEntryMessage msg : mapEntryMsgs){
-			send(msg);
+		if (mapEntryMsgs!=null) {
+			for(TribesMapEntryMessage msg : mapEntryMsgs){
+				send(msg);
+			}
 		}
 		
 		TribesCommandMessage comMsg = new TribesCommandMessage(
-				CommandConstants.UPDATE_STATE, parentId, contextId, contextId);
+				CommandConstants.UPDATE_STATE, parentContextId, contextId, contextId);
 
 		send(comMsg);
 	}
@@ -303,4 +312,31 @@
 		log.debug("Member Payload" + member.getPayload());
 		log.debug("===============================\n");
 	}
+
+
+	public boolean isContextClusterable(AbstractContext context) {
+		
+		if ((context instanceof ConfigurationContext) ||
+			(context instanceof ServiceContext) ||
+			(context instanceof ServiceGroupContext)) {
+			return true;
+		}
+		
+		return false;
+	}
+	
+	private String getContextID (AbstractContext context) {
+		
+		String id = null;
+		
+		if (context instanceof ServiceContext) {
+			AxisService axisService = ((ServiceContext) context).getAxisService();
+			return axisService.getName();
+		} else if (context instanceof ServiceGroupContext) {
+			return ((ServiceGroupContext) context).getId();
+		}
+		
+		return id;
+	}
+	
 }

Modified: webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/cluster/ClusterManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/cluster/ClusterManager.java?view=diff&rev=506412&r1=506411&r2=506412
==============================================================================
--- webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/cluster/ClusterManager.java (original)
+++ webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/cluster/ClusterManager.java Mon Feb 12 02:56:16 2007
@@ -1,19 +1,24 @@
 package org.apache.axis2.cluster;
 
-import java.util.Map;
-
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.AbstractContext;
-import org.apache.axis2.context.ServiceContext;
 
 public interface ClusterManager {
 
 	public void init(ConfigurationContext context);
 
-	public void addContext(String contextId, String parentContextId, AbstractContext context);
+	public void addContext(AbstractContext context);
+	
+	public void removeContext(AbstractContext context);
 	
-	public void removeContext(String contextId, String parentContextId, AbstractContext context);
+	public void updateState(AbstractContext context);
 	
-	public void updateState(ServiceContext ctx);
+	/**
+	 * This can be used to limit the contexts that get replicated through the 'flush' method.
+	 * 
+	 * @param context
+	 * @return
+	 */
+	public boolean isContextClusterable (AbstractContext context);
 	
-}
+}
\ No newline at end of file

Modified: webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/AbstractContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/AbstractContext.java?view=diff&rev=506412&r1=506411&r2=506412
==============================================================================
--- webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/AbstractContext.java (original)
+++ webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/AbstractContext.java Mon Feb 12 02:56:16 2007
@@ -21,6 +21,7 @@
 import java.util.Iterator;
 import java.util.Map;
 
+import org.apache.axis2.AxisFault;
 import org.apache.axis2.cluster.ClusterManager;
 
 /**
@@ -37,13 +38,15 @@
 
     protected transient AbstractContext parent;
     protected transient Map properties;
+    
+    private boolean clustered;
 
     protected AbstractContext(AbstractContext parent) {
         this.properties = new HashMap();
         this.parent = parent;
     }
 
-    /**
+	/**
      * @return Returns AbstractContext.
      */
     public AbstractContext getParent() {
@@ -165,4 +168,55 @@
     public void setLastTouchedTime(long t) {
         lastTouchedTime = t;
     }
+    
+    public boolean isClustered() {
+		return clustered;
+	}
+
+    public void setClustered(boolean clustered) {
+		this.clustered = clustered;
+	}
+    
+    public void flush () throws AxisFault {
+    	
+    	//if clustering is enabled, ClusterManager will be called to replicate the context state.
+    	if (clustered) {
+    		
+    		ClusterManager clusterManager = null;
+    		
+    		if (this instanceof ConfigurationContext) {
+    			ConfigurationContext configurationContext = (ConfigurationContext) this;
+    			clusterManager = configurationContext.getAxisConfiguration().getClusterManager();
+    			
+    		} else if (this instanceof ServiceGroupContext) {
+    			ConfigurationContext configurationContext = (ConfigurationContext) this.getParent();
+    			if (configurationContext==null) {
+    				String message = "The parent of the ServiceGroupContext has not been set";
+    				throw new AxisFault (message);
+    			}
+    			
+    			clusterManager = configurationContext.getAxisConfiguration().getClusterManager();
+    			
+    		} else if (this instanceof ServiceContext) {
+    			ServiceGroupContext serviceGroupContext = (ServiceGroupContext) this.getParent();
+    			if (serviceGroupContext==null) {
+      				String message = "The parent of the ServiceContext has not been set";
+    				throw new AxisFault (message);
+    			}
+    			
+    			ConfigurationContext configurationContext = (ConfigurationContext) serviceGroupContext.getParent();
+    			if (serviceGroupContext==null) {
+      				String message = "The parent of the ServiceGroupContext has not been set";
+    				throw new AxisFault (message);
+    			}
+    			
+    			clusterManager = configurationContext.getAxisConfiguration().getClusterManager();
+    		}
+    		
+    		if (clusterManager!=null && clusterManager.isContextClusterable (this)) {
+    			clusterManager.updateState(this);
+    		}
+    	}
+    }
+    
 }

Modified: webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java?view=diff&rev=506412&r1=506411&r2=506412
==============================================================================
--- webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java (original)
+++ webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ConfigurationContext.java Mon Feb 12 02:56:16 2007
@@ -23,6 +23,7 @@
 import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.axiom.om.util.UUIDGenerator;
@@ -73,7 +74,8 @@
         this.axisConfiguration = axisConfiguration;
         initConfigContextTimeout(axisConfiguration);
 
-        initCluster();
+        if (axisConfiguration.getClusterManager()!=null)
+        	initCluster();
     }
 
     private void initCluster() {
@@ -136,14 +138,20 @@
                     if (axisServiceGroup == null) {
                         axisServiceGroup = (AxisServiceGroup) axisService.getParent();
                     }
-                    serviceGroupContext = new ServiceGroupContext(messageContext.getConfigurationContext(),
-                            axisServiceGroup);
+                    
+                    serviceGroupContext = new ServiceGroupContext(this, axisServiceGroup);
 
                     if (applicationSessionServiceGroupContextTable == null) {
                         applicationSessionServiceGroupContextTable = new Hashtable();
                     }
                     applicationSessionServiceGroupContextTable.put(serviceGroupName, serviceGroupContext);
-
+                    
+                    ClusterManager clusterManager = this.getAxisConfiguration().getClusterManager();
+                    if (clusterManager!=null) {
+                    	serviceGroupContext.setClustered(true);
+                    	clusterManager.addContext(serviceGroupContext);
+                    }
+                    
                 }
                 serviceContext = serviceGroupContext.getServiceContext(axisService);
 
@@ -171,6 +179,13 @@
 
                     // set the serviceGroupContextID
                     serviceGroupContext.setId(serviceGroupContextId);
+                    
+                    ClusterManager clusterManager = this.getAxisConfiguration().getClusterManager();
+                    if (clusterManager!=null) {
+                    	serviceGroupContext.setClustered(true);
+                    	clusterManager.addContext(serviceGroupContext);
+                    }
+                    
                 } else {
                     throw new AxisFault(Messages.getMessage("servicenotfound"));
                 }
@@ -615,4 +630,5 @@
         }
         return serviceGroupContextTimoutInterval;
     }
+    
 }

Modified: webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java?view=diff&rev=506412&r1=506411&r2=506412
==============================================================================
--- webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java (original)
+++ webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java Mon Feb 12 02:56:16 2007
@@ -18,6 +18,7 @@
 
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
+import org.apache.axis2.cluster.ClusterManager;
 import org.apache.axis2.deployment.*;
 import org.apache.axis2.deployment.util.Utils;
 import org.apache.axis2.description.AxisModule;
@@ -82,6 +83,13 @@
             if (Constants.SCOPE_APPLICATION.equals(maxScope)) {
                 ServiceGroupContext serviceGroupContext = new ServiceGroupContext(configCtx, axisServiceGroup);
                 configCtx.addServiceGroupContextintoApplicatoionScopeTable(serviceGroupContext);
+                
+                ClusterManager clusterManager = configCtx.getAxisConfiguration().getClusterManager();
+                if (clusterManager!=null) {
+                	serviceGroupContext.setClustered(true);
+                	clusterManager.addContext(serviceGroupContext);
+                }
+                
                 DependencyManager.initService(serviceGroupContext);
             }
         }

Modified: webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/OperationContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/OperationContext.java?view=diff&rev=506412&r1=506411&r2=506412
==============================================================================
--- webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/OperationContext.java (original)
+++ webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/OperationContext.java Mon Feb 12 02:56:16 2007
@@ -1196,4 +1196,5 @@
             log.warn(logCorrelationIDString+":"+methodname+"(): ****WARNING**** "+myClassName+".activate(configurationContext) needs to be invoked.");
         }
     }
+    
 }

Modified: webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ServiceContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ServiceContext.java?view=diff&rev=506412&r1=506411&r2=506412
==============================================================================
--- webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ServiceContext.java (original)
+++ webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ServiceContext.java Mon Feb 12 02:56:16 2007
@@ -146,9 +146,6 @@
         this.serviceGroupContext = serviceGroupContext;
         this.axisService = serviceConfig;
         this.configContext = (ConfigurationContext) parent.getParent();
-        
-        clusterManager = configContext.getAxisConfiguration().getClusterManager();
-        clusterManager.addContext(serviceConfig.getName(), serviceGroupContext.getId(),this);
     }
 
     public OperationContext createOperationContext(QName name) {

Modified: webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java?view=diff&rev=506412&r1=506411&r2=506412
==============================================================================
--- webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java (original)
+++ webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/context/ServiceGroupContext.java Mon Feb 12 02:56:16 2007
@@ -154,6 +154,12 @@
             serviceContext = new ServiceContext(service, this);
             serviceContextMap.put(service.getName(), serviceContext);
             
+            ClusterManager clusterManager = axisService.getAxisConfiguration().getClusterManager();
+            if (clusterManager!=null) {
+            	serviceContext.setClustered(true);
+            	clusterManager.addContext(serviceContext);
+            }
+            
             System.out.println("Added a new Service Ctx " + service.getName());
         }
         return serviceContext;
@@ -175,8 +181,6 @@
      */
     public void setId(String id) {
         this.id = id;
-        ClusterManager clusterManager = ((ConfigurationContext)this.getParent()).getAxisConfiguration().getClusterManager();
-        clusterManager.addContext(id, null,this);
     }
     
     /**

Modified: webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java?view=diff&rev=506412&r1=506411&r2=506412
==============================================================================
--- webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java (original)
+++ webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java Mon Feb 12 02:56:16 2007
@@ -20,7 +20,6 @@
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.cluster.NullClusterManager;
 import org.apache.axis2.deployment.util.PhasesInfo;
 import org.apache.axis2.deployment.util.Utils;
 import org.apache.axis2.description.*;
@@ -137,14 +136,12 @@
                 processDefaultModuleVersions(defaultModuleVerionElement);
             }
             
-            OMElement clusterElement = config_element.getFirstChildWithName(new QName(TAG_CLUSTER));
-            if (clusterElement != null) {
-	        ClusterBuilder clusterBuilder = new ClusterBuilder(axisConfig);
-	        clusterBuilder.buildCluster(clusterElement);
-	    }else {
-	        axisConfig.setClusterManager(new NullClusterManager());
-	    }
-
+            OMElement clusterElement = config_element
+					.getFirstChildWithName(new QName(TAG_CLUSTER));
+			if (clusterElement != null) {
+				ClusterBuilder clusterBuilder = new ClusterBuilder(axisConfig);
+				clusterBuilder.buildCluster(clusterElement);
+			}
             
             // process MessageBuilders
             OMElement messageBuildersElement = config_element.getFirstChildWithName(new QName(TAG_MESSAGE_BUILDERS));

Modified: webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/deployment/ClusterBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/deployment/ClusterBuilder.java?view=diff&rev=506412&r1=506411&r2=506412
==============================================================================
--- webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/deployment/ClusterBuilder.java (original)
+++ webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/deployment/ClusterBuilder.java Mon Feb 12 02:56:16 2007
@@ -23,7 +23,6 @@
 
 import org.apache.axiom.om.OMElement;
 import org.apache.axis2.cluster.ClusterManager;
-import org.apache.axis2.cluster.NullClusterManager;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.commons.logging.Log;
@@ -50,6 +49,7 @@
      */
     public void buildCluster(OMElement clusterElement)
 			throws DeploymentException {
+    	
 		String className = clusterElement.getAttribute(
 				new QName(TAG_CLASS_NAME)).getAttributeValue();
 		ClusterManager clusterManager;
@@ -59,15 +59,15 @@
 			axisConfig.setClusterManager(clusterManager);
 			return;
 		} catch (ClassNotFoundException e) {
-			log.error("Cluster implementation class not found", e);
+			String message = "Cluster implementation class not found";
+			throw new DeploymentException (message, e);
 		} catch (InstantiationException e) {
-			log.error("Cannot load Cluster implementation", e);
-			e.printStackTrace();
+			String message = "Cannot load Cluster implementation";
+			throw new DeploymentException (message, e);
 		} catch (IllegalAccessException e) {
-			log.error("", e);
+			throw new DeploymentException (e);
 		}
 
-		axisConfig.setClusterManager(new NullClusterManager());
 	}
 
 }

Modified: webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java?view=diff&rev=506412&r1=506411&r2=506412
==============================================================================
--- webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java (original)
+++ webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java Mon Feb 12 02:56:16 2007
@@ -27,7 +27,6 @@
 import org.apache.axiom.soap.SOAPHeaderBlock;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.client.async.Callback;
-import org.apache.axis2.cluster.ClusterManager;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.OperationContext;
@@ -201,15 +200,6 @@
           flowComplete(msgContext, true);
           throw e;
         }
-        
-        // Choosing this as the replication point.
-        ServiceContext ctx = msgContext.getServiceContext();
-        
-		if (ctx != null){
-			ClusterManager clusterManager = confContext.getAxisConfiguration()
-					.getClusterManager();
-			clusterManager.updateState(ctx);
-		}
         
         return InvocationResponse.CONTINUE;
     }

Modified: webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/util/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/util/Utils.java?view=diff&rev=506412&r1=506411&r2=506412
==============================================================================
--- webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/util/Utils.java (original)
+++ webservices/axis2/branches/java/clustering/modules/kernel/src/org/apache/axis2/util/Utils.java Mon Feb 12 02:56:16 2007
@@ -28,6 +28,7 @@
 import org.apache.axiom.soap.SOAPFault;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
+import org.apache.axis2.cluster.ClusterManager;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.ConfigurationContextFactory;
 import org.apache.axis2.context.MessageContext;
@@ -136,7 +137,18 @@
         serviceGroupContext.setId(serviceGroupContextId);
         configurationContext.registerServiceGroupContext(serviceGroupContext);
 
-        return new ServiceContext(axisService, serviceGroupContext);
+        ServiceContext serviceContext = new ServiceContext(axisService, serviceGroupContext);
+        
+        ClusterManager clusterManager = configurationContext.getAxisConfiguration().getClusterManager();
+        if (clusterManager!=null) {
+        	serviceGroupContext.setClustered(true);
+        	clusterManager.addContext(serviceGroupContext);
+        	
+        	serviceContext.setClustered(true);
+        	clusterManager.addContext(serviceContext);
+        }
+        
+        return serviceContext;
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org