C# 클래스 CK.Monitoring.GrandOutput

파일 보기 프로젝트 열기: Invenietis/ck-core 1 사용 예제들

공개 메소드들

메소드 설명
Dispose ( ) : void

Calls Dispose(IActivityMonitor,int) with a SystemActivityMonitor and Timeout.Infinite.

Dispose ( IActivityMonitor monitor, int millisecondsBeforeForceClose = Timeout.Infinite ) : void

Closes this GrandOutput.

EnsureActiveDefault ( Action configurator = null ) : GrandOutput

Ensures that the Default GrandOutput is created and that any ActivityMonitor that will be created in this application domain will automatically have a GrandOutputClient registered for this Default GrandOutput. Use EnsureActiveDefaultWithDefaultSettings to initially configure this default.

This method is thread-safe (a simple lock protects it) and uses a ActivityMonitor.AutoConfiguration action that Registers newly created ActivityMonitor.

EnsureActiveDefaultWithDefaultSettings ( IActivityMonitor monitor = null ) : GrandOutput

Ensures that the Default GrandOutput is created (see EnsureActiveDefault) and configured with default settings: only one one channel with its minimal filter sets to Debug with one text file handler that writes .txt files in "SystemActivityMonitor.RootLogPath\GrandOutputDefault" directory. The SystemActivityMonitor.RootLogPath must be valid and if a GrandOutput.config file exists inside, it is loaded as the configuration. If it exists, it must be valid (otherwise an exception is thrown). Once loaded, the file is monitored and any change that occurs to it dynamically triggers a SetConfiguration with the new file.

GrandOutput ( IGrandOutputDispatcherStrategy dispatcherStrategy = null ) : System

Initializes a new GrandOutput.

Register ( IActivityMonitor monitor ) : GrandOutputClient

Ensures that a client for this GrandOutput is registered on a monitor.

RegisterGlobalSink ( IGrandOutputSink sink ) : void

Registers a IGrandOutputSink.

SetConfiguration ( GrandOutputConfiguration config, IActivityMonitor monitor = null, int millisecondsBeforeForceClose = Timeout.Infinite ) : bool

Attempts to set a new configuration.

UnregisterGlobalSink ( IGrandOutputSink sink ) : void

Unregisters a IGrandOutputSink.

WaitForNextConfiguration ( int configurationAttemptCount, int millisecondsTimeout ) : bool

Blocks the caller until the current ConfigurationAttemptCount is greater or equal to the given number and the last configuration has been applied (or this object is disposed).

비공개 메소드들

메소드 설명
AttemptGarbageDeadClients ( ) : void
CreateDefaultConfig ( ) : GrandOutputConfiguration
DoGarbageDeadClients ( System.DateTime utcNow ) : int
ObtainChannel ( string topic ) : IChannel

Obtains an actual channel based on the activity IActivityMonitor.Topic (null when . This is called on the monitor's thread.

OnConfigurationClosing ( object sender, IChannel>.ConfiguredRouteHost e ) : void

This is called by the host when current configuration must be closed.

OnConfigurationReady ( ChannelHost e ) : void
OnDomainTermination ( object sender, EventArgs e ) : void
Reload ( object state ) : void
SignalConfigurationChanged ( ) : bool

Signals the clients referenced by weak refs that they need to obtain a new channel and returns true if at least one weak ref is not alive.

StartMonitoring ( IActivityMonitor monitor ) : void
_watcher_Changed ( object sender, FileSystemEventArgs unusedEventArgs ) : void
_watcher_Error ( object sender, ErrorEventArgs e ) : void

메소드 상세

Dispose() 공개 메소드

Calls Dispose(IActivityMonitor,int) with a SystemActivityMonitor and Timeout.Infinite.
public Dispose ( ) : void
리턴 void

Dispose() 공개 메소드

Closes this GrandOutput.
public Dispose ( IActivityMonitor monitor, int millisecondsBeforeForceClose = Timeout.Infinite ) : void
monitor IActivityMonitor Monitor that will be used. Must not be null.
millisecondsBeforeForceClose int Maximal time to wait for current routes to be unlocked (see ).
리턴 void

EnsureActiveDefault() 정적인 공개 메소드

Ensures that the Default GrandOutput is created and that any ActivityMonitor that will be created in this application domain will automatically have a GrandOutputClient registered for this Default GrandOutput. Use EnsureActiveDefaultWithDefaultSettings to initially configure this default.
This method is thread-safe (a simple lock protects it) and uses a ActivityMonitor.AutoConfiguration action that Registers newly created ActivityMonitor.
static public EnsureActiveDefault ( Action configurator = null ) : GrandOutput
configurator Action /// Optional action that can configure the default GrandOutput. /// If specified will be called after the creation of a new GrandOutput: it will not be called /// if a is already available. /// This parameter is optional since you can configure it at any time. ///
리턴 GrandOutput

EnsureActiveDefaultWithDefaultSettings() 정적인 공개 메소드

Ensures that the Default GrandOutput is created (see EnsureActiveDefault) and configured with default settings: only one one channel with its minimal filter sets to Debug with one text file handler that writes .txt files in "SystemActivityMonitor.RootLogPath\GrandOutputDefault" directory. The SystemActivityMonitor.RootLogPath must be valid and if a GrandOutput.config file exists inside, it is loaded as the configuration. If it exists, it must be valid (otherwise an exception is thrown). Once loaded, the file is monitored and any change that occurs to it dynamically triggers a SetConfiguration with the new file.
static public EnsureActiveDefaultWithDefaultSettings ( IActivityMonitor monitor = null ) : GrandOutput
monitor IActivityMonitor An optional monitor.
리턴 GrandOutput

GrandOutput() 공개 메소드

Initializes a new GrandOutput.
public GrandOutput ( IGrandOutputDispatcherStrategy dispatcherStrategy = null ) : System
dispatcherStrategy IGrandOutputDispatcherStrategy Strategy to use to handle the throughput.
리턴 System

Register() 공개 메소드

Ensures that a client for this GrandOutput is registered on a monitor.
public Register ( IActivityMonitor monitor ) : GrandOutputClient
monitor IActivityMonitor The monitor onto which a must be registered.
리턴 GrandOutputClient

RegisterGlobalSink() 공개 메소드

Registers a IGrandOutputSink.
public RegisterGlobalSink ( IGrandOutputSink sink ) : void
sink IGrandOutputSink The sink to register.
리턴 void

SetConfiguration() 공개 메소드

Attempts to set a new configuration.
public SetConfiguration ( GrandOutputConfiguration config, IActivityMonitor monitor = null, int millisecondsBeforeForceClose = Timeout.Infinite ) : bool
config GrandOutputConfiguration The configuration that must be set.
monitor IActivityMonitor Optional monitor.
millisecondsBeforeForceClose int Optional timeout to wait before forcing the close of the currently active configuration.
리턴 bool

UnregisterGlobalSink() 공개 메소드

Unregisters a IGrandOutputSink.
public UnregisterGlobalSink ( IGrandOutputSink sink ) : void
sink IGrandOutputSink The sink to unregister.
리턴 void

WaitForNextConfiguration() 공개 메소드

Blocks the caller until the current ConfigurationAttemptCount is greater or equal to the given number and the last configuration has been applied (or this object is disposed).
public WaitForNextConfiguration ( int configurationAttemptCount, int millisecondsTimeout ) : bool
configurationAttemptCount int The number of configuration attempt count to wait for.
millisecondsTimeout int Maximum number of milliseconds to wait. Use or -1 for no limit.
리턴 bool