Windsor 2.1 では、コードが wcf コンテキストで実行されるときに、すべてのサービスのライフスタイルを PerWcfOperation に変更する次のコードがあります。
container.Kernel.ComponentModelBuilder.AddContributor(
new CustomLifestyleLevelingContributeComponentModelConstruction(typeof (PerWcfOperationLifestyle))
ここで、CustomLifestyleLevelingContributeComponentModelConstruction は次のとおりです。
public class CustomLifestyleLevelingContributeComponentModelConstruction : IContributeComponentModelConstruction
{
private readonly Type customLifestyleType;
private readonly List<LifestyleType> ignoredLifetyles;
public CustomLifestyleLevelingContributeComponentModelConstruction(Type customLifestyleType)
{
this.customLifestyleType = customLifestyleType;
}
public void ProcessModel(IKernel kernel, ComponentModel model)
{
model.LifestyleType = LifestyleType.Custom;
model.CustomLifestyle = customLifestyleType;
}
}
私の問題は、クラスPerWcfOperationLifestyle が Windsor 3.0 から削除されたことです。Windsor 3.x で同じ目標を達成する方法を教えてください。