Exemple #1
0
        public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            beanContextFactory.RegisterBean <EventListenerRegistry>("eventListenerRegistry").Autowireable(typeof(IEventListenerExtendable), typeof(IEventTargetListenerExtendable), typeof(IEventBatcherExtendable),
                                                                                                          typeof(IEventTargetExtractorExtendable), typeof(IEventBatcher), typeof(IEventDispatcher), typeof(IEventListener), typeof(IEventQueue));

            if (IsNetworkClientMode && IsEventServiceBeanActive)
            {
                beanContextFactory.RegisterBean <ClientServiceBean>("eventServiceWCF")
                .PropertyValue("Interface", typeof(IEventService))
                .PropertyValue("SyncRemoteInterface", typeof(IEventServiceWCF))
                .PropertyValue("AsyncRemoteInterface", typeof(IEventClient))
                .Autowireable <IEventService>();
                //beanContextFactory.registerBean<EventServiceDelegate>("eventService").autowireable<IEventService>();

                if (IsPollingActive)
                {
                    beanContextFactory.RegisterBean <EventPoller>("eventPoller").Autowireable <IEventPoller>();
                    beanContextFactory.Link("eventPoller").To <IOfflineListenerExtendable>();
                }
                else
                {
                    if (Log.InfoEnabled)
                    {
                        Log.Info("Event polling disabled. Reason: property '" + EventConfigurationConstants.PollingActive + "' set to '" + IsPollingActive + "'");
                    }
                }
            }
        }
Exemple #2
0
 public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
 {
     beanContextFactory.RegisterBean("revertChangesHelper", typeof(RevertChangesHelperMock)).Autowireable(typeof(IRevertChangesHelper));
     beanContextFactory.RegisterBean("cache", typeof(CacheMock)).Autowireable(typeof(ICache));
     beanContextFactory.RegisterBean("cacheFactory", typeof(CacheFactoryMock)).Autowireable(typeof(ICacheFactory));
     beanContextFactory.RegisterBean("cacheProvider", typeof(CacheProviderMock)).Autowireable(typeof(ICacheProvider));
     beanContextFactory.RegisterBean("prefetchHelper", typeof(PrefetchHelperMock)).Autowireable(typeof(IPrefetchHelper));
 }
Exemple #3
0
            public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
            {
                beanContextFactory.RegisterBean(bean1Name, typeof(Bean1));
                beanContextFactory.RegisterBean(bean2Name, typeof(Bean2)).Autowireable <Bean2>();
                beanContextFactory.RegisterBean(bean3Name, typeof(Bean3));

                beanContextFactory.RegisterBean <AutowiredTestBean>().Autowireable <AutowiredTestBean>();
            }
Exemple #4
0
            public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
            {
                beanContextFactory.RegisterBean <SingletonContextHandle>(SINGLETON_CCH).PropertyValue("Content", new IBackgroundWorkerParamDelegate <IBeanContextFactory>(new DummyListTestModule().AfterPropertiesSet));
                beanContextFactory.RegisterBean <ThreadLocalContextHandle>(THREADLOCAL_CCH).PropertyValue("Content", new IBackgroundWorkerParamDelegate <IBeanContextFactory>(new DummyListTestModule().AfterPropertiesSet));
                beanContextFactory.RegisterBean <PrototypeContextHandle>(PROTOTYPE_CCH).PropertyValue("Content", new IBackgroundWorkerParamDelegate <IBeanContextFactory>(new DummyListTestModule().AfterPropertiesSet));

                beanContextFactory.RegisterBean <SingletonContextHandle>(SINGLETON_CCH_WITH_CCF).PropertyRef("ContextFactory", CHILD_CONTEXT_FACTORY);
            }
Exemple #5
0
        public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            beanContextFactory.RegisterBean <BytecodeEnhancer>("bytecodeEnhancer").Autowireable(typeof(IBytecodeEnhancer), typeof(IBytecodeBehaviorExtendable));

            IBeanConfiguration bytecodeClassLoaderBC = beanContextFactory.RegisterBean <BytecodeClassLoader>().Autowireable(typeof(IBytecodeClassLoader),
                                                                                                                            typeof(IBytecodePrinter));

            beanContextFactory.Link(bytecodeClassLoaderBC).To <IEventListenerExtendable>().With(typeof(ClearAllCachesEvent)).Optional();
        }
Exemple #6
0
        public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            // Default ObjectCopier implementation
            beanContextFactory.RegisterBean <ObjectCopier>().Autowireable(typeof(IObjectCopier), typeof(IObjectCopierExtendable));

            // Default ObjectCopier extensions
            IBeanConfiguration stringBuilderOCE = beanContextFactory.RegisterBean <StringBuilderOCE>();

            beanContextFactory.Link(stringBuilderOCE).To <IObjectCopierExtendable>().With(typeof(StringBuilder));
        }
