Skip to content

Commit

Permalink
v1.0.35-beta
Browse files Browse the repository at this point in the history
Reordered the parameters of the HostFactory classes' constructors.
Minor cosmetic changes.
  • Loading branch information
vmelamed committed Jan 28, 2016
1 parent 977723f commit d0f97cd
Show file tree
Hide file tree
Showing 18 changed files with 112 additions and 96 deletions.
1 change: 1 addition & 0 deletions Aspects/DIContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ public static void Dump(
/// <param name="container">
/// The container.
/// </param>
[Conditional("DEBUG")]
public static void DebugDump(
this IUnityContainer container)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>AspectExpressionSerialization</id>
<version>1.0.34</version>
<version>1.0.35</version>
<authors>Val Melamed</authors>
<owners>Val Melamed</owners>
<summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
[assembly: AssemblyTitle("vm.Aspects.Linq.Expressions.Serialization")]
[assembly: AssemblyDescription("Serializes and deserializes LINQ expression trees to and from XML documents.")]

[assembly: AssemblyVersion("1.0.34")]
[assembly: AssemblyFileVersion("1.0.34")]
[assembly: AssemblyInformationalVersion("1.0.34")]
[assembly: AssemblyVersion("1.0.35")]
[assembly: AssemblyFileVersion("1.0.35")]
[assembly: AssemblyInformationalVersion("1.0.35")]

[assembly: InternalsVisibleTo(
"vm.Aspects.Linq.Expressions.Serialization.Test, " +
Expand Down
6 changes: 3 additions & 3 deletions Aspects/Model/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
[assembly: AssemblyTitle("vm.Aspect.Model")]
[assembly: AssemblyDescription("Defines the IRepository and related base classes and utilities - a framework of building domain object model.")]

[assembly: AssemblyVersion("1.0.34")]
[assembly: AssemblyFileVersion("1.0.34")]
[assembly: AssemblyInformationalVersion("1.0.34")]
[assembly: AssemblyVersion("1.0.35")]
[assembly: AssemblyFileVersion("1.0.35")]
[assembly: AssemblyInformationalVersion("1.0.35")]

[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(
"vm.Aspects.Model.Tests, " +
Expand Down
10 changes: 3 additions & 7 deletions Aspects/NuGet/vm.Aspects.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>vm.Aspects</id>
<version>1.0.34-beta</version>
<version>1.0.35-beta</version>
<authors>Val Melamed</authors>
<owners>Val Melamed</owners>
<summary>
Expand All @@ -12,12 +12,8 @@
A set of classes, utilities, etc. addressing various common cross-cutting concerns or extending existing similar libraries like Enterprise Library, Unity, etc.
</description>
<releaseNotes>
* Copied the ExceptionShieldingErrorHandler from Enterprise Library and modified to set the `HttpStatusCode`.
For faults that inherit from `vm.Aspects.Wcf.FaultContract.Fault` it takes the code from the fault property `HttpStatusCode`,
for all others - sets the error code to HTTP 500 - internal server error.
* Added the property `HttpStatusCode` to the base class
* Removed the dependency on the NuGet package Microsoft.Practices.EnterpriseLibrary.PolicyInjection which depended on Unity 3.0.
Recompiled and added Microsoft.Practices.EnterpriseLibrary.PolicyInjection as a standalone assembly depending on Unity 4.0.1.
* Reordered the parameters of the HostFactory classes' constructors.
* Minor cosmetic changes.
</releaseNotes>
<licenseUrl>https://github.com/vmelamed/vm/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/vmelamed/vm/tree/master/Aspects</projectUrl>
Expand Down
6 changes: 3 additions & 3 deletions Aspects/Parsers/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
[assembly: AssemblyTitle("vm.Aspects.Parser")]
[assembly: AssemblyDescription("Text parsing readers, e.g. CSV/TSV reader.")]

[assembly: AssemblyVersion("1.0.34")]
[assembly: AssemblyFileVersion("1.0.34")]
[assembly: AssemblyInformationalVersion("1.0.34")]
[assembly: AssemblyVersion("1.0.35")]
[assembly: AssemblyFileVersion("1.0.35")]
[assembly: AssemblyInformationalVersion("1.0.35")]

[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(
"vm.Aspects.Parsers.Tests, " +
Expand Down
6 changes: 3 additions & 3 deletions Aspects/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

[assembly: AssemblyTitle("vm.Aspects")]
[assembly: AssemblyDescription("A set of classes addressing various common cross-cutting concerns.")]
[assembly: AssemblyVersion("1.0.34")]
[assembly: AssemblyFileVersion("1.0.34")]
[assembly: AssemblyInformationalVersion("1.0.34")]
[assembly: AssemblyVersion("1.0.35")]
[assembly: AssemblyFileVersion("1.0.35")]
[assembly: AssemblyInformationalVersion("1.0.35")]


[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
using System.ServiceModel.Dispatcher;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF;

namespace vm.Aspects.Wcf.ExceptionHandling
namespace vm.Aspects.Wcf.ExceptionShieldingBehavior
{
/// <summary>
/// Indicates that an implementation service class will use exception shielding.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
using System.ServiceModel.Dispatcher;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF;

namespace vm.Aspects.Wcf.ExceptionHandling
namespace vm.Aspects.Wcf.ExceptionShieldingBehavior
{
/// <summary>
/// The behavior class that set up the <see cref="ExceptionShieldingErrorHandler"/>
/// for implementing the exception shielding process.
/// </summary>
public class ExceptionShieldingBehavior : IServiceBehavior, IContractBehavior
{
#region ExceptionShieldingBehavior Members
#region ExceptionShieldingBehavior Constructors

private string exceptionPolicyName;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
using Microsoft.Practices.EnterpriseLibrary.Logging;
using vm.Aspects.Wcf.FaultContracts;

namespace vm.Aspects.Wcf.ExceptionHandling
namespace vm.Aspects.Wcf.ExceptionShieldingBehavior
{
/// <summary>
/// The error handler class that implements the exception shielding logic.
Expand Down
6 changes: 3 additions & 3 deletions Aspects/Wcf/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
[assembly: AssemblyTitle("Wcf")]
[assembly: AssemblyDescription("A set of classes and generics simplifying the initial configuration work of creating WCF services.")]

[assembly: AssemblyVersion("1.0.34")]
[assembly: AssemblyFileVersion("1.0.34")]
[assembly: AssemblyInformationalVersion("1.0.34")]
[assembly: AssemblyVersion("1.0.35")]
[assembly: AssemblyFileVersion("1.0.35")]
[assembly: AssemblyInformationalVersion("1.0.35")]

[assembly: System.Runtime.CompilerServices.InternalsVisibleTo(
"vm.Aspects.Wcf.Test, " +
Expand Down
11 changes: 4 additions & 7 deletions Aspects/Wcf/ServicePolicies/ServiceExceptionHandlingPolicies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected override void DoRegister(
container
.RegisterInstanceIfNot<IExceptionPolicyProvider>(
registrations,
"vm.Aspects.Wcf",
"vm.Aspects.Wcf.ServicePolicies",
new ServiceExceptionHandlingPolicies());
}
}
Expand Down Expand Up @@ -83,10 +83,7 @@ public IDictionary<string, IEnumerable<ExceptionPolicyEntry>> ExceptionPolicyEnt
}
#endregion

static NameValueCollection _faultMappings = new NameValueCollection
{
{ "HandlingInstanceId", "{Guid}" },
};
static readonly NameValueCollection _faultMappings = new NameValueCollection {["HandlingInstanceId"] = "{Guid}"};

/// <summary>
/// Creates an exception policy entry that logs the exception and throws a new fault exception created out of the original exception.
Expand All @@ -95,7 +92,7 @@ public IDictionary<string, IEnumerable<ExceptionPolicyEntry>> ExceptionPolicyEnt
/// <param name="faultType">Type of the fault.</param>
/// <param name="eventId">The event identifier.</param>
/// <returns>An <see cref="ExceptionPolicyEntry"/> instance.</returns>
static ExceptionPolicyEntry GetThrowFaultExceptionPolicyEntry(
public static ExceptionPolicyEntry GetThrowFaultExceptionPolicyEntry(
Type exceptionType,
Type faultType,
int eventId)
Expand All @@ -120,7 +117,7 @@ static ExceptionPolicyEntry GetThrowFaultExceptionPolicyEntry(
});
}

[SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification="Refers to many exceptions that can be thrown.")]
[SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Refers to many exceptions that can be thrown.")]
static List<ExceptionPolicyEntry> WcfExceptionShieldingPolicyEntries()
{
int eventId = 3000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Microsoft.Practices.ServiceLocation;
using Microsoft.Practices.Unity;
using vm.Aspects.Facilities;
using vm.Aspects.Wcf.Bindings;

namespace vm.Aspects.Wcf.Services
{
Expand All @@ -25,15 +26,10 @@ namespace vm.Aspects.Wcf.Services
/// registers some Dump metadata,
/// initializes the DIContainer,
/// gets the registrations,
/// registers Facility-s, ExceptionHandler-s, BindingConfigurator-s
/// registers Facility-s, SEH-s, BindingConfigurator-s
/// )
/// DoRegisterDefaults
/// (
/// [ MessagingPatternInitializedServiceHostFactory override:
/// ObtainInitializerResolveName,
/// registers the initializer with InitializerResolveName and ServiceInitializerLifetimeManager
/// ]
///
/// *** good method to override in order to add registration of other facilities, e.g. repositories, etc. ***
/// )
/// (
Expand All @@ -49,28 +45,32 @@ namespace vm.Aspects.Wcf.Services
/// *** good method to override in order to add programmaticly endpoints ***
/// )
/// (
/// configures the host with bindings according to the MessagingPattern, transaction timeout, debug behaviors, metadata behavior,
/// configures the bindings according to the MessagingPattern, transaction timeout, debug behaviors, metadata behavior,
/// subscribes to host.Opening with InitializeHost and host.Closing with CleanupHost
/// *** good method to override in order to add more stuff to the host ***
/// )
///
/// </code>
/// when the service host is created it fires host.Opening
/// <code>
///
/// InitializeHost
/// (
/// makes sure that the service is registered
/// [ MessagingPatternInitializedServiceHostFactory
/// if it resolves the service initializer - calls it asynchronously
/// ]
/// writes a message to the event log
/// *** good method to override in order to add service specific initialization tasks, e.g. data access layer initialization, etc. ***
/// *** good method to override in order to add initialization tasks ***
/// )
/// HostInitialized
/// (
/// here it simply writes an entry in the event log that the service is up fully initialized and ready to process requests.
/// }
///
/// ...
///
/// CleanupHost
/// (
/// writes a message to the event log.
/// *** good method in order to call to add some cleanup tasks ***
/// *** good method to call in order to add some cleanup tasks ***
/// )
/// </code>
/// See also <seealso cref="MessagingPatternServiceHostFactory{TContract}"/>.
Expand All @@ -86,8 +86,9 @@ public class MessagingPatternInitializedServiceHostFactory<TContract, TInitializ

#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="T:MessagingPatternInitializedServiceHostFactory&lt;TContract&gt;"/> class
/// with a messaging pattern set on the interface with <see cref="T:MessagingPatternAttribute"/> or the default and default initializer resolve name (<see langword="null"/>).
/// Initializes a new instance of the <see cref="MessagingPatternInitializedServiceHostFactory{TContract, TInitializeer}"/> class
/// with a messaging pattern set on the interface with <see cref="MessagingPatternAttribute"/> or the default configured in the configuration file
/// and the default initializer resolve name (<see langword="null"/>).
/// </summary>
public MessagingPatternInitializedServiceHostFactory()
: this(null, null)
Expand All @@ -100,7 +101,10 @@ public MessagingPatternInitializedServiceHostFactory()
/// </summary>
/// <param name="messagingPattern">
/// The binding pattern to be applied to all descriptions of end points in the service host.
/// Must be one of the <see cref="P:BindingConfigurator.MessagingPattern"/> registered values, e.g. <c>RequestResponseConfigurator.MessagingPattern</c>.
/// Must be one of the <see cref="BindingConfigurator.MessagingPattern"/> registered values,
/// e.g. <c>RequestResponseConfigurator.MessagingPattern</c>. If <see langword="null"/> the host will try to resolve the messaging
/// pattern from the <see cref="MessagingPatternAttribute"/> applied to the contract (the interface).
/// If the messaging pattern is not resolved yet, the host will assume that the binding is fully configured, e.g. from a config file.
/// </param>
public MessagingPatternInitializedServiceHostFactory(
string messagingPattern)
Expand All @@ -111,8 +115,12 @@ public MessagingPatternInitializedServiceHostFactory(
/// <summary>
/// Initializes a new instance of the <see cref="T:MessagingPatternInitializedServiceHostFactory&lt;TContract&gt;" /> class.
/// </summary>
/// <param name="messagingPattern">The binding pattern to be applied to all descriptions of end points in the service host.
/// Must be one of the <see cref="P:BindingConfigurator.MessagingPattern" /> registered values, e.g. <c>RequestResponseConfigurator.MessagingPattern</c>.
/// <param name="messagingPattern">
/// The binding pattern to be applied to all descriptions of end points in the service host.
/// Must be one of the <see cref="BindingConfigurator.MessagingPattern"/> registered values,
/// e.g. <c>RequestResponseConfigurator.MessagingPattern</c>. If <see langword="null"/> the host will try to resolve the messaging
/// pattern from the <see cref="MessagingPatternAttribute"/> applied to the contract (the interface).
/// If the messaging pattern is not resolved yet, the host will assume that the binding is fully configured, e.g. from a config file.
/// </param>
/// <param name="initializerResolveName">The resolve name of the initializer.</param>
public MessagingPatternInitializedServiceHostFactory(
Expand All @@ -126,21 +134,24 @@ public MessagingPatternInitializedServiceHostFactory(
/// <summary>
/// Initializes a new instance of the <see cref="T:MessagingPatternInitializedServiceHostFactory&lt;TContract&gt;" /> class.
/// </summary>
/// <param name="messagingPattern">The binding pattern to be applied to all descriptions of end points in the service host.
/// Must be one of the <see cref="P:BindingConfigurator.MessagingPattern" /> registered values,
/// e.g. <c>RequestResponseConfigurator.MessagingPattern</c> or it can be <see langword="null" /> in which case
/// the host will try to resolve it from the <see cref="T:MessagingPatternAttribute" /> applied to the service's interface if present.</param>
/// <param name="identityType">Type of the identity: can be <see cref="ServiceIdentity.Dns" />, <see cref="ServiceIdentity.Spn" />, <see cref="ServiceIdentity.Upn" /> or <see cref="ServiceIdentity.Rsa" />.</param>
/// <param name="identity">The identifier in the case of <see cref="ServiceIdentity.Dns" /> should be the DNS name of specified by the service's certificate or machine.
/// If the identity type is <see cref="ServiceIdentity.Upn" /> - use the UPN of the service identity; if <see cref="ServiceIdentity.Spn" /> - use the SPN and if
/// <see cref="ServiceIdentity.Rsa" /> - use the RSA key.</param>
/// <param name="messagingPattern">
/// The binding pattern to be applied to all descriptions of end points in the service host.
/// Must be one of the <see cref="BindingConfigurator.MessagingPattern"/> registered values,
/// e.g. <c>RequestResponseConfigurator.MessagingPattern</c>. If <see langword="null"/> the host will try to resolve the messaging
/// pattern from the <see cref="MessagingPatternAttribute"/> applied to the contract (the interface).
/// If the messaging pattern is not resolved yet, the host will assume that the binding is fully configured, e.g. from a config file.
/// </param>
/// <param name="initializerResolveName">The resolve name of the initializer.</param>
public MessagingPatternInitializedServiceHostFactory(
string messagingPattern,
ServiceIdentity identityType,
string identity,
string messagingPattern = null,
string initializerResolveName = null)
: base(messagingPattern, identityType, identity)
: base(identityType, identity, messagingPattern)
{
Contract.Requires<ArgumentException>(
identityType == ServiceIdentity.None ||
Expand All @@ -153,19 +164,22 @@ public MessagingPatternInitializedServiceHostFactory(
/// <summary>
/// Initializes a new instance of the <see cref="T:MessagingPatternInitializedServiceHostFactory&lt;TContract&gt;" /> class.
/// </summary>
/// <param name="messagingPattern">The binding pattern to be applied to all descriptions of end points in the service host.
/// Must be one of the <see cref="P:BindingConfigurator.MessagingPattern" /> registered values,
/// e.g. <c>RequestResponseConfigurator.MessagingPattern</c> or it can be <see langword="null" /> in which case
/// the host will try to resolve it from the <see cref="T:MessagingPatternAttribute" /> applied to the service's interface if present.</param>
/// <param name="identityType">Type of the identity should be either <see cref="ServiceIdentity.Certificate"/> or <see cref="ServiceIdentity.Rsa"/>.</param>
/// <param name="certificate">Specifies the identifying certificate. Assumes that the identity type is <see cref="ServiceIdentity.Certificate" />.</param>
/// <param name="messagingPattern">
/// The binding pattern to be applied to all descriptions of end points in the service host.
/// Must be one of the <see cref="BindingConfigurator.MessagingPattern"/> registered values,
/// e.g. <c>RequestResponseConfigurator.MessagingPattern</c>. If <see langword="null"/> the host will try to resolve the messaging
/// pattern from the <see cref="MessagingPatternAttribute"/> applied to the contract (the interface).
/// If the messaging pattern is not resolved yet, the host will assume that the binding is fully configured, e.g. from a config file.
/// </param>
/// <param name="initializerResolveName">The resolve name of the initializer.</param>
public MessagingPatternInitializedServiceHostFactory(
string messagingPattern,
ServiceIdentity identityType,
X509Certificate2 certificate,
string messagingPattern = null,
string initializerResolveName = null)
: base(messagingPattern, identityType, certificate)
: base(identityType, certificate, messagingPattern)
{
Contract.Requires<ArgumentException>(
identityType == ServiceIdentity.None ||
Expand Down
Loading

0 comments on commit d0f97cd

Please sign in to comment.