misc initial cosmetic cleanup

This commit is contained in:
Steve Bohlen
2012-12-21 16:01:18 -05:00
parent fdb0a57a96
commit 51b34811b3
32 changed files with 1960 additions and 1571 deletions

View File

@@ -1,3 +1,23 @@
#region License
/*
* Copyright <20> 2002-2011 the original author or authors.
*
* 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.
*/
#endregion
using System;
using System.Reflection;

View File

@@ -1,3 +1,23 @@
#region License
/*
* Copyright <20> 2002-2011 the original author or authors.
*
* 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.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;
@@ -11,21 +31,17 @@ using Spring.Context;
namespace Spring.ConversationWA.HttpModule
{
/// <summary>
/// HttpModule for end Conversation with Timeout exceeded.
/// HttpModule for ending Conversations with Timeout exceeded.
/// </summary>
/// <author>Hailton de Castro</author>
public class ConversationModule : IHttpModule, IApplicationContextAware
{
private static readonly ILog LOG = LogManager.GetLogger(typeof(ConversationModule));
/// <summary>
/// Default constructor.
/// </summary>
public ConversationModule(){ }
private IList<String> conversationManagerName;
/// <summary>
/// Name for the IConversationManager on the spring context.
/// The Names of the <see cref="IConversationManager"/>s in the <see cref="IApplicationContext"/>
/// </summary>
public IList<String> ConversationManagerNameList
{
@@ -41,13 +57,14 @@ namespace Spring.ConversationWA.HttpModule
/// <param name="context"></param>
public void Init(HttpApplication context)
{
context.PreRequestHandlerExecute += new EventHandler(context_PreRequestHandlerExecute);
context.PostRequestHandlerExecute += new EventHandler(context_PostRequestHandlerExecute);
context.EndRequest += new EventHandler(context_EndRequest);
context.PreRequestHandlerExecute += context_PreRequestHandlerExecute;
context.PostRequestHandlerExecute += context_PostRequestHandlerExecute;
context.EndRequest += context_EndRequest;
}
/// <summary>
/// NOOP.
/// Disposes of the resources (other than memory) used by the module that implements <see cref="T:System.Web.IHttpModule"/>.
/// </summary>
public void Dispose()
{
@@ -63,9 +80,10 @@ namespace Spring.ConversationWA.HttpModule
if (HttpContext.Current.Session != null)
{
if (LOG.IsDebugEnabled) LOG.Debug("context_PreRequestHandlerExecute: HttpContext.Current.Session is NOT null");
if (LOG.IsDebugEnabled) LOG.Debug("context_PreRequestHandlerExecute: Processing HttpContext.Current.Session");
foreach (String convMngName in this.ConversationManagerNameList)
{
if (LOG.IsDebugEnabled) LOG.Debug(string.Format("context_PreRequestHandlerExecute: Processing ConversationManager: {0}", convMngName));
IConversationManager convMng = (IConversationManager)this.applicationContext.GetObject(convMngName);
convMng.EndOnTimeOut();
convMng.FreeEnded();
@@ -73,21 +91,26 @@ namespace Spring.ConversationWA.HttpModule
}
else
{
if (LOG.IsDebugEnabled) LOG.Debug("context_PreRequestHandlerExecute: HttpContext.Current.Session IS null");
if (LOG.IsDebugEnabled) LOG.Debug("context_PreRequestHandlerExecute: no HttpContext.Current.Session found.");
}
}
}
/// <summary>
/// Necessary for Redirect or Abort for some reason.
/// Handles the Unload event of the page control.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
/// <remarks>
/// Necessary for Redirect or Abort for any reason.
/// </remarks>
void page_Unload(object sender, EventArgs e)
{
if (LOG.IsDebugEnabled) LOG.Debug("page_Unload HttpContext.Current.Session is null: " + (HttpContext.Current.Session == null));
foreach (String convMngName in this.ConversationManagerNameList)
{
if (LOG.IsDebugEnabled) LOG.Debug(string.Format("page_Unload: Processing ConversationManager: {0}", convMngName));
IConversationManager convMng = (IConversationManager)this.applicationContext.GetObject(convMngName);
convMng.EndOnTimeOut();
convMng.FreeEnded();
@@ -112,9 +135,34 @@ namespace Spring.ConversationWA.HttpModule
#region IApplicationContextAware Members
private IApplicationContext applicationContext;
/// <summary>
/// Used to obtain the instances of "IConversationManager".
/// Sets the <see cref="Spring.Context.IApplicationContext"/> that this
/// object runs in.
/// </summary>
/// <value></value>
/// <remarks>
/// <p>
/// Used to obtain the instances of <see cref="IConversationManager"/>
/// </p>
/// <p>
/// Invoked after population of normal object properties but before an
/// init callback such as
/// <see cref="Spring.Objects.Factory.IInitializingObject"/>'s
/// <see cref="Spring.Objects.Factory.IInitializingObject.AfterPropertiesSet"/>
/// or a custom init-method. Invoked after the setting of any
/// <see cref="Spring.Context.IResourceLoaderAware"/>'s
/// <see cref="Spring.Context.IResourceLoaderAware.ResourceLoader"/>
/// property.
/// </p>
/// </remarks>
/// <exception cref="Spring.Context.ApplicationContextException">
/// In the case of application context initialization errors.
/// </exception>
/// <exception cref="Spring.Objects.ObjectsException">
/// If thrown by any application context methods.
/// </exception>
/// <exception cref="Spring.Objects.Factory.ObjectInitializationException"/>
public IApplicationContext ApplicationContext
{
set { this.applicationContext = value; }

View File

@@ -1,3 +1,23 @@
#region License
/*
* Copyright <20> 2002-2011 the original author or authors.
*
* 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.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;
@@ -24,21 +44,21 @@ namespace Spring.ConversationWA
void EndOnTimeOut();
/// <summary>
/// Close IDbConnection's for <see cref="IConversationState"/> that
/// Close IDbConnections for <see cref="IConversationState"/> that
/// use 'session-per-conversation'. It calls
/// <see cref="IConversationState.PauseConversation"/> in all conversations.
/// </summary>
void PauseConversations();
/// <summary>
/// Release the ended conversatons And remove it.
/// If the conversation support 'session-per-conversation' close the session.
/// Release the ended conversations And removes them.
/// If the conversation supports 'session-per-conversation', also close the session.
/// </summary>
void FreeEnded();
/// <summary>
/// Add conversation. If <see cref="IConversationManager"/> is null
/// it is setted with 'this'.
/// it resolves to 'this'.
/// </summary>
/// <param name="conversation"></param>
/// <exception cref="InvalidOperationException">
@@ -74,7 +94,7 @@ namespace Spring.ConversationWA
/// <summary>
/// Ends the "paused conversations" in call to <see cref="ActiveConversation"/>.
/// Important: Unexpected behavior may occur if there are nested conversations,
/// as in 'StartResumeConversation' only the own conversation and their parents
/// as in <see cref="IConversationState.StartResumeConversation"/> only the current conversation and its parents
/// are started, the 'conversations children' remain paused, so these will be ended.
/// Defaul value: <c>false</c>.
/// </summary>

View File

@@ -1,3 +1,23 @@
#region License
/*
* Copyright <20> 2002-2011 the original author or authors.
*
* 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.
*/
#endregion
using System;
using System.Data;
using System.Configuration;
@@ -17,7 +37,7 @@ namespace Spring.ConversationWA
/// <summary>
/// Port to conversation. If the object is not found in the current
/// conversation, will be tried on the parent if the parent is
/// different not null.
/// not null.
/// </summary>
/// <exception cref="InvalidOperationException">
/// If <see cref="Id"/> is different from spring name for this instance.
@@ -31,9 +51,9 @@ namespace Spring.ConversationWA
String Id { get; set; }
/// <summary>
/// Starts or resumes the conversation and the <see cref="ParenteConversation"/>.
/// Starts or resumes the conversation and the <see cref="ParentConversation"/>.
/// <para>If <see cref="RootSessionPerConversation"/> is not null, so
/// <see cref="SessionFactory"/>.GetCurrentSession() is called to
/// <see cref="ISessionFactory.GetCurrentSession"/> is called to
/// Raise SessionHolder for make the reconnection.
/// </para>
/// <para>Make <see cref="IsNew"/> return false.
@@ -47,7 +67,7 @@ namespace Spring.ConversationWA
/// </item>
/// <item>If <see cref="RootSessionPerConversation"/> is not null and
/// <see cref="RootSessionPerConversation"/> different from
/// <see cref="SessionFactory"/>.GetCurrentSession()
/// <see cref="ISessionFactory.GetCurrentSession"/>
/// </item>
/// </list>
/// </exception>
@@ -59,7 +79,7 @@ namespace Spring.ConversationWA
bool IsNew { get; }
/// <summary>
/// Ends the conversation. End each the 'inner conversation' in
/// Ends the conversation. End each of the 'inner conversations' in
/// <see cref="InnerConversations"/>. Returns false if the
/// conversation and all <see cref="IConversationState"/> of
/// <see cref="InnerConversations"/> has already been ended.
@@ -84,14 +104,14 @@ namespace Spring.ConversationWA
bool Ended { get; }
/// <summary>
/// Inner conversation. After added if the <see cref="ParenteConversation"/>
/// is null it will be setted with 'this'.
/// Inner conversation. After added if the <see cref="ParentConversation"/>
/// is null it will resolve to 'this'.
/// </summary>
/// <exception cref="InvalidOperationException">at
/// <see cref="T:System.Collections.Generic.ICollection`1.Add(T)"/>,
/// <see cref="T:System.Collections.Generic.IList`1.this[int]"/>,
/// <see cref="T:System.Collections.Generic.IList`1.Insert(int, T)"/>
/// if Circular Dependence is detected.</exception>
/// if Circular Dependency is detected.</exception>
IList<IConversationState> InnerConversations { get; }
/// <summary>
@@ -103,23 +123,23 @@ namespace Spring.ConversationWA
/// </item>
/// <item>If this Conversation is not new.
/// </item>
/// <item>If Circular Dependence is detected.
/// <item>If Circular Dependency is detected.
/// </item>
/// <item>The Parent conversation is not new.
/// </item>
/// </list>
/// </exception>
IConversationState ParenteConversation { get; set;}
IConversationState ParentConversation { get; set;}
/// <summary>
/// TimeOut for the conversation in milliseconds.
/// If <c>0</c> means it will be ignored.
/// If <c>0</c> TimeOut will be ignored.
/// </summary>
Int32 TimeOut { get; set; }
/// <summary>
/// Last acces for a value into this Conversation or Inner Conversation.
/// It is reseted for DateTime.Now each time <see cref="StartResumeConversation()"/>
/// Reset to DateTime.Now each time <see cref="StartResumeConversation()"/>
/// is called.
/// </summary>
DateTime LastAccess { get; set; }