Exemple #7
0
        public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            beanContextFactory.RegisterBean <OriWrapperTestBed>("oriWrapperTestBed").Autowireable(typeof(OriWrapperTestBed));

            IBeanConfiguration cacheRetrieverConf = beanContextFactory.RegisterBean <CacheRetrieverMock>();

            beanContextFactory.Link(cacheRetrieverConf).To <ICacheRetrieverExtendable>().With(typeof(EntityA));
            beanContextFactory.Link(cacheRetrieverConf).To <ICacheRetrieverExtendable>().With(typeof(EntityB));
            beanContextFactory.Link(cacheRetrieverConf).To <ICacheRetrieverExtendable>().With(typeof(Material));
            beanContextFactory.Link(cacheRetrieverConf).To <ICacheRetrieverExtendable>().With(typeof(MaterialGroup));
        }
Exemple #8
0
 public static IBeanConfiguration RegisterExtendableBean(IBeanContextFactory beanContextFactory, String beanName, Type providerType,
                                                         Type extendableType)
 {
     if (beanName != null)
     {
         return(beanContextFactory.RegisterBean(beanName, typeof(ExtendableBean)).PropertyValue(ExtendableBean.P_PROVIDER_TYPE, providerType)
                .PropertyValue(ExtendableBean.P_EXTENDABLE_TYPE, extendableType).Autowireable(providerType, extendableType));
     }
     return(beanContextFactory.RegisterBean(typeof(ExtendableBean)).PropertyValue(ExtendableBean.P_PROVIDER_TYPE, providerType)
            .PropertyValue(ExtendableBean.P_EXTENDABLE_TYPE, extendableType).Autowireable(providerType, extendableType));
 }
Exemple #9
0
        public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            beanContextFactory.RegisterBean <MainPage>("mainPage").Precedence(PrecedenceType.LOW);

            beanContextFactory.RegisterBean <UndoNotPersistedCommand>("command_cancel");

            beanContextFactory.RegisterBean <SaveNotPersistedCommand>("command_save").PropertyRef("ControllerService", "client.helloWorldService").PropertyValue("MethodName", "SaveTestEntities")
            .PropertyValue("MethodParameters", new Type[] { typeof(IEnumerable <TestEntity>) });

            beanContextFactory.RegisterBean <SaveNotPersistedCommand>("command_save2").PropertyRef("ControllerService", "client.helloWorldService").PropertyValue("MethodName", "SaveTestEntities2")
            .PropertyValue("MethodParameters", new Type[] { typeof(IEnumerable <TestEntity2>) });
        }
 public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
 {
     for (int a = Count; a-- > 0;)
     {
         beanContextFactory.RegisterBean("name" + a, typeof(TestBean)).PropertyValue("Value", "value");
     }
 }
Exemple #11
0
        public static IBeanConfiguration AddDefaultBytecodeBehavior(IBeanContextFactory beanContextFactory, Type behaviorType)
        {
            IBeanConfiguration behaviorBC = beanContextFactory.RegisterBean(behaviorType);

            beanContextFactory.Link(behaviorBC).To <IBytecodeBehaviorExtendable>();
            return(behaviorBC);
        }
Exemple #12
0
        public virtual void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            if (GenericTransferMapping)
            {
                beanContextFactory.RegisterBean <ValueObjectConfigReader>("valueObjectConfigReader");
                beanContextFactory.Link("valueObjectConfigReader").To <IEventListenerExtendable>().With(typeof(EntityMetaDataAddedEvent));

                beanContextFactory.RegisterBean <ListTypeHelper>("listTypeHelper").Autowireable <IListTypeHelper>();
                beanContextFactory.RegisterBean <MapperServiceFactory>("mapperServiceFactory").Autowireable <IMapperServiceFactory>();

                beanContextFactory.RegisterBean <ExtendableBean>("mapperExtensionRegistry")
                .Autowireable <IDedicatedMapperExtendable>().Autowireable <IDedicatedMapperRegistry>()
                .PropertyValue(ExtendableBean.P_EXTENDABLE_TYPE, typeof(IDedicatedMapperExtendable))
                .PropertyValue(ExtendableBean.P_PROVIDER_TYPE, typeof(IDedicatedMapperRegistry));
            }
        }
        public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            // creates objects that implement the interfaces
            beanContextFactory.RegisterBean(IMPLEMENT_ABSTRACT_OBJECT_FACTORY, typeof(ImplementAbstractObjectFactory)).Autowireable(
                typeof(IImplementAbstractObjectFactory), typeof(IImplementAbstractObjectFactoryExtendable));

            BytecodeModule.AddDefaultBytecodeBehavior(beanContextFactory, typeof(ImplementAbstractObjectBehavior)).PropertyRef("ImplementAbstractObjectFactory",
                                                                                                                               IMPLEMENT_ABSTRACT_OBJECT_FACTORY);
        }
Exemple #14
0
        public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            IBeanConfiguration dummyServiceBC = beanContextFactory.RegisterBean <DummyService>(DUMMY_CACHE_SERVICE).Autowireable(typeof(IClientServiceFactory), typeof(ICacheRetriever));

            beanContextFactory.RegisterAlias(CacheModule.EXTERNAL_CACHE_SERVICE, DUMMY_CACHE_SERVICE);
            beanContextFactory.Link(dummyServiceBC).To <IMergeServiceExtensionExtendable>().With(typeof(Object));


            beanContextFactory.RegisterAlias(CacheModule.ROOT_CACHE_RETRIEVER, "cacheServiceRegistry");
        }
Exemple #15
0
        public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            beanContextFactory.RegisterBean <SecurityContextHolder>().Autowireable(typeof(ISecurityContextHolder), typeof(IAuthorizationChangeListenerExtendable), typeof(ILightweightSecurityContext));

            if (IsNetworkClientMode && IsSecurityBeanActive)
            {
                beanContextFactory.RegisterBean <ClientServiceBean>("securityServiceWCF")
                .PropertyValue("Interface", typeof(ISecurityService))
                .PropertyValue("SyncRemoteInterface", typeof(ISecurityServiceWCF))
                .PropertyValue("AsyncRemoteInterface", typeof(ISecurityClient))
                .Autowireable <ISecurityService>();
                //beanContextFactory.registerBean<SecurityServiceDelegate>("securityService").autowireable<ISecurityService>();
            }
            else if (!IsNetworkClientMode)
            {
                //beanContextFactory.registerBean<SecurityScopeProvider>("securityScopeProvider").autowireable<ISecurityScopeProvider>();
            }
            beanContextFactory.RegisterBean <AESEncryption>("encryption").Autowireable <IEncryption>();
        }
Exemple #16
0
        public virtual void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            beanContextFactory.RegisterBean <CompositeIdFactory>("compositeIdFactory").Autowireable <ICompositeIdFactory>();

            BytecodeModule.AddDefaultBytecodeBehavior <CompositeIdBehavior>(beanContextFactory);
            BytecodeModule.AddDefaultBytecodeBehavior <EntityMetaDataMemberBehavior>(beanContextFactory);

            BytecodeModule.AddDefaultBytecodeBehavior <ObjRefBehavior>(beanContextFactory);
            BytecodeModule.AddDefaultBytecodeBehavior <ObjRefStoreBehavior>(beanContextFactory);
        }
Exemple #17
0
        public virtual void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            IBeanConfiguration privilegeProvider = beanContextFactory.RegisterBean <PrivilegeProvider>().Autowireable <IPrivilegeProvider>();
            IBeanConfiguration ppEventListener   = beanContextFactory.RegisterBean <UnfilteredDataChangeListener>().PropertyRefs(privilegeProvider);

            beanContextFactory.Link(ppEventListener).To <IEventListenerExtendable>().With(typeof(IDataChange));
            beanContextFactory.Link(privilegeProvider, PrivilegeProvider.m_HandleClearAllCaches).To <IEventListenerExtendable>().With(typeof(ClearAllCachesEvent));

            beanContextFactory.RegisterBean <EntityPrivilegeFactoryProvider>().Autowireable <IEntityPrivilegeFactoryProvider>();
            beanContextFactory.RegisterBean <EntityTypePrivilegeFactoryProvider>().Autowireable <IEntityTypePrivilegeFactoryProvider>();

            if (IsNetworkClientMode && IsPrivilegeServiceBeanActive)
            {
                beanContextFactory.RegisterBean <ClientServiceBean>("privilegeServiceWCF")
                .PropertyValue("Interface", typeof(IPrivilegeService))
                .PropertyValue("SyncRemoteInterface", typeof(IPrivilegeServiceWCF))
                .PropertyValue("AsyncRemoteInterface", typeof(IPrivilegeClient)).Autowireable <IPrivilegeService>();
            }
        }
        public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            IBeanConfiguration cacheRetrieverConf = beanContextFactory.RegisterBean <CacheRetrieverMock>();

            beanContextFactory.Link(cacheRetrieverConf).To <ICacheRetrieverExtendable>().With(typeof(Material));
            beanContextFactory.Link(cacheRetrieverConf).To <ICacheRetrieverExtendable>().With(typeof(MaterialType));

            if (dispatcherThread == null)
            {
                Log.Info("Create SyncContext...");
                CreateDispatcherThread(beanContextFactory);
                Log.Info("SyncContext created");
            }
        }
