/// <summary> /// Creates the handler repository. /// </summary> /// <returns></returns> private ListenerConfigurator CreateHandlerRepository() { var handlerRepositoryFactory = HandlerRepositoryFactory.GetFactory <ListenersHandlerRepositoryFactory>(); var assemblies = _listenerConfig.HandlersAssemblies.Cast <HandlerAssemblyConfig>().Select(ha => ha.Assembly).ToList(); _handlerRepository = handlerRepositoryFactory.Create(assemblies); return(this); }
/// <summary> /// Creates the handler repository. /// </summary> /// <returns></returns> private ServiceProcessorConfigurator CreateHandlerRepository() { var handlerRepositoryFactory = HandlerRepositoryFactory.GetFactory <ServiceHandlerRepositoryFactory>(); var assemblies = _serviceProcessorConfig.HandlersAssemblies.Cast <HandlerAssemblyConfig>().Select(ha => ha.Assembly); _handlerRepository = handlerRepositoryFactory.Create(assemblies); return(this); }
public void LoadHandlersFromAssemblies() { var contextManager = new Mock <IContextManager>(); contextManager.Setup(c => c.AddComponent(It.IsAny <Type>())); var handlerRepository = HandlerRepositoryFactory.GetFactory <ServiceHandlerRepositoryFactory>(contextManager.Object) .Create(new List <string> { "Operativa.UI.Envios.dll" }); Assert.IsTrue(handlerRepository.GetHandlersByMessage(typeof(MessageFake)).Any()); }
public void LoadHandlers() { var contextManager = new Mock <IContextManager>(); contextManager.Setup(c => c.AddComponent(It.IsAny <Type>())); var handlerRepository = HandlerRepositoryFactory.GetFactory <ServiceHandlerRepositoryFactory>(contextManager.Object) .Create(new List <string> { "Mrwesb.Core.Test.dll" }); Assert.IsTrue(handlerRepository.GetHandlersByMessage(typeof(MessageFake)).Any()); Assert.IsTrue(handlerRepository.GetHandlersByMessage(typeof(IDynamicChild1Level2)).Any()); }
/// <summary> /// Loads the handlers. /// </summary> /// <returns></returns> private ControlProcessorConfigurator LoadHandlers() { var handlerRepositoryFactory = HandlerRepositoryFactory.GetFactory <ControlHandlerRepositoryFactory>(); var list = (from HandlerAssemblyConfig handlersAssembly in _HermEsbServiceConfig.ControlProcessor.HandlersAssemblies select handlersAssembly.Assembly).ToList(); var coreAssembly = string.Format("{0}.dll", handlerRepositoryFactory.GetType().Assembly.GetName().Name); if (!list.Contains(coreAssembly)) { list.Add(coreAssembly); } _handlerRepository = handlerRepositoryFactory.Create(list); return(this); }