View File

@@ -1,355 +1,376 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using Common.Logging;
using Iesi.Collections.Generic;
namespace Spring.ConversationWA.Imple
{
/// <summary>
/// List that make validation for Circular Dependence for <see cref="IConversationState"/>
/// </summary>
/// <author>Hailton de Castro</author>
[Serializable]
public class InnerConversationList: IList<IConversationState>, IList
{
private static readonly ILog LOG = LogManager.GetLogger(typeof(InnerConversationList));
private IConversationState conversationOwner;
/// <summary>
/// Contructor.
/// </summary>
/// <param name="conversationOwner">The IConversation that owns this InnerConversationList.</param>
public InnerConversationList(IConversationState conversationOwner)
{
if (conversationOwner == null)
{
String exMsgStr = "'conversationOwner' can not be null";
LOG.Error(exMsgStr);
throw new InvalidOperationException(exMsgStr);
}
if (LOG.IsDebugEnabled) LOG.Error(String.Format("Creating InnerConversationList for '{0}'", conversationOwner.Id));
this.conversationOwner = conversationOwner;
}
private IList<IConversationState> innerList = new List<IConversationState>();
/// <summary>
/// Common Helper to be run before insert.
/// </summary>
/// <param name="itemAdded"></param>
private void addPreAddHelper(IConversationState itemAdded)
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("addPreAddHelper: added={0} into {1}", itemAdded, this.conversationOwner));
this.validateCircularDependence(itemAdded);
if (itemAdded.ParenteConversation != null && itemAdded.ParenteConversation != this.conversationOwner)
{
throw new InvalidOperationException(
String.Format(WebConversationSpringState.MSG_CONVERSATION_ALREADY_HAS_PARENT, itemAdded.ParenteConversation.Id, this.conversationOwner.Id));
}
}
/// <summary>
/// Common Helper to be run after insert.
/// </summary>
private void addPostAddHelper(IConversationState itemAdded)
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("addPreAddHelper: added={0} into {1}", itemAdded, this.conversationOwner));
if (itemAdded.ParenteConversation == null)
{
itemAdded.ParenteConversation = this.conversationOwner;
}
}
private void validateCircularDependence(IConversationState itemAdded)
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("Validating Circular Dependence: added={0} into {1}", itemAdded, this.conversationOwner));
ICollection<IConversationState> visitedColl = new HashedSet<IConversationState>();
visitedColl.Add(conversationOwner);
IConversationState parentAncestor = this.conversationOwner;
String path = this.conversationOwner.Id;
//string conectorPath = "";
this.validateCircularDependenceRecursive(itemAdded, visitedColl, path + "->" + itemAdded.Id);
}
private void validateCircularDependenceRecursive(IConversationState currentConv, ICollection<IConversationState> visitedColl, String path)
{
foreach (IConversationState convItem in currentConv.InnerConversations)
{
if (visitedColl.Contains(convItem))
{
String exMsgStr =
"ConversationState Circular Dependence detected: " +
path + "->" + convItem.Id;
LOG.Error(exMsgStr);
throw new InvalidOperationException(exMsgStr);
}
visitedColl.Add(convItem);
this.validateCircularDependenceRecursive(convItem, visitedColl, path + "->" + convItem.Id);
}
}
#region IList<IConversationState> Members
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
public int IndexOf(IConversationState item)
{
return this.innerList.IndexOf(item);
}
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="index"></param>
/// <param name="item"></param>
public void Insert(int index, IConversationState item)
{
this.addPreAddHelper(item);
this.innerList.Insert(index, item);
this.addPostAddHelper(item);
}
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="index"></param>
public void RemoveAt(int index)
{
this.innerList.RemoveAt(index);
}
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
public IConversationState this[int index]
{
get
{
return this.innerList[index];
}
set
{
this.addPreAddHelper(value);
this.innerList[index] = value;
this.addPostAddHelper(value);
}
}
#endregion
#region ICollection<IConversationState> Members
/// <summary>
/// <see cref="T:ICollection`1"/>
/// </summary>
/// <param name="item"></param>
public void Add(IConversationState item)
{
this.addPreAddHelper(item);
this.innerList.Add(item);
this.addPostAddHelper(item);
}
/// <summary>
/// <see cref="T:ICollection`1"/>
/// </summary>
public void Clear()
{
this.innerList.Clear();
}
/// <summary>
/// <see cref="T:ICollection`1"/>
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
public bool Contains(IConversationState item)
{
return this.innerList.Contains(item);
}
/// <summary>
/// <see cref="T:ICollection`1"/>
/// </summary>
/// <param name="array"></param>
/// <param name="arrayIndex"></param>
public void CopyTo(IConversationState[] array, int arrayIndex)
{
this.innerList.CopyTo(array, arrayIndex);
}
/// <summary>
/// <see cref="T:ICollection`1"/>
/// </summary>
public int Count
{
get { return this.innerList.Count; }
}
/// <summary>
/// <see cref="T:ICollection`1"/>
/// </summary>
public bool IsReadOnly
{
get { return this.innerList.IsReadOnly; }
}
/// <summary>
/// <see cref="T:ICollection`1"/>
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
public bool Remove(IConversationState item)
{
return this.innerList.Remove(item);
}
#endregion
#region IEnumerable<IConversationState> Members
/// <summary>
/// <see cref="T:IEnumerable`1"/>
/// </summary>
/// <returns></returns>
public IEnumerator<IConversationState> GetEnumerator()
{
return this.innerList.GetEnumerator();
}
#endregion
#region IEnumerable Members
/// <summary>
/// <see cref="IEnumerable"/>
/// </summary>
/// <returns></returns>
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return this.innerList.GetEnumerator();
}
#endregion
#region IList Members
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public int Add(object value)
{
((IList<IConversationState>)this).Add((IConversationState)value);
return this.innerList.Count - 1;
}
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public bool Contains(object value)
{
return ((IList<IConversationState>)this).Contains((IConversationState)value);
}
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public int IndexOf(object value)
{
return ((IList<IConversationState>)this).IndexOf((IConversationState)value);
}
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="index"></param>
/// <param name="value"></param>
public void Insert(int index, object value)
{
((IList<IConversationState>)this).Insert(index, (IConversationState)value);
}
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
public bool IsFixedSize
{
get { return false; }
}
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="value"></param>
public void Remove(object value)
{
((IList<IConversationState>)this).Add((IConversationState)value);
}
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
object IList.this[int index]
{
get
{
return ((IList<IConversationState>)this)[index];
}
set
{
((IList<IConversationState>)this)[index] = (IConversationState)value;
}
}
#endregion
#region ICollection Members
/// <summary>
/// <see cref="ICollection"/>
/// </summary>
/// <param name="array"></param>
/// <param name="index"></param>
public void CopyTo(Array array, int index)
{
IConversationState[] convArr = new IConversationState[array.Length];
((IList<IConversationState>)this).CopyTo(convArr, index);
convArr.CopyTo(array, index);
}
/// <summary>
/// <see cref="ICollection"/>
/// </summary>
public bool IsSynchronized
{
get { return false; }
}
/// <summary>
/// <see cref="ICollection"/>
/// </summary>
public object SyncRoot
{
get { return this; }
}
#endregion
}
}
#region License
/*
* Copyright © 2002-2011 the original author or authors.
*
* 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.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Collections;
using Common.Logging;
using Iesi.Collections.Generic;
namespace Spring.ConversationWA.Impl
{
/// <summary>
/// List that make validation for Circular Dependency for <see cref="IConversationState"/>
/// </summary>
/// <author>Hailton de Castro</author>
[Serializable]
public class InnerConversationList: IList<IConversationState>, IList
{
private static readonly ILog LOG = LogManager.GetLogger(typeof(InnerConversationList));
private IConversationState conversationOwner;
private IList<IConversationState> innerList = new List<IConversationState>();
/// <summary>
/// Contructor.
/// </summary>
/// <param name="conversationOwner">The <see cref="IConversationState"/> that owns this <see cref="InnerConversationList"/>.</param>
public InnerConversationList(IConversationState conversationOwner)
{
if (conversationOwner == null)
{
String message = "'conversationOwner' can not be null";
LOG.Error(message);
throw new InvalidOperationException(message);
}
if (LOG.IsDebugEnabled) LOG.Error(String.Format("Creating InnerConversationList for '{0}'", conversationOwner.Id));
this.conversationOwner = conversationOwner;
}
/// <summary>
/// Common Helper to be run before insert.
/// </summary>
/// <param name="itemAdded"></param>
private void PreAddProcessor(IConversationState itemAdded)
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("PreAddProcessor: added={0} into {1}", itemAdded, this.conversationOwner));
this.ValidateCircularDependency(itemAdded);
if (itemAdded.ParentConversation != null && itemAdded.ParentConversation != this.conversationOwner)
{
throw new InvalidOperationException(
String.Format(WebConversationSpringState.MSG_CONVERSATION_ALREADY_HAS_PARENT, itemAdded.ParentConversation.Id, this.conversationOwner.Id));
}
}
/// <summary>
/// Common Helper to be run after insert.
/// </summary>
private void PostAddProcessor(IConversationState itemAdded)
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("PostAddProcessor: added={0} into {1}", itemAdded, this.conversationOwner));
if (itemAdded.ParentConversation == null)
{
itemAdded.ParentConversation = this.conversationOwner;
}
}
private void ValidateCircularDependency(IConversationState itemAdded)
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("Validating Circular Dependency: added={0} into {1}", itemAdded, this.conversationOwner));
ICollection<IConversationState> visitedColl = new HashedSet<IConversationState>();
visitedColl.Add(conversationOwner);
IConversationState parentAncestor = this.conversationOwner;
String path = this.conversationOwner.Id;
//string conectorPath = "";
this.ValidateCircularDependencyRecursive(itemAdded, visitedColl, path + "->" + itemAdded.Id);
}
private void ValidateCircularDependencyRecursive(IConversationState currentConv, ICollection<IConversationState> visitedColl, String path)
{
foreach (IConversationState convItem in currentConv.InnerConversations)
{
if (visitedColl.Contains(convItem))
{
String exMsgStr =
"ConversationState Circular Dependency detected: " +
path + "->" + convItem.Id;
LOG.Error(exMsgStr);
throw new InvalidOperationException(exMsgStr);
}
visitedColl.Add(convItem);
this.ValidateCircularDependencyRecursive(convItem, visitedColl, path + "->" + convItem.Id);
}
}
#region IList<IConversationState> Members
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
public int IndexOf(IConversationState item)
{
return this.innerList.IndexOf(item);
}
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="index"></param>
/// <param name="item"></param>
public void Insert(int index, IConversationState item)
{
this.PreAddProcessor(item);
this.innerList.Insert(index, item);
this.PostAddProcessor(item);
}
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="index"></param>
public void RemoveAt(int index)
{
this.innerList.RemoveAt(index);
}
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
public IConversationState this[int index]
{
get
{
return this.innerList[index];
}
set
{
this.PreAddProcessor(value);
this.innerList[index] = value;
this.PostAddProcessor(value);
}
}
#endregion
#region ICollection<IConversationState> Members
/// <summary>
/// <see cref="T:ICollection`1"/>
/// </summary>
/// <param name="item"></param>
public void Add(IConversationState item)
{
this.PreAddProcessor(item);
this.innerList.Add(item);
this.PostAddProcessor(item);
}
/// <summary>
/// <see cref="T:ICollection`1"/>
/// </summary>
public void Clear()
{
this.innerList.Clear();
}
/// <summary>
/// <see cref="T:ICollection`1"/>
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
public bool Contains(IConversationState item)
{
return this.innerList.Contains(item);
}
/// <summary>
/// <see cref="T:ICollection`1"/>
/// </summary>
/// <param name="array"></param>
/// <param name="arrayIndex"></param>
public void CopyTo(IConversationState[] array, int arrayIndex)
{
this.innerList.CopyTo(array, arrayIndex);
}
/// <summary>
/// <see cref="T:ICollection`1"/>
/// </summary>
public int Count
{
get { return this.innerList.Count; }
}
/// <summary>
/// <see cref="T:ICollection`1"/>
/// </summary>
public bool IsReadOnly
{
get { return this.innerList.IsReadOnly; }
}
/// <summary>
/// <see cref="T:ICollection`1"/>
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
public bool Remove(IConversationState item)
{
return this.innerList.Remove(item);
}
#endregion
#region IEnumerable<IConversationState> Members
/// <summary>
/// <see cref="T:IEnumerable`1"/>
/// </summary>
/// <returns></returns>
public IEnumerator<IConversationState> GetEnumerator()
{
return this.innerList.GetEnumerator();
}
#endregion
#region IEnumerable Members
/// <summary>
/// <see cref="IEnumerable"/>
/// </summary>
/// <returns></returns>
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return this.innerList.GetEnumerator();
}
#endregion
#region IList Members
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public int Add(object value)
{
((IList<IConversationState>)this).Add((IConversationState)value);
return this.innerList.Count - 1;
}
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public bool Contains(object value)
{
return ((IList<IConversationState>)this).Contains((IConversationState)value);
}
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public int IndexOf(object value)
{
return ((IList<IConversationState>)this).IndexOf((IConversationState)value);
}
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="index"></param>
/// <param name="value"></param>
public void Insert(int index, object value)
{
((IList<IConversationState>)this).Insert(index, (IConversationState)value);
}
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
public bool IsFixedSize
{
get { return false; }
}
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="value"></param>
public void Remove(object value)
{
((IList<IConversationState>)this).Add((IConversationState)value);
}
/// <summary>
/// <see cref="T:IList`1"/>
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
object IList.this[int index]
{
get
{
return ((IList<IConversationState>)this)[index];
}
set
{
((IList<IConversationState>)this)[index] = (IConversationState)value;
}
}
#endregion
#region ICollection Members
/// <summary>
/// <see cref="ICollection"/>
/// </summary>
/// <param name="array"></param>
/// <param name="index"></param>
public void CopyTo(Array array, int index)
{
IConversationState[] convArr = new IConversationState[array.Length];
((IList<IConversationState>)this).CopyTo(convArr, index);
convArr.CopyTo(array, index);
}
/// <summary>
/// <see cref="ICollection"/>
/// </summary>
public bool IsSynchronized
{
get { return false; }
}
/// <summary>
/// <see cref="ICollection"/>
/// </summary>
public object SyncRoot
{
get { return this; }
}
#endregion
}
}

View File

@@ -1,354 +1,374 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Web;
using Common.Logging;
using Spring.Data.NHibernate.Support;
using NHibernate;
using Spring.Context;
using Spring.Context.Support;
namespace Spring.ConversationWA.Imple
{
/// <summary>
/// This was made to stay under session scope.
/// </summary>
/// <author>Hailton de Castro</author>
[Serializable]
public class WebConversationManager : SessionPerConversationScope, IConversationManager, IApplicationContextAware
{
private static readonly ILog LOG = LogManager.GetLogger(typeof(WebConversationManager));
private static readonly String CONVERSATION_COOKIE_ID = "WebConversationManager.activeConversationId";
/// <summary>
/// Semaphore to synchronize writes to the dictionary.
/// </summary>
[NonSerialized]
private Mutex mutexEditDic = new Mutex();
private Mutex MutexEditDic
{
get
{
if (this.mutexEditDic == null)
this.mutexEditDic = new Mutex();
return this.mutexEditDic;
}
}
private IDictionary<String, IConversationState> conversations = new Dictionary<String, IConversationState>();
private IConversationState activeConversation = null;
#region IConversationManager Members
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public IConversationState GetConversationById(string id)
{
if (this.conversations.ContainsKey(id))
{
return this.conversations[id];
}
else
{
return null;
}
}
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
public void EndOnTimeOut()
{
try
{
if (LOG.IsDebugEnabled) LOG.Debug("EndOnTimeOut");
this.MutexEditDic.WaitOne(5000);
foreach (String keyItem in this.conversations.Keys)
{
IConversationState conversationItem = this.conversations[keyItem];
if (conversationItem.TimeOut > 0)
{
if (DateTime.Now.Subtract(conversationItem.LastAccess).TotalMilliseconds > conversationItem.TimeOut)
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("Timeout for conversation '{0}'", conversationItem.Id));
conversationItem.EndConversation();
}
}
}
}
finally
{
this.MutexEditDic.ReleaseMutex();
}
}
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
public void PauseConversations()
{
foreach (IConversationState convItem in this.conversations.Values)
{
convItem.PauseConversation();
}
this.Close(this.SessionFactory, this.conversations.Values);
}
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
public void FreeEnded()
{
try
{
if (LOG.IsDebugEnabled) LOG.Debug("EndOnTimeOut");
this.MutexEditDic.WaitOne(5000);
List<IConversationState> removeList = new List<IConversationState>();
foreach (String keyItem in this.conversations.Keys)
{
IConversationState conversationItem = this.conversations[keyItem];
if (conversationItem.Ended)
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("FreeEnded: Release conversation '{0}'", conversationItem.Id));
removeList.Add(conversationItem);
}
}
if (removeList.Count > 0)
{
this.Close(this.SessionFactory, removeList);
}
foreach (IConversationState conversationItem in removeList)
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("FreeEnded: Remove conversation '{0}'", conversationItem.Id));
conversationItem.EndConversation();
this.RemoveConversation(conversationItem);
}
}
finally
{
this.MutexEditDic.ReleaseMutex();
}
}
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
/// <param name="conversation"></param>
public void AddConversation(IConversationState conversation)
{
try
{
this.MutexEditDic.WaitOne(5000);
this.conversations.Add(conversation.Id, conversation);
}
finally
{
this.MutexEditDic.ReleaseMutex();
}
if (conversation.ConversationManager != null && conversation.ConversationManager != this)
{
throw new InvalidOperationException(String.Format("Conversation already has another manager. conversation='{0}'", conversation.Id));
}
if (conversation.ConversationManager == null)
{
conversation.ConversationManager = this;
}
}
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
/// <param name="conversation"></param>
public void SetActiveConversation(IConversationState conversation)
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("SetActiveConversation('{0}')", conversation.Id));
//Close connection for the last conversation, if it is open.
if (this.activeConversation != null && this.activeConversation != conversation)
{
this.Close(this.SessionFactory, this.conversations.Values);
}
this.Open(conversation, this.conversations.Values);
this.activeConversation = conversation;
//Ending the paused conversations.
if (this.EndPaused)
{
foreach (IConversationState convItem in this.conversations.Values)
{
if (convItem.IsPaused)
{
convItem.EndConversation();
}
}
}
}
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
[Obsolete("Not used, the active conversation is defined by call 'IConversationManager.SetActiveConversation' on 'IConversationState.StartResumeConversation'")]
public void LoadActiveConversation()
{
//reset this.activeConversation
this.activeConversation = null;
if (LOG.IsDebugEnabled) LOG.Debug("LoadActiveConversation");
HttpCookie activeConveCookie = HttpContext.Current.Request.Cookies[CONVERSATION_COOKIE_ID];
if (activeConveCookie != null && !String.IsNullOrEmpty(activeConveCookie.Value))
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("LoadActiveConversation: cooking found for current active conversation: [{0}]", activeConveCookie.ToString()));
if (this.conversations.ContainsKey(activeConveCookie.Value))
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("LoadActiveConversation: active conversation found for id: '{0}'", activeConveCookie.Value));
IConversationState conversation = this.conversations[activeConveCookie.Value];
if (conversation != null)
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("LoadActiveConversation: conversation found: '{0}'", conversation.Id));
//find root conversation.
IConversationState rootConversation = conversation;
while (rootConversation.ParenteConversation != null)
{
rootConversation = rootConversation.ParenteConversation;
}
rootConversation.StartResumeConversation();
this.SetActiveConversation(rootConversation);
}
}
else
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("LoadActiveConversation: conversation NOT found for id on the cookie: '{0}'", activeConveCookie.Value));
HttpContext.Current.Response.Cookies.Remove(CONVERSATION_COOKIE_ID);
}
}
}
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
public IConversationState ActiveConversation
{
get
{
return this.activeConversation;
}
}
private String sessionFactoryName;
/// <summary>
/// "SessionFactory" name in the current context.
/// This approach is required to support serialization.
/// </summary>
public String SessionFactoryName
{
get { return sessionFactoryName; }
set { sessionFactoryName = value; }
}
[NonSerialized]
private ISessionFactory sessionFactory;
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
public ISessionFactory SessionFactory
{
get
{
if (this.sessionFactory == null && this.sessionFactoryName != null)
{
this.sessionFactory = this.ApplicationContext.GetObject<ISessionFactory>(this.sessionFactoryName);
}
return sessionFactory;
}
}
private bool endPaused = false;
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
public bool EndPaused
{
get { return endPaused; }
set { endPaused = value; }
}
#endregion
#region SessionPerConversationScope Members
/// <summary>
/// Ends all conversations and Closes all their Session.
/// </summary>
public override void Dispose()
{
if (LOG.IsDebugEnabled) LOG.Debug("Dispose. End all Conversations");
foreach (String conversationId in this.conversations.Keys)
{
this.conversations[conversationId].EndConversation();
}
this.Close(this.SessionFactory, this.conversations.Values);
this.conversations.Clear();
this.sessionFactory = null;
}
#endregion
/// <summary>
/// Remove conversation.
/// </summary>
/// <param name="conversation"></param>
private void RemoveConversation(IConversationState conversation)
{
try
{
this.MutexEditDic.WaitOne(5000);
if (!this.conversations.Remove(conversation.Id))
{
throw new InvalidOperationException(String.Format("Conversation '{0}' not exists on this manager", conversation.Id));
}
}
finally
{
this.MutexEditDic.ReleaseMutex();
}
}
#region IApplicationContextAware Members
private String applicationContextName;
[NonSerialized]
private IApplicationContext applicationContext = null;
/// <summary>
/// Returns the current context. Supports serialization and deserialization.
/// </summary>
public IApplicationContext ApplicationContext
{
set
{
this.applicationContext = value;
this.applicationContextName = this.applicationContext.Name;
}
get
{
if (this.applicationContext == null)
{
this.applicationContext = ContextRegistry.GetContext(this.applicationContextName);
}
return this.applicationContext;
}
}
#endregion
}
}
#region License
/*
* Copyright © 2002-2011 the original author or authors.
*
* 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.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Threading;
using System.Web;
using Common.Logging;
using Spring.Data.NHibernate.Support;
using NHibernate;
using Spring.Context;
using Spring.Context.Support;
namespace Spring.ConversationWA.Impl
{
/// <summary>
/// This was made to stay under session scope.
/// </summary>
/// <author>Hailton de Castro</author>
[Serializable]
public class WebConversationManager : SessionPerConversationScope, IConversationManager, IApplicationContextAware
{
private static readonly ILog LOG = LogManager.GetLogger(typeof(WebConversationManager));
private static readonly String CONVERSATION_COOKIE_ID = "WebConversationManager.activeConversationId";
/// <summary>
/// Semaphore to synchronize writes to the dictionary.
/// </summary>
[NonSerialized]
private Mutex mutexEditDic = new Mutex();
private Mutex MutexEditDic
{
get
{
if (this.mutexEditDic == null)
this.mutexEditDic = new Mutex();
return this.mutexEditDic;
}
}
private readonly IDictionary<String, IConversationState> conversations = new Dictionary<String, IConversationState>();
private IConversationState activeConversation = null;
#region IConversationManager Members
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public IConversationState GetConversationById(string id)
{
if (this.conversations.ContainsKey(id))
{
return this.conversations[id];
}
else
{
return null;
}
}
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
public void EndOnTimeOut()
{
try
{
if (LOG.IsDebugEnabled) LOG.Debug("EndOnTimeOut");
this.MutexEditDic.WaitOne(5000);
foreach (String keyItem in this.conversations.Keys)
{
IConversationState conversationItem = this.conversations[keyItem];
if (conversationItem.TimeOut > 0)
{
if (DateTime.Now.Subtract(conversationItem.LastAccess).TotalMilliseconds > conversationItem.TimeOut)
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("Timeout for conversation '{0}'", conversationItem.Id));
conversationItem.EndConversation();
}
}
}
}
finally
{
this.MutexEditDic.ReleaseMutex();
}
}
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
public void PauseConversations()
{
foreach (IConversationState convItem in this.conversations.Values)
{
convItem.PauseConversation();
}
this.Close(this.SessionFactory, this.conversations.Values);
}
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
public void FreeEnded()
{
try
{
if (LOG.IsDebugEnabled) LOG.Debug("EndOnTimeOut");
this.MutexEditDic.WaitOne(5000);
List<IConversationState> removeList = new List<IConversationState>();
foreach (String keyItem in this.conversations.Keys)
{
IConversationState conversationItem = this.conversations[keyItem];
if (conversationItem.Ended)
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("FreeEnded: Release conversation '{0}'", conversationItem.Id));
removeList.Add(conversationItem);
}
}
if (removeList.Count > 0)
{
this.Close(this.SessionFactory, removeList);
}
foreach (IConversationState conversationItem in removeList)
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("FreeEnded: Remove conversation '{0}'", conversationItem.Id));
conversationItem.EndConversation();
this.RemoveConversation(conversationItem);
}
}
finally
{
this.MutexEditDic.ReleaseMutex();
}
}
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
/// <param name="conversation"></param>
public void AddConversation(IConversationState conversation)
{
try
{
this.MutexEditDic.WaitOne(5000);
this.conversations.Add(conversation.Id, conversation);
}
finally
{
this.MutexEditDic.ReleaseMutex();
}
if (conversation.ConversationManager != null && conversation.ConversationManager != this)
{
throw new InvalidOperationException(String.Format("Conversation already has another manager. conversation='{0}'", conversation.Id));
}
if (conversation.ConversationManager == null)
{
conversation.ConversationManager = this;
}
}
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
/// <param name="conversation"></param>
public void SetActiveConversation(IConversationState conversation)
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("SetActiveConversation('{0}')", conversation.Id));
//Close connection for the last conversation, if it is open.
if (this.activeConversation != null && this.activeConversation != conversation)
{
this.Close(this.SessionFactory, this.conversations.Values);
}
this.Open(conversation, this.conversations.Values);
this.activeConversation = conversation;
//Ending the paused conversations.
if (this.EndPaused)
{
foreach (IConversationState convItem in this.conversations.Values)
{
if (convItem.IsPaused)
{
convItem.EndConversation();
}
}
}
}
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
[Obsolete("Not used, the active conversation is defined by call 'IConversationManager.SetActiveConversation' on 'IConversationState.StartResumeConversation'")]
public void LoadActiveConversation()
{
//reset this.activeConversation
this.activeConversation = null;
if (LOG.IsDebugEnabled) LOG.Debug("LoadActiveConversation");
HttpCookie activeConveCookie = HttpContext.Current.Request.Cookies[CONVERSATION_COOKIE_ID];
if (activeConveCookie != null && !String.IsNullOrEmpty(activeConveCookie.Value))
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("LoadActiveConversation: cooking found for current active conversation: [{0}]", activeConveCookie.ToString()));
if (this.conversations.ContainsKey(activeConveCookie.Value))
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("LoadActiveConversation: active conversation found for id: '{0}'", activeConveCookie.Value));
IConversationState conversation = this.conversations[activeConveCookie.Value];
if (conversation != null)
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("LoadActiveConversation: conversation found: '{0}'", conversation.Id));
//find root conversation.
IConversationState rootConversation = conversation;
while (rootConversation.ParentConversation != null)
{
rootConversation = rootConversation.ParentConversation;
}
rootConversation.StartResumeConversation();
this.SetActiveConversation(rootConversation);
}
}
else
{
if (LOG.IsDebugEnabled) LOG.Debug(String.Format("LoadActiveConversation: conversation NOT found for id on the cookie: '{0}'", activeConveCookie.Value));
HttpContext.Current.Response.Cookies.Remove(CONVERSATION_COOKIE_ID);
}
}
}
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
public IConversationState ActiveConversation
{
get
{
return this.activeConversation;
}
}
private String sessionFactoryName;
/// <summary>
/// "SessionFactory" name in the current context.
/// This approach is required to support serialization.
/// </summary>
public String SessionFactoryName
{
get { return sessionFactoryName; }
set { sessionFactoryName = value; }
}
[NonSerialized]
private ISessionFactory sessionFactory;
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
public ISessionFactory SessionFactory
{
get
{
if (this.sessionFactory == null && this.sessionFactoryName != null)
{
this.sessionFactory = this.ApplicationContext.GetObject<ISessionFactory>(this.sessionFactoryName);
}
return sessionFactory;
}
}
private bool endPaused = false;
/// <summary>
/// <see cref="IConversationManager"/>
/// </summary>
public bool EndPaused
{
get { return endPaused; }
set { endPaused = value; }
}
#endregion
#region SessionPerConversationScope Members
/// <summary>
/// Ends all conversations and Closes all their Session.
/// </summary>
public override void Dispose()
{
if (LOG.IsDebugEnabled) LOG.Debug("Dispose. End all Conversations");
foreach (String conversationId in this.conversations.Keys)
{
if (LOG.IsDebugEnabled) LOG.Debug(string.Format("Ending Conversation for Conversation Id: {0}", conversationId));
this.conversations[conversationId].EndConversation();
}
this.Close(this.SessionFactory, this.conversations.Values);
this.conversations.Clear();
this.sessionFactory = null;
}
#endregion
/// <summary>
/// Remove conversation.
/// </summary>
/// <param name="conversation"></param>
private void RemoveConversation(IConversationState conversation)
{
try
{
this.MutexEditDic.WaitOne(5000);
if (!this.conversations.Remove(conversation.Id))
{
throw new InvalidOperationException(String.Format("Conversation '{0}' does not exist on this manager.", conversation.Id));
}
}
finally
{
this.MutexEditDic.ReleaseMutex();
}
}
#region IApplicationContextAware Members
private String applicationContextName;
[NonSerialized]
private IApplicationContext applicationContext = null;
/// <summary>
/// Returns the current context. Supports serialization and deserialization.
/// </summary>
public IApplicationContext ApplicationContext
{
set
{
this.applicationContext = value;
this.applicationContextName = this.applicationContext.Name;
}
get
{
if (this.applicationContext == null)
{
this.applicationContext = ContextRegistry.GetContext(this.applicationContextName);
}
return this.applicationContext;
}
}
#endregion
}
}

View File

@@ -1,14 +1,14 @@
#region Licence
#region License
/*
* Copyright <20> 2002-2007 the original author or authors.
*
* Copyright <20> 2002-2011 the original author or authors.
*
* 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.
@@ -39,7 +39,7 @@ namespace Spring.Data.NHibernate.Support
{
///<summary>
///Based on <see cref="Spring.Data.NHibernate.Support.SessionScope"/>
/// for dupport to 'session-per-conversation' pattern.
/// for support of 'session-per-conversation' pattern.
///</summary>
///<author>Hailton de Castro</author>
[Serializable]
@@ -50,7 +50,7 @@ namespace Spring.Data.NHibernate.Support
/// <summary>
/// The logging instance.
/// </summary>
protected readonly ILog log = LogManager.GetLogger(MethodInfo.GetCurrentMethod().DeclaringType);
protected readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private readonly SessionPerConversationScopeSettings settings;
@@ -115,7 +115,7 @@ namespace Spring.Data.NHibernate.Support
}
/// <summary>
/// Get or set the configured EntityInterceptor
/// Get the configured EntityInterceptor
/// </summary>
public IInterceptor EntityInterceptor
{
@@ -177,7 +177,6 @@ namespace Spring.Data.NHibernate.Support
public virtual void Dispose()
{
//no OP
log.Warn("I'm not doing anything");
}
#endregion
@@ -187,16 +186,16 @@ namespace Spring.Data.NHibernate.Support
/// <summary>
/// Open a new session or reconect the
/// <see cref="IConversationState.RootSessionPerConversation"/> in <paramref name="activeConversation"/>.
/// Participates in an existing session registed with spring's <see cref="TransactionSynchronizationManager"/>
/// Participating in an existing session registed with <see cref="TransactionSynchronizationManager"/>
/// is not alowed.
/// </summary>
/// <param name="activeConversation"></param>
/// <param name="allManagedConversation"></param>
/// <exception cref="InvalidOperationException">
/// <list type="bullet">
/// <item>If there is another conversation with a ISession with opened
/// IDbConnection.</item>
/// <item>If trie to participating in existing Hibernate SessionFactory
/// <item>If there is another conversation with a <see cref="ISession"/> with opened
/// <see cref="IDbConnection"/>.</item>
/// <item>If attempting to participate in an existing NHibernate <see cref="ISessionFactory"/>
/// managed by <see cref="TransactionSynchronizationManager"/>.
/// </item>
/// </list>
@@ -226,12 +225,12 @@ namespace Spring.Data.NHibernate.Support
if (TransactionSynchronizationManager.HasResource(activeConversation.SessionFactory))
{
// Do not modify the Session: just set the participate flag.
if (isDebugEnabled) log.Debug("Participating in existing Hibernate SessionFactory IS NOT ALOWED.");
throw new InvalidOperationException("Participating in existing Hibernate SessionFactory IS NOT ALOWED.");
if (isDebugEnabled) log.Debug("Participating in existing NHibernate SessionFactory IS NOT ALLOWED.");
throw new InvalidOperationException("Participating in existing NHibernate SessionFactory IS NOT ALLOWED.");
}
else
{
if (isDebugEnabled) log.Debug("Opening single Hibernate Session in SessionPerConversationScope");
if (isDebugEnabled) log.Debug("Opening single NHibernate Session in SessionPerConversationScope");
TransactionSynchronizationManager.BindResource(activeConversation.SessionFactory, new LazySessionPerConversationHolder(this, activeConversation, allManagedConversation));
SetOpen(true);
@@ -247,17 +246,17 @@ namespace Spring.Data.NHibernate.Support
/// <summary>
/// Close the current view's session and unregisters
/// from spring's <see cref="TransactionSynchronizationManager"/>.
/// from <see cref="TransactionSynchronizationManager"/>.
/// </summary>
/// <param name="sessionFactory">The session factory that IConversationState on <paramref name="allManagedConversation"/> use</param>
/// <param name="sessionFactory">The session factory that <see cref="IConversationState"/> on <paramref name="allManagedConversation"/> use</param>
/// <param name="allManagedConversation">A list of conversations which the session can be closed or disconnected</param>
/// <exception cref="InvalidOperationException">
/// <list type="bullet">
/// <item>If start/resume a conversation from a
/// IConversationManager when exists a diferent IConversationManager
/// with open ISession registered on TransactionSynchronizationManager
/// <see cref="IConversationManager"/> when exists a different <see cref="IConversationManager"/>
/// with open <see cref="ISession"/> registered on <see cref="TransactionSynchronizationManager"/>
/// </item>
/// <item>If the holder on TransactionSynchronizationManager, is not a LazySessionPerConversationHolder.</item>
/// <item>If the holder on <see cref="TransactionSynchronizationManager"/>, is not a <see cref="LazySessionPerConversationHolder"/>.</item>
/// </list>
/// </exception>
public void Close(ISessionFactory sessionFactory, ICollection<IConversationState> allManagedConversation)
@@ -370,11 +369,11 @@ namespace Spring.Data.NHibernate.Support
/// <summary>
/// This sessionHolder creates a session for the active conversation only if it is
/// needed (<see cref="Spring.ConversationWA.IConversationState.StartResumeConversation"/>.
/// needed (<see cref="Spring.ConversationWA.IConversationState.StartResumeConversation"/>).
/// </summary>
/// <remarks>
/// Although a NHibernateSession deferes creation of db-connections until they are really
/// needed, instantiation a session is imho still more expensive than this LazySessionHolder. (EE)
/// Although a NHibernateSession defers creation of db-connections until they are really
/// needed, instantiation a session is still more expensive than using LazySessionHolder.
/// </remarks>
private class LazySessionPerConversationHolder : SessionHolder
{

View File

@@ -1,3 +1,23 @@
#region License
/*
* Copyright <20> 2002-2011 the original author or authors.
*
* 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.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;

View File

@@ -61,9 +61,9 @@
<Compile Include="ConversationWA\HttpModule\ConversationModule.cs" />
<Compile Include="ConversationWA\IConversationManager.cs" />
<Compile Include="ConversationWA\IConversationState.cs" />
<Compile Include="ConversationWA\Imple\InnerConversationList.cs" />
<Compile Include="ConversationWA\Imple\WebConversationManager.cs" />
<Compile Include="ConversationWA\Imple\WebConversationSpringState.cs" />
<Compile Include="ConversationWA\Impl\InnerConversationList.cs" />
<Compile Include="ConversationWA\Impl\WebConversationManager.cs" />
<Compile Include="ConversationWA\Impl\WebConversationSpringState.cs" />
<Compile Include="Data\NHibernate\Support\SessionPerConversationScope.cs" />
<Compile Include="Data\NHibernate\Support\SessionPerConversationSettings.cs" />
</ItemGroup>
@@ -72,7 +72,6 @@
<Link>nant.xsd</Link>
</None>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Spring.Core\Spring.Core.2010.csproj">

View File

@@ -1 +0,0 @@
sources are linked here from Spring.ConversationWA.NH32

View File

@@ -66,14 +66,14 @@
<Compile Include="..\Spring.ConversationWA.NH32\ConversationWA\IConversationState.cs">
<Link>Conversation\IConversationState.cs</Link>
</Compile>
<Compile Include="..\Spring.ConversationWA.NH32\ConversationWA\Imple\InnerConversationList.cs">
<Link>Conversation\Imple\InnerConversationList.cs</Link>
<Compile Include="..\Spring.ConversationWA.NH32\ConversationWA\Impl\InnerConversationList.cs">
<Link>Conversation\Impl\InnerConversationList.cs</Link>
</Compile>
<Compile Include="..\Spring.ConversationWA.NH32\ConversationWA\Imple\WebConversationManager.cs">
<Link>Conversation\Imple\WebConversationManager.cs</Link>
<Compile Include="..\Spring.ConversationWA.NH32\ConversationWA\Impl\WebConversationManager.cs">
<Link>Conversation\Impl\WebConversationManager.cs</Link>
</Compile>
<Compile Include="..\Spring.ConversationWA.NH32\ConversationWA\Imple\WebConversationSpringState.cs">
<Link>Conversation\Imple\WebConversationSpringState.cs</Link>
<Compile Include="..\Spring.ConversationWA.NH32\ConversationWA\Impl\WebConversationSpringState.cs">
<Link>Conversation\Impl\WebConversationSpringState.cs</Link>
</Compile>
<Compile Include="..\Spring.ConversationWA.NH32\Data\NHibernate\Support\SessionPerConversationScope.cs">
<Link>Data\NHibernate\Support\SessionPerConversationScope.cs</Link>

View File

@@ -1,3 +1,23 @@
#region License
/*
* Copyright <20> 2002-2011 the original author or authors.
*
* 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.
*/
#endregion
using System;
using System.Data;
using System.Configuration;