Exemple #19
0
        public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            ParamChecker.AssertNotNull(ProxyFactory, "ProxyFactory");
            // One of maybe hundred models of any type
            beanContextFactory.RegisterBean <GenericViewModel <TestEntity> >("model_TestEntity_all");

            beanContextFactory.RegisterBean <ModelMultiContainer <TestEntity> >("selected_TestEntity_all");

            beanContextFactory.RegisterBean <AllTestEntitiesRefresher>("refresher_TestEntity_all");

            ViewModelDataChangeController <TestEntity> vmdccTestEntity = (ViewModelDataChangeController <TestEntity>)
                                                                         beanContextFactory.RegisterBean <ViewModelDataChangeController <TestEntity> >("controller_TestEntity_all")
                                                                         .PropertyRefs("refresher_TestEntity_all", "model_TestEntity_all").GetInstance();

            vmdccTestEntity.AddRelationPath("Relation");

            beanContextFactory.RegisterBean <GenericViewModel <TestEntity2> >("model_TestEntity2_all");

            beanContextFactory.RegisterBean <AllTest2EntitiesRefresher>("refresher_TestEntity2_all");

            beanContextFactory.RegisterBean <ViewModelDataChangeController <TestEntity2> >("controller_TestEntity2_all")
            .PropertyRefs("refresher_TestEntity2_all", "model_TestEntity2_all").GetInstance();

            IHelloWorldService service = ProxyFactory.CreateProxy <IHelloWorldService>();

            beanContextFactory.RegisterExternalBean("client.helloWorldService", service).Autowireable <IHelloWorldService>();

            if (!IsNetworkClientMode || !IsHelloWorldBeanActive)
            {
                beanContextFactory.RegisterBean <HelloWorldServiceMock>("helloWorldServiceMock");

                beanContextFactory.RegisterBean <RandomDataGenerator>("randomDataGenerator").PropertyRefs(CacheNamedBeans.CacheProviderPrototype);
            }

            // Data output
            // beanContextFactory.registerBean<DataProvider>("dataOutput_model_TestEntity_all").propertyRef("Data", "model_TestEntity_all");

            // Data input
            // beanContextFactory.registerBean<DataConsumer>("model_TestEntity_all_2").propertyValue("Token", "myTokenInSharedData");
        }
Exemple #20
0
        public virtual void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            beanContextFactory.RegisterBean <SecurityScopeProvider>("securityScopeProvider").Autowireable(typeof(ISecurityScopeProvider), typeof(ISecurityScopeChangeExtendable));

#if SILVERLIGHT
            beanContextFactory.RegisterBean <WindowFactory>("windowFactory").Autowireable <IWindowFactory>();
#endif
            beanContextFactory.RegisterBean <BusyController>("busyController").Autowireable <IBusyController>();

            //beanContextFactory.RegisterBean<ClientEntityFactory>("clientEntityFactory").Autowireable<IEntityFactory>();

            beanContextFactory.RegisterBean <UserControlPostProcessor>("UserControlPostProcessor");

            beanContextFactory.RegisterBean <DataChangeControllerPostProcessor>("dataChangeControllerPostProcessor");

#if SILVERLIGHT
            beanContextFactory.RegisterBean <CommandBindingHelper>("commandBindingHelper").Autowireable <ICommandBindingHelper>();
#endif
            SynchronizationContext current = SynchronizationContext.Current;
            if (current != null)
            {
                beanContextFactory.RegisterExternalBean("synchronizationContext", current).Autowireable <SynchronizationContext>();
            }

            beanContextFactory.RegisterBean <SharedData>("sharedData").Autowireable(typeof(ISharedData), typeof(ISharedDataHandOnExtendable));

#if SILVERLIGHT
            beanContextFactory.RegisterBean <FilterDescriptorConverter>("filterDescriptorConverter").Autowireable <IFilterDescriptorConverter>();
#endif

            //TODO Replace by CacheServiceExtendable Mocks
            //if (!IsCacheServiceBeanActive)
            //{
            //    beanContextFactory.registerBean<CacheServiceMock>("cacheServiceMock").autowireable(/*typeof(ICacheService),*/ typeof(IPersistenceMock));
            //}
            //if (!IsMergeServiceBeanActive)
            //{
            //    ParamChecker.AssertNotNull(MergeServiceMockType, "MergeServiceMockType");

            //    //beanContextFactory.registerBean("mergeServiceMock", MergeServiceMockType).autowireable<IMergeService>();
            //}
        }
Exemple #21
0
        public virtual void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            ParamChecker.AssertNotNull(ClientServiceFactoryType, "ClientServiceFactoryType");

            if (IsNetworkClientMode)
            {
                if (IsOfflineModeSupported)
                {
                    //TODO
                    throw new NotSupportedException("Property '" + ServiceConfigurationConstants.OfflineModeSupported + "' with 'true' currently not supported");
                }
                if (!typeof(IClientServiceFactory).IsAssignableFrom(ClientServiceFactoryType))
                {
                    throw new ArgumentException("Type " + ClientServiceFactoryType.FullName + " must implement interface " + typeof(IClientServiceFactory).FullName);
                }
                beanContextFactory.RegisterBean("clientServiceFactory", ClientServiceFactoryType).Autowireable <IClientServiceFactory>();
                //CreateServices(beanContextFactory);
                //beanContextFactory.registerAutowireableBean<IServiceFactory, WCFServiceFactory>();
            }
        }
