public AssemblyResolver NewAssemblyResolver(LoggerSetter loggerSetter) { AssemblyResolverImpl assemblyResolver = new AssemblyResolverImpl(); loggerSetter.Add(assemblyResolver); return(assemblyResolver); }
/// <summary> /// Todo /// </summary> private void BootstrapAssembly() { // Get a way to create the top level objects Log4netFactory log4netFactory = new Log4netFactoryImpl(); BootstrapperFactory bootstrapperFactory = new BootstrapperFactoryImpl(); // Initialise the individual bootstrappers CommonLoggingBootstrapper commonLoggingBootstrapper = bootstrapperFactory.NewCommonLoggingBootstrapper(); LogBootstrapper logBootstrapper = bootstrapperFactory.NewLogBootstrapper(Log4NetAssembly, Log4NetAssemblyName, Log4NetXmlCfgFPathFile); LoggerSetter loggerSetter = log4netFactory.NewBootstrapDependentLoggerSetter(logBootstrapper); //AssemblyResolver assemblyResolver = bootstrapperFactory.NewAssemblyResolver(loggerSetter); SpringBootstrapper springBootstrapper = bootstrapperFactory.NewSpringBootstrapper(loggerSetter, SpringContextPathFile); // Combine them into a composite IList <Bootstrapper> bootstrappers = new List <Bootstrapper>(); bootstrappers.Add(commonLoggingBootstrapper); bootstrappers.Add(logBootstrapper); bootstrappers.Add(loggerSetter); //bootstrappers.Add(assemblyResolver); bootstrappers.Add(springBootstrapper); Bootstrapper bootstrapper = bootstrapperFactory.NewCompositeBootstrapper(loggerSetter, bootstrappers); // Bootstrap bootstrapper.Bootstrap(); // Set the main object AddinMain = (AddinMain)springBootstrapper.Ctx.GetObject("AddinMainObj"); }
public SpringBootstrapper NewSpringBootstrapper(LoggerSetter loggerSetter) { SpringBootstrapperImpl springBootstrapper = new SpringBootstrapperImpl(); loggerSetter.Add(springBootstrapper); return(springBootstrapper); }
public BootstrapLog4netAttribute() { Log4netFactory = new Log4netFactoryImpl(); BootstrapperFactory = new BootstrapperFactoryImpl(); LogBootstrapper = BootstrapperFactory.NewLogBootstrapper(); LoggerSetter = Log4netFactory.NewBootstrapDependentLoggerSetter(LogBootstrapper); }
public void TestInitialize() { Log4netFactory log4netFactory = new Log4netFactoryImpl(); BootstrapperFactory = new BootstrapperFactoryImpl(); LoggerSetter = log4netFactory.NewLoggerSetter(); }
public Runner NewSpringRunner(LoggerSetter loggerSetter, SpringBootstrapper springBootstrapper) { SpringRunnerImpl runner = new SpringRunnerImpl(); runner.SpringBootstrapper = springBootstrapper; loggerSetter.Add(runner); return(runner); }
public CompositeBootstrapper NewCompositeBootstrapper(LoggerSetter loggerSetter, IList <Bootstrapper> bootstrappers) { CompositeBootstrapperImpl compositeBootstrapper = new CompositeBootstrapperImpl(); compositeBootstrapper.SubBootstrappers = bootstrappers; loggerSetter.Add(compositeBootstrapper); return(compositeBootstrapper); }
//public AssemblyResolver NewAssemblyResolver(LoggerSetter loggerSetter) { // AssemblyResolverImpl assemblyResolver = new AssemblyResolverImpl(); // loggerSetter.Add(assemblyResolver); // return assemblyResolver; //} public SpringBootstrapper NewSpringBootstrapper(LoggerSetter loggerSetter, string xmlFile = null) { SpringBootstrapperImpl springBootstrapper = new SpringBootstrapperImpl(); springBootstrapper.XmlFile = xmlFile; loggerSetter.Add(springBootstrapper); return(springBootstrapper); }
public void TestBootstrap() { BootstrapperFactory bootstrapperFactory = new BootstrapperFactoryImpl(); LoggerSetter loggerSetter = Log4netFactory.NewLoggerSetter(); loggerSetter.Add(MockLoggerRecipient); loggerSetter.Bootstrap(); Assert.IsNotNull(MockLoggerRecipient); }
public void TestAdd() { BootstrapperFactory bootstrapperFactory = new BootstrapperFactoryImpl(); LoggerSetter loggerSetter = Log4netFactory.NewLoggerSetter(); LoggerSetterImpl loggerSetterImpl = (LoggerSetterImpl)loggerSetter; Assert.IsTrue(loggerSetterImpl.LoggerRecipients.Count == 0); loggerSetter.Add(MockLoggerRecipient); Assert.IsTrue(loggerSetterImpl.LoggerRecipients.Count == 1); }
public void TestNewLoggerSetter() { LoggerSetter loggerSetter = Log4netFactory.NewLoggerSetter(); Assert.IsNotNull(loggerSetter); Assert.IsTrue(loggerSetter is LoggerSetterImpl); LoggerSetterImpl loggerSetterImpl = (LoggerSetterImpl)loggerSetter; Assert.IsNotNull(loggerSetterImpl.LoggerRecipients); Assert.IsTrue(loggerSetterImpl.LoggerRecipients.Count == 0); }
public Bootstrapper NewProgramBootstrapper(LogBootstrapper logBootstrapper, LoggerSetter loggerSetter, AssemblyResolver assemblyResolver, SpringBootstrapper springBootstrapper) { IList <Bootstrapper> bootstrappers = new List <Bootstrapper>(); bootstrappers.Add(logBootstrapper); bootstrappers.Add(loggerSetter); bootstrappers.Add(assemblyResolver); bootstrappers.Add(springBootstrapper); CompositeBootstrapper compositeBootstrapper = BootstrapperFactory.NewCompositeBootstrapper(loggerSetter, bootstrappers); return(compositeBootstrapper); }
public void TestNewBootstrapDependentLoggerSetter() { LoggerSetter loggerSetter = Log4netFactory.NewBootstrapDependentLoggerSetter(LogBootstrapper); Assert.IsNotNull(loggerSetter); Assert.IsTrue(loggerSetter is BootstrapDependentLoggerSetterImpl); BootstrapDependentLoggerSetterImpl loggerSetterImpl = (BootstrapDependentLoggerSetterImpl)loggerSetter; Assert.AreEqual(LogBootstrapper, loggerSetterImpl.LogBootstrapper); Assert.IsNotNull(loggerSetterImpl.LoggerRecipients); Assert.IsTrue(loggerSetterImpl.LoggerRecipients.Count == 0); }
public void BootstrapStandard() { Logger.Debug("Bootstrapping Spring.NET..."); Ctx = ContextRegistry.GetContext(); Logger.Debug("Setting object loggers."); LoggerSetter loggerSetter = (LoggerSetter)Ctx.GetObject("LoggerSetter"); loggerSetter.SetLoggers(); Logger.Debug("Bootstrapping Spring.NET - Done."); IsDone = true; }
static void Main(string[] args) { // Get a way to create the top level objects Log4netFactory log4netFactory = new Log4netFactoryImpl(); BootstrapperFactory bootstrapperFactory = new BootstrapperFactoryImpl(); MainFactory mainFactory = new MainFactoryClass(); mainFactory.BootstrapperFactory = bootstrapperFactory; // Initialise the individual bootstrappers LogBootstrapper logBootstrapper = bootstrapperFactory.NewLogBootstrapper(); LoggerSetter loggerSetter = log4netFactory.NewBootstrapDependentLoggerSetter(logBootstrapper); AssemblyResolver assemblyResolver = bootstrapperFactory.NewAssemblyResolver(loggerSetter); SpringBootstrapper springBootstrapper = bootstrapperFactory.NewSpringBootstrapper(loggerSetter); // Create the program components Bootstrapper bootstrapper = mainFactory.NewProgramBootstrapper(logBootstrapper, loggerSetter, assemblyResolver, springBootstrapper); Runner runner = bootstrapperFactory.NewSpringRunner(loggerSetter, springBootstrapper); // Create and run the program Program program = mainFactory.NewProgram(bootstrapper, runner); program.Run(); }