Update NMS libraries.

Note, using privately modified NMS library, not strongly signed.
This commit is contained in:
markpollack
2008-06-14 11:29:59 +00:00
parent e05df65c40
commit 106c5dacfe
29 changed files with 166 additions and 138 deletions

Binary file not shown.

BIN
lib/Net/2.0/Apache.NMS.dll Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -1,90 +1,117 @@
#region License
/*
* Copyright 2002-2007 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;
using Common.Logging;
using Spring.Expressions;
namespace Spring.Aspects.Exceptions
{
/// <summary>
/// Log the exceptions. Default log nameis "LogExceptionHandler" and log level is Debug
/// </summary>
/// <author>Mark Pollack</author>
public class LogExceptionHandler : AbstractExceptionHandler
{
private string logName = "LogExceptionHandler";
/// <summary>
/// Initializes a new instance of the <see cref="LogExceptionHandler"/> class.
/// </summary>
public LogExceptionHandler()
{
ContinueProcessing = true;
}
/// <summary>
/// Initializes a new instance of the <see cref="LogExceptionHandler"/> class.
/// </summary>
/// <param name="exceptionNames">The exception names.</param>
public LogExceptionHandler(string[] exceptionNames) : base(exceptionNames)
{
ContinueProcessing = true;
}
/// <summary>
/// Gets or sets the name of the log.
/// </summary>
/// <value>The name of the log.</value>
public string LogName
{
get { return logName; }
set { logName = value; }
}
/// <summary>
/// Handles the exception.
/// </summary>
/// <param name="callContextDictionary">the calling context dictionary</param>
/// <returns>
/// The return value from handling the exception, if not rethrown or a new exception is thrown.
/// </returns>
public override object HandleException(IDictionary callContextDictionary)
{
ILog log = LogManager.GetLogger(logName);
callContextDictionary.Add("log", log);
try
{
IExpression expression = Expression.Parse(ActionExpressionText);
expression.GetValue(null, callContextDictionary);
}
catch (Exception e)
{
log.Warn("Was not able to evaluate action expression [" + ActionExpressionText + "]", e);
}
return "logged";
}
}
#region License
/*
* Copyright 2002-2007 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;
using Common.Logging;
using Spring.Expressions;
namespace Spring.Aspects.Exceptions
{
/// <summary>
/// Log the exceptions. Default log nameis "LogExceptionHandler" and log level is Debug
/// </summary>
/// <author>Mark Pollack</author>
public class LogExceptionHandler : AbstractExceptionHandler
{
#region Fields
private string logName = "LogExceptionHandler";
private LogLevel logLevel = LogLevel.Trace;
private bool logMessageOnly = false;
#endregion
/// <summary>
/// Initializes a new instance of the <see cref="LogExceptionHandler"/> class.
/// </summary>
public LogExceptionHandler()
{
ContinueProcessing = true;
}
/// <summary>
/// Initializes a new instance of the <see cref="LogExceptionHandler"/> class.
/// </summary>
/// <param name="exceptionNames">The exception names.</param>
public LogExceptionHandler(string[] exceptionNames) : base(exceptionNames)
{
ContinueProcessing = true;
}
/// <summary>
/// Gets or sets the name of the log.
/// </summary>
/// <value>The name of the log.</value>
public string LogName
{
get { return logName; }
set { logName = value; }
}
/// <summary>
/// Gets or sets the log level.
/// </summary>
/// <value>The log level.</value>
public LogLevel LogLevel
{
get { return logLevel; }
set { logLevel = value; }
}
/// <summary>
/// Gets or sets a value indicating whether to log message only, and not pass in the
/// exception to the logging API
/// </summary>
/// <value><c>true</c> if log message only; otherwise, <c>false</c>.</value>
public bool LogMessageOnly
{
get { return logMessageOnly; }
set { logMessageOnly = value; }
}
/// <summary>
/// Handles the exception.
/// </summary>
/// <param name="callContextDictionary">the calling context dictionary</param>
/// <returns>
/// The return value from handling the exception, if not rethrown or a new exception is thrown.
/// </returns>
public override object HandleException(IDictionary callContextDictionary)
{
ILog log = LogManager.GetLogger(logName);
callContextDictionary.Add("log", log);
try
{
IExpression expression = Expression.Parse(ActionExpressionText);
expression.GetValue(null, callContextDictionary);
}
catch (Exception e)
{
log.Warn("Was not able to evaluate action expression [" + ActionExpressionText + "]", e);
}
return "logged";
}
}
}

View File

@@ -348,7 +348,7 @@ namespace Spring.Data.NHibernate
protected override void DoBegin(object transaction, ITransactionDefinition definition)
{
HibernateTransactionObject txObject = (HibernateTransactionObject) transaction;
if (DbProvider != null && TransactionSynchronizationManager.HasResource(DbProvider)
&& !txObject.ConnectionHolder.SynchronizedWithTransaction)
{

View File

@@ -198,11 +198,11 @@ namespace Spring.Data.NHibernate
#endregion
#region Methods
#region Methods
#endregion
#endregion
/// <summary>
/// <summary>
/// Return the singleon session factory.
/// </summary>
/// <returns>The singleon session factory.</returns>
@@ -286,6 +286,7 @@ namespace Spring.Data.NHibernate
}
}
IResourceLoader resourceLoader = new ConfigurableResourceLoader();
if (this.mappingResources != null)

View File

@@ -21,7 +21,7 @@
using System;
using Spring.Transaction.Support;
using Spring.Util;
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms.IConnections
{
@@ -90,7 +90,7 @@ namespace Spring.Messaging.Nms.IConnections
{
conHolderToUse = new NmsResourceHolder();
}
NMS.IConnection con = resourceFactory.GetConnection(conHolderToUse);
Apache.NMS.IConnection con = resourceFactory.GetConnection(conHolderToUse);
ISession session = null;
try
{
@@ -153,12 +153,12 @@ namespace Spring.Messaging.Nms.IConnections
private IConnectionFactory cf;
private bool synchedLocalTransactionAllowed;
public AnonymousClassResourceFactory(NMS.IConnection existingCon, IConnectionFactory cf, bool synchedLocalTransactionAllowed)
public AnonymousClassResourceFactory(Apache.NMS.IConnection existingCon, IConnectionFactory cf, bool synchedLocalTransactionAllowed)
{
InitBlock(existingCon, cf, synchedLocalTransactionAllowed);
}
private void InitBlock(NMS.IConnection existingCon, IConnectionFactory cf, bool synchedLocalTransactionAllowed)
private void InitBlock(Apache.NMS.IConnection existingCon, IConnectionFactory cf, bool synchedLocalTransactionAllowed)
{
this.existingCon = existingCon;
this.cf = cf;
@@ -169,18 +169,18 @@ namespace Spring.Messaging.Nms.IConnections
{
return holder.GetSession(typeof(ISession), existingCon);
}
public virtual NMS.IConnection GetConnection(NmsResourceHolder holder)
public virtual Apache.NMS.IConnection GetConnection(NmsResourceHolder holder)
{
return (existingCon != null ? existingCon : holder.GetConnection());
}
public virtual NMS.IConnection CreateConnection()
public virtual Apache.NMS.IConnection CreateConnection()
{
return cf.CreateConnection();
}
public virtual ISession CreateSession(NMS.IConnection con)
public virtual ISession CreateSession(Apache.NMS.IConnection con)
{
if (synchedLocalTransactionAllowed)
{
@@ -236,7 +236,7 @@ namespace Spring.Messaging.Nms.IConnections
/// <returns> the new NMS ISession
/// </returns>
/// <throws>NMSException if thrown by NMS API methods </throws>
ISession CreateSession(NMS.IConnection con);
ISession CreateSession(Apache.NMS.IConnection con);
/// <summary>

View File

@@ -24,7 +24,7 @@ using Common.Logging;
using Spring.Collections;
using Spring.Transaction.Support;
using Spring.Util;
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms.IConnections
{
@@ -71,7 +71,7 @@ namespace Spring.Messaging.Nms.IConnections
/// </param>
/// <param name="session">the NMS ISession
/// </param>
public NmsResourceHolder(NMS.IConnection connection, ISession session)
public NmsResourceHolder(Apache.NMS.IConnection connection, ISession session)
{
AddConnection(connection);
AddSession(session, connection);
@@ -93,7 +93,7 @@ namespace Spring.Messaging.Nms.IConnections
#region Methods
public void AddConnection(NMS.IConnection connection)
public void AddConnection(Apache.NMS.IConnection connection)
{
//TODO - update Assert utility class...
//Assert.isTrue(!this.frozen, "Cannot add IConnection because NmsResourceHolder is frozen");
@@ -109,7 +109,7 @@ namespace Spring.Messaging.Nms.IConnections
AddSession(session, null);
}
public void AddSession(ISession session, NMS.IConnection connection)
public void AddSession(ISession session, Apache.NMS.IConnection connection)
{
//TOOD update AssertUtils class
//Assert.isTrue(!this.frozen, "Cannot add ISession because NmsResourceHolder is frozen");
@@ -130,12 +130,12 @@ namespace Spring.Messaging.Nms.IConnections
}
}
public virtual NMS.IConnection GetConnection()
public virtual Apache.NMS.IConnection GetConnection()
{
return (!(this.connections.Count == 0) ? (NMS.IConnection)this.connections[0] : null);
return (!(this.connections.Count == 0) ? (Apache.NMS.IConnection)this.connections[0] : null);
}
public virtual NMS.IConnection GetConnection(System.Type connectionType)
public virtual Apache.NMS.IConnection GetConnection(System.Type connectionType)
{
throw new NotImplementedException();
//TODO Updae CollectionUtils...
@@ -152,7 +152,7 @@ namespace Spring.Messaging.Nms.IConnections
return GetSession(sessionType, null);
}
public virtual ISession GetSession(System.Type sessionType, NMS.IConnection connection)
public virtual ISession GetSession(System.Type sessionType, Apache.NMS.IConnection connection)
{
IList sessions = this.sessions;
if (connection != null)
@@ -199,7 +199,7 @@ namespace Spring.Messaging.Nms.IConnections
logger.Debug("Could not close NMS ISession after transaction", ex);
}
}
foreach (NMS.IConnection connection in connections)
foreach (Apache.NMS.IConnection connection in connections)
{
try
{

View File

@@ -18,7 +18,7 @@
#endregion
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms
{

View File

@@ -18,7 +18,7 @@
#endregion
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms
{

View File

@@ -18,7 +18,7 @@
#endregion
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms
{

View File

@@ -18,7 +18,7 @@
#endregion
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms
{

View File

@@ -18,7 +18,7 @@
#endregion
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms
{

View File

@@ -18,7 +18,7 @@
#endregion
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms
{

View File

@@ -4,7 +4,7 @@ using Spring.Context;
using Spring.Messaging.Nms.Support;
using Spring.Messaging.Nms.Support.IDestinations;
using Spring.Util;
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms.Listener
{

View File

@@ -6,7 +6,7 @@ using Spring.Messaging.Nms.Support;
using Spring.Messaging.Nms.Support.Converter;
using Spring.Messaging.Nms.Support.IDestinations;
using Spring.Util;
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms.Listener.Adapter
{

View File

@@ -1,4 +1,4 @@
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms.Listener
{

View File

@@ -1,6 +1,6 @@
using Spring.Collections;
using Spring.Messaging.Nms.Support;
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms.Listener
{
@@ -58,7 +58,7 @@ namespace Spring.Messaging.Nms.Listener
//TODO TaskExectuor abstraction would go here...
SimpleMessageListener listener = new SimpleMessageListener(this, session);
consumer.Listener += new NMS.MessageListener(listener.OnMessage);
consumer.Listener += new Apache.NMS.MessageListener(listener.OnMessage);
return consumer;
}

View File

@@ -18,7 +18,7 @@
#endregion
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms
{

View File

@@ -21,7 +21,7 @@
using System;
using Common.Logging;
using Spring.Objects.Factory;
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms
{

View File

@@ -25,7 +25,7 @@ using Spring.Messaging.Nms.Support.Converter;
using Spring.Messaging.Nms.Support.IDestinations;
using Spring.Transaction.Support;
using Spring.Util;
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms
{

View File

@@ -18,7 +18,7 @@
#endregion
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms.Support.Converter
{

View File

@@ -21,7 +21,7 @@
using System;
using System.Collections;
using System.Runtime.Serialization;
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms.Support.Converter
{

View File

@@ -19,7 +19,7 @@
#endregion
using Spring.Util;
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms.Support.IDestinations
{

View File

@@ -18,7 +18,7 @@
#endregion
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms.Support.IDestinations
{

View File

@@ -19,7 +19,7 @@
#endregion
using Spring.Util;
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms.Support.IDestinations
{

View File

@@ -21,7 +21,7 @@
using System;
using Common.Logging;
using Spring.Objects.Factory;
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms.Support
{

View File

@@ -21,7 +21,7 @@
using System;
using Common.Logging;
using Spring.Util;
using NMS;
using Apache.NMS;
namespace Spring.Messaging.Nms.Support
{

View File

@@ -33,14 +33,14 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\net\2.0\antlr.runtime.dll</HintPath>
</Reference>
<Reference Include="Apache.NMS, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\Net\2.0\Apache.NMS.dll</HintPath>
</Reference>
<Reference Include="Common.Logging, Version=1.1.0.2, Culture=neutral, PublicKeyToken=65e474d141e25e07, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\net\2.0\Common.Logging.dll</HintPath>
</Reference>
<Reference Include="NMS, Version=4.0.0.0, Culture=neutral">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\net\2.0\NMS.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />