private BinderSingleton() { try { if (Simple) { Logger.Info("BackEnd Binder is using the Simple Windsor Delegate."); binderDelegate = new SimpleWindsorAdapter(); } else { Logger.Info("BackEnd Binder is using the Windsor Delegate..."); MBeanServerExtension mbeanServerExtension = MBeanServerExtension.Instance; binderDelegate = new WindsorDelegate(mbeanServerExtension); mbeanServerExtension.AddMBean("WindsorContainer", binderDelegate); //Stopped exporting the MBeanServer via the JSR262 connection because of inability to make it work! //It was working but due to some configuration change on the MOSS, this stopped. //Given this, reverted to the WCF exported service of the MBeanServer! //jsr262Exporter = new MBeanServerJsr262Exporter(mbeanServerExtension.MBeanServer); //jsr262Exporter.Start(); Logger.Info("Added windsor container to the MBeanServer and started server!"); } } catch (Exception exception) { Logger.Fatal("Something serious happened!", exception); } }
public void Init() { XmlConfigurator.Configure(new FileInfo("log4net_commonlibrary.config")); mbeanServerExtension = MBeanServerExtension.Instance; wcfExporter = new MBeanServerWcfExporter(new MBeanServerService(mbeanServerExtension.MBeanServer)); wcfExporter.Start(); mbeanServerExtension.AddMBean("ValidMBean", new ValidInstance()); Thread.Sleep(500); }
public WindsorDelegate(MBeanServerExtension mbeanServerExtension) { if (Logger.IsDebugEnabled) { Logger.Debug("Initialising the BackEnd Windsor delegate..."); } //Add an event listener in order to determine the component creation order Container.Kernel.ComponentCreated += (componentModel, instance) => mbeanServerExtension.AddMBean(componentModel.Service.Name, instance); DoInitialise(); Logger.Info("Created and initialised the Castle Windsor delegate!"); }
public void TestAddInvalidMBean() { Assert.IsFalse(mbeanServerExtension.AddMBean("InValidMBean", new object())); }