DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
Deveel.Data.Diagnostics.EventRegistry Class Reference
Inheritance diagram for Deveel.Data.Diagnostics.EventRegistry:
Deveel.Data.Diagnostics.ThreadedQueue< IEvent > Deveel.Data.Diagnostics.IEventRegistry

Public Member Functions

 EventRegistry (IContext context)
 
void RegisterEvent (IEvent @event)
 Adds the specified event object to the registry. More...
 
- Public Member Functions inherited from Deveel.Data.Diagnostics.ThreadedQueue< IEvent >
void Dispose ()
 

Protected Member Functions

override void Consume (IEvent message)
 
override void Dispose (bool disposing)
 
- Protected Member Functions inherited from Deveel.Data.Diagnostics.ThreadedQueue< IEvent >
 ThreadedQueue ()
 
abstract void Consume (TMessage message)
 
void Enqueue (TMessage message)
 

Properties

IContext Context [get, private set]
 
override int ThreadCount [get]
 
- Properties inherited from Deveel.Data.Diagnostics.ThreadedQueue< IEvent >
virtual int ThreadCount [get]
 

Private Member Functions

 ~EventRegistry ()
 

Private Attributes

bool disposed
 
readonly int threadCount
 

Additional Inherited Members

- Public Attributes inherited from Deveel.Data.Diagnostics.ThreadedQueue< IEvent >
const int DefaultThreadCount
 

Detailed Description

Definition at line 22 of file EventRegistry.cs.

Constructor & Destructor Documentation

Deveel.Data.Diagnostics.EventRegistry.EventRegistry ( IContext  context)
inline

Definition at line 27 of file EventRegistry.cs.

27  {
28  if (context == null)
29  throw new ArgumentNullException("context");
30 
31  Context = context;
32 
33  var config = context.ResolveService<IConfiguration>();
34  threadCount = config.GetInt32("system.events.threadCount", 4);
35  }
Defines the contract for the configuration node of a component within the system or of the system its...
Deveel.Data.Diagnostics.EventRegistry.~EventRegistry ( )
inlineprivate

Definition at line 37 of file EventRegistry.cs.

37  {
38  Dispose(false);
39  }

Member Function Documentation

override void Deveel.Data.Diagnostics.EventRegistry.Consume ( IEvent  message)
inlineprotected

Definition at line 51 of file EventRegistry.cs.

51  {
52  var routers = Context.ResolveAllServices<IEventRouter>();
53  foreach (var router in routers) {
54  try {
55  if (router.CanRoute(message))
56  router.RouteEvent(message);
57  } catch (Exception ex) {
58  Enqueue(new ErrorEvent(ex, -1, ErrorLevel.Critical));
59  }
60  }
61  }
ErrorLevel
In case of error messages, this enumerates the level of severity of the error.
Definition: ErrorLevel.cs:24
override void Deveel.Data.Diagnostics.EventRegistry.Dispose ( bool  disposing)
inlineprotectedvirtual

Reimplemented from Deveel.Data.Diagnostics.ThreadedQueue< IEvent >.

Definition at line 63 of file EventRegistry.cs.

63  {
64  if (disposed) {
65  Context = null;
66  disposed = true;
67  }
68 
69  base.Dispose(disposing);
70  }
void Deveel.Data.Diagnostics.EventRegistry.RegisterEvent ( IEvent event)
inline

Adds the specified event object to the registry.

Parameters
eventThe event object to be registered.

Implements Deveel.Data.Diagnostics.IEventRegistry.

Definition at line 47 of file EventRegistry.cs.

47  {
48  Enqueue(@event);
49  }

Member Data Documentation

bool Deveel.Data.Diagnostics.EventRegistry.disposed
private

Definition at line 23 of file EventRegistry.cs.

readonly int Deveel.Data.Diagnostics.EventRegistry.threadCount
private

Definition at line 25 of file EventRegistry.cs.

Property Documentation

IContext Deveel.Data.Diagnostics.EventRegistry.Context
getprivate set

Definition at line 41 of file EventRegistry.cs.

override int Deveel.Data.Diagnostics.EventRegistry.ThreadCount
get

Definition at line 43 of file EventRegistry.cs.


The documentation for this class was generated from the following file: