Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
49 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,40 @@ | ||
using System; | ||
using System.Net; | ||
using Alexandria.Backend.Model; | ||
using Alexandria.Backend.Modules; | ||
using Castle.Core; | ||
using Castle.Facilities.FactorySupport; | ||
using Castle.MicroKernel.Registration; | ||
using HibernatingRhinos.Profiler.Appender.NHibernate; | ||
using log4net.Appender; | ||
using log4net.Config; | ||
using log4net.Core; | ||
using log4net.Layout; | ||
using NHibernate; | ||
using NHibernate.Cfg; | ||
using NHibernate.Tool.hbm2ddl; | ||
using Rhino.ServiceBus.Hosting; | ||
using Rhino.ServiceBus.MessageModules; | ||
|
||
namespace Alexandria.Backend | ||
{ | ||
public class AlexandriaBootStrapper : AbstractBootStrapper | ||
{ | ||
public AlexandriaBootStrapper() | ||
{ | ||
NHibernateProfiler.Initialize(); | ||
} | ||
public class AlexandriaBootStrapper : AbstractBootStrapper | ||
{ | ||
public AlexandriaBootStrapper() | ||
{ | ||
NHibernateProfiler.Initialize(); | ||
} | ||
|
||
protected override void ConfigureContainer() | ||
{ | ||
container.Kernel.AddFacility("factory", new FactorySupportFacility()); | ||
protected override void ConfigureContainer() | ||
{ | ||
var cfg = new Configuration() | ||
.Configure("nhibernate.config"); | ||
var sessionFactory = cfg.BuildSessionFactory(); | ||
|
||
var cfg = new Configuration() | ||
.Configure("nhibernate.config"); | ||
container.Kernel.AddFacility("factory", new FactorySupportFacility()); | ||
|
||
var sessionFactory = cfg.BuildSessionFactory(); | ||
container.Register(Component.For<ISessionFactory>().Instance(sessionFactory)); | ||
container.Register( | ||
Component.For<ISessionFactory>() | ||
.Instance(sessionFactory), | ||
Component.For<IMessageModule>() | ||
.ImplementedBy<NHibernateMessageModule>(), | ||
Component.For<ISession>() | ||
.UsingFactoryMethod(() => NHibernateMessageModule.CurrentSession) | ||
.LifeStyle.Is(LifestyleType.Transient)); | ||
|
||
container.Register(Component.For<IMessageModule>().ImplementedBy<NHibernateMessageModule>()); | ||
|
||
container.Register(Component.For<ISession>() | ||
.UsingFactoryMethod(() => NHibernateMessageModule.CurrentSession) | ||
.LifeStyle.Is(LifestyleType.Transient)); | ||
|
||
base.ConfigureContainer(); | ||
} | ||
} | ||
base.ConfigureContainer(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.