예제 #1
0
        protected override void Install(IWindsorContainer container, IConfigurationStore store, FromTypesDescriptor allLoadedTypes)
        {
            container.Register(
                Component
                .For(typeof(IDao <>))
                .ImplementedBy(typeof(NHibernateStatefulDao <>)),

                Component
                .For <IDao <LogModel> >()
                .ImplementedBy <NHibernateStatelessDao <LogModel> >()
                );
        }
예제 #2
0
        protected override void Install(IWindsorContainer container, IConfigurationStore store, FromTypesDescriptor allLoadedTypes)
        {
            container.Register(
                Component
                .For <IResultTransformer>()
                .ImplementedBy <ChainedResultTransformer>()
                .IsDefault(),

                allLoadedTypes
                .BasedOn <IExecutionItemList>()
                .WithService
                .FromInterface()
                );
        }
예제 #3
0
        protected override void Install(IWindsorContainer container, IConfigurationStore store, FromTypesDescriptor allLoadedTypes)
        {
            container.Register(
                Compositor
                .Of <IInstantiator>()
                .In(allLoadedTypes)
                .ImplementedBy <CompositeInstantiator>(),

                Compositor
                .Of <IMapper>()
                .In(allLoadedTypes)
                .ImplementedBy <CompositeMapper>()
                );
        }
예제 #4
0
        protected override void Install(IWindsorContainer container, IConfigurationStore store, FromTypesDescriptor allLoadedTypes)
        {
            container.Register(
                allLoadedTypes
                .BasedOn <IPersistenceConfigurerProvider>()
                .WithService
                .FromInterface(),

                Component
                .For <IPersistenceConfigurerProvider>()
                .ImplementedBy <ChainedPersistenceConfigurerProvider>().IsDefault()
                );
        }
예제 #5
0
 protected override void Install(IWindsorContainer container, IConfigurationStore store, FromTypesDescriptor allLoadedTypes)
 {
     container.Register(
         allLoadedTypes
         .BasedOn <IAutoPersistenceModelProvider>()
         .WithService
         .FromInterface()
         );
 }
예제 #6
0
        protected override void Install(IWindsorContainer container, IConfigurationStore store, FromTypesDescriptor allLoadedTypes)
        {
            container.Register(
                Component
                .For(typeof(ILuceneDao <>))
                .ImplementedBy(typeof(LuceneDao <>))
                .NamedAutomatically("LuceneDao"),

                Component
                .For(typeof(ISessionProviderFactory <>))
                .ImplementedBy(typeof(LuceneSessionProviderFactory <>), new ImplementationMatchingStrategy(), new ServiceStrategy())
                .NamedAutomatically("LuceneSessionProviderFactory"),

                allLoadedTypes
                .BasedOn(typeof(ILuceneMap <>))
                .WithService
                .AllInterfaces(),

                //TODO: Cache decoartor of LuceneSessionProviderFactory<> must be...
                allLoadedTypes
                .BasedOn <ILuceneDataProviderFactory>()
                .WithService
                .FromInterface(),

                Decorator
                .Of <ILuceneDataProviderFactory>()
                .Is <CacheDecorator>()
                );
        }
예제 #7
0
        protected override void Install(IWindsorContainer container, IConfigurationStore store, FromTypesDescriptor allLoadedTypes)
        {
            container.Register(
                Component
                .For(typeof(INHibernateStatefulDao <>))
                .ImplementedBy(typeof(NHibernateStatefulDao <>))
                .NamedAutomatically("NHibernateStatefulDao"),

                Component
                .For <ISessionProviderFactory <NHibernateStatefulSession> >()
                .ImplementedBy <NHibernateStatefulSessionProviderFactory>()
                .NamedAutomatically("NHibernateStatefulSessionProviderFactory"),

                Decorator
                .Of <ISessionProviderFactory <NHibernateStatefulSession> >()
                .Is <Core.Session.Provider.Factory.Decoration.CacheDecorator <NHibernateStatefulSession> >(),

                Component
                .For(typeof(INHibernateStatelessDao <>))
                .ImplementedBy(typeof(NHibernateStatelessDao <>))
                .NamedAutomatically("INHibernateStatelessDao"),

                Component
                .For <ISessionProviderFactory <NHibernateStatelessSession> >()
                .ImplementedBy <NHibernateStatelessSessionProviderFactory>()
                .NamedAutomatically("NHibernateStatelessSessionProviderFactory"),

                Decorator
                .Of <ISessionProviderFactory <NHibernateStatelessSession> >()
                .Is <Core.Session.Provider.Factory.Decoration.CacheDecorator <NHibernateStatelessSession> >(),

                Component
                .For <INHibernateSessionFactoryBuilder>()
                .ImplementedBy <DefaultNHibernateSessionFactoryBuilder>(),

                Decorator
                .Of <INHibernateSessionFactoryBuilder>()
                .Is <CacheDecorator>()
                );
        }
예제 #8
0
        protected override void Install(IWindsorContainer container, IConfigurationStore store, FromTypesDescriptor allLoadedTypes)
        {
            container.AddFacility <TypedFactoryFacility>();
            //IsDefault composti'lerde zaten oluyor olmalı
            //Composite lerde from interface yettmiyor, all interfaces yap bari :( ya da explicit olarak şu interface diye söyle.

            container.Register(
                Compositor
                .Of <IDefaultSessionProvider>()
                .In(allLoadedTypes)
                .ImplementedBy <CompositeDefaultSessionProvider>()
                .IsDefault(),

                Compositor
                .Of <IDefaultSessionAliasProvider>()
                .In(allLoadedTypes)
                .ImplementedBy <ChainedSessionAliasProvider>()
                .IsDefault(),

                allLoadedTypes
                .BasedOn <ISession>()
                .WithService
                .Self()
                //.LifestyleCustom<SessionLifeStyleManager>()
                .LifestyleScoped <ScopeAccessor>()
                .Configure(registration => registration.UsingFactoryMethod(BuildSession)),

                Component
                .For <ISessionLifeStyleProvider>()
                .ImplementedBy <DefaultSessionLifeStyleProvider>()
                .IsFallback()
                );
        }
예제 #9
0
        protected override void Install(IWindsorContainer container, IConfigurationStore store, FromTypesDescriptor allLoadedTypes)
        {
            container.Register(
                Component
                .For(typeof(ILogger <ServiceLog>))
                .ImplementedBy(typeof(DemoLogger)),

                Component
                .For <IService>()
                .ImplementedBy <DefaultService>(),

                Component
                .For <IContextProvider <InvocationContext> >()
                .Forward <InvocationContextProvider>()
                .ImplementedBy <InvocationContextProvider>()
                .LifeStyle
                .PerThread
                );
        }
예제 #10
0
        protected override void Install(IWindsorContainer container, IConfigurationStore store, FromTypesDescriptor allLoadedTypes)
        {
            //TODO: ISerializer için de default bir registration olmalı
            container.Register(
                allLoadedTypes
                .BasedOn(typeof(IBinarySerializer <>))
                .WithService
                .FirstInterface(),

                allLoadedTypes
                .BasedOn(typeof(IXmlSerializer <>))
                .WithService
                .FirstInterface(),

                allLoadedTypes
                .BasedOn(typeof(IJsonSerializer <>))
                .WithService
                .FirstInterface(),

                Component
                .For <Serializer>(),

                Component
                .For <XmlSerializer>(),

                Component
                .For <BinarySerializer>(),

                Component
                .For <JsonSerializer>()
                );
        }
예제 #11
0
 protected override void Install(IWindsorContainer container, IConfigurationStore store, FromTypesDescriptor allLoadedTypes)
 {
     container.Register(
         Component
         .For(typeof(IDao <>))
         .ImplementedBy(typeof(LuceneDao <>))
         );
 }
예제 #12
0
        protected override void Install(IWindsorContainer container, IConfigurationStore store, FromTypesDescriptor allLoadedTypes)
        {
            container.Register(
                allLoadedTypes
                .BasedOn(typeof(IServiceAspect <>))
                .WithService
                .FromInterface()
                .Configure(ConfigureAspect),

                allLoadedTypes
                .BasedOn <IServiceAspectApplier>()
                .WithService
                .FromInterface(),

                Component
                .For <IServiceAspectApplier>()
                .ImplementedBy <CompositeServiceAspectApplier>()
                .IsDefault(),

                Component
                .For <IModelInterceptorsSelector>()
                .ImplementedBy <DefaultModelInterceptorsSelector>()
                );

            IModelInterceptorsSelector modelInterceptorsSelector = container.Resolve <IModelInterceptorsSelector>();

            container.Kernel.ProxyFactory.AddInterceptorSelector(modelInterceptorsSelector);
        }