DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Protected Member Functions | Package Functions | Properties | Private Member Functions | Static Private Member Functions | List of all members
Deveel.Data.DatabaseContext Class Reference
Inheritance diagram for Deveel.Data.DatabaseContext:
Deveel.Data.Context Deveel.Data.IDatabaseContext Deveel.Data.IContext Deveel.Data.Configuration.IConfigurationProvider Deveel.Data.IContext

Public Member Functions

TransactionContext CreateTransactionContext ()
 Creates a context to handle services and variables in the scope of a transaction. More...
 
- Public Member Functions inherited from Deveel.Data.Context
void Dispose ()
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from Deveel.Data.Context
 Context ()
 
 Context (IContext parent)
 

Package Functions

 DatabaseContext (ISystemContext systemContext, IConfiguration configuration)
 

Properties

override string ContextName [get]
 
IConfiguration Configuration [get, private set]
 
ISystemContext SystemContext [get, private set]
 
IStoreSystem StoreSystem [get, private set]
 
- Properties inherited from Deveel.Data.Context
abstract string ContextName [get]
 
virtual IScope ContextScope [get]
 
IContext ParentContext [get, private set]
 
IContext IContext. Parent [get]
 
IScope IContext. Scope [get]
 
string IContext. Name [get]
 
- Properties inherited from Deveel.Data.IContext
IContext Parent [get]
 
string Name [get]
 
IScope Scope [get]
 
- Properties inherited from Deveel.Data.IDatabaseContext
ISystemContext SystemContext [get]
 Gets the context of the database system that handles this database. More...
 
IStoreSystem StoreSystem [get]
 Gets the system that handles the storage of the data of the database. More...
 
- Properties inherited from Deveel.Data.Configuration.IConfigurationProvider
IConfiguration Configuration [get]
 

Private Member Functions

void InitStorageSystem ()
 
ITransactionContext IDatabaseContext. CreateTransactionContext ()
 Creates a context to handle services and variables in the scope of a transaction. More...
 

Static Private Member Functions

static IConfiguration CreateSimpleConfig (ISystemContext systemContext, string dbName)
 

Detailed Description

Definition at line 25 of file DatabaseContext.cs.

Constructor & Destructor Documentation

Deveel.Data.DatabaseContext.DatabaseContext ( ISystemContext  systemContext,
IConfiguration  configuration 
)
inlinepackage

Definition at line 26 of file DatabaseContext.cs.

27  : base(systemContext) {
28  if (systemContext == null)
29  throw new ArgumentNullException("systemContext");
30  if (configuration == null)
31  throw new ArgumentNullException("configuration");
32 
34  ContextScope.RegisterInstance<IConfiguration>(configuration);
35  ContextScope.RegisterInstance<IDatabaseContext>(this);
36 
37  SystemContext = systemContext;
38 
39  Configuration = configuration;
40 
42  }
virtual IScope ContextScope
Definition: Context.cs:40
bool Unregister(Type serviceType, object serviceKey)
Defines the contract for the configuration node of a component within the system or of the system its...

Member Function Documentation

static IConfiguration Deveel.Data.DatabaseContext.CreateSimpleConfig ( ISystemContext  systemContext,
string  dbName 
)
inlinestaticprivate

Definition at line 48 of file DatabaseContext.cs.

48  {
49  if (String.IsNullOrEmpty(dbName))
50  throw new ArgumentNullException("dbName");
51 
52  var config = new Configuration.Configuration(systemContext.Configuration);
53  config.SetValue("database.name", dbName);
54  return config;
55  }
A long string in the system.
Configuration(bool isRoot)
Constructs the Configuration.
ITransactionContext IDatabaseContext. Deveel.Data.DatabaseContext.CreateTransactionContext ( )
inlineprivate

Creates a context to handle services and variables in the scope of a transaction.

Returns

Implements Deveel.Data.IDatabaseContext.

Definition at line 88 of file DatabaseContext.cs.

88  {
89  return CreateTransactionContext();
90  }
ITransactionContext IDatabaseContext. CreateTransactionContext()
Creates a context to handle services and variables in the scope of a transaction. ...
TransactionContext Deveel.Data.DatabaseContext.CreateTransactionContext ( )
inline

Creates a context to handle services and variables in the scope of a transaction.

Returns

Implements Deveel.Data.IDatabaseContext.

Definition at line 92 of file DatabaseContext.cs.

override void Deveel.Data.DatabaseContext.Dispose ( bool  disposing)
inlineprotectedvirtual

Reimplemented from Deveel.Data.Context.

Definition at line 57 of file DatabaseContext.cs.

57  {
58  if (disposing) {
59  if (StoreSystem != null)
60  StoreSystem.Dispose();
61  }
62 
63  StoreSystem = null;
64 
65  base.Dispose(disposing);
66  }
void Deveel.Data.DatabaseContext.InitStorageSystem ( )
inlineprivate

Definition at line 74 of file DatabaseContext.cs.

74  {
75  try {
76  var storageTypeName = Configuration.GetString("database.storageSystem", DefaultStorageSystemNames.Heap);
77  StoreSystem = this.ResolveService<IStoreSystem>(storageTypeName);
78 
79  if (StoreSystem == null)
80  throw new DatabaseConfigurationException("The storage system for the database was not set.");
82  throw;
83  } catch (Exception ex) {
84  throw new DatabaseConfigurationException("Could not initialize the storage system", ex);
85  }
86  }

Property Documentation

IConfiguration Deveel.Data.DatabaseContext.Configuration
getprivate set

Definition at line 68 of file DatabaseContext.cs.

override string Deveel.Data.DatabaseContext.ContextName
getprotected

Definition at line 44 of file DatabaseContext.cs.

IStoreSystem Deveel.Data.DatabaseContext.StoreSystem
getprivate set

Definition at line 72 of file DatabaseContext.cs.

ISystemContext Deveel.Data.DatabaseContext.SystemContext
getprivate set

Definition at line 70 of file DatabaseContext.cs.


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