hey,
i am trying to implement a single Application Pool that will include a
Container
in this container i would like to have a subContainer per every
WCFComponent.
meaning:
Service1.svc will be in Child1
Service2.svc will be in Child2
Child1 and Child2 will be in Parent
can this be done?
cause from my testing once i register 2 differenet Services one on
each Container
the first one registerd doesnt work.
here is my code:
public class ContainerBuilder
{
static WindsorContainer parent = new WindsorContainer();
static WindsorContainer child;
static WindsorContainer child2;
public static IWindsorContainer Build()
{
var debug = new ServiceDebugBehavior
{
IncludeExceptionDetailInFaults = true
};
var metadata = new ServiceMetadataBehavior
{
HttpGetEnabled = true
};
parent.AddFacility<WcfFacility>();
child = new WindsorContainer();
child
.Register(
Component.For<IServiceBehavior>().Instance(debug),
Component.For<IServiceBehavior>().Instance(metadata),
Component.For<IPostAtomFeedMapper>().ImplementedBy<DefaultPostAtomFeedMapper>(),
Component
.For<IService1>()
.ImplementedBy<Service1>()
.Named("blogService2")
.LifeStyle.Transient
.ActAs(new DefaultServiceModel().Hosted()
.AddBaseAddresses("http://localhost:51223/
Service1.svc")),
Component.For<ILogger>().ImplementedBy<DefaultLogger>().LifeStyle.Transient
);
child2 = new WindsorContainer();
child2
.Register(
Component.For<IServiceBehavior>().Instance(metadata),
Component.For<IServiceBehavior>().Instance(debug),
Component.For<IPostAtomFeedMapper>().ImplementedBy<DefaultPostAtomFeedMapper>(),
Component
.For<IService2>()
.ImplementedBy<Service2>()
.Named("blogService")
.LifeStyle.Transient
.ActAs(new DefaultServiceModel().Hosted()
.AddBaseAddresses("http://localhost:51223/
Service2.svc")),
Component.For<ILogger>().ImplementedBy<DefaultLogger>().LifeStyle.Transient
);
parent.AddChildContainer(child);
parent.AddChildContainer(child2);
return parent;
}
}
--
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en.