ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chamik...@apache.org
Subject svn commit: r349924 [12/22] - in /webservices/site/trunk/targets/sandesha: ./ sandesha2/ sandesha2/images/ sandesha2/images/logos/ sandesha2/style/ sandesha2/xref-test/ sandesha2/xref-test/org/ sandesha2/xref-test/org/apache/ sandesha2/xref-test/org/ap...
Date Wed, 30 Nov 2005 11:17:58 GMT
Added: webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.html
URL: http://svn.apache.org/viewcvs/webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.html?rev=349924&view=auto
==============================================================================
--- webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.html (added)
+++ webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.html Wed Nov 30 03:11:01 2005
@@ -0,0 +1,411 @@
+<!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" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>ApplicationMsgProcessor xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../apidocs/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1">1</a>   <em class="comment">/*</em>
+<a name="2" href="#2">2</a>   <em class="comment"> * Copyright 1999-2004 The Apache Software Foundation.</em>
+<a name="3" href="#3">3</a>   <em class="comment"> * </em>
+<a name="4" href="#4">4</a>   <em class="comment"> * Licensed under the Apache License, Version 2.0 (the "License"); you may not</em>
+<a name="5" href="#5">5</a>   <em class="comment"> * use this file except in compliance with the License. You may obtain a copy of</em>
+<a name="6" href="#6">6</a>   <em class="comment"> * the License at</em>
+<a name="7" href="#7">7</a>   <em class="comment"> * </em>
+<a name="8" href="#8">8</a>   <em class="comment"> * <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a name="9" href="#9">9</a>   <em class="comment"> * </em>
+<a name="10" href="#10">10</a>  <em class="comment"> * Unless required by applicable law or agreed to in writing, software</em>
+<a name="11" href="#11">11</a>  <em class="comment"> * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT</em>
+<a name="12" href="#12">12</a>  <em class="comment"> * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the</em>
+<a name="13" href="#13">13</a>  <em class="comment"> * License for the specific language governing permissions and limitations under</em>
+<a name="14" href="#14">14</a>  <em class="comment"> * the License.</em>
+<a name="15" href="#15">15</a>  <em class="comment"> *  </em>
+<a name="16" href="#16">16</a>  <em class="comment"> */</em>
+<a name="17" href="#17">17</a>  
+<a name="18" href="#18">18</a>  <strong>package</strong> <a href="../../../../org/apache/sandesha2/msgprocessors/package-summary.html">org.apache.sandesha2.msgprocessors</a>;
+<a name="19" href="#19">19</a>  
+<a name="20" href="#20">20</a>  <strong>import</strong> java.util.ArrayList;
+<a name="21" href="#21">21</a>  <strong>import</strong> java.util.Collection;
+<a name="22" href="#22">22</a>  <strong>import</strong> java.util.Iterator;
+<a name="23" href="#23">23</a>  
+<a name="24" href="#24">24</a>  <strong>import</strong> javax.xml.namespace.QName;
+<a name="25" href="#25">25</a>  
+<a name="26" href="#26">26</a>  <strong>import</strong> org.apache.axis2.AxisFault;
+<a name="27" href="#27">27</a>  <strong>import</strong> org.apache.axis2.addressing.EndpointReference;
+<a name="28" href="#28">28</a>  <strong>import</strong> org.apache.axis2.context.ConfigurationContext;
+<a name="29" href="#29">29</a>  <strong>import</strong> org.apache.axis2.context.MessageContext;
+<a name="30" href="#30">30</a>  <strong>import</strong> org.apache.axis2.context.OperationContext;
+<a name="31" href="#31">31</a>  <strong>import</strong> org.apache.axis2.context.ServiceContext;
+<a name="32" href="#32">32</a>  <strong>import</strong> org.apache.axis2.context.ServiceGroupContext;
+<a name="33" href="#33">33</a>  <strong>import</strong> org.apache.axis2.description.AxisOperation;
+<a name="34" href="#34">34</a>  <strong>import</strong> org.apache.axis2.description.AxisOperationFactory;
+<a name="35" href="#35">35</a>  <strong>import</strong> org.apache.axis2.description.AxisService;
+<a name="36" href="#36">36</a>  <strong>import</strong> org.apache.axis2.description.AxisServiceGroup;
+<a name="37" href="#37">37</a>  <strong>import</strong> org.apache.axis2.engine.AxisConfiguration;
+<a name="38" href="#38">38</a>  <strong>import</strong> org.apache.axis2.engine.AxisEngine;
+<a name="39" href="#39">39</a>  <strong>import</strong> org.apache.axis2.soap.SOAPEnvelope;
+<a name="40" href="#40">40</a>  <strong>import</strong> org.apache.axis2.soap.SOAPFactory;
+<a name="41" href="#41">41</a>  <strong>import</strong> org.apache.sandesha2.Sandesha2Constants;
+<a name="42" href="#42">42</a>  <strong>import</strong> org.apache.sandesha2.RMMsgContext;
+<a name="43" href="#43">43</a>  <strong>import</strong> org.apache.sandesha2.SandeshaException;
+<a name="44" href="#44">44</a>  <strong>import</strong> org.apache.sandesha2.policy.RMPolicyBean;
+<a name="45" href="#45">45</a>  <strong>import</strong> org.apache.sandesha2.storage.StorageManager;
+<a name="46" href="#46">46</a>  <strong>import</strong> org.apache.sandesha2.storage.beanmanagers.NextMsgBeanMgr;
+<a name="47" href="#47">47</a>  <strong>import</strong> org.apache.sandesha2.storage.beanmanagers.SenderBeanMgr;
+<a name="48" href="#48">48</a>  <strong>import</strong> org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
+<a name="49" href="#49">49</a>  <strong>import</strong> org.apache.sandesha2.storage.beanmanagers.InvokerBeanMgr;
+<a name="50" href="#50">50</a>  <strong>import</strong> org.apache.sandesha2.storage.beans.NextMsgBean;
+<a name="51" href="#51">51</a>  <strong>import</strong> org.apache.sandesha2.storage.beans.SenderBean;
+<a name="52" href="#52">52</a>  <strong>import</strong> org.apache.sandesha2.storage.beans.SequencePropertyBean;
+<a name="53" href="#53">53</a>  <strong>import</strong> org.apache.sandesha2.storage.beans.InvokerBean;
+<a name="54" href="#54">54</a>  <strong>import</strong> org.apache.sandesha2.util.MsgInitializer;
+<a name="55" href="#55">55</a>  <strong>import</strong> org.apache.sandesha2.util.PropertyManager;
+<a name="56" href="#56">56</a>  <strong>import</strong> org.apache.sandesha2.util.RMMsgCreator;
+<a name="57" href="#57">57</a>  <strong>import</strong> org.apache.sandesha2.util.SOAPAbstractFactory;
+<a name="58" href="#58">58</a>  <strong>import</strong> org.apache.sandesha2.util.SandeshaUtil;
+<a name="59" href="#59">59</a>  <strong>import</strong> org.apache.sandesha2.wsrm.AckRequested;
+<a name="60" href="#60">60</a>  <strong>import</strong> org.apache.sandesha2.wsrm.LastMessage;
+<a name="61" href="#61">61</a>  <strong>import</strong> org.apache.sandesha2.wsrm.Sequence;
+<a name="62" href="#62">62</a>  <strong>import</strong> org.apache.sandesha2.wsrm.SequenceAcknowledgement;
+<a name="63" href="#63">63</a>  <strong>import</strong> org.apache.wsdl.WSDLConstants;
+<a name="64" href="#64">64</a>  
+<a name="65" href="#65">65</a>  <em>/**<em>*</em></em>
+<a name="66" href="#66">66</a>  <em> * Responsible for processing an incoming Application message.</em>
+<a name="67" href="#67">67</a>  <em> * </em>
+<a name="68" href="#68">68</a>  <em> * @author Chamikara Jayalath &lt;chamikaramj@gmail.com></em>
+<a name="69" href="#69">69</a>  <em> */</em>
+<a name="70" href="#70">70</a>  
+<a name="71" href="#71">71</a>  <strong>public</strong> <strong>class</strong> <a href="../../../../org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.html">ApplicationMsgProcessor</a> implements <a href="../../../../org/apache/sandesha2/msgprocessors/MsgProcessor.html">MsgProcessor</a> {
+<a name="72" href="#72">72</a>  
+<a name="73" href="#73">73</a>  	<strong>private</strong> <strong>boolean</strong> letInvoke = false;
+<a name="74" href="#74">74</a>  
+<a name="75" href="#75">75</a>  	<strong>public</strong> <strong>void</strong> processMessage(<a href="../../../../org/apache/sandesha2/RMMsgContext.html">RMMsgContext</a> rmMsgCtx) throws SandeshaException {
+<a name="76" href="#76">76</a>  
+<a name="77" href="#77">77</a>  		<em class="comment">//Processing for ack if any</em>
+<a name="78" href="#78">78</a>  		SequenceAcknowledgement sequenceAck = (SequenceAcknowledgement) rmMsgCtx
+<a name="79" href="#79">79</a>  				.getMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT);
+<a name="80" href="#80">80</a>  		<strong>if</strong> (sequenceAck != <strong>null</strong>) {
+<a name="81" href="#81">81</a>  			AcknowledgementProcessor ackProcessor = <strong>new</strong> <a href="../../../../org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.html">AcknowledgementProcessor</a>();
+<a name="82" href="#82">82</a>  			ackProcessor.processMessage(rmMsgCtx);
+<a name="83" href="#83">83</a>  		}
+<a name="84" href="#84">84</a>  
+<a name="85" href="#85">85</a>  		<em class="comment">//Processing the application message.</em>
+<a name="86" href="#86">86</a>  		MessageContext msgCtx = rmMsgCtx.getMessageContext();
+<a name="87" href="#87">87</a>  		<strong>if</strong> (msgCtx == <strong>null</strong>)
+<a name="88" href="#88">88</a>  			<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(<span class="string">"Message context is null"</span>);
+<a name="89" href="#89">89</a>  
+<a name="90" href="#90">90</a>  		<strong>if</strong> (rmMsgCtx.getProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE) != <strong>null</strong>
+<a name="91" href="#91">91</a>  				&amp;&amp; rmMsgCtx.getProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE)
+<a name="92" href="#92">92</a>  						.equals(<span class="string">"true"</span>)) {
+<a name="93" href="#93">93</a>  			<strong>return</strong>;
+<a name="94" href="#94">94</a>  		}
+<a name="95" href="#95">95</a>  
+<a name="96" href="#96">96</a>  		StorageManager storageManager = <a href="../../../../org/apache/sandesha2/util/SandeshaUtil.html">SandeshaUtil</a>
+<a name="97" href="#97">97</a>  				.getSandeshaStorageManager(rmMsgCtx.getMessageContext()
+<a name="98" href="#98">98</a>  						.getSystemContext());
+<a name="99" href="#99">99</a>  		SequencePropertyBeanMgr seqPropMgr = storageManager
+<a name="100" href="#100">100</a> 				.getSequencePropretyBeanMgr();
+<a name="101" href="#101">101</a> 
+<a name="102" href="#102">102</a> 		<em class="comment">//setting acked msg no range</em>
+<a name="103" href="#103">103</a> 		Sequence sequence = (Sequence) rmMsgCtx
+<a name="104" href="#104">104</a> 				.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
+<a name="105" href="#105">105</a> 		String sequenceId = sequence.getIdentifier().getIdentifier();
+<a name="106" href="#106">106</a> 		ConfigurationContext configCtx = rmMsgCtx.getMessageContext()
+<a name="107" href="#107">107</a> 				.getSystemContext();
+<a name="108" href="#108">108</a> 		<strong>if</strong> (configCtx == <strong>null</strong>)
+<a name="109" href="#109">109</a> 			<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(<span class="string">"Configuration Context is null"</span>);
+<a name="110" href="#110">110</a> 
+<a name="111" href="#111">111</a> 		SequencePropertyBean msgsBean = seqPropMgr.retrieve(sequenceId,
+<a name="112" href="#112">112</a> 				Sandesha2Constants.SequenceProperties.RECEIVED_MESSAGES);
+<a name="113" href="#113">113</a> 
+<a name="114" href="#114">114</a> 		<strong>long</strong> msgNo = sequence.getMessageNumber().getMessageNumber();
+<a name="115" href="#115">115</a> 		<strong>if</strong> (msgNo == 0)
+<a name="116" href="#116">116</a> 			<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(<span class="string">"Wrong message number"</span>);
+<a name="117" href="#117">117</a> 
+<a name="118" href="#118">118</a> 		String messagesStr = (String) msgsBean.getValue();
+<a name="119" href="#119">119</a> 
+<a name="120" href="#120">120</a> 		<strong>if</strong> (msgNoPresentInList(messagesStr, msgNo)
+<a name="121" href="#121">121</a> 				&amp;&amp; (Sandesha2Constants.QOS.InvocationType.DEFAULT_INVOCATION_TYPE == Sandesha2Constants.QOS.InvocationType.EXACTLY_ONCE)) {
+<a name="122" href="#122">122</a> 			<em class="comment">//this is a duplicate message and the invocation type is</em>
+<a name="123" href="#123">123</a> 			<em class="comment">// EXACTLY_ONCE.</em>
+<a name="124" href="#124">124</a> 
+<a name="125" href="#125">125</a> 			msgCtx.setPausedTrue(<strong>new</strong> QName(Sandesha2Constants.IN_HANDLER_NAME));
+<a name="126" href="#126">126</a> 
+<a name="127" href="#127">127</a> 		}
+<a name="128" href="#128">128</a> 
+<a name="129" href="#129">129</a> 		<strong>if</strong> (messagesStr != <span class="string">""</span> &amp;&amp; messagesStr != <strong>null</strong>)
+<a name="130" href="#130">130</a> 			messagesStr = messagesStr + <span class="string">","</span> + Long.toString(msgNo);
+<a name="131" href="#131">131</a> 		<strong>else</strong>
+<a name="132" href="#132">132</a> 			messagesStr = Long.toString(msgNo);
+<a name="133" href="#133">133</a> 
+<a name="134" href="#134">134</a> 		msgsBean.setValue(messagesStr);
+<a name="135" href="#135">135</a> 		seqPropMgr.update(msgsBean);
+<a name="136" href="#136">136</a> 
+<a name="137" href="#137">137</a> 		sendAckIfNeeded(rmMsgCtx, messagesStr);
+<a name="138" href="#138">138</a> 
+<a name="139" href="#139">139</a> 		<em class="comment">//	Pause the messages bean if not the right message to invoke.</em>
+<a name="140" href="#140">140</a> 		NextMsgBeanMgr mgr = storageManager.getNextMsgBeanMgr();
+<a name="141" href="#141">141</a> 		NextMsgBean bean = mgr.retrieve(sequenceId);
+<a name="142" href="#142">142</a> 
+<a name="143" href="#143">143</a> 		<strong>if</strong> (bean == <strong>null</strong>)
+<a name="144" href="#144">144</a> 			<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(<span class="string">"Error- The sequence does not exist"</span>);
+<a name="145" href="#145">145</a> 
+<a name="146" href="#146">146</a> 		InvokerBeanMgr storageMapMgr = storageManager.getStorageMapBeanMgr();
+<a name="147" href="#147">147</a> 
+<a name="148" href="#148">148</a> 		<strong>long</strong> nextMsgno = bean.getNextMsgNoToProcess();
+<a name="149" href="#149">149</a> 
+<a name="150" href="#150">150</a> 		<strong>if</strong> (msgCtx.isServerSide()) {
+<a name="151" href="#151">151</a> 			<strong>boolean</strong> inOrderInvocation = PropertyManager.getInstance().isInOrderInvocation();
+<a name="152" href="#152">152</a> 			<strong>if</strong> (inOrderInvocation) {
+<a name="153" href="#153">153</a> 				<em class="comment">//pause the message</em>
+<a name="154" href="#154">154</a> 				msgCtx.setPausedTrue(<strong>new</strong> QName(Sandesha2Constants.IN_HANDLER_NAME));
+<a name="155" href="#155">155</a> 
+<a name="156" href="#156">156</a> 				SequencePropertyBean incomingSequenceListBean = (SequencePropertyBean) seqPropMgr
+<a name="157" href="#157">157</a> 						.retrieve(
+<a name="158" href="#158">158</a> 								Sandesha2Constants.SequenceProperties.ALL_SEQUENCES,
+<a name="159" href="#159">159</a> 								Sandesha2Constants.SequenceProperties.INCOMING_SEQUENCE_LIST);
+<a name="160" href="#160">160</a> 
+<a name="161" href="#161">161</a> 				<strong>if</strong> (incomingSequenceListBean == <strong>null</strong>) {
+<a name="162" href="#162">162</a> 					ArrayList incomingSequenceList = <strong>new</strong> ArrayList();
+<a name="163" href="#163">163</a> 					incomingSequenceListBean = <strong>new</strong> <a href="../../../../org/apache/sandesha2/storage/beans/SequencePropertyBean.html">SequencePropertyBean</a>();
+<a name="164" href="#164">164</a> 					incomingSequenceListBean
+<a name="165" href="#165">165</a> 							.setSequenceId(Sandesha2Constants.SequenceProperties.ALL_SEQUENCES);
+<a name="166" href="#166">166</a> 					incomingSequenceListBean
+<a name="167" href="#167">167</a> 							.setName(Sandesha2Constants.SequenceProperties.INCOMING_SEQUENCE_LIST);
+<a name="168" href="#168">168</a> 					incomingSequenceListBean.setValue(incomingSequenceList);
+<a name="169" href="#169">169</a> 
+<a name="170" href="#170">170</a> 					seqPropMgr.insert(incomingSequenceListBean);
+<a name="171" href="#171">171</a> 				}
+<a name="172" href="#172">172</a> 
+<a name="173" href="#173">173</a> 				ArrayList incomingSequenceList = (ArrayList) incomingSequenceListBean
+<a name="174" href="#174">174</a> 						.getValue();
+<a name="175" href="#175">175</a> 
+<a name="176" href="#176">176</a> 				<em class="comment">//Adding current sequence to the incoming sequence List.</em>
+<a name="177" href="#177">177</a> 				<strong>if</strong> (!incomingSequenceList.contains(sequenceId)) {
+<a name="178" href="#178">178</a> 					incomingSequenceList.add(sequenceId);
+<a name="179" href="#179">179</a> 				}
+<a name="180" href="#180">180</a> 
+<a name="181" href="#181">181</a> 				<em class="comment">//saving the message.</em>
+<a name="182" href="#182">182</a> 				<strong>try</strong> {
+<a name="183" href="#183">183</a> 					String key = SandeshaUtil.storeMessageContext(rmMsgCtx
+<a name="184" href="#184">184</a> 							.getMessageContext());
+<a name="185" href="#185">185</a> 					storageMapMgr.insert(<strong>new</strong> <a href="../../../../org/apache/sandesha2/storage/beans/InvokerBean.html">InvokerBean</a>(key, msgNo,
+<a name="186" href="#186">186</a> 							sequenceId));
+<a name="187" href="#187">187</a> 
+<a name="188" href="#188">188</a> 					<em class="comment">//This will avoid performing application processing more</em>
+<a name="189" href="#189">189</a> 					<em class="comment">// than</em>
+<a name="190" href="#190">190</a> 					<em class="comment">// once.</em>
+<a name="191" href="#191">191</a> 					rmMsgCtx.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE,
+<a name="192" href="#192">192</a> 							<span class="string">"true"</span>);
+<a name="193" href="#193">193</a> 
+<a name="194" href="#194">194</a> 				} <strong>catch</strong> (Exception ex) {
+<a name="195" href="#195">195</a> 					<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(ex.getMessage());
+<a name="196" href="#196">196</a> 				}
+<a name="197" href="#197">197</a> 
+<a name="198" href="#198">198</a> 				<em class="comment">//Starting the invoker if stopped.</em>
+<a name="199" href="#199">199</a> 				SandeshaUtil.startInvokerIfStopped(msgCtx.getSystemContext());
+<a name="200" href="#200">200</a> 
+<a name="201" href="#201">201</a> 			}
+<a name="202" href="#202">202</a> 		}
+<a name="203" href="#203">203</a> 
+<a name="204" href="#204">204</a> 		<strong>try</strong> {
+<a name="205" href="#205">205</a> 			MessageContext requestMessage = rmMsgCtx.getMessageContext()
+<a name="206" href="#206">206</a> 					.getOperationContext().getMessageContext(
+<a name="207" href="#207">207</a> 							WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+<a name="208" href="#208">208</a> 			String requestMessageId = requestMessage.getMessageID();
+<a name="209" href="#209">209</a> 			SequencePropertyBean checkResponseBean = seqPropMgr.retrieve(
+<a name="210" href="#210">210</a> 					requestMessageId,
+<a name="211" href="#211">211</a> 					Sandesha2Constants.SequenceProperties.CHECK_RESPONSE);
+<a name="212" href="#212">212</a> 			<strong>if</strong> (checkResponseBean != <strong>null</strong>) {
+<a name="213" href="#213">213</a> 				checkResponseBean.setValue(msgCtx);
+<a name="214" href="#214">214</a> 				seqPropMgr.update(checkResponseBean);
+<a name="215" href="#215">215</a> 			}
+<a name="216" href="#216">216</a> 
+<a name="217" href="#217">217</a> 		} <strong>catch</strong> (AxisFault e) {
+<a name="218" href="#218">218</a> 			<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(e.getMessage());
+<a name="219" href="#219">219</a> 		}
+<a name="220" href="#220">220</a> 	}
+<a name="221" href="#221">221</a> 
+<a name="222" href="#222">222</a> 	<em class="comment">//TODO convert following from INT to LONG</em>
+<a name="223" href="#223">223</a> 	<strong>private</strong> <strong>boolean</strong> msgNoPresentInList(String list, <strong>long</strong> no) {
+<a name="224" href="#224">224</a> 		String[] msgStrs = list.split(<span class="string">","</span>);
+<a name="225" href="#225">225</a> 
+<a name="226" href="#226">226</a> 		<strong>int</strong> l = msgStrs.length;
+<a name="227" href="#227">227</a> 
+<a name="228" href="#228">228</a> 		<strong>for</strong> (<strong>int</strong> i = 0; i &lt; l; i++) {
+<a name="229" href="#229">229</a> 			<strong>if</strong> (msgStrs[i].equals(Long.toString(no)))
+<a name="230" href="#230">230</a> 				<strong>return</strong> <strong>true</strong>;
+<a name="231" href="#231">231</a> 		}
+<a name="232" href="#232">232</a> 
+<a name="233" href="#233">233</a> 		<strong>return</strong> false;
+<a name="234" href="#234">234</a> 	}
+<a name="235" href="#235">235</a> 
+<a name="236" href="#236">236</a> 	<strong>public</strong> <strong>void</strong> sendAckIfNeeded(<a href="../../../../org/apache/sandesha2/RMMsgContext.html">RMMsgContext</a> rmMsgCtx, String messagesStr)
+<a name="237" href="#237">237</a> 			throws <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a> {
+<a name="238" href="#238">238</a> 
+<a name="239" href="#239">239</a> 		MessageContext msgCtx = rmMsgCtx.getMessageContext();
+<a name="240" href="#240">240</a> 
+<a name="241" href="#241">241</a> 		SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(<a href="../../../../org/apache/sandesha2/util/SandeshaUtil.html">SandeshaUtil</a>
+<a name="242" href="#242">242</a> 				.getSOAPVersion(msgCtx.getEnvelope()));
+<a name="243" href="#243">243</a> 		StorageManager storageManager = <a href="../../../../org/apache/sandesha2/util/SandeshaUtil.html">SandeshaUtil</a>
+<a name="244" href="#244">244</a> 				.getSandeshaStorageManager(msgCtx.getSystemContext());
+<a name="245" href="#245">245</a> 		SequencePropertyBeanMgr seqPropMgr = storageManager
+<a name="246" href="#246">246</a> 				.getSequencePropretyBeanMgr();
+<a name="247" href="#247">247</a> 
+<a name="248" href="#248">248</a> 		Sequence sequence = (Sequence) rmMsgCtx
+<a name="249" href="#249">249</a> 				.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
+<a name="250" href="#250">250</a> 		String sequenceId = sequence.getIdentifier().getIdentifier();
+<a name="251" href="#251">251</a> 		ConfigurationContext configCtx = rmMsgCtx.getMessageContext()
+<a name="252" href="#252">252</a> 				.getSystemContext();
+<a name="253" href="#253">253</a> 		<strong>if</strong> (configCtx == <strong>null</strong>)
+<a name="254" href="#254">254</a> 			<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(<span class="string">"Configuration Context is null"</span>);
+<a name="255" href="#255">255</a> 
+<a name="256" href="#256">256</a> 		AckRequested ackRequested = (AckRequested) rmMsgCtx
+<a name="257" href="#257">257</a> 				.getMessagePart(Sandesha2Constants.MessageParts.ACK_REQUEST);
+<a name="258" href="#258">258</a> 		LastMessage lastMessage = (LastMessage) sequence.getLastMessage();
+<a name="259" href="#259">259</a> 
+<a name="260" href="#260">260</a> 		<em class="comment">//Setting the ack depending on AcksTo.</em>
+<a name="261" href="#261">261</a> 		SequencePropertyBean acksToBean = seqPropMgr.retrieve(sequenceId,
+<a name="262" href="#262">262</a> 				Sandesha2Constants.SequenceProperties.ACKS_TO_EPR);
+<a name="263" href="#263">263</a> 
+<a name="264" href="#264">264</a> 		EndpointReference acksTo = (EndpointReference) acksToBean.getValue();
+<a name="265" href="#265">265</a> 		String acksToStr = acksTo.getAddress();
+<a name="266" href="#266">266</a> 
+<a name="267" href="#267">267</a> 		<strong>if</strong> (acksToStr == <strong>null</strong> || messagesStr == <strong>null</strong>)
+<a name="268" href="#268">268</a> 			<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(
+<a name="269" href="#269">269</a> 					<span class="string">"Seqeunce properties are not set correctly"</span>);
+<a name="270" href="#270">270</a> 
+<a name="271" href="#271">271</a> 		<strong>if</strong> (Sandesha2Constants.WSA.NS_URI_ANONYMOUS.equals(acksTo.getAddress())) {
+<a name="272" href="#272">272</a> 			<em class="comment">// send ack in the sync case, only if the last message or the</em>
+<a name="273" href="#273">273</a> 			<em class="comment">// ackRequested tag is present.</em>
+<a name="274" href="#274">274</a> 			<strong>boolean</strong> ackRequired = false;
+<a name="275" href="#275">275</a> 			<strong>if</strong> (ackRequested != <strong>null</strong> || lastMessage != <strong>null</strong>)
+<a name="276" href="#276">276</a> 				ackRequired = <strong>true</strong>;
+<a name="277" href="#277">277</a> 
+<a name="278" href="#278">278</a> 			<strong>if</strong> (!ackRequired) {
+<a name="279" href="#279">279</a> 				<strong>return</strong>;
+<a name="280" href="#280">280</a> 			}
+<a name="281" href="#281">281</a> 		}
+<a name="282" href="#282">282</a> 		AxisOperation ackOperation = <strong>null</strong>;
+<a name="283" href="#283">283</a> 
+<a name="284" href="#284">284</a> 		<strong>try</strong> {
+<a name="285" href="#285">285</a> 			ackOperation = AxisOperationFactory
+<a name="286" href="#286">286</a> 					.getOperetionDescription(AxisOperationFactory.MEP_URI_IN_ONLY);
+<a name="287" href="#287">287</a> 		} <strong>catch</strong> (AxisFault e) {
+<a name="288" href="#288">288</a> 			<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(<span class="string">"Could not create the Operation"</span>);
+<a name="289" href="#289">289</a> 		}
+<a name="290" href="#290">290</a> 
+<a name="291" href="#291">291</a> 		AxisOperation rmMsgOperation = rmMsgCtx.getMessageContext()
+<a name="292" href="#292">292</a> 				.getAxisOperation();
+<a name="293" href="#293">293</a> 		<strong>if</strong> (rmMsgOperation != <strong>null</strong>) {
+<a name="294" href="#294">294</a> 			ArrayList outFlow = rmMsgOperation.getPhasesOutFlow();
+<a name="295" href="#295">295</a> 			<strong>if</strong> (outFlow != <strong>null</strong>) {
+<a name="296" href="#296">296</a> 				ackOperation.setPhasesOutFlow(outFlow);
+<a name="297" href="#297">297</a> 				ackOperation.setPhasesOutFaultFlow(outFlow);
+<a name="298" href="#298">298</a> 			}
+<a name="299" href="#299">299</a> 		}
+<a name="300" href="#300">300</a> 
+<a name="301" href="#301">301</a> 		MessageContext ackMsgCtx = SandeshaUtil.createNewRelatedMessageContext(
+<a name="302" href="#302">302</a> 				rmMsgCtx, ackOperation);
+<a name="303" href="#303">303</a> 		RMMsgContext ackRMMsgCtx = MsgInitializer.initializeMessage(ackMsgCtx);
+<a name="304" href="#304">304</a> 
+<a name="305" href="#305">305</a> 		ackMsgCtx.setMessageID(SandeshaUtil.getUUID());
+<a name="306" href="#306">306</a> 
+<a name="307" href="#307">307</a> 		<em class="comment">//Setting new envelope</em>
+<a name="308" href="#308">308</a> 		SOAPEnvelope envelope = factory.getDefaultEnvelope();
+<a name="309" href="#309">309</a> 		<strong>try</strong> {
+<a name="310" href="#310">310</a> 			ackMsgCtx.setEnvelope(envelope);
+<a name="311" href="#311">311</a> 		} <strong>catch</strong> (AxisFault e3) {
+<a name="312" href="#312">312</a> 			<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(e3.getMessage());
+<a name="313" href="#313">313</a> 		}
+<a name="314" href="#314">314</a> 
+<a name="315" href="#315">315</a> 		ackMsgCtx.setTo(acksTo);
+<a name="316" href="#316">316</a> 		ackMsgCtx.setReplyTo(msgCtx.getTo());
+<a name="317" href="#317">317</a> 		RMMsgCreator.addAckMessage(ackRMMsgCtx, sequenceId);
+<a name="318" href="#318">318</a> 
+<a name="319" href="#319">319</a> 		<strong>if</strong> (Sandesha2Constants.WSA.NS_URI_ANONYMOUS.equals(acksTo.getAddress())) {
+<a name="320" href="#320">320</a> 
+<a name="321" href="#321">321</a> 			AxisEngine engine = <strong>new</strong> AxisEngine(ackRMMsgCtx.getMessageContext()
+<a name="322" href="#322">322</a> 					.getSystemContext());
+<a name="323" href="#323">323</a> 
+<a name="324" href="#324">324</a> 			<em class="comment">//setting CONTEXT_WRITTEN since acksto is anonymous</em>
+<a name="325" href="#325">325</a> 			<strong>if</strong> (rmMsgCtx.getMessageContext().getOperationContext() == <strong>null</strong>) {
+<a name="326" href="#326">326</a> 				<em class="comment">//operation context will be null when doing in a GLOBAL</em>
+<a name="327" href="#327">327</a> 				<em class="comment">// handler.</em>
+<a name="328" href="#328">328</a> 				<strong>try</strong> {
+<a name="329" href="#329">329</a> 					AxisOperation op = AxisOperationFactory
+<a name="330" href="#330">330</a> 							.getAxisOperation(AxisOperationFactory.MEP_CONSTANT_IN_OUT);
+<a name="331" href="#331">331</a> 					OperationContext opCtx = <strong>new</strong> OperationContext(op);
+<a name="332" href="#332">332</a> 					rmMsgCtx.getMessageContext().setAxisOperation(op);
+<a name="333" href="#333">333</a> 					rmMsgCtx.getMessageContext().setOperationContext(opCtx);
+<a name="334" href="#334">334</a> 				} <strong>catch</strong> (AxisFault e2) {
+<a name="335" href="#335">335</a> 					<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(e2.getMessage());
+<a name="336" href="#336">336</a> 				}
+<a name="337" href="#337">337</a> 			}
+<a name="338" href="#338">338</a> 
+<a name="339" href="#339">339</a> 			rmMsgCtx.getMessageContext().getOperationContext().setProperty(
+<a name="340" href="#340">340</a> 					org.apache.axis2.Constants.RESPONSE_WRITTEN, <span class="string">"true"</span>);
+<a name="341" href="#341">341</a> 
+<a name="342" href="#342">342</a> 			rmMsgCtx.getMessageContext().setProperty(Sandesha2Constants.ACK_WRITTEN,
+<a name="343" href="#343">343</a> 					<span class="string">"true"</span>);
+<a name="344" href="#344">344</a> 			<strong>try</strong> {
+<a name="345" href="#345">345</a> 				engine.send(ackRMMsgCtx.getMessageContext());
+<a name="346" href="#346">346</a> 			} <strong>catch</strong> (AxisFault e1) {
+<a name="347" href="#347">347</a> 				<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(e1.getMessage());
+<a name="348" href="#348">348</a> 			}
+<a name="349" href="#349">349</a> 		} <strong>else</strong> {
+<a name="350" href="#350">350</a> 
+<a name="351" href="#351">351</a> 			SenderBeanMgr retransmitterBeanMgr = storageManager
+<a name="352" href="#352">352</a> 					.getRetransmitterBeanMgr();
+<a name="353" href="#353">353</a> 
+<a name="354" href="#354">354</a> 			String key = SandeshaUtil.storeMessageContext(ackMsgCtx);
+<a name="355" href="#355">355</a> 			SenderBean ackBean = <strong>new</strong> <a href="../../../../org/apache/sandesha2/storage/beans/SenderBean.html">SenderBean</a>();
+<a name="356" href="#356">356</a> 			ackBean.setKey(key);
+<a name="357" href="#357">357</a> 			ackBean.setMessageId(ackMsgCtx.getMessageID());
+<a name="358" href="#358">358</a> 			ackBean.setReSend(false);
+<a name="359" href="#359">359</a> 			ackBean.setSend(<strong>true</strong>);
+<a name="360" href="#360">360</a> 			ackBean.setMessagetype(Sandesha2Constants.MessageTypes.ACK);
+<a name="361" href="#361">361</a> 
+<a name="362" href="#362">362</a> 			<em class="comment">//the internalSequenceId value of the retransmitter Table for the</em>
+<a name="363" href="#363">363</a> 			<em class="comment">// messages related to an incoming</em>
+<a name="364" href="#364">364</a> 			<em class="comment">//sequence is the actual sequence ID</em>
+<a name="365" href="#365">365</a> 			ackBean.setInternalSequenceId(sequenceId);
+<a name="366" href="#366">366</a> 
+<a name="367" href="#367">367</a> 			RMPolicyBean policyBean = (RMPolicyBean) rmMsgCtx
+<a name="368" href="#368">368</a> 					.getProperty(Sandesha2Constants.WSP.RM_POLICY_BEAN);
+<a name="369" href="#369">369</a> 			<strong>long</strong> ackInterval = PropertyManager.getInstance().getAcknowledgementInterval();
+<a name="370" href="#370">370</a> 			<strong>if</strong> (policyBean != <strong>null</strong>) {
+<a name="371" href="#371">371</a> 				ackInterval = policyBean.getAcknowledgementInaterval();
+<a name="372" href="#372">372</a> 			}
+<a name="373" href="#373">373</a> 
+<a name="374" href="#374">374</a> 			<em class="comment">//Ack will be sent as stand alone, only after the retransmitter</em>
+<a name="375" href="#375">375</a> 			<em class="comment">// interval.</em>
+<a name="376" href="#376">376</a> 			<strong>long</strong> timeToSend = System.currentTimeMillis() + ackInterval;
+<a name="377" href="#377">377</a> 			ackBean.setTimeToSend(timeToSend);
+<a name="378" href="#378">378</a> 
+<a name="379" href="#379">379</a> 			<em class="comment">//removing old acks.</em>
+<a name="380" href="#380">380</a> 			SenderBean findBean = <strong>new</strong> <a href="../../../../org/apache/sandesha2/storage/beans/SenderBean.html">SenderBean</a>();
+<a name="381" href="#381">381</a> 			findBean.setMessagetype(Sandesha2Constants.MessageTypes.ACK);
+<a name="382" href="#382">382</a> 			findBean.setInternalSequenceId(sequenceId);
+<a name="383" href="#383">383</a> 			Collection coll = retransmitterBeanMgr.find(findBean);
+<a name="384" href="#384">384</a> 			Iterator it = coll.iterator();
+<a name="385" href="#385">385</a> 			<strong>while</strong> (it.hasNext()) {
+<a name="386" href="#386">386</a> 				SenderBean retransmitterBean = (SenderBean) it
+<a name="387" href="#387">387</a> 						.next();
+<a name="388" href="#388">388</a> 				retransmitterBeanMgr.delete(retransmitterBean.getMessageId());
+<a name="389" href="#389">389</a> 			}
+<a name="390" href="#390">390</a> 
+<a name="391" href="#391">391</a> 			<em class="comment">//inserting the new ack.</em>
+<a name="392" href="#392">392</a> 			retransmitterBeanMgr.insert(ackBean);
+<a name="393" href="#393">393</a> 
+<a name="394" href="#394">394</a> 			SandeshaUtil.startSenderIfStopped(configCtx);
+<a name="395" href="#395">395</a> 		}
+<a name="396" href="#396">396</a> 
+<a name="397" href="#397">397</a> 	}
+<a name="398" href="#398">398</a> }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Added: webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.html
URL: http://svn.apache.org/viewcvs/webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.html?rev=349924&view=auto
==============================================================================
--- webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.html (added)
+++ webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.html Wed Nov 30 03:11:01 2005
@@ -0,0 +1,194 @@
+<!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" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>CreateSeqMsgProcessor xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../apidocs/org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1">1</a>   <em class="comment">/*</em>
+<a name="2" href="#2">2</a>   <em class="comment"> * Copyright 1999-2004 The Apache Software Foundation.</em>
+<a name="3" href="#3">3</a>   <em class="comment"> * </em>
+<a name="4" href="#4">4</a>   <em class="comment"> * Licensed under the Apache License, Version 2.0 (the "License"); you may not</em>
+<a name="5" href="#5">5</a>   <em class="comment"> * use this file except in compliance with the License. You may obtain a copy of</em>
+<a name="6" href="#6">6</a>   <em class="comment"> * the License at</em>
+<a name="7" href="#7">7</a>   <em class="comment"> * </em>
+<a name="8" href="#8">8</a>   <em class="comment"> * <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a name="9" href="#9">9</a>   <em class="comment"> * </em>
+<a name="10" href="#10">10</a>  <em class="comment"> * Unless required by applicable law or agreed to in writing, software</em>
+<a name="11" href="#11">11</a>  <em class="comment"> * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT</em>
+<a name="12" href="#12">12</a>  <em class="comment"> * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the</em>
+<a name="13" href="#13">13</a>  <em class="comment"> * License for the specific language governing permissions and limitations under</em>
+<a name="14" href="#14">14</a>  <em class="comment"> * the License.</em>
+<a name="15" href="#15">15</a>  <em class="comment"> *  </em>
+<a name="16" href="#16">16</a>  <em class="comment"> */</em>
+<a name="17" href="#17">17</a>  
+<a name="18" href="#18">18</a>  <strong>package</strong> <a href="../../../../org/apache/sandesha2/msgprocessors/package-summary.html">org.apache.sandesha2.msgprocessors</a>;
+<a name="19" href="#19">19</a>  
+<a name="20" href="#20">20</a>  <strong>import</strong> javax.xml.namespace.QName;
+<a name="21" href="#21">21</a>  
+<a name="22" href="#22">22</a>  <strong>import</strong> org.apache.axis2.AxisFault;
+<a name="23" href="#23">23</a>  <strong>import</strong> org.apache.axis2.addressing.EndpointReference;
+<a name="24" href="#24">24</a>  <strong>import</strong> org.apache.axis2.context.ConfigurationContext;
+<a name="25" href="#25">25</a>  <strong>import</strong> org.apache.axis2.context.MessageContext;
+<a name="26" href="#26">26</a>  <strong>import</strong> org.apache.axis2.engine.AxisEngine;
+<a name="27" href="#27">27</a>  <strong>import</strong> org.apache.axis2.util.Utils;
+<a name="28" href="#28">28</a>  <strong>import</strong> org.apache.sandesha2.Sandesha2Constants;
+<a name="29" href="#29">29</a>  <strong>import</strong> org.apache.sandesha2.RMMsgContext;
+<a name="30" href="#30">30</a>  <strong>import</strong> org.apache.sandesha2.SandeshaException;
+<a name="31" href="#31">31</a>  <strong>import</strong> org.apache.sandesha2.storage.StorageManager;
+<a name="32" href="#32">32</a>  <strong>import</strong> org.apache.sandesha2.storage.beanmanagers.CreateSeqBeanMgr;
+<a name="33" href="#33">33</a>  <strong>import</strong> org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
+<a name="34" href="#34">34</a>  <strong>import</strong> org.apache.sandesha2.storage.beans.CreateSeqBean;
+<a name="35" href="#35">35</a>  <strong>import</strong> org.apache.sandesha2.storage.beans.SequencePropertyBean;
+<a name="36" href="#36">36</a>  <strong>import</strong> org.apache.sandesha2.util.RMMsgCreator;
+<a name="37" href="#37">37</a>  <strong>import</strong> org.apache.sandesha2.util.SandeshaUtil;
+<a name="38" href="#38">38</a>  <strong>import</strong> org.apache.sandesha2.util.SequenceManager;
+<a name="39" href="#39">39</a>  <strong>import</strong> org.apache.sandesha2.wsrm.Accept;
+<a name="40" href="#40">40</a>  <strong>import</strong> org.apache.sandesha2.wsrm.CreateSequence;
+<a name="41" href="#41">41</a>  <strong>import</strong> org.apache.sandesha2.wsrm.CreateSequenceResponse;
+<a name="42" href="#42">42</a>  <strong>import</strong> org.apache.sandesha2.wsrm.SequenceOffer;
+<a name="43" href="#43">43</a>  
+<a name="44" href="#44">44</a>  <em>/**<em>*</em></em>
+<a name="45" href="#45">45</a>  <em> * Responsible for processing an incoming Create Sequence message.</em>
+<a name="46" href="#46">46</a>  <em> * </em>
+<a name="47" href="#47">47</a>  <em> * @author Chamikara Jayalath &lt;chamikaramj@gmail.com></em>
+<a name="48" href="#48">48</a>  <em> */</em>
+<a name="49" href="#49">49</a>  
+<a name="50" href="#50">50</a>  <strong>public</strong> <strong>class</strong> <a href="../../../../org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.html">CreateSeqMsgProcessor</a> implements <a href="../../../../org/apache/sandesha2/msgprocessors/MsgProcessor.html">MsgProcessor</a> {
+<a name="51" href="#51">51</a>  
+<a name="52" href="#52">52</a>  	<strong>public</strong> <strong>void</strong> processMessage(<a href="../../../../org/apache/sandesha2/RMMsgContext.html">RMMsgContext</a> createSeqRMMsg)
+<a name="53" href="#53">53</a>  			throws <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a> {
+<a name="54" href="#54">54</a>  
+<a name="55" href="#55">55</a>  		MessageContext createSeqMsg = createSeqRMMsg.getMessageContext();
+<a name="56" href="#56">56</a>  		CreateSequence createSeqPart = (CreateSequence) createSeqRMMsg
+<a name="57" href="#57">57</a>  				.getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ);
+<a name="58" href="#58">58</a>  		<strong>if</strong> (createSeqPart == <strong>null</strong>)
+<a name="59" href="#59">59</a>  			<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(
+<a name="60" href="#60">60</a>  					<span class="string">"No create sequence part is present in the create sequence message"</span>);
+<a name="61" href="#61">61</a>  
+<a name="62" href="#62">62</a>  		MessageContext outMessage = <strong>null</strong>;
+<a name="63" href="#63">63</a>  		<strong>try</strong> {
+<a name="64" href="#64">64</a>  			outMessage = Utils.createOutMessageContext(createSeqMsg);
+<a name="65" href="#65">65</a>  		} <strong>catch</strong> (AxisFault e) {
+<a name="66" href="#66">66</a>  			<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(e.getMessage());
+<a name="67" href="#67">67</a>  		}
+<a name="68" href="#68">68</a>  
+<a name="69" href="#69">69</a>  		<strong>try</strong> {
+<a name="70" href="#70">70</a>  			String newSequenceId = <a href="../../../../org/apache/sandesha2/util/SequenceManager.html">SequenceManager</a>
+<a name="71" href="#71">71</a>  					.setupNewSequence(createSeqRMMsg);
+<a name="72" href="#72">72</a>  			ConfigurationContext context = createSeqRMMsg.getMessageContext()
+<a name="73" href="#73">73</a>  					.getSystemContext();
+<a name="74" href="#74">74</a>  			<strong>if</strong> (newSequenceId == <strong>null</strong>)
+<a name="75" href="#75">75</a>  				<strong>throw</strong> <strong>new</strong> AxisFault(
+<a name="76" href="#76">76</a>  						<span class="string">"Internal error - Generated sequence id is null"</span>);
+<a name="77" href="#77">77</a>  
+<a name="78" href="#78">78</a>  			RMMsgContext createSeqResponse = <a href="../../../../org/apache/sandesha2/util/RMMsgCreator.html">RMMsgCreator</a>
+<a name="79" href="#79">79</a>  					.createCreateSeqResponseMsg(createSeqRMMsg, outMessage,
+<a name="80" href="#80">80</a>  							newSequenceId);
+<a name="81" href="#81">81</a>  			CreateSequenceResponse createSeqResPart = (CreateSequenceResponse) createSeqResponse
+<a name="82" href="#82">82</a>  					.getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ_RESPONSE);
+<a name="83" href="#83">83</a>  
+<a name="84" href="#84">84</a>  			<em class="comment">//If an offer is accepted do necessary procesing.</em>
+<a name="85" href="#85">85</a>  			Accept accept = createSeqResPart.getAccept();
+<a name="86" href="#86">86</a>  			<strong>if</strong> (accept != <strong>null</strong>) {
+<a name="87" href="#87">87</a>  				SequenceOffer offer = createSeqPart.getSequenceOffer();
+<a name="88" href="#88">88</a>  				<strong>if</strong> (offer == <strong>null</strong>)
+<a name="89" href="#89">89</a>  					<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(
+<a name="90" href="#90">90</a>  							<span class="string">"Internal error - no offer for the response message with Accept"</span>);
+<a name="91" href="#91">91</a>  
+<a name="92" href="#92">92</a>  				<em class="comment">//Setting the CreateSequence table entry.</em>
+<a name="93" href="#93">93</a>  				String incomingSeqId = createSeqResPart.getIdentifier()
+<a name="94" href="#94">94</a>  						.getIdentifier();
+<a name="95" href="#95">95</a>  				String outSequenceId = offer.getIdentifer().getIdentifier();
+<a name="96" href="#96">96</a>  				CreateSeqBean createSeqBean = <strong>new</strong> <a href="../../../../org/apache/sandesha2/storage/beans/CreateSeqBean.html">CreateSeqBean</a>();
+<a name="97" href="#97">97</a>  				createSeqBean.setSequenceId(outSequenceId);
+<a name="98" href="#98">98</a>  				createSeqBean.setInternalSequenceId(newSequenceId);
+<a name="99" href="#99">99</a>  				createSeqBean.setCreateSeqMsgId(SandeshaUtil.getUUID()); <em class="comment">//this</em>
+<a name="100" href="#100">100</a> 				<em class="comment">// is a</em>
+<a name="101" href="#101">101</a> 				<em class="comment">// dummy</em>
+<a name="102" href="#102">102</a> 				<em class="comment">// value.</em>
+<a name="103" href="#103">103</a> 
+<a name="104" href="#104">104</a> 				StorageManager storageManager = <a href="../../../../org/apache/sandesha2/util/SandeshaUtil.html">SandeshaUtil</a>
+<a name="105" href="#105">105</a> 						.getSandeshaStorageManager(context);
+<a name="106" href="#106">106</a> 				CreateSeqBeanMgr createSeqMgr = storageManager
+<a name="107" href="#107">107</a> 						.getCreateSeqBeanMgr();
+<a name="108" href="#108">108</a> 
+<a name="109" href="#109">109</a> 				<em class="comment">//Setting sequence properties.</em>
+<a name="110" href="#110">110</a> 				SequencePropertyBeanMgr seqPropMgr = storageManager
+<a name="111" href="#111">111</a> 						.getSequencePropretyBeanMgr();
+<a name="112" href="#112">112</a> 				SequencePropertyBean outSequenceBean = <strong>new</strong> <a href="../../../../org/apache/sandesha2/storage/beans/SequencePropertyBean.html">SequencePropertyBean</a>();
+<a name="113" href="#113">113</a> 				outSequenceBean
+<a name="114" href="#114">114</a> 						.setName(Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID);
+<a name="115" href="#115">115</a> 				outSequenceBean.setValue(outSequenceId);
+<a name="116" href="#116">116</a> 				outSequenceBean.setSequenceId(newSequenceId);
+<a name="117" href="#117">117</a> 				seqPropMgr.insert(outSequenceBean);
+<a name="118" href="#118">118</a> 
+<a name="119" href="#119">119</a> 				<em class="comment">//Temp sequence id should be set for the server side.</em>
+<a name="120" href="#120">120</a> 				<em class="comment">//If internal sequence id is not set. this implies server side.</em>
+<a name="121" href="#121">121</a> 				SequencePropertyBean internalSeqBean = seqPropMgr.retrieve(
+<a name="122" href="#122">122</a> 						outSequenceId,
+<a name="123" href="#123">123</a> 						Sandesha2Constants.SequenceProperties.INTERNAL_SEQUENCE_ID);
+<a name="124" href="#124">124</a> 				<strong>if</strong> (internalSeqBean == <strong>null</strong>) {
+<a name="125" href="#125">125</a> 					SequencePropertyBean internalSequenceBean = <strong>new</strong> <a href="../../../../org/apache/sandesha2/storage/beans/SequencePropertyBean.html">SequencePropertyBean</a>();
+<a name="126" href="#126">126</a> 					internalSequenceBean
+<a name="127" href="#127">127</a> 							.setName(Sandesha2Constants.SequenceProperties.INTERNAL_SEQUENCE_ID);
+<a name="128" href="#128">128</a> 					internalSequenceBean.setSequenceId(outSequenceId);
+<a name="129" href="#129">129</a> 					internalSequenceBean.setValue(newSequenceId);
+<a name="130" href="#130">130</a> 					seqPropMgr.insert(internalSequenceBean);
+<a name="131" href="#131">131</a> 				}
+<a name="132" href="#132">132</a> 
+<a name="133" href="#133">133</a> 			}
+<a name="134" href="#134">134</a> 
+<a name="135" href="#135">135</a> 			CreateSequence createSeq = (CreateSequence) createSeqRMMsg
+<a name="136" href="#136">136</a> 					.getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ);
+<a name="137" href="#137">137</a> 			<strong>if</strong> (createSeq == <strong>null</strong>)
+<a name="138" href="#138">138</a> 				<strong>throw</strong> <strong>new</strong> AxisFault(
+<a name="139" href="#139">139</a> 						<span class="string">"Create sequence part not present in the create sequence message"</span>);
+<a name="140" href="#140">140</a> 
+<a name="141" href="#141">141</a> 			EndpointReference acksTo = createSeq.getAcksTo().getAddress()
+<a name="142" href="#142">142</a> 					.getEpr();
+<a name="143" href="#143">143</a> 			<strong>if</strong> (acksTo == <strong>null</strong> || acksTo.getAddress() == <strong>null</strong>
+<a name="144" href="#144">144</a> 					|| acksTo.getAddress() == <span class="string">""</span>)
+<a name="145" href="#145">145</a> 				<strong>throw</strong> <strong>new</strong> AxisFault(
+<a name="146" href="#146">146</a> 						<span class="string">"Acks to not present in the create sequence message"</span>);
+<a name="147" href="#147">147</a> 
+<a name="148" href="#148">148</a> 			SequencePropertyBean seqPropBean = <strong>new</strong> <a href="../../../../org/apache/sandesha2/storage/beans/SequencePropertyBean.html">SequencePropertyBean</a>(
+<a name="149" href="#149">149</a> 					newSequenceId, Sandesha2Constants.SequenceProperties.ACKS_TO_EPR,
+<a name="150" href="#150">150</a> 					acksTo);
+<a name="151" href="#151">151</a> 
+<a name="152" href="#152">152</a> 			StorageManager storageManager = <a href="../../../../org/apache/sandesha2/util/SandeshaUtil.html">SandeshaUtil</a>
+<a name="153" href="#153">153</a> 					.getSandeshaStorageManager(context);
+<a name="154" href="#154">154</a> 			SequencePropertyBeanMgr seqPropMgr = storageManager
+<a name="155" href="#155">155</a> 					.getSequencePropretyBeanMgr();
+<a name="156" href="#156">156</a> 			seqPropMgr.insert(seqPropBean);
+<a name="157" href="#157">157</a> 			outMessage.setResponseWritten(<strong>true</strong>);
+<a name="158" href="#158">158</a> 
+<a name="159" href="#159">159</a> 			Object obj1 = createSeqMsg.getOperationContext().getProperty(
+<a name="160" href="#160">160</a> 					org.apache.axis2.Constants.RESPONSE_WRITTEN);
+<a name="161" href="#161">161</a> 
+<a name="162" href="#162">162</a> 			AxisEngine engine = <strong>new</strong> AxisEngine(context);
+<a name="163" href="#163">163</a> 			engine.send(outMessage);
+<a name="164" href="#164">164</a> 
+<a name="165" href="#165">165</a> 			Object obj = createSeqMsg.getOperationContext().getProperty(
+<a name="166" href="#166">166</a> 					org.apache.axis2.Constants.RESPONSE_WRITTEN);
+<a name="167" href="#167">167</a> 			<strong>if</strong> (Sandesha2Constants.WSA.NS_URI_ANONYMOUS.equals(createSeqMsg.getReplyTo()
+<a name="168" href="#168">168</a> 					.getAddress())) {
+<a name="169" href="#169">169</a> 				createSeqMsg.getOperationContext().setProperty(
+<a name="170" href="#170">170</a> 						org.apache.axis2.Constants.RESPONSE_WRITTEN, <span class="string">"true"</span>);
+<a name="171" href="#171">171</a> 			} <strong>else</strong> {
+<a name="172" href="#172">172</a> 				createSeqMsg.getOperationContext().setProperty(
+<a name="173" href="#173">173</a> 						org.apache.axis2.Constants.RESPONSE_WRITTEN, <span class="string">"false"</span>);
+<a name="174" href="#174">174</a> 			}
+<a name="175" href="#175">175</a> 		} <strong>catch</strong> (AxisFault e1) {
+<a name="176" href="#176">176</a> 			<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(e1.getMessage());
+<a name="177" href="#177">177</a> 		}
+<a name="178" href="#178">178</a> 
+<a name="179" href="#179">179</a> 		createSeqMsg.setPausedTrue(<strong>new</strong> QName(Sandesha2Constants.IN_HANDLER_NAME));
+<a name="180" href="#180">180</a> 	}
+<a name="181" href="#181">181</a> }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Added: webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.html
URL: http://svn.apache.org/viewcvs/webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.html?rev=349924&view=auto
==============================================================================
--- webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.html (added)
+++ webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.html Wed Nov 30 03:11:01 2005
@@ -0,0 +1,213 @@
+<!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" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>CreateSeqResponseMsgProcessor xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../apidocs/org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1">1</a>   <em class="comment">/*</em>
+<a name="2" href="#2">2</a>   <em class="comment"> * Copyright 1999-2004 The Apache Software Foundation.</em>
+<a name="3" href="#3">3</a>   <em class="comment"> * </em>
+<a name="4" href="#4">4</a>   <em class="comment"> * Licensed under the Apache License, Version 2.0 (the "License"); you may not</em>
+<a name="5" href="#5">5</a>   <em class="comment"> * use this file except in compliance with the License. You may obtain a copy of</em>
+<a name="6" href="#6">6</a>   <em class="comment"> * the License at</em>
+<a name="7" href="#7">7</a>   <em class="comment"> * </em>
+<a name="8" href="#8">8</a>   <em class="comment"> * <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a name="9" href="#9">9</a>   <em class="comment"> * </em>
+<a name="10" href="#10">10</a>  <em class="comment"> * Unless required by applicable law or agreed to in writing, software</em>
+<a name="11" href="#11">11</a>  <em class="comment"> * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT</em>
+<a name="12" href="#12">12</a>  <em class="comment"> * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the</em>
+<a name="13" href="#13">13</a>  <em class="comment"> * License for the specific language governing permissions and limitations under</em>
+<a name="14" href="#14">14</a>  <em class="comment"> * the License.</em>
+<a name="15" href="#15">15</a>  <em class="comment"> *  </em>
+<a name="16" href="#16">16</a>  <em class="comment"> */</em>
+<a name="17" href="#17">17</a>  
+<a name="18" href="#18">18</a>  <strong>package</strong> <a href="../../../../org/apache/sandesha2/msgprocessors/package-summary.html">org.apache.sandesha2.msgprocessors</a>;
+<a name="19" href="#19">19</a>  
+<a name="20" href="#20">20</a>  <strong>import</strong> org.apache.sandesha2.Sandesha2Constants;
+<a name="21" href="#21">21</a>  <strong>import</strong> org.apache.sandesha2.RMMsgContext;
+<a name="22" href="#22">22</a>  <strong>import</strong> org.apache.sandesha2.SandeshaException;
+<a name="23" href="#23">23</a>  <strong>import</strong> org.apache.sandesha2.storage.StorageManager;
+<a name="24" href="#24">24</a>  <strong>import</strong> org.apache.sandesha2.storage.beanmanagers.CreateSeqBeanMgr;
+<a name="25" href="#25">25</a>  <strong>import</strong> org.apache.sandesha2.storage.beanmanagers.NextMsgBeanMgr;
+<a name="26" href="#26">26</a>  <strong>import</strong> org.apache.sandesha2.storage.beanmanagers.SenderBeanMgr;
+<a name="27" href="#27">27</a>  <strong>import</strong> org.apache.sandesha2.storage.beanmanagers.SequencePropertyBeanMgr;
+<a name="28" href="#28">28</a>  <strong>import</strong> org.apache.sandesha2.storage.beans.CreateSeqBean;
+<a name="29" href="#29">29</a>  <strong>import</strong> org.apache.sandesha2.storage.beans.NextMsgBean;
+<a name="30" href="#30">30</a>  <strong>import</strong> org.apache.sandesha2.storage.beans.SenderBean;
+<a name="31" href="#31">31</a>  <strong>import</strong> org.apache.sandesha2.storage.beans.SequencePropertyBean;
+<a name="32" href="#32">32</a>  <strong>import</strong> org.apache.sandesha2.util.MsgInitializer;
+<a name="33" href="#33">33</a>  <strong>import</strong> org.apache.sandesha2.util.SOAPAbstractFactory;
+<a name="34" href="#34">34</a>  <strong>import</strong> org.apache.sandesha2.util.SandeshaUtil;
+<a name="35" href="#35">35</a>  <strong>import</strong> org.apache.sandesha2.wsrm.Accept;
+<a name="36" href="#36">36</a>  <strong>import</strong> org.apache.sandesha2.wsrm.AckRequested;
+<a name="37" href="#37">37</a>  <strong>import</strong> org.apache.sandesha2.wsrm.CreateSequenceResponse;
+<a name="38" href="#38">38</a>  <strong>import</strong> org.apache.sandesha2.wsrm.Identifier;
+<a name="39" href="#39">39</a>  <strong>import</strong> org.apache.sandesha2.wsrm.Sequence;
+<a name="40" href="#40">40</a>  <strong>import</strong> org.apache.sandesha2.wsrm.SequenceAcknowledgement;
+<a name="41" href="#41">41</a>  <strong>import</strong> org.apache.axis2.AxisFault;
+<a name="42" href="#42">42</a>  <strong>import</strong> org.apache.axis2.addressing.EndpointReference;
+<a name="43" href="#43">43</a>  <strong>import</strong> org.apache.axis2.context.ConfigurationContext;
+<a name="44" href="#44">44</a>  <strong>import</strong> org.apache.axis2.context.MessageContext;
+<a name="45" href="#45">45</a>  <strong>import</strong> org.apache.axis2.soap.SOAPFactory;
+<a name="46" href="#46">46</a>  
+<a name="47" href="#47">47</a>  <strong>import</strong> java.util.Iterator;
+<a name="48" href="#48">48</a>  <strong>import</strong> javax.xml.namespace.QName;
+<a name="49" href="#49">49</a>  
+<a name="50" href="#50">50</a>  <em>/**<em>*</em></em>
+<a name="51" href="#51">51</a>  <em> * Responsible for processing an incoming Create Sequence Response message.</em>
+<a name="52" href="#52">52</a>  <em> * </em>
+<a name="53" href="#53">53</a>  <em> * @author Chamikara Jayalath &lt;chamikaramj@gmail.com></em>
+<a name="54" href="#54">54</a>  <em> */</em>
+<a name="55" href="#55">55</a>  
+<a name="56" href="#56">56</a>  <strong>public</strong> <strong>class</strong> <a href="../../../../org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.html">CreateSeqResponseMsgProcessor</a> implements <a href="../../../../org/apache/sandesha2/msgprocessors/MsgProcessor.html">MsgProcessor</a> {
+<a name="57" href="#57">57</a>  	<strong>public</strong> <strong>void</strong> processMessage(<a href="../../../../org/apache/sandesha2/RMMsgContext.html">RMMsgContext</a> createSeqResponseRMMsgCtx)
+<a name="58" href="#58">58</a>  			throws <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a> {
+<a name="59" href="#59">59</a>  
+<a name="60" href="#60">60</a>  		SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(<a href="../../../../org/apache/sandesha2/util/SandeshaUtil.html">SandeshaUtil</a>
+<a name="61" href="#61">61</a>  				.getSOAPVersion(createSeqResponseRMMsgCtx.getSOAPEnvelope()));
+<a name="62" href="#62">62</a>  
+<a name="63" href="#63">63</a>  		<em class="comment">//Processing for ack if any</em>
+<a name="64" href="#64">64</a>  		SequenceAcknowledgement sequenceAck = (SequenceAcknowledgement) createSeqResponseRMMsgCtx
+<a name="65" href="#65">65</a>  				.getMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT);
+<a name="66" href="#66">66</a>  		<strong>if</strong> (sequenceAck != <strong>null</strong>) {
+<a name="67" href="#67">67</a>  			AcknowledgementProcessor ackProcessor = <strong>new</strong> <a href="../../../../org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.html">AcknowledgementProcessor</a>();
+<a name="68" href="#68">68</a>  			ackProcessor.processMessage(createSeqResponseRMMsgCtx);
+<a name="69" href="#69">69</a>  		}
+<a name="70" href="#70">70</a>  
+<a name="71" href="#71">71</a>  		<em class="comment">//Processing the create sequence response.</em>
+<a name="72" href="#72">72</a>  		CreateSequenceResponse createSeqResponsePart = (CreateSequenceResponse) createSeqResponseRMMsgCtx
+<a name="73" href="#73">73</a>  				.getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ_RESPONSE);
+<a name="74" href="#74">74</a>  		<strong>if</strong> (createSeqResponsePart == <strong>null</strong>)
+<a name="75" href="#75">75</a>  			<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(<span class="string">"Create Sequence Response part is null"</span>);
+<a name="76" href="#76">76</a>  
+<a name="77" href="#77">77</a>  		String newOutSequenceId = createSeqResponsePart.getIdentifier()
+<a name="78" href="#78">78</a>  				.getIdentifier();
+<a name="79" href="#79">79</a>  		<strong>if</strong> (newOutSequenceId == <strong>null</strong>)
+<a name="80" href="#80">80</a>  			<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(<span class="string">"New sequence Id is null"</span>);
+<a name="81" href="#81">81</a>  
+<a name="82" href="#82">82</a>  		ConfigurationContext configCtx = createSeqResponseRMMsgCtx
+<a name="83" href="#83">83</a>  				.getMessageContext().getSystemContext();
+<a name="84" href="#84">84</a>  		String createSeqMsgId = createSeqResponseRMMsgCtx.getMessageContext()
+<a name="85" href="#85">85</a>  				.getRelatesTo().getValue();
+<a name="86" href="#86">86</a>  
+<a name="87" href="#87">87</a>  		StorageManager storageManager = <a href="../../../../org/apache/sandesha2/util/SandeshaUtil.html">SandeshaUtil</a>
+<a name="88" href="#88">88</a>  				.getSandeshaStorageManager(configCtx);
+<a name="89" href="#89">89</a>  
+<a name="90" href="#90">90</a>  		SenderBeanMgr retransmitterMgr = storageManager
+<a name="91" href="#91">91</a>  				.getRetransmitterBeanMgr();
+<a name="92" href="#92">92</a>  		CreateSeqBeanMgr createSeqMgr = storageManager.getCreateSeqBeanMgr();
+<a name="93" href="#93">93</a>  
+<a name="94" href="#94">94</a>  		CreateSeqBean createSeqBean = createSeqMgr.retrieve(createSeqMsgId);
+<a name="95" href="#95">95</a>  		<strong>if</strong> (createSeqBean == <strong>null</strong>)
+<a name="96" href="#96">96</a>  			<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(<span class="string">"Create Sequence entry is not found"</span>);
+<a name="97" href="#97">97</a>  
+<a name="98" href="#98">98</a>  		String internalSequenceId = createSeqBean.getInternalSequenceId();
+<a name="99" href="#99">99</a>  		<strong>if</strong> (internalSequenceId == <strong>null</strong> || <span class="string">""</span>.equals(internalSequenceId))
+<a name="100" href="#100">100</a> 			<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(<span class="string">"TempSequenceId has is not set"</span>);
+<a name="101" href="#101">101</a> 
+<a name="102" href="#102">102</a> 		<em class="comment">//deleting the create sequence entry.</em>
+<a name="103" href="#103">103</a> 		retransmitterMgr.delete(createSeqMsgId);
+<a name="104" href="#104">104</a> 
+<a name="105" href="#105">105</a> 		<em class="comment">//storing new out sequence id</em>
+<a name="106" href="#106">106</a> 		SequencePropertyBeanMgr sequencePropMgr = storageManager
+<a name="107" href="#107">107</a> 				.getSequencePropretyBeanMgr();
+<a name="108" href="#108">108</a> 		SequencePropertyBean outSequenceBean = <strong>new</strong> <a href="../../../../org/apache/sandesha2/storage/beans/SequencePropertyBean.html">SequencePropertyBean</a>(
+<a name="109" href="#109">109</a> 				internalSequenceId, Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID,
+<a name="110" href="#110">110</a> 				newOutSequenceId);
+<a name="111" href="#111">111</a> 		SequencePropertyBean internalSequenceBean = <strong>new</strong> <a href="../../../../org/apache/sandesha2/storage/beans/SequencePropertyBean.html">SequencePropertyBean</a>(
+<a name="112" href="#112">112</a> 				newOutSequenceId,
+<a name="113" href="#113">113</a> 				Sandesha2Constants.SequenceProperties.INTERNAL_SEQUENCE_ID, internalSequenceId);
+<a name="114" href="#114">114</a> 		sequencePropMgr.insert(outSequenceBean);
+<a name="115" href="#115">115</a> 		sequencePropMgr.insert(internalSequenceBean);
+<a name="116" href="#116">116</a> 
+<a name="117" href="#117">117</a> 		<em class="comment">//processing for accept (offer has been sent)</em>
+<a name="118" href="#118">118</a> 		Accept accept = createSeqResponsePart.getAccept();
+<a name="119" href="#119">119</a> 		<strong>if</strong> (accept != <strong>null</strong>) {
+<a name="120" href="#120">120</a> 			<em class="comment">//Find offered sequence from internal sequence id.</em>
+<a name="121" href="#121">121</a> 			SequencePropertyBean offeredSequenceBean = sequencePropMgr
+<a name="122" href="#122">122</a> 					.retrieve(internalSequenceId,
+<a name="123" href="#123">123</a> 							Sandesha2Constants.SequenceProperties.OFFERED_SEQUENCE);
+<a name="124" href="#124">124</a> 
+<a name="125" href="#125">125</a> 			<em class="comment">//TODO this should be detected in the Fault manager.</em>
+<a name="126" href="#126">126</a> 			<strong>if</strong> (offeredSequenceBean == <strong>null</strong>)
+<a name="127" href="#127">127</a> 				<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(
+<a name="128" href="#128">128</a> 						<span class="string">"No offered sequence. But an accept was received"</span>);
+<a name="129" href="#129">129</a> 
+<a name="130" href="#130">130</a> 			String offeredSequenceId = (String) offeredSequenceBean.getValue();
+<a name="131" href="#131">131</a> 
+<a name="132" href="#132">132</a> 			EndpointReference acksToEPR = accept.getAcksTo().getAddress()
+<a name="133" href="#133">133</a> 					.getEpr();
+<a name="134" href="#134">134</a> 			SequencePropertyBean acksToBean = <strong>new</strong> <a href="../../../../org/apache/sandesha2/storage/beans/SequencePropertyBean.html">SequencePropertyBean</a>();
+<a name="135" href="#135">135</a> 			acksToBean.setName(Sandesha2Constants.SequenceProperties.ACKS_TO_EPR);
+<a name="136" href="#136">136</a> 			acksToBean.setSequenceId(offeredSequenceId);
+<a name="137" href="#137">137</a> 			acksToBean.setValue(acksToEPR);
+<a name="138" href="#138">138</a> 
+<a name="139" href="#139">139</a> 			sequencePropMgr.insert(acksToBean);
+<a name="140" href="#140">140</a> 
+<a name="141" href="#141">141</a> 			NextMsgBean nextMsgBean = <strong>new</strong> <a href="../../../../org/apache/sandesha2/storage/beans/NextMsgBean.html">NextMsgBean</a>();
+<a name="142" href="#142">142</a> 			nextMsgBean.setSequenceId(offeredSequenceId);
+<a name="143" href="#143">143</a> 			nextMsgBean.setNextMsgNoToProcess(1);
+<a name="144" href="#144">144</a> 
+<a name="145" href="#145">145</a> 			NextMsgBeanMgr nextMsgMgr = storageManager.getNextMsgBeanMgr();
+<a name="146" href="#146">146</a> 			nextMsgMgr.insert(nextMsgBean);
+<a name="147" href="#147">147</a> 		}
+<a name="148" href="#148">148</a> 
+<a name="149" href="#149">149</a> 		SenderBean target = <strong>new</strong> <a href="../../../../org/apache/sandesha2/storage/beans/SenderBean.html">SenderBean</a>();
+<a name="150" href="#150">150</a> 		target.setInternalSequenceId(internalSequenceId);
+<a name="151" href="#151">151</a> 
+<a name="152" href="#152">152</a> 		Iterator iterator = retransmitterMgr.find(target).iterator();
+<a name="153" href="#153">153</a> 		<strong>while</strong> (iterator.hasNext()) {
+<a name="154" href="#154">154</a> 			SenderBean tempBean = (SenderBean) iterator.next();
+<a name="155" href="#155">155</a> 
+<a name="156" href="#156">156</a> 			<em class="comment">//updating the application message</em>
+<a name="157" href="#157">157</a> 			String key = tempBean.getKey();
+<a name="158" href="#158">158</a> 			MessageContext applicationMsg = <a href="../../../../org/apache/sandesha2/util/SandeshaUtil.html">SandeshaUtil</a>
+<a name="159" href="#159">159</a> 					.getStoredMessageContext(key);
+<a name="160" href="#160">160</a> 
+<a name="161" href="#161">161</a> 			RMMsgContext applicaionRMMsg = <a href="../../../../org/apache/sandesha2/util/MsgInitializer.html">MsgInitializer</a>
+<a name="162" href="#162">162</a> 					.initializeMessage(applicationMsg);
+<a name="163" href="#163">163</a> 
+<a name="164" href="#164">164</a> 			Sequence sequencePart = (Sequence) applicaionRMMsg
+<a name="165" href="#165">165</a> 					.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
+<a name="166" href="#166">166</a> 			<strong>if</strong> (sequencePart == <strong>null</strong>)
+<a name="167" href="#167">167</a> 				<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(<span class="string">"Sequence part is null"</span>);
+<a name="168" href="#168">168</a> 
+<a name="169" href="#169">169</a> 			Identifier identifier = <strong>new</strong> <a href="../../../../org/apache/sandesha2/wsrm/Identifier.html">Identifier</a>(factory);
+<a name="170" href="#170">170</a> 			identifier.setIndentifer(newOutSequenceId);
+<a name="171" href="#171">171</a> 
+<a name="172" href="#172">172</a> 			sequencePart.setIdentifier(identifier);
+<a name="173" href="#173">173</a> 
+<a name="174" href="#174">174</a> 			AckRequested ackRequestedPart = (AckRequested) applicaionRMMsg
+<a name="175" href="#175">175</a> 					.getMessagePart(Sandesha2Constants.MessageParts.ACK_REQUEST);
+<a name="176" href="#176">176</a> 			<strong>if</strong> (ackRequestedPart != <strong>null</strong>) {
+<a name="177" href="#177">177</a> 				Identifier id1 = <strong>new</strong> <a href="../../../../org/apache/sandesha2/wsrm/Identifier.html">Identifier</a>(factory);
+<a name="178" href="#178">178</a> 				id1.setIndentifer(newOutSequenceId);
+<a name="179" href="#179">179</a> 				ackRequestedPart.setIdentifier(id1);
+<a name="180" href="#180">180</a> 			}
+<a name="181" href="#181">181</a> 
+<a name="182" href="#182">182</a> 			<strong>try</strong> {
+<a name="183" href="#183">183</a> 				applicaionRMMsg.addSOAPEnvelope();
+<a name="184" href="#184">184</a> 			} <strong>catch</strong> (AxisFault e) {
+<a name="185" href="#185">185</a> 				<strong>throw</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/SandeshaException.html">SandeshaException</a>(e.getMessage());
+<a name="186" href="#186">186</a> 			}
+<a name="187" href="#187">187</a> 
+<a name="188" href="#188">188</a> 			<em class="comment">//asking to send the application msssage</em>
+<a name="189" href="#189">189</a> 			tempBean.setSend(<strong>true</strong>);
+<a name="190" href="#190">190</a> 			retransmitterMgr.update(tempBean);
+<a name="191" href="#191">191</a> 		}
+<a name="192" href="#192">192</a> 
+<a name="193" href="#193">193</a> 		createSeqResponseRMMsgCtx.getMessageContext().getOperationContext()
+<a name="194" href="#194">194</a> 				.setProperty(org.apache.axis2.Constants.RESPONSE_WRITTEN,
+<a name="195" href="#195">195</a> 						<span class="string">"false"</span>);
+<a name="196" href="#196">196</a> 
+<a name="197" href="#197">197</a> 		createSeqResponseRMMsgCtx.getMessageContext().setPausedTrue(
+<a name="198" href="#198">198</a> 				<strong>new</strong> QName(Sandesha2Constants.IN_HANDLER_NAME));
+<a name="199" href="#199">199</a> 	}
+<a name="200" href="#200">200</a> }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Added: webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/MsgProcessor.html
URL: http://svn.apache.org/viewcvs/webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/MsgProcessor.html?rev=349924&view=auto
==============================================================================
--- webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/MsgProcessor.html (added)
+++ webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/MsgProcessor.html Wed Nov 30 03:11:01 2005
@@ -0,0 +1,45 @@
+<!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" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>MsgProcessor xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../apidocs/org/apache/sandesha2/msgprocessors/MsgProcessor.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1">1</a>   <em class="comment">/*</em>
+<a name="2" href="#2">2</a>   <em class="comment"> * Copyright  1999-2004 The Apache Software Foundation.</em>
+<a name="3" href="#3">3</a>   <em class="comment"> *</em>
+<a name="4" href="#4">4</a>   <em class="comment"> *  Licensed under the Apache License, Version 2.0 (the "License");</em>
+<a name="5" href="#5">5</a>   <em class="comment"> *  you may not use this file except in compliance with the License.</em>
+<a name="6" href="#6">6</a>   <em class="comment"> *  You may obtain a copy of the License at</em>
+<a name="7" href="#7">7</a>   <em class="comment"> *</em>
+<a name="8" href="#8">8</a>   <em class="comment"> *      <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a name="9" href="#9">9</a>   <em class="comment"> *</em>
+<a name="10" href="#10">10</a>  <em class="comment"> *  Unless required by applicable law or agreed to in writing, software</em>
+<a name="11" href="#11">11</a>  <em class="comment"> *  distributed under the License is distributed on an "AS IS" BASIS,</em>
+<a name="12" href="#12">12</a>  <em class="comment"> *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
+<a name="13" href="#13">13</a>  <em class="comment"> *  See the License for the specific language governing permissions and</em>
+<a name="14" href="#14">14</a>  <em class="comment"> *  limitations under the License.</em>
+<a name="15" href="#15">15</a>  <em class="comment"> *</em>
+<a name="16" href="#16">16</a>  <em class="comment"> */</em>
+<a name="17" href="#17">17</a>  
+<a name="18" href="#18">18</a>  <strong>package</strong> <a href="../../../../org/apache/sandesha2/msgprocessors/package-summary.html">org.apache.sandesha2.msgprocessors</a>;
+<a name="19" href="#19">19</a>  
+<a name="20" href="#20">20</a>  <strong>import</strong> org.apache.sandesha2.RMMsgContext;
+<a name="21" href="#21">21</a>  <strong>import</strong> org.apache.sandesha2.SandeshaException;
+<a name="22" href="#22">22</a>  
+<a name="23" href="#23">23</a>  <em>/**<em>*</em></em>
+<a name="24" href="#24">24</a>  <em> * The message processor interface.</em>
+<a name="25" href="#25">25</a>  <em> * </em>
+<a name="26" href="#26">26</a>  <em> * @author Chamikara Jayalath &lt;chamikaramj@gmail.com></em>
+<a name="27" href="#27">27</a>  <em> * @author Sanka Samaranayaka &lt;ssanka@gmail.com></em>
+<a name="28" href="#28">28</a>  <em> */</em>
+<a name="29" href="#29">29</a>  
+<a name="30" href="#30">30</a>  <strong>public</strong> <strong>interface</strong> <a href="../../../../org/apache/sandesha2/msgprocessors/MsgProcessor.html">MsgProcessor</a> {
+<a name="31" href="#31">31</a>  	<strong>public</strong> <strong>void</strong> processMessage(<a href="../../../../org/apache/sandesha2/RMMsgContext.html">RMMsgContext</a> rmMsgCtx) throws SandeshaException;
+<a name="32" href="#32">32</a>  }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+

