Mercurial > pub > ImplabNet
annotate Implab/Components/IInitializable.cs @ 281:e0916ddc9950 v3 tip
code cleanup and refactoring
| author | cin |
|---|---|
| date | Fri, 01 Jun 2018 21:35:24 +0300 |
| parents | f1696cdc3d7a |
| children |
| rev | line source |
|---|---|
| 152 | 1 using System; |
| 262 | 2 using System.Threading; |
| 152 | 3 |
| 4 namespace Implab.Components { | |
| 5 /// <summary> | |
| 6 /// Initializable components are created and initialized in two steps, first we have create the component, | |
|
205
8200ab154c8a
Added ResetState to RunnableComponent to reset in case of failure
cin
parents:
184
diff
changeset
|
7 /// then we have to complete it's creation by calling an <see cref="Initialize()"/> method. All parameters needed |
|
8200ab154c8a
Added ResetState to RunnableComponent to reset in case of failure
cin
parents:
184
diff
changeset
|
8 /// to complete the initialization must be passed before the calling <see cref="Initialize()"/> |
| 152 | 9 /// </summary> |
| 10 public interface IInitializable { | |
| 11 /// <summary> | |
| 12 /// Completes initialization. | |
| 13 /// </summary> | |
| 14 /// <remarks> | |
| 251 | 15 /// <para> |
| 184 | 16 /// Normally virtual methods shouldn't be called from the constructor, due to the incomplete object state, but |
| 250 | 17 /// they can be called from this method. This method is also usefull when we constructing a complex grpah |
| 152 | 18 /// of components where cyclic references may take place. |
| 251 | 19 /// </para> |
| 20 /// <para> | |
| 21 /// In asyncronous patterns <see cref="Initialize()"/> can be called | |
| 22 /// to start initialization and the <see cref="IRunnable.Completion"/> | |
| 23 /// property can be used to track operation completion. | |
| 24 /// </para> | |
| 152 | 25 /// </remarks> |
|
205
8200ab154c8a
Added ResetState to RunnableComponent to reset in case of failure
cin
parents:
184
diff
changeset
|
26 void Initialize(); |
| 262 | 27 void Initialize(CancellationToken ct); |
| 152 | 28 } |
| 29 } | |
| 30 |
