コード例 #1
0
        public static IHandler[] GetPotentiallyMisconfigured(IWindsorContainer container)
        {
            IDiagnosticsHost host = (IDiagnosticsHost)container.Kernel.GetSubSystem(SubSystemConstants.DiagnosticsKey);
            IPotentiallyMisconfiguredComponentsDiagnostic diagnostics = host.GetDiagnostic <IPotentiallyMisconfiguredComponentsDiagnostic>();

            return(diagnostics.Inspect());
        }
コード例 #2
0
		public override void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost)
		{
			var process = Process.GetCurrentProcess();
			var name = string.Format("Instance {0} | process {1} (id:{2})", Interlocked.Increment(ref instanceId),
			                         process.ProcessName, process.Id);
			diagnostic = new TrackedComponentsDiagnostic(perfMetricsFactory.CreateInstancesTrackedByReleasePolicyCounter(name));
			diagnosticsHost.AddDiagnostic<ITrackedComponentsDiagnostic>(diagnostic);
		}
コード例 #3
0
        private static void CheckForPotentiallyMisconfiguredComponents(IDiagnosticsHost host)
        {
            var diagnostics = host.GetDiagnostic <IPotentiallyMisconfiguredComponentsDiagnostic>();

            var handlers = diagnostics.Inspect();

            if (!handlers.Any())
            {
                return;
            }

            var message   = new StringBuilder();
            var inspector = new DependencyInspector(message);

            foreach (var handler in handlers)
            {
                ((IExposeDependencyInfo)handler).ObtainDependencyDetails(inspector);
            }

            throw new MisconfiguredComponentException(message.ToString());
        }
コード例 #4
0
        private static void CheckForMisconfiguredLifetimesForComponents(IDiagnosticsHost host)
        {
            var diagnostics = host.GetDiagnostic <IPotentialLifestyleMismatchesDiagnostic>();

            var handlers = diagnostics.Inspect();

            if (!handlers.Any())
            {
                return;
            }

            var messages = handlers.ConvertAll(GetMismatchMessage);

            if (messages.Length == 0)
            {
                return;
            }

            var message = string.Join(Environment.NewLine, messages);

            throw new MisconfiguredComponentException(message);
        }
コード例 #5
0
		public abstract void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost);
コード例 #6
0
 public override void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost)
 {
     this.kernel = kernel;
 }
コード例 #7
0
 public abstract void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost);
コード例 #8
0
		public override void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost)
		{
			diagnostic = new TrackedComponentsDiagnostic();
			diagnosticsHost.AddDiagnostic<ITrackedComponentsDiagnostic>(diagnostic);
		}
コード例 #9
0
 public override void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost)
 {
     diagnostic = new TrackedComponentsDiagnostic(perfMetricsFactory.CreateInstancesTrackedByReleasePolicyCounter(name));
     diagnosticsHost.AddDiagnostic <ITrackedComponentsDiagnostic>(diagnostic);
 }
コード例 #10
0
 public override void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost)
 {
     diagnostic = new TrackedComponentsDiagnostic();
     diagnosticsHost.AddDiagnostic <ITrackedComponentsDiagnostic>(diagnostic);
 }
コード例 #11
0
ファイル: AllComponents.cs プロジェクト: kolhapuri/Windsor
		public override void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost)
		{
			diagnostic = new AllComponentsDiagnostic(kernel);
			diagnosticsHost.AddDiagnostic(diagnostic);
		}
コード例 #12
0
		public override void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost)
		{
			diagnostic = new PotentialLifestyleMismatchesDiagnostic(kernel);
			diagnosticsHost.AddDiagnostic(diagnostic);
		}
コード例 #13
0
 public override void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost)
 {
     diagnostic = new UsingContainerAsServiceLocatorDiagnostic(kernel);
     diagnosticsHost.AddDiagnostic(diagnostic);
 }
コード例 #14
0
 public override void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost)
 {
     diagnostic = new PotentiallyMisconfiguredComponentsDiagnostic(kernel);
     diagnosticsHost.AddDiagnostic(diagnostic);
 }
コード例 #15
0
		public override void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost)
		{
			diagnostic = new DuplicatedDependenciesDiagnostic(kernel);
			diagnosticsHost.AddDiagnostic<IDuplicatedDependenciesDiagnostic>(diagnostic);
		}
コード例 #16
0
		public override void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost)
		{
			diagnostic = new PotentiallyMisconfiguredComponentsDiagnostic(kernel);
			diagnosticsHost.AddDiagnostic(diagnostic);
		}
コード例 #17
0
		public override void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost)
		{
			this.kernel = kernel;
		}
コード例 #18
0
 public override void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost)
 {
     diagnostic = new DuplicatedDependenciesDiagnostic(kernel);
     diagnosticsHost.AddDiagnostic <IDuplicatedDependenciesDiagnostic>(diagnostic);
 }
コード例 #19
0
 public override void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost)
 {
     diagnostic = new PotentialLifestyleMismatchesDiagnostic(kernel);
     diagnosticsHost.AddDiagnostic(diagnostic);
 }
コード例 #20
0
 public override void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost)
 {
     diagnostic = new UsingContainerAsServiceLocatorDiagnostic(kernel);
     diagnosticsHost.AddDiagnostic(diagnostic);
 }
コード例 #21
0
ファイル: AllServices.cs プロジェクト: vtml/Windsor
 public override void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost)
 {
     diagnostic = new AllServicesDiagnostic(kernel);
     diagnosticsHost.AddDiagnostic(diagnostic);
 }
コード例 #22
0
		public override void Init(IKernel kernel, IDiagnosticsHost diagnosticsHost)
		{
			diagnostic = new TrackedComponentsDiagnostic(perfMetricsFactory.CreateInstancesTrackedByReleasePolicyCounter(name));
			diagnosticsHost.AddDiagnostic<ITrackedComponentsDiagnostic>(diagnostic);
		}