Fixed the licensing statements - I had erroneously marked the files as covered by...
[lwes-dotnet/github-mirror.git] / Org.Lwes / Journaler / JournalerBase.cs
blob2ad882e3be9c1747795bf9de1569da6c16756d50
1 //
2 // This file is part of the LWES .NET Binding (LWES.net)
3 //
4 // COPYRIGHT (C) 2009, Phillip Clark (cerebralkungfu[at*g mail[dot*com)
5 // original .NET implementation
6 //
7 // LWES.net is free software: you can redistribute it and/or modify
8 // it under the terms of the Lesser GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
12 // LWES.net is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the Lesser GNU General Public License
18 // along with LWES.net. If not, see <http://www.gnu.org/licenses/>.
20 namespace Org.Lwes.Journaler
22 using System;
23 using System.Collections.Generic;
24 using System.Linq;
25 using System.Text;
26 using System.Threading;
28 using Org.Lwes.Properties;
30 /// <summary>
31 /// Base class implementation for journalers.
32 /// </summary>
33 public abstract class JournalerBase : IJournaler
35 #region Fields
37 Status<JournalerState> _status;
39 #endregion Fields
41 #region Constructors
43 /// <summary>
44 /// Finalizes the journaler.
45 /// </summary>
46 ~JournalerBase()
48 Dispose(false);
51 #endregion Constructors
53 #region Properties
55 /// <summary>
56 /// Gets the status of the journaler.
57 /// </summary>
58 public JournalerState Status
60 get { return _status.CurrentState; }
63 #endregion Properties
65 #region Methods
67 /// <summary>
68 /// Disposes of the journaler.
69 /// </summary>
70 public void Dispose()
72 Dispose(true);
73 GC.SuppressFinalize(this);
76 /// <summary>
77 /// Initializes the journaler.
78 /// </summary>
79 public void Initialize()
81 if (!_status.SetStateIfLessThan(JournalerState.Initializing, JournalerState.Initializing))
82 throw new InvalidOperationException(Resources.Error_AlreadyInitialized);
85 /// <summary>
86 /// Starts the journaler.
87 /// </summary>
88 public void Start()
90 throw new NotImplementedException();
93 /// <summary>
94 /// Stops the journaler.
95 /// </summary>
96 public void Stop()
98 throw new NotImplementedException();
101 private void Dispose(bool disposing)
103 _status.SetStateIfLessThan(JournalerState.Disposed, JournalerState.Disposed);
106 #endregion Methods