Exemple #22
0
        public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            beanContextFactory.RegisterBean <RevertChangesHelper>("revertChangesHelper").Autowireable <IRevertChangesHelper>();

            IBeanConfiguration rootCacheClearEventListenerBC = beanContextFactory.RegisterBean <RootCacheClearEventListener>().PropertyRefs(CacheModule.COMMITTED_ROOT_CACHE);

            beanContextFactory.Link(rootCacheClearEventListenerBC).To <IEventListenerExtendable>().With(typeof(ClearAllCachesEvent));

            IBeanConfiguration serviceResultCacheDCL = beanContextFactory.RegisterBean <UnfilteredDataChangeListener>().PropertyRef(
                beanContextFactory.RegisterBean <ServiceResultCacheDCL>());

            beanContextFactory.Link(serviceResultCacheDCL).To <IEventListenerExtendable>().With(typeof(IDataChange));

            IBeanConfiguration cacheDCListener = beanContextFactory.RegisterBean <CacheDataChangeListener>("cacheDataChangeListener");

            beanContextFactory.Link(cacheDCListener).To <IEventListenerExtendable>().With(typeof(IDataChange));

            beanContextFactory.RegisterBean <DataChangeEventBatcher>("dataChangeEventBatcher");
            beanContextFactory.Link("dataChangeEventBatcher").To <IEventBatcherExtendable>().With(typeof(IDataChange));
        }
Exemple #23
0
        public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            IBeanConfiguration registryC = beanContextFactory.RegisterBean <TestRegistry>(LinkContainerTest.REGISTRY_NAME).Autowireable(typeof(ITestListenerExtendable),
                                                                                                                                        typeof(ITestRegistry), typeof(INotifyPropertyChanged));
            IBeanConfiguration listenerC = beanContextFactory.RegisterBean <TestListener>(LinkContainerTest.LISTENER_NAME);

            if (ListenerName == null)
            {
                ListenerName = LinkContainerTest.LISTENER_NAME;
            }
            String registryPropertyName = LinkContainerTest.REGISTRY_PROPERTY_NAME;
            ILinkRegistryNeededConfiguration link1;

            switch (ListenerVariant)
            {
            case ListenerVariant.BY_NAME:
                link1 = beanContextFactory.Link(ListenerName);
                break;

            case ListenerVariant.BY_NAME_DELEGATE:
                if (ExtendableType == null)
                {
                    ExtendableType = typeof(INotifyPropertyChanged);
                }
                beanContextFactory.RegisterExternalBean(LinkContainerTest.LISTENER_DELEGATE_NAME, new PropertyChangedEventHandler(((TestListener)listenerC.GetInstance()).HandlePropertyChangedTest));
                link1 = beanContextFactory.Link(LinkContainerTest.LISTENER_DELEGATE_NAME);
                registryPropertyName = LinkContainerTest.REGISTRY_EVENT_PROPERTY_NAME;
                break;

            case ListenerVariant.BY_NAME_AND_METHOD:
                link1 = beanContextFactory.Link(ListenerName, "HandlePropertyChangedTest");
                break;

            case ListenerVariant.BY_CONF:
                link1 = beanContextFactory.Link(listenerC);
                break;

            case ListenerVariant.BY_CONF_DELEGATE:
                if (ExtendableType == null)
                {
                    ExtendableType = typeof(INotifyPropertyChanged);
                }
                IBeanConfiguration listenerDelegateC = beanContextFactory.RegisterExternalBean(LinkContainerTest.LISTENER_DELEGATE_NAME, new PropertyChangedEventHandler(((TestListener)listenerC.GetInstance()).HandlePropertyChangedTest));
                link1 = beanContextFactory.Link(listenerDelegateC);
                registryPropertyName = LinkContainerTest.REGISTRY_EVENT_PROPERTY_NAME;
                break;

            case ListenerVariant.BY_INSTANCE:
                link1 = beanContextFactory.Link(listenerC.GetInstance());
                break;

            case ListenerVariant.BY_INSTANCE_DELEGATE:
                if (ExtendableType == null)
                {
                    ExtendableType = typeof(INotifyPropertyChanged);
                }
                link1 = beanContextFactory.Link(new PropertyChangedEventHandler(((TestListener)listenerC.GetInstance()).HandlePropertyChangedTest));
                registryPropertyName = LinkContainerTest.REGISTRY_EVENT_PROPERTY_NAME;
                break;

            default:
                throw new System.Exception("Unsupported enum: " + ListenerVariant);
            }

            if (ExtendableType == null)
            {
                ExtendableType = typeof(ITestListenerExtendable);
            }
            ILinkConfigWithOptional link2;

            switch (RegistryVariant)
            {
            case RegistryVariant.BY_EXTENDABLE:
                link2 = link1.To(ExtendableType);
                break;

            case RegistryVariant.BY_NAME_AND_EXTENDABLE:
                link2 = link1.To(LinkContainerTest.REGISTRY_NAME, ExtendableType);
                break;

            case RegistryVariant.BY_NAME_AND_EVENT:
                link2 = link1.To(LinkContainerTest.REGISTRY_NAME, new EventDelegate <Object>(registryPropertyName));
                break;

            case RegistryVariant.BY_NAME_AND_PROPERTY:
                link2 = link1.To(LinkContainerTest.REGISTRY_NAME, registryPropertyName);
                break;

            case RegistryVariant.BY_INSTANCE_AND_EXTENDABLE:
                link2 = link1.To(registryC.GetInstance(), ExtendableType);
                break;

            case RegistryVariant.BY_INSTANCE_AND_EVENT:
                link2 = link1.To(registryC.GetInstance(), new EventDelegate <Object>(registryPropertyName));
                break;

            case RegistryVariant.BY_INSTANCE_AND_PROPERTY:
                link2 = link1.To(registryC.GetInstance(), registryPropertyName);
                break;

            default:
                throw new System.Exception("Unsupported enum: " + RegistryVariant);
            }
            if (Optional)
            {
                link2.Optional();
                link2 = null;
            }
        }
