Ejemplo n.º 1
0
 public BootstrapLog4netAttribute()
 {
     Log4netFactory      = new Log4netFactoryImpl();
     BootstrapperFactory = new BootstrapperFactoryImpl();
     LogBootstrapper     = BootstrapperFactory.NewLogBootstrapper();
     LoggerSetter        = Log4netFactory.NewBootstrapDependentLoggerSetter(LogBootstrapper);
 }
Ejemplo n.º 2
0
        /// <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");
        }
Ejemplo n.º 3
0
        public void TestInitialize()
        {
            Log4netFactory log4netFactory = new Log4netFactoryImpl();

            BootstrapperFactory = new BootstrapperFactoryImpl();
            LoggerSetter        = log4netFactory.NewLoggerSetter();
        }
Ejemplo n.º 4
0
 public void TestInitialize()
 {
     Log4netFactory      = new Log4netFactoryImpl();
     BootstrapperFactory = new BootstrapperFactoryImpl();
     LogBootstrapper     = BootstrapperFactory.NewLogBootstrapper();
     LoggerSetter        = Log4netFactory.NewLoggerSetter();
     LoggerSetterImpl    = (LoggerSetterImpl)LoggerSetter;
     SpringBootstrapper  = BootstrapperFactory.NewSpringBootstrapper(LoggerSetter);
     Bootstrappers       = new List <Bootstrapper>();
     Bootstrappers.Add(LogBootstrapper);
 }
Ejemplo n.º 5
0
        public void TestInitialize()
        {
            Log4netFactory          = new Log4netFactoryImpl();
            MockBootstrapperFactory = new MockBootstrapperFactoryImpl();
            MainFactory             = new MainFactoryClass();
            BootstrapperFactory bootstrapperFactory = new BootstrapperFactoryImpl();

            LoggerSetter      = Log4netFactory.NewLoggerSetter();
            MockBootstrapper  = MockBootstrapperFactory.NewMockBootstrapper();
            MockRunner        = new MockRunnerClass();
            MockRunner.IsDone = false;
        }
 public void TestInitialize()
 {
     Log4netFactory          = new Log4netFactoryImpl();
     BootstrapperFactory     = new BootstrapperFactoryImpl();
     LoggerSetter            = Log4netFactory.NewLoggerSetter();
     MockBootstrapperFactory = new MockBootstrapperFactoryImpl();
     MockBootstrapper1       = MockBootstrapperFactory.NewMockBootstrapper();
     MockBootstrapper2       = MockBootstrapperFactory.NewMockBootstrapper();
     MockBootstrapperList    = new List <Bootstrapper>();
     MockBootstrapperList.Add(MockBootstrapper1);
     MockBootstrapperList.Add(MockBootstrapper2);
 }
Ejemplo n.º 7
0
        public void TestInitialize()
        {
            Log4netFactory log4netFactory = new Log4netFactoryImpl();

            BootstrapperFactory = new BootstrapperFactoryImpl();
            LogBootstrapper logBootstrapper = BootstrapperFactory.NewLogBootstrapper();

            LoggerSetter       = log4netFactory.NewLoggerSetter();
            SpringBootstrapper = BootstrapperFactory.NewSpringBootstrapper(LoggerSetter);
            IList <Bootstrapper> bootstrappers = new List <Bootstrapper>();

            bootstrappers.Add(logBootstrapper);
            bootstrappers.Add(LoggerSetter);
            bootstrappers.Add(SpringBootstrapper);
            Bootstrapper = BootstrapperFactory.NewCompositeBootstrapper(LoggerSetter, bootstrappers);
        }
Ejemplo n.º 8
0
 public void TestInitialize()
 {
     Log4netFactory      = new Log4netFactoryImpl();
     BootstrapperFactory = new BootstrapperFactoryImpl();
     MainFactory         = new MainFactoryClass();
     LogBootstrapper     = BootstrapperFactory.NewLogBootstrapper();
     LoggerSetter        = Log4netFactory.NewLoggerSetter();
     AssemblyResolver    = BootstrapperFactory.NewAssemblyResolver(LoggerSetter);
     SpringBootstrapper  = BootstrapperFactory.NewSpringBootstrapper(LoggerSetter);
     Bootstrappers       = new List <Bootstrapper>();
     Bootstrappers.Add(LogBootstrapper);
     Bootstrappers.Add(AssemblyResolver);
     Bootstrappers.Add(SpringBootstrapper);
     CompositeBootstrapper = BootstrapperFactory.NewCompositeBootstrapper(LoggerSetter, Bootstrappers);
     Runner = BootstrapperFactory.NewSpringRunner(LoggerSetter, SpringBootstrapper);
 }
Ejemplo n.º 9
0
        public void TestInitialize()
        {
            // Factories
            Log4netFactory      = new Log4netFactoryImpl();
            BootstrapperFactory = new BootstrapperFactoryImpl();
            MvcFactoryImpl      = new FactoryImpl();
            MvcFactory          = MvcFactoryImpl;
            MockMvcFactory      = new Vji.Mock.Mvc.FactoryImpl();

            // Bootstrapping - Logging
            LogBootstrapper logBootstrapper = BootstrapperFactory.NewLogBootstrapper();

            LoggerSetter                = Log4netFactory.NewLoggerSetter();
            LoggerSetterImpl            = (LoggerSetterImpl)LoggerSetter;
            MvcFactoryImpl.LoggerSetter = LoggerSetter;
            MockMvcFactory.LoggerSetter = LoggerSetter;

            // Bootstrapping others
            IList <Bootstrapper> bootstrappers = new List <Bootstrapper>();

            bootstrappers.Add(logBootstrapper);
            bootstrappers.Add(LoggerSetter);
            Bootstrapper = BootstrapperFactory.NewCompositeBootstrapper(LoggerSetter, bootstrappers);
        }
Ejemplo n.º 10
0
        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();
        }