Added: webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/MsgProcessorFactory.html
URL: http://svn.apache.org/viewcvs/webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/MsgProcessorFactory.html?rev=349924&view=auto
==============================================================================
--- webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/MsgProcessorFactory.html (added)
+++ webservices/site/trunk/targets/sandesha/sandesha2/xref/org/apache/sandesha2/msgprocessors/MsgProcessorFactory.html Wed Nov 30 03:11:01 2005
@@ -0,0 +1,59 @@
+<!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" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>MsgProcessorFactory xref</title>
+<link type="text/css" rel="stylesheet" href="../../../../stylesheet.css" />
+</head>
+<body>
+<div id="overview"><a href="../../../../../apidocs/org/apache/sandesha2/msgprocessors/MsgProcessorFactory.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1">1</a>   <em class="comment">/*</em>
+<a name="2" href="#2">2</a>   <em class="comment"> * Copyright 1999-2004 The Apache Software Foundation.</em>
+<a name="3" href="#3">3</a>   <em class="comment"> * </em>
+<a name="4" href="#4">4</a>   <em class="comment"> * Licensed under the Apache License, Version 2.0 (the "License"); you may not</em>
+<a name="5" href="#5">5</a>   <em class="comment"> * use this file except in compliance with the License. You may obtain a copy of</em>
+<a name="6" href="#6">6</a>   <em class="comment"> * the License at</em>
+<a name="7" href="#7">7</a>   <em class="comment"> * </em>
+<a name="8" href="#8">8</a>   <em class="comment"> * <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a name="9" href="#9">9</a>   <em class="comment"> * </em>
+<a name="10" href="#10">10</a>  <em class="comment"> * Unless required by applicable law or agreed to in writing, software</em>
+<a name="11" href="#11">11</a>  <em class="comment"> * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT</em>
+<a name="12" href="#12">12</a>  <em class="comment"> * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the</em>
+<a name="13" href="#13">13</a>  <em class="comment"> * License for the specific language governing permissions and limitations under</em>
+<a name="14" href="#14">14</a>  <em class="comment"> * the License.</em>
+<a name="15" href="#15">15</a>  <em class="comment"> *  </em>
+<a name="16" href="#16">16</a>  <em class="comment"> */</em>
+<a name="17" href="#17">17</a>  
+<a name="18" href="#18">18</a>  <strong>package</strong> <a href="../../../../org/apache/sandesha2/msgprocessors/package-summary.html">org.apache.sandesha2.msgprocessors</a>;
+<a name="19" href="#19">19</a>  
+<a name="20" href="#20">20</a>  <strong>import</strong> org.apache.sandesha2.Sandesha2Constants;
+<a name="21" href="#21">21</a>  
+<a name="22" href="#22">22</a>  <em>/**<em>*</em></em>
+<a name="23" href="#23">23</a>  <em> * Used to get a suitable message processor. Given the message type.</em>
+<a name="24" href="#24">24</a>  <em> * </em>
+<a name="25" href="#25">25</a>  <em> * @author Chamikara Jayalath &lt;chamikaramj@gmail.com></em>
+<a name="26" href="#26">26</a>  <em> */</em>
+<a name="27" href="#27">27</a>  
+<a name="28" href="#28">28</a>  <strong>public</strong> <strong>class</strong> <a href="../../../../org/apache/sandesha2/msgprocessors/MsgProcessorFactory.html">MsgProcessorFactory</a> {
+<a name="29" href="#29">29</a>  
+<a name="30" href="#30">30</a>  	<strong>public</strong> <strong>static</strong> <a href="../../../../org/apache/sandesha2/msgprocessors/MsgProcessor.html">MsgProcessor</a> getMessageProcessor(<strong>int</strong> msgType) {
+<a name="31" href="#31">31</a>  		<strong>switch</strong> (msgType) {
+<a name="32" href="#32">32</a>  		<strong>case</strong> (Sandesha2Constants.MessageTypes.CREATE_SEQ):
+<a name="33" href="#33">33</a>  			<strong>return</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/msgprocessors/CreateSeqMsgProcessor.html">CreateSeqMsgProcessor</a>();
+<a name="34" href="#34">34</a>  		<strong>case</strong> (Sandesha2Constants.MessageTypes.TERMINATE_SEQ):
+<a name="35" href="#35">35</a>  			<strong>return</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/msgprocessors/TerminateSeqMsgProcessor.html">TerminateSeqMsgProcessor</a>();
+<a name="36" href="#36">36</a>  		<strong>case</strong> (Sandesha2Constants.MessageTypes.APPLICATION):
+<a name="37" href="#37">37</a>  			<strong>return</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.html">ApplicationMsgProcessor</a>();
+<a name="38" href="#38">38</a>  		<strong>case</strong> (Sandesha2Constants.MessageTypes.CREATE_SEQ_RESPONSE):
+<a name="39" href="#39">39</a>  			<strong>return</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/msgprocessors/CreateSeqResponseMsgProcessor.html">CreateSeqResponseMsgProcessor</a>();
+<a name="40" href="#40">40</a>  		<strong>case</strong> (Sandesha2Constants.MessageTypes.ACK):
+<a name="41" href="#41">41</a>  			<strong>return</strong> <strong>new</strong> <a href="../../../../org/apache/sandesha2/msgprocessors/AcknowledgementProcessor.html">AcknowledgementProcessor</a>();
+<a name="42" href="#42">42</a>  		<strong>default</strong>:
+<a name="43" href="#43">43</a>  			<strong>return</strong> <strong>null</strong>;
+<a name="44" href="#44">44</a>  		}
+<a name="45" href="#45">45</a>  	}
+<a name="46" href="#46">46</a>  }
+</pre>
+<hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
+</html>
+



Mime
View raw message