View File

@@ -1,3 +1,23 @@
#region License
/*
* Copyright <20> 2002-2011 the original author or authors.
*
* 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.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;

View File

@@ -1,3 +1,23 @@
#region License
/*
* Copyright <20> 2002-2011 the original author or authors.
*
* 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.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;

View File

@@ -1,3 +1,23 @@
#region License
/*
* Copyright <20> 2002-2011 the original author or authors.
*
* 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.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;
@@ -55,7 +75,7 @@ namespace Spring.Bsn
SPCMasterEnt masterEnt3 = sessionNoConv.Get<SPCMasterEnt>(3);
Assert.AreEqual(1, masterEnt3.SPCDetailEntList.Count, "masterEnt3.SPCDetailEntList.Count");
Assert.AreEqual(1, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count");
Assert.AreEqual(1, ConnectionCreationTrackingDbProvider.Count, "ConnectionCreationTrackingDbProvider.Count");
}
#endregion

View File

@@ -1,3 +1,23 @@
#region License
/*
* Copyright <20> 2002-2011 the original author or authors.
*
* 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.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;

View File

@@ -1,3 +1,23 @@
#region License
/*
* Copyright <20> 2002-2011 the original author or authors.
*
* 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.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;

View File

@@ -1,4 +1,24 @@
using System;
#region License
/*
* Copyright © 2002-2011 the original author or authors.
*
* 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.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

View File

@@ -1,4 +1,24 @@
using System;
#region License
/*
* Copyright © 2002-2011 the original author or authors.
*
* 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.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

View File

@@ -96,11 +96,11 @@ public partial class ConnectionReleaseModeIssue : System.Web.UI.Page, IApplicati
this.setConnectionReleaseModeByReflection(settings, ConnectionReleaseMode.AfterTransaction);
//((SessionFactoryImpl)this.sessionFactory).Settings.ConnectionReleaseMode = ConnectionReleaseMode.AfterTransaction;
CountGetConnDbProvider.Count = 0;
ConnectionCreationTrackingDbProvider.Count = 0;
this.Conversation.StartResumeConversation();
ISession sessionA = this.SessionFactory.GetCurrentSession();
SPCDetailEnt detailEnt = sessionA.Get<SPCDetailEnt>(1);
Assert.AreEqual(1, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count");
Assert.AreEqual(1, ConnectionCreationTrackingDbProvider.Count, "ConnectionCreationTrackingDbProvider.Count");
SessionScopeSettings sessionScopeSettings = new SessionScopeSettings(this.sessionFactory);
sessionScopeSettings.SingleSession = true;
@@ -110,20 +110,20 @@ public partial class ConnectionReleaseModeIssue : System.Web.UI.Page, IApplicati
ISession sessionB = this.SessionFactory.GetCurrentSession();
masterEnt = sessionB.Get<SPCMasterEnt>(1);
Assert.AreEqual(2, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count");
Assert.AreEqual(2, ConnectionCreationTrackingDbProvider.Count, "ConnectionCreationTrackingDbProvider.Count");
Assert.AreSame(sessionA, sessionB, "sessionA, sessionB");
}
SPCMasterEnt masterEnt2 = sessionA.Get<SPCMasterEnt>(2);
Assert.AreEqual(3, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count");
Assert.AreEqual(3, ConnectionCreationTrackingDbProvider.Count, "ConnectionCreationTrackingDbProvider.Count");
Assert.AreEqual(1, masterEnt2.SPCDetailEntList.Count, "masterEnt2.SPCDetailEntList.Count");
Assert.AreEqual(4, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count");
Assert.AreEqual(4, ConnectionCreationTrackingDbProvider.Count, "ConnectionCreationTrackingDbProvider.Count");
SPCMasterEnt masterEnt3 = sessionA.Get<SPCMasterEnt>(3);
Assert.AreEqual(5, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count");
Assert.AreEqual(5, ConnectionCreationTrackingDbProvider.Count, "ConnectionCreationTrackingDbProvider.Count");
Assert.AreEqual(1, masterEnt3.SPCDetailEntList.Count, "masterEnt3.SPCDetailEntList.Count");
Assert.AreEqual(6, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count");
Assert.AreEqual(6, ConnectionCreationTrackingDbProvider.Count, "ConnectionCreationTrackingDbProvider.Count");
//Renew the conversation.
@@ -152,7 +152,7 @@ public partial class ConnectionReleaseModeIssue : System.Web.UI.Page, IApplicati
ConnectionReleaseMode connReleaseModeOriginal = settings.ConnectionReleaseMode;
this.setConnectionReleaseModeByReflection(settings, ConnectionReleaseMode.AfterTransaction);
CountGetConnDbProvider.Count = 0;
ConnectionCreationTrackingDbProvider.Count = 0;
this.ConnectionReleaseModeIssueBsn.Test();
this.setConnectionReleaseModeByReflection(settings, connReleaseModeOriginal);
@@ -172,19 +172,19 @@ public partial class ConnectionReleaseModeIssue : System.Web.UI.Page, IApplicati
//with no conversation
SessionScopeSettings sessionScopeSettings = new SessionScopeSettings(this.sessionFactory);
CountGetConnDbProvider.Count = 0;
ConnectionCreationTrackingDbProvider.Count = 0;
using (new SessionScope(sessionScopeSettings, true))
{
ISession sessionNoConv = this.SessionFactory.GetCurrentSession();
SPCMasterEnt masterEnt2 = sessionNoConv.Get<SPCMasterEnt>(2);
Assert.AreEqual(1, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count");
Assert.AreEqual(1, ConnectionCreationTrackingDbProvider.Count, "ConnectionCreationTrackingDbProvider.Count");
Assert.AreEqual(1, masterEnt2.SPCDetailEntList.Count, "masterEnt2.SPCDetailEntList.Count");
Assert.AreEqual(2, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count");
Assert.AreEqual(2, ConnectionCreationTrackingDbProvider.Count, "ConnectionCreationTrackingDbProvider.Count");
SPCMasterEnt masterEnt3 = sessionNoConv.Get<SPCMasterEnt>(3);
Assert.AreEqual(3, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count");
Assert.AreEqual(3, ConnectionCreationTrackingDbProvider.Count, "ConnectionCreationTrackingDbProvider.Count");
Assert.AreEqual(1, masterEnt3.SPCDetailEntList.Count, "masterEnt3.SPCDetailEntList.Count");
Assert.AreEqual(4, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count");
Assert.AreEqual(4, ConnectionCreationTrackingDbProvider.Count, "ConnectionCreationTrackingDbProvider.Count");
}
this.setConnectionReleaseModeByReflection(settings, connReleaseModeOriginal);
@@ -206,11 +206,11 @@ public partial class ConnectionReleaseModeIssue : System.Web.UI.Page, IApplicati
this.setConnectionReleaseModeByReflection(settings, ConnectionReleaseMode.OnClose);
//with conversation and "connection.release_mode" "on_close"(AfterTransaction)
CountGetConnDbProvider.Count = 0;
ConnectionCreationTrackingDbProvider.Count = 0;
this.Conversation.StartResumeConversation();
ISession sessionA = this.SessionFactory.GetCurrentSession();
SPCDetailEnt detailEnt = sessionA.Get<SPCDetailEnt>(1);
Assert.AreEqual(1, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count");
Assert.AreEqual(1, ConnectionCreationTrackingDbProvider.Count, "ConnectionCreationTrackingDbProvider.Count");
SessionScopeSettings sessionScopeSettings = new SessionScopeSettings(this.sessionFactory);
sessionScopeSettings.SingleSession = true;
@@ -226,7 +226,7 @@ public partial class ConnectionReleaseModeIssue : System.Web.UI.Page, IApplicati
Assert.AreEqual(3, masterEnt.SPCDetailEntList.Count, "masterEnt.SPCDetailEntList.Count");
Assert.AreEqual(1, CountGetConnDbProvider.Count, "CountGetConnDbProvider.Count");
Assert.AreEqual(1, ConnectionCreationTrackingDbProvider.Count, "ConnectionCreationTrackingDbProvider.Count");
//Renew the conversation.
this.Conversation.EndConversation();

View File

@@ -9,7 +9,7 @@ using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Spring.ConversationWA;
using Spring.ConversationWA.Imple;
using Spring.ConversationWA.Impl;
using System.Text.RegularExpressions;
using NHibernate;
using Spring.Data.NHibernate.Support;
@@ -176,9 +176,9 @@ public partial class IoeTests : System.Web.UI.Page
{
otherConversationState = new WebConversationSpringState();
otherConversationState.Id = "otherConversationState";
//try second by 'ParenteConversation = '
this.ConversationAA.ParenteConversation = otherConversationState;
throw new Exception("NOT OK: No raise for 'this.ConversationAA.ParenteConversation = otherConversationState'");
//try second by 'ParentConversation = '
this.ConversationAA.ParentConversation = otherConversationState;
throw new Exception("NOT OK: No raise for 'this.ConversationAA.ParentConversation = otherConversationState'");
}
catch (InvalidOperationException ioe)
{
@@ -216,8 +216,8 @@ public partial class IoeTests : System.Web.UI.Page
{
otherConversationState = new WebConversationSpringState();
otherConversationState.Id = "otherConversationState";
//try second by 'ParenteConversation = '
otherConversationState.ParenteConversation = this.ConversationA;
//try second by 'ParentConversation = '
otherConversationState.ParentConversation = this.ConversationA;
this.Session["testResult"] = "OK";
}
finally
@@ -264,9 +264,9 @@ public partial class IoeTests : System.Web.UI.Page
otherConversationState.Id = "otherConversationState";
// make not new
otherConversationState.StartResumeConversation();
//try second by 'ParenteConversation = '
otherConversationState.ParenteConversation = this.ConversationA;
throw new Exception("NOT OK: No raise for 'this.ConversationAA.ParenteConversation = otherConversationState'");
//try second by 'ParentConversation = '
otherConversationState.ParentConversation = this.ConversationA;
throw new Exception("NOT OK: No raise for 'this.ConversationAA.ParentConversation = otherConversationState'");
}
catch (InvalidOperationException ioe)
{
@@ -305,8 +305,8 @@ public partial class IoeTests : System.Web.UI.Page
otherConversationState = new WebConversationSpringState();
otherConversationState.Id = "otherConversationState";
// leave new
//try second by 'ParenteConversation = '
otherConversationState.ParenteConversation = this.ConversationA;
//try second by 'ParentConversation = '
otherConversationState.ParentConversation = this.ConversationA;
this.Session["testResult"] = "OK";
}
finally
@@ -366,7 +366,7 @@ public partial class IoeTests : System.Web.UI.Page
private void participatingHibernateNotAlowed()
{
Regex msgErrorRx = new Regex(".*Participating.*Hibernate.*NOT.*ALOWED.*");
Regex msgErrorRx = new Regex(".*Participating.*Hibernate.*NOT.*ALLOWED.*");
try
{
//No raise

View File

@@ -12,12 +12,12 @@
<property name="Conversation" ref="convEndConversationTest"></property>
<property name="ConversationEvidenceBsn" expression="@(convEndConversationTest)['conversationEvidenceBsn']"></property>
</object>
<object name="convEndConversationTest" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convEndConversationTest" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convEndConversationTest"></property>
<property name="['conversationEvidenceBsn']" ref="conversationEvidenceBsn"></property>
</object>
<object name="convCircularDependenceTest_A" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convCircularDependenceTest_A" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convCircularDependenceTest_A"></property>
<property name="InnerConversations">
<list>
@@ -25,7 +25,7 @@
</list>
</property>
</object>
<object name="convCircularDependenceTest_A_A" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convCircularDependenceTest_A_A" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convCircularDependenceTest_A_A"></property>
<property name="InnerConversations">
<list>
@@ -33,7 +33,7 @@
</list>
</property>
</object>
<object name="convCircularDependenceTest_A_A_A" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convCircularDependenceTest_A_A_A" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convCircularDependenceTest_A_A_A"></property>
<property name="['conversationEvidenceBsn']" ref="conversationEvidenceBsn"></property>
</object>
@@ -52,7 +52,7 @@
<object type="PatialEndConv_A_B_End.aspx">
<property name="Conversation" ref="convPatialEndConv_A_B"></property>
</object>
<object name="convPatialEndConv_A" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convPatialEndConv_A" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convPatialEndConv_A"></property>
<property name="InnerConversations">
<list>
@@ -62,10 +62,10 @@
</list>
</property>
</object>
<object name="convPatialEndConv_A_A" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convPatialEndConv_A_A" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convPatialEndConv_A_A"></property>
</object>
<object name="convPatialEndConv_A_B" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convPatialEndConv_A_B" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convPatialEndConv_A_B"></property>
<property name="InnerConversations">
<list>
@@ -74,20 +74,20 @@
</list>
</property>
</object>
<object name="convPatialEndConv_A_B_A" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convPatialEndConv_A_B_A" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convPatialEndConv_A_B_A"></property>
</object>
<object name="convPatialEndConv_A_B_B" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convPatialEndConv_A_B_B" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convPatialEndConv_A_B_B"></property>
</object>
<object name="convPatialEndConv_A_C" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convPatialEndConv_A_C" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convPatialEndConv_A_C"></property>
</object>
<object type="GetParentObjetFromChild.aspx">
<property name="Conversation" ref="convGetParentObjetFromChildChild"></property>
</object>
<object name="convGetParentObjetFromChildParent" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convGetParentObjetFromChildParent" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convGetParentObjetFromChildParent"></property>
<property name="['parentKey']" value="parentValue"></property>
<property name="['overwrittenKey']" value="overwrittenValueParent"></property>
@@ -97,9 +97,9 @@
</list>
</property>
</object>
<object name="convGetParentObjetFromChildChild" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convGetParentObjetFromChildChild" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convGetParentObjetFromChildChild"></property>
<property name="ParenteConversation" ref="convGetParentObjetFromChildParent"></property>
<property name="ParentConversation" ref="convGetParentObjetFromChildParent"></property>
<property name="['childKey']" value="childValue"></property>
<property name="['overwrittenKey']" value="overwrittenValueChild"></property>
</object>
@@ -110,7 +110,7 @@
<object type="TimeOut_WithTimeOut.aspx">
<property name="Conversation" ref="convTimeOut"></property>
</object>
<object name="convTimeOut" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convTimeOut" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convTimeOut"></property>
<property name="TimeOut" value="60000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
@@ -147,7 +147,7 @@
<object type="SPCLazyLoadTest_A_Status.aspx">
<property name="Conversation" ref="convSPCLazyLoad"></property>
</object>
<object name="convSPCLazyLoad" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convSPCLazyLoad" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convSPCLazyLoad"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
@@ -160,14 +160,14 @@
<property name="ConversationA" ref="convSPCSwitchConversationSameRequestA"></property>
<property name="SessionFactory" ref="MySessionFactory"/>
</object>
<object name="convSPCSwitchConversationSameRequestA" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convSPCSwitchConversationSameRequestA" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convSPCSwitchConversationSameRequestA"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
<property name="SessionFactoryName" value="MySessionFactory"/>
<property name="DbProviderName" value="DbProvider"/>
</object>
<object name="convSPCSwitchConversationSameRequestB" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convSPCSwitchConversationSameRequestB" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convSPCSwitchConversationSameRequestB"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
@@ -180,7 +180,7 @@
<object type="RedirectErrorNoPauseConversation.aspx">
<property name="Conversation" ref="convRedirectErrorNoPauseConversation"></property>
</object>
<object name="convRedirectErrorNoPauseConversation" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convRedirectErrorNoPauseConversation" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convRedirectErrorNoPauseConversation"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
@@ -197,18 +197,18 @@
<property name="SessionFactory" ref="MySessionFactory"></property>
</object>
<object name="convIoeTestsA" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convIoeTestsA" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convIoeTestsA"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
<property name="SessionFactoryName" value="MySessionFactory"/>
<property name="DbProviderName" value="DbProvider"/>
</object>
<object name="convIoeTestsAA" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convIoeTestsAA" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convIoeTestsAA"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
<property name="ParenteConversation" ref="convIoeTestsA"></property>
<property name="ParentConversation" ref="convIoeTestsA"></property>
</object>
<!--END: InvalidOperationException Tests -->
@@ -217,15 +217,15 @@
<property name="ConvA" ref="convAEndPaused"></property>
<property name="ConvB" ref="convBEndPaused"></property>
</object>
<object name="convAEndPaused" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convAEndPaused" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convAEndPaused"></property>
<property name="ConversationManager" ref="conversationManagerEndPaused"></property>
</object>
<object name="convBEndPaused" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convBEndPaused" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convBEndPaused"></property>
<property name="ConversationManager" ref="conversationManagerEndPaused"></property>
</object>
<object name="conversationManagerEndPaused" type="Spring.ConversationWA.Imple.WebConversationManager, Spring.ConversationWA.NH32" scope="session">
<object name="conversationManagerEndPaused" type="Spring.ConversationWA.Impl.WebConversationManager, Spring.ConversationWA.NH32" scope="session">
<property name="EndPaused" value="true"></property>
</object>
<!--END: EndPausedTest Tests -->
@@ -238,14 +238,14 @@
<property name="Conversation" ref="convBSessionIsClosed"></property>
<property name="ConversationA" ref="convASessionIsClosed"></property>
</object>
<object name="convASessionIsClosed" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convASessionIsClosed" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convASessionIsClosed"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
<property name="SessionFactoryName" value="MySessionFactory"/>
<property name="DbProviderName" value="DbProvider"/>
</object>
<object name="convBSessionIsClosed" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convBSessionIsClosed" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convBSessionIsClosed"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
@@ -261,21 +261,21 @@
<object type="EndPausedSessionIsClosedB.aspx">
<property name="Conversation" ref="convBEndPausedSessionIsClosed"></property>
</object>
<object name="convAEndPausedSessionIsClosed" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convAEndPausedSessionIsClosed" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convAEndPausedSessionIsClosed"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="convMngEndPausedSessionIsClosed"></property>
<property name="SessionFactoryName" value="MySessionFactory"/>
<property name="DbProviderName" value="DbProvider"/>
</object>
<object name="convBEndPausedSessionIsClosed" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convBEndPausedSessionIsClosed" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convBEndPausedSessionIsClosed"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="convMngEndPausedSessionIsClosed"></property>
<property name="SessionFactoryName" value="MySessionFactory"/>
<property name="DbProviderName" value="DbProvider"/>
</object>
<object name="convMngEndPausedSessionIsClosed" type="Spring.ConversationWA.Imple.WebConversationManager, Spring.ConversationWA.NH32" scope="session">
<object name="convMngEndPausedSessionIsClosed" type="Spring.ConversationWA.Impl.WebConversationManager, Spring.ConversationWA.NH32" scope="session">
<property name="SessionFactoryName" value="MySessionFactory"/>
<property name="EndPaused" value="true"/>
</object>
@@ -287,7 +287,7 @@
<property name="SessionFactory" ref="MySessionFactory"/>
<property name="ConnectionReleaseModeIssueBsn" ref="connectionReleaseModeIssueBsn"/>
</object>
<object name="convConnectionReleaseModeIssue" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convConnectionReleaseModeIssue" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convConnectionReleaseModeIssue"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
@@ -303,7 +303,7 @@
<object type="SerializeConversationTest.aspx">
<property name="Conversation" ref="convSerializeConversationTest"/>
</object>
<object name="convSerializeConversationTest" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<object name="convSerializeConversationTest" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH32" scope="session">
<property name="Id" value="convSerializeConversationTest"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
@@ -313,7 +313,7 @@
<!--END: SerializeConversationTest-->
<!-- BEGIN: Common configuration-->
<object name="conversationManager" type="Spring.ConversationWA.Imple.WebConversationManager, Spring.ConversationWA.NH32" scope="session">
<object name="conversationManager" type="Spring.ConversationWA.Impl.WebConversationManager, Spring.ConversationWA.NH32" scope="session">
<property name="SessionFactoryName" value="MySessionFactory"/>
</object>
@@ -344,7 +344,7 @@
</dictionary>
</property>
</object>
<object id="DbProvider" type="Spring.Spring.Data.Common.CountGetConnDbProvider, Spring.ConversationWA.NH32.Tests">
<object id="DbProvider" type="Spring.Spring.Data.Common.ConnectionCreationTrackingDbProvider, Spring.ConversationWA.NH32.Tests">
<property name="TargetDbProvider" ref="targetDbProvider"/>
</object>
<db:provider id="targetDbProvider" provider="System.Data.SQLite" connectionString="Data Source=|DataDirectory|../sqlite/conversationTests.db;Version=3;FailIfMissing=True;"></db:provider>

View File

@@ -1,3 +1,23 @@
#region License
/*
* Copyright <20> 2002-2011 the original author or authors.
*
* 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.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;

View File

@@ -1,3 +1,23 @@
#region License
/*
* Copyright <20> 2002-2011 the original author or authors.
*
* 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.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;

View File

@@ -87,7 +87,7 @@
<Compile Include="ConversationWA\WebConversationStateTest.cs" />
<Compile Include="Entities\SPCDetailEnt.cs" />
<Compile Include="Entities\SPCMasterEnt.cs" />
<Compile Include="Spring\Data\Common\CountGetConnDbProvider.cs" />
<Compile Include="Spring\Data\Common\ConnectionCreationTrackingDbProvider.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Spring\Spring.Aop\Spring.Aop.2008.csproj">

View File

@@ -101,7 +101,7 @@
<Compile Include="ConversationWA\WebConversationStateTest.cs" />
<Compile Include="Entities\SPCDetailEnt.cs" />
<Compile Include="Entities\SPCMasterEnt.cs" />
<Compile Include="Spring\Data\Common\CountGetConnDbProvider.cs" />
<Compile Include="Spring\Data\Common\ConnectionCreationTrackingDbProvider.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Spring\Spring.Aop\Spring.Aop.2010.csproj">

View File

@@ -0,0 +1,49 @@
#region License
/*
* Copyright <20> 2002-2011 the original author or authors.
*
* 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.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Text;
using Spring.Data.Common;
using System.Data;
namespace Spring.Spring.Data.Common
{
/// <summary>
/// Count the number of calls to "CreateConnection()".
/// </summary>
public class ConnectionCreationTrackingDbProvider : DelegatingDbProvider
{
/// <summary>
/// Count of calls to <see cref="CreateConnection"/>
/// </summary>
public static Int32 Count = 0;
/// <summary>
/// Count.
/// </summary>
/// <returns></returns>
public override IDbConnection CreateConnection()
{
Count++;
return this.TargetDbProvider.CreateConnection();
}
}
}

View File

@@ -1,29 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using Spring.Data.Common;
using System.Data;
namespace Spring.Spring.Data.Common
{
/// <summary>
/// Count the number of calls to "CreateConnection()".
/// </summary>
public class CountGetConnDbProvider : DelegatingDbProvider
{
/// <summary>
/// Count of calls to <see cref="CreateConnection"/>
/// </summary>
public static Int32 Count = 0;
/// <summary>
/// Count.
/// </summary>
/// <returns></returns>
public override IDbConnection CreateConnection()
{
Count++;
return this.TargetDbProvider.CreateConnection();
}
}
}

View File

@@ -12,12 +12,12 @@
<property name="Conversation" ref="convEndConversationTest"></property>
<property name="ConversationEvidenceBsn" expression="@(convEndConversationTest)['conversationEvidenceBsn']"></property>
</object>
<object name="convEndConversationTest" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convEndConversationTest" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convEndConversationTest"></property>
<property name="['conversationEvidenceBsn']" ref="conversationEvidenceBsn"></property>
</object>
<object name="convCircularDependenceTest_A" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convCircularDependenceTest_A" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convCircularDependenceTest_A"></property>
<property name="InnerConversations">
<list>
@@ -25,7 +25,7 @@
</list>
</property>
</object>
<object name="convCircularDependenceTest_A_A" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convCircularDependenceTest_A_A" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convCircularDependenceTest_A_A"></property>
<property name="InnerConversations">
<list>
@@ -33,7 +33,7 @@
</list>
</property>
</object>
<object name="convCircularDependenceTest_A_A_A" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convCircularDependenceTest_A_A_A" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convCircularDependenceTest_A_A_A"></property>
<property name="['conversationEvidenceBsn']" ref="conversationEvidenceBsn"></property>
</object>
@@ -52,7 +52,7 @@
<object type="PatialEndConv_A_B_End.aspx">
<property name="Conversation" ref="convPatialEndConv_A_B"></property>
</object>
<object name="convPatialEndConv_A" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convPatialEndConv_A" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convPatialEndConv_A"></property>
<property name="InnerConversations">
<list>
@@ -62,10 +62,10 @@
</list>
</property>
</object>
<object name="convPatialEndConv_A_A" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convPatialEndConv_A_A" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convPatialEndConv_A_A"></property>
</object>
<object name="convPatialEndConv_A_B" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convPatialEndConv_A_B" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convPatialEndConv_A_B"></property>
<property name="InnerConversations">
<list>
@@ -74,20 +74,20 @@
</list>
</property>
</object>
<object name="convPatialEndConv_A_B_A" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convPatialEndConv_A_B_A" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convPatialEndConv_A_B_A"></property>
</object>
<object name="convPatialEndConv_A_B_B" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convPatialEndConv_A_B_B" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convPatialEndConv_A_B_B"></property>
</object>
<object name="convPatialEndConv_A_C" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convPatialEndConv_A_C" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convPatialEndConv_A_C"></property>
</object>
<object type="GetParentObjetFromChild.aspx">
<property name="Conversation" ref="convGetParentObjetFromChildChild"></property>
</object>
<object name="convGetParentObjetFromChildParent" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convGetParentObjetFromChildParent" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convGetParentObjetFromChildParent"></property>
<property name="['parentKey']" value="parentValue"></property>
<property name="['overwrittenKey']" value="overwrittenValueParent"></property>
@@ -97,7 +97,7 @@
</list>
</property>
</object>
<object name="convGetParentObjetFromChildChild" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convGetParentObjetFromChildChild" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convGetParentObjetFromChildChild"></property>
<property name="ParenteConversation" ref="convGetParentObjetFromChildParent"></property>
<property name="['childKey']" value="childValue"></property>
@@ -110,7 +110,7 @@
<object type="TimeOut_WithTimeOut.aspx">
<property name="Conversation" ref="convTimeOut"></property>
</object>
<object name="convTimeOut" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convTimeOut" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convTimeOut"></property>
<property name="TimeOut" value="60000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
@@ -147,7 +147,7 @@
<object type="SPCLazyLoadTest_A_Status.aspx">
<property name="Conversation" ref="convSPCLazyLoad"></property>
</object>
<object name="convSPCLazyLoad" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convSPCLazyLoad" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convSPCLazyLoad"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
@@ -160,14 +160,14 @@
<property name="ConversationA" ref="convSPCSwitchConversationSameRequestA"></property>
<property name="SessionFactory" ref="MySessionFactory"/>
</object>
<object name="convSPCSwitchConversationSameRequestA" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convSPCSwitchConversationSameRequestA" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convSPCSwitchConversationSameRequestA"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
<property name="SessionFactoryName" value="MySessionFactory"/>
<property name="DbProviderName" value="DbProvider"/>
</object>
<object name="convSPCSwitchConversationSameRequestB" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convSPCSwitchConversationSameRequestB" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convSPCSwitchConversationSameRequestB"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
@@ -180,7 +180,7 @@
<object type="RedirectErrorNoPauseConversation.aspx">
<property name="Conversation" ref="convRedirectErrorNoPauseConversation"></property>
</object>
<object name="convRedirectErrorNoPauseConversation" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convRedirectErrorNoPauseConversation" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convRedirectErrorNoPauseConversation"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
@@ -197,14 +197,14 @@
<property name="SessionFactory" ref="MySessionFactory"></property>
</object>
<object name="convIoeTestsA" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convIoeTestsA" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convIoeTestsA"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
<property name="SessionFactoryName" value="MySessionFactory"/>
<property name="DbProviderName" value="DbProvider"/>
</object>
<object name="convIoeTestsAA" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convIoeTestsAA" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convIoeTestsAA"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
@@ -217,15 +217,15 @@
<property name="ConvA" ref="convAEndPaused"></property>
<property name="ConvB" ref="convBEndPaused"></property>
</object>
<object name="convAEndPaused" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convAEndPaused" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convAEndPaused"></property>
<property name="ConversationManager" ref="conversationManagerEndPaused"></property>
</object>
<object name="convBEndPaused" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convBEndPaused" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convBEndPaused"></property>
<property name="ConversationManager" ref="conversationManagerEndPaused"></property>
</object>
<object name="conversationManagerEndPaused" type="Spring.ConversationWA.Imple.WebConversationManager, Spring.ConversationWA.NH33" scope="session">
<object name="conversationManagerEndPaused" type="Spring.ConversationWA.Impl.WebConversationManager, Spring.ConversationWA.NH33" scope="session">
<property name="EndPaused" value="true"></property>
</object>
<!--END: EndPausedTest Tests -->
@@ -238,14 +238,14 @@
<property name="Conversation" ref="convBSessionIsClosed"></property>
<property name="ConversationA" ref="convASessionIsClosed"></property>
</object>
<object name="convASessionIsClosed" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convASessionIsClosed" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convASessionIsClosed"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
<property name="SessionFactoryName" value="MySessionFactory"/>
<property name="DbProviderName" value="DbProvider"/>
</object>
<object name="convBSessionIsClosed" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convBSessionIsClosed" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convBSessionIsClosed"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
@@ -261,21 +261,21 @@
<object type="EndPausedSessionIsClosedB.aspx">
<property name="Conversation" ref="convBEndPausedSessionIsClosed"></property>
</object>
<object name="convAEndPausedSessionIsClosed" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convAEndPausedSessionIsClosed" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convAEndPausedSessionIsClosed"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="convMngEndPausedSessionIsClosed"></property>
<property name="SessionFactoryName" value="MySessionFactory"/>
<property name="DbProviderName" value="DbProvider"/>
</object>
<object name="convBEndPausedSessionIsClosed" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convBEndPausedSessionIsClosed" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convBEndPausedSessionIsClosed"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="convMngEndPausedSessionIsClosed"></property>
<property name="SessionFactoryName" value="MySessionFactory"/>
<property name="DbProviderName" value="DbProvider"/>
</object>
<object name="convMngEndPausedSessionIsClosed" type="Spring.ConversationWA.Imple.WebConversationManager, Spring.ConversationWA.NH33" scope="session">
<object name="convMngEndPausedSessionIsClosed" type="Spring.ConversationWA.Impl.WebConversationManager, Spring.ConversationWA.NH33" scope="session">
<property name="SessionFactoryName" value="MySessionFactory"/>
<property name="EndPaused" value="true"/>
</object>
@@ -287,7 +287,7 @@
<property name="SessionFactory" ref="MySessionFactory"/>
<property name="ConnectionReleaseModeIssueBsn" ref="connectionReleaseModeIssueBsn"/>
</object>
<object name="convConnectionReleaseModeIssue" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convConnectionReleaseModeIssue" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convConnectionReleaseModeIssue"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
@@ -303,7 +303,7 @@
<object type="SerializeConversationTest.aspx">
<property name="Conversation" ref="convSerializeConversationTest"/>
</object>
<object name="convSerializeConversationTest" type="Spring.ConversationWA.Imple.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<object name="convSerializeConversationTest" type="Spring.ConversationWA.Impl.WebConversationSpringState, Spring.ConversationWA.NH33" scope="session">
<property name="Id" value="convSerializeConversationTest"></property>
<property name="TimeOut" value="600000"></property>
<property name="ConversationManager" ref="conversationManager"></property>
@@ -313,7 +313,7 @@
<!--END: SerializeConversationTest-->
<!-- BEGIN: Common configuration-->
<object name="conversationManager" type="Spring.ConversationWA.Imple.WebConversationManager, Spring.ConversationWA.NH33" scope="session">
<object name="conversationManager" type="Spring.ConversationWA.Impl.WebConversationManager, Spring.ConversationWA.NH33" scope="session">
<property name="SessionFactoryName" value="MySessionFactory"/>
</object>

View File

@@ -116,8 +116,8 @@
<Compile Include="..\Spring.ConversationWA.NH32.Tests\Entities\SPCMasterEnt.cs">
<Link>Entities\SPCMasterEnt.cs</Link>
</Compile>
<Compile Include="..\Spring.ConversationWA.NH32.Tests\Spring\Data\Common\CountGetConnDbProvider.cs">
<Link>Spring\Data\Common\CountGetConnDbProvider.cs</Link>
<Compile Include="..\Spring.ConversationWA.NH32.Tests\Spring\Data\Common\ConnectionCreationTrackingDbProvider.cs">
<Link>Spring\Data\Common\ConnectionCreationTrackingDbProvider.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>