Exemple #24
0
 public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
 {
     beanContextFactory.RegisterBean <XmlConfigUtil>("xmlConfigUtil").Autowireable <IXmlConfigUtil>();
 }
Exemple #25
0
        public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            beanContextFactory.RegisterBean <ThreadPool>("threadPool").Autowireable(typeof(IThreadPool), typeof(IDelayedExecution));

            beanContextFactory.RegisterBean <BooleanArrayConverter>("booleanArrayConverter");
            DedicatedConverterUtil.BiLink(beanContextFactory, "booleanArrayConverter", typeof(String), typeof(bool[]));

            beanContextFactory.RegisterBean <ByteArrayConverter>("byteArrayConverter");
            DedicatedConverterUtil.BiLink(beanContextFactory, "byteArrayConverter", typeof(String), typeof(byte[]));

            beanContextFactory.RegisterBean <SByteArrayConverter>("sbyteArrayConverter");
            DedicatedConverterUtil.BiLink(beanContextFactory, "sbyteArrayConverter", typeof(String), typeof(sbyte[]));

            beanContextFactory.RegisterBean <CharArrayConverter>("charArrayConverter");
            DedicatedConverterUtil.BiLink(beanContextFactory, "charArrayConverter", typeof(String), typeof(char[]));

            IBeanConfiguration stringToFileConverter = beanContextFactory.RegisterBean <StringToFileConverter>();

            DedicatedConverterUtil.Link(beanContextFactory, stringToFileConverter, typeof(String), typeof(FileInfo));
            DedicatedConverterUtil.Link(beanContextFactory, stringToFileConverter, typeof(String), typeof(DirectoryInfo));

            IBeanConfiguration stringToClassArrayConverter = beanContextFactory.RegisterBean <StringToClassArrayConverter>();

            DedicatedConverterUtil.BiLink(beanContextFactory, stringToClassArrayConverter, typeof(String), typeof(Type[]));

            IBeanConfiguration stringToDoubleArrayConverter = beanContextFactory.RegisterBean <StringToDoubleArrayConverter>();

            DedicatedConverterUtil.BiLink(beanContextFactory, stringToDoubleArrayConverter, typeof(String), typeof(double[]));

            IBeanConfiguration stringToFloatArrayConverter = beanContextFactory.RegisterBean <StringToFloatArrayConverter>();

            DedicatedConverterUtil.BiLink(beanContextFactory, stringToFloatArrayConverter, typeof(String), typeof(float[]));

            IBeanConfiguration stringToIntArrayConverter = beanContextFactory.RegisterBean <StringToIntArrayConverter>();

            DedicatedConverterUtil.BiLink(beanContextFactory, stringToIntArrayConverter, typeof(String), typeof(int[]));

            IBeanConfiguration stringToLongArrayConverter = beanContextFactory.RegisterBean <StringToLongArrayConverter>();

            DedicatedConverterUtil.BiLink(beanContextFactory, stringToLongArrayConverter, typeof(String), typeof(long[]));

            IBeanConfiguration stringToPatternConverterBC = beanContextFactory.RegisterBean <StringToPatternConverter>();

            DedicatedConverterUtil.BiLink(beanContextFactory, stringToPatternConverterBC, typeof(String), typeof(Regex));
            DedicatedConverterUtil.BiLink(beanContextFactory, stringToPatternConverterBC, typeof(String), typeof(Regex[]));

            IBeanConfiguration stringToStringArrayConverter = beanContextFactory.RegisterBean <StringToStringArrayConverter>();

            DedicatedConverterUtil.BiLink(beanContextFactory, stringToStringArrayConverter, typeof(String), typeof(String[]));

            beanContextFactory.RegisterBean <InterningFeature>("interningFeature").Autowireable <IInterningFeature>();

            beanContextFactory.RegisterBean <GuiThreadHelper>("guiThreadHelper").Autowireable <IGuiThreadHelper>();

            beanContextFactory.RegisterBean <MultithreadingHelper>().Autowireable <IMultithreadingHelper>();
        }
 public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
 {
     beanContextFactory.RegisterBean <ProgressDispatcherTL>("progressDispatcher").Autowireable <IProgressDispatcher>();
 }
 public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
 {
     beanContextFactory.RegisterBean <XmlConfigUtil>("xmlConfigUtil").Autowireable(typeof(IXmlConfigUtil));
     beanContextFactory.RegisterBean <XmlTypeHelper>("xmlTypeHelper").Autowireable <IXmlTypeHelper>();
 }
Exemple #28
0
        public virtual void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            beanContextFactory.RegisterAutowireableBean <IMergeController, MergeController>();
            beanContextFactory.RegisterAutowireableBean <IMergeProcess, MergeProcess>();
            beanContextFactory.RegisterAutowireableBean <ICUDResultApplier, CUDResultApplier>();
            beanContextFactory.RegisterAutowireableBean <ICUDResultComparer, CUDResultComparer>();

            beanContextFactory.RegisterAutowireableBean <CompositeIdMixin, CompositeIdMixin>();
            beanContextFactory.RegisterAutowireableBean <ObjRefMixin, ObjRefMixin>();

            beanContextFactory.RegisterBean <SecurityScopeProvider>().Autowireable(typeof(ISecurityScopeProvider), typeof(ISecurityScopeChangeListenerExtendable));
            beanContextFactory.RegisterBean <SecurityActivation>().Autowireable <ISecurityActivation>();

            beanContextFactory.RegisterBean <CacheModification>().Autowireable <ICacheModification>();

            beanContextFactory.RegisterAutowireableBean <IObjRefHelper, ObjRefHelper>();
            beanContextFactory.RegisterBean <CUDResultHelper>().Autowireable(typeof(ICUDResultHelper), typeof(ICUDResultExtendable));

            beanContextFactory.RegisterBean <EntityMetaDataReader>().Autowireable <IEntityMetaDataReader>();

            beanContextFactory.RegisterBean <MergeServiceRegistry>().Autowireable(typeof(IMergeService), typeof(IMergeServiceExtensionExtendable), typeof(IMergeListenerExtendable),
                                                                                  typeof(IMergeTimeProvider));

            IBeanConfiguration valueObjectMap = beanContextFactory.RegisterBean <ValueObjectMap>();

            IBeanConfiguration entityMetaDataProvider = beanContextFactory.RegisterBean <EntityMetaDataProvider>()
                                                        .PropertyRef("ValueObjectMap", valueObjectMap)
                                                        .Autowireable <IEntityMetaDataProvider>()
                                                        .Autowireable <IEntityMetaDataRefresher>()
                                                        .Autowireable <IValueObjectConfigExtendable>()
                                                        .Autowireable <IEntityLifecycleExtendable>()
                                                        .Autowireable <ITechnicalEntityTypeExtendable>()
                                                        .Autowireable <IEntityMetaDataExtendable>()
                                                        .Autowireable <IEntityInstantiationExtensionExtendable>();

            beanContextFactory.RegisterBean <IndependentEntityMetaDataReader>(INDEPENDENT_META_DATA_READER).Precedence(PrecedenceType.HIGH);

            if (!IndependentMetaData)
            {
                IBeanConfiguration entityMetaDataConverter = beanContextFactory.RegisterBean <EntityMetaDataConverter>();
                DedicatedConverterUtil.BiLink(beanContextFactory, entityMetaDataConverter, typeof(EntityMetaData), typeof(EntityMetaDataTransfer));

                beanContextFactory.RegisterBean <EntityMetaDataClient>(REMOTE_ENTITY_METADATA_PROVIDER);
            }
            else
            {
            }

            IBeanConfiguration ormConfigGroupProvider = beanContextFactory.RegisterBean <OrmConfigGroupProvider>().Autowireable <IOrmConfigGroupProvider>();

            beanContextFactory.Link(ormConfigGroupProvider, OrmConfigGroupProvider.handleClearAllCachesEvent).To <IEventListenerExtendable>()
            .With(typeof(ClearAllCachesEvent));

            IBeanConfiguration ormXmlReaderLegathy = beanContextFactory.RegisterBean <OrmXmlReaderLegathy>();

            ExtendableBean.RegisterExtendableBean(beanContextFactory, typeof(IOrmXmlReaderRegistry), typeof(IOrmXmlReaderExtendable))        //
            .PropertyRef(ExtendableBean.P_DEFAULT_BEAN, ormXmlReaderLegathy);
            IBeanConfiguration ormXmlReader20BC = beanContextFactory.RegisterBean <OrmXmlReader20>();

            beanContextFactory.Link(ormXmlReader20BC).To <IOrmXmlReaderExtendable>().With(OrmXmlReader20.ORM_XML_NS);

            beanContextFactory.RegisterBean <XmlConfigUtil>().Autowireable <IXmlConfigUtil>();

            beanContextFactory.RegisterBean <RelationProvider>().Autowireable(typeof(IRelationProvider), typeof(INoEntityTypeExtendable));

            beanContextFactory.RegisterBean <MemberTypeProvider>().Autowireable <IMemberTypeProvider>().Autowireable <IIntermediateMemberTypeProvider>();
            beanContextFactory.RegisterBean <EmbeddedMemberMixin>().Autowireable <EmbeddedMemberMixin>();

            beanContextFactory.RegisterBean <ObjRefFactory>().Autowireable <IObjRefFactory>();
            IBeanConfiguration objRefObjectCopierExtension = beanContextFactory.RegisterBean <ObjRefObjectCopierExtension>();

            beanContextFactory.Link(objRefObjectCopierExtension).To <IObjectCopierExtendable>().With(typeof(IObjRef));

            Type entityFactoryType = this.EntityFactoryType;

            if (entityFactoryType == null)
            {
                entityFactoryType = typeof(EntityFactory);
            }
            beanContextFactory.RegisterBean("entityFactory", entityFactoryType).Autowireable <IEntityFactory>();

            beanContextFactory.RegisterBean <ObjRefStoreEntryProvider>().Autowireable <IObjRefStoreEntryProvider>();

            if (IsNetworkClientMode && IsMergeServiceBeanActive)
            {
                IBeanConfiguration remoteMergeServiceExtension = beanContextFactory.RegisterBean <ClientServiceBean>(DEFAULT_MERGE_SERVICE_EXTENSION)
                                                                 .PropertyValue("Interface", typeof(IMergeServiceExtension))
                                                                 .PropertyValue("SyncRemoteInterface", typeof(IMergeServiceWCF))
                                                                 .PropertyValue("AsyncRemoteInterface", typeof(IMergeClient));

                // register to all entities in a "most-weak" manner
                beanContextFactory.Link(remoteMergeServiceExtension).To <IMergeServiceExtensionExtendable>().With(typeof(Object));
            }
        }
Exemple #29
0
        public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            if (TypeInfoProviderType == null)
            {
                TypeInfoProviderType = typeof(TypeInfoProvider);
            }
            if (IsNetworkClientMode)
            {
                beanContextFactory.RegisterBean <ServiceFactory>("serviceFactory");

                if (!IsOfflineModeSupported)
                {
                    // Register default service url provider
                    beanContextFactory.RegisterBean <DefaultServiceUrlProvider>("serviceUrlProvider").Autowireable(typeof(IServiceUrlProvider), typeof(IOfflineListenerExtendable));
                }
                if (ServiceRemoteInterceptorType == null)
                {
                    ServiceRemoteInterceptorType = typeof(SyncClientServiceInterceptorBuilder);
                }
                beanContextFactory.RegisterBean("clientServiceInterceptorBuilder", ServiceRemoteInterceptorType).Autowireable <IClientServiceInterceptorBuilder>();
            }
            else if (!IsOfflineModeSupported)
            {
                beanContextFactory.RegisterBean <NoOpOfflineExtendable>().Autowireable <IOfflineListenerExtendable>();
            }

            beanContextFactory.RegisterBean("serviceByNameProvider", typeof(ServiceByNameProvider)).Autowireable(
                typeof(IServiceByNameProvider), typeof(IServiceExtendable));

            beanContextFactory.RegisterBean <ServiceResultProcessorRegistry>("serviceResultProcessorRegistry").Autowireable(
                typeof(IServiceResultProcessorRegistry), typeof(IServiceResultProcessorExtendable));

            beanContextFactory.RegisterBean("typeInfoProvider", TypeInfoProviderType).Autowireable <ITypeInfoProvider>();

            beanContextFactory.RegisterBean <TypeInfoProviderFactory>("typeInfoProviderFactory").PropertyValue("TypeInfoProviderType", TypeInfoProviderType)
            .Autowireable <ITypeInfoProviderFactory>();

            beanContextFactory.RegisterBean <LoggingPostProcessor>("loggingPostProcessor");

            if (IsNetworkClientMode && IsProcessServiceBeanActive)
            {
                beanContextFactory.RegisterBean <ClientServiceBean>("processServiceWCF")
                .PropertyValue("Interface", typeof(IProcessService))
                .PropertyValue("SyncRemoteInterface", typeof(IProcessServiceWCF))
                .PropertyValue("AsyncRemoteInterface", typeof(IProcessClient))
                .Autowireable <IProcessService>();
            }
            beanContextFactory.RegisterBean <XmlTypeHelper>("xmlTypeHelper").Autowireable <IXmlTypeHelper>();
        }
        public void AfterPropertiesSet(IBeanContextFactory beanContextFactory)
        {
            beanContextFactory.RegisterBean <ClasspathScanner>().Autowireable <IClasspathScanner>();

            beanContextFactory.RegisterBean <ModuleScanner>();
        }