Permalink
Browse files

Updated to EventStore and CommonDomain with fluent configuration

  • Loading branch information...
1 parent 2f21823 commit 9509c5105b41145435e9dd18cf8882ec398d175c JoergEg committed Mar 25, 2011
@@ -24,10 +24,7 @@ public void Install(IWindsorContainer container, IConfigurationStore store)
{
//Bus
var bus = new InProcessBus(container);
- //container.Register(Component.For<IBus>().ImplementedBy<InProcessBus>().LifeStyle.Singleton);
container.Register(Component.For<IBus>().Instance(bus));
- //container.Register(Component.For<IPublishMessages>().Instance(bus));
-
var eventStore = GetInitializedEventStore(bus);
var repository = new EventStoreRepository(eventStore, new AggregateFactory(), new ConflictDetector());
@@ -38,19 +35,11 @@ public void Install(IWindsorContainer container, IConfigurationStore store)
private IStoreEvents GetInitializedEventStore(IPublishMessages bus)
{
- var persistence = BuildPersistenceEngine();
- persistence.Initialize();
-
- var dispatcher = BuildDispatcher(bus, persistence);
- return new OptimisticEventStore(persistence, dispatcher);
- }
-
- private IPersistStreams BuildPersistenceEngine()
- {
- //return new SqlPersistenceFactory("EventStore", BuildSerializer()).Build();
- return new RavenPersistenceFactory(BootStrapper.RavenDbConnectionStringName, BuildSerializer()).Build();
-
- //return new InMemoryPersistenceEngine();
+ return Wireup.Init()
+ //.UsingRavenPersistence(BootStrapper.RavenDbConnectionStringName, new ByteStreamDocumentSerializer(BuildSerializer()))
+ .UsingRavenPersistence(BootStrapper.RavenDbConnectionStringName, new NullDocumentSerializer())
+ .UsingSynchronousDispatcher(bus)
+ .Build();
}
private ISerialize BuildSerializer()
@@ -59,27 +48,5 @@ private ISerialize BuildSerializer()
serializer = new GzipSerializer(serializer);
return new RijndaelSerializer(serializer, _encryptionKey);
}
-
- private IDispatchCommits BuildDispatcher(IPublishMessages bus, IPersistStreams persistence)
- {
- //return new AsynchronousDispatcher(
- // new DelegateMessagePublisher(DispatchCommit),
- // persistence,
- // OnDispatchError);
-
- return new SynchronousDispatcher(bus, persistence);
- }
-
- private void DispatchCommit(Commit commit)
- {
- // this is where we'd hook into our messaging infrastructure, e.g. NServiceBus.
- Console.WriteLine("Messages from commit have been published.");
- }
- private static void OnDispatchError(Commit commit, Exception exception)
- {
- // if for some reason our messaging infrastructure couldn't dispatch the messages we've committed
- // we would be alerted here.
- Console.WriteLine("Exception while publishing message");
- }
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -34,36 +34,87 @@
<param name="info">The SerializationInfo that holds the serialized object data of the exception being thrown.</param>
<param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
</member>
- <member name="T:EventStore.Persistence.StorageOfflineException">
+ <member name="T:EventStore.Persistence.StorageException">
+ <summary>
+ Represents a general failure of the storage engine or persistence infrastructure.
+ </summary>
+ </member>
+ <member name="M:EventStore.Persistence.StorageException.#ctor">
+ <summary>
+ Initializes a new instance of the StorageException class.
+ </summary>
+ </member>
+ <member name="M:EventStore.Persistence.StorageException.#ctor(System.String)">
+ <summary>
+ Initializes a new instance of the StorageException class.
+ </summary>
+ <param name="message">The message that describes the error.</param>
+ </member>
+ <member name="M:EventStore.Persistence.StorageException.#ctor(System.String,System.Exception)">
+ <summary>
+ Initializes a new instance of the StorageException class.
+ </summary>
+ <param name="message">The message that describes the error.</param>
+ <param name="innerException">The message that is the cause of the current exception.</param>
+ </member>
+ <member name="M:EventStore.Persistence.StorageException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
+ <summary>
+ Initializes a new instance of the StorageException class.
+ </summary>
+ <param name="info">The SerializationInfo that holds the serialized object data of the exception being thrown.</param>
+ <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
+ </member>
+ <member name="T:EventStore.Persistence.StorageUnavailableException">
<summary>
Indicates that the underlying persistence medium is unavailable or offline.
</summary>
</member>
- <member name="M:EventStore.Persistence.StorageOfflineException.#ctor">
+ <member name="M:EventStore.Persistence.StorageUnavailableException.#ctor">
<summary>
- Initializes a new instance of the StorageOfflineException class.
+ Initializes a new instance of the StorageUnavailableException class.
</summary>
</member>
- <member name="M:EventStore.Persistence.StorageOfflineException.#ctor(System.String)">
+ <member name="M:EventStore.Persistence.StorageUnavailableException.#ctor(System.String)">
<summary>
- Initializes a new instance of the StorageOfflineException class.
+ Initializes a new instance of the StorageUnavailableException class.
</summary>
<param name="message">The message that describes the error.</param>
</member>
- <member name="M:EventStore.Persistence.StorageOfflineException.#ctor(System.String,System.Exception)">
+ <member name="M:EventStore.Persistence.StorageUnavailableException.#ctor(System.String,System.Exception)">
<summary>
- Initializes a new instance of the StorageOfflineException class.
+ Initializes a new instance of the StorageUnavailableException class.
</summary>
<param name="message">The message that describes the error.</param>
<param name="innerException">The message that is the cause of the current exception.</param>
</member>
- <member name="M:EventStore.Persistence.StorageOfflineException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
+ <member name="M:EventStore.Persistence.StorageUnavailableException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
<summary>
- Initializes a new instance of the StorageOfflineException class.
+ Initializes a new instance of the StorageUnavailableException class.
</summary>
<param name="info">The SerializationInfo that holds the serialized object data of the exception being thrown.</param>
<param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
</member>
+ <member name="T:EventStore.Serialization.IDocumentSerializer">
+ <summary>
+ Provides the ability to serialize an object graph to and from a document.
+ </summary>
+ </member>
+ <member name="M:EventStore.Serialization.IDocumentSerializer.Serialize``1(``0)">
+ <summary>
+ Serializes the object graph provided into a document.
+ </summary>
+ <typeparam name="T">The type of object to be serialized</typeparam>
+ <param name="graph">The object graph to be serialized.</param>
+ <returns>The document form of the graph provided.</returns>
+ </member>
+ <member name="M:EventStore.Serialization.IDocumentSerializer.Deserialize``1(System.Object)">
+ <summary>
+ Deserializes the document provided into an object graph.
+ </summary>
+ <typeparam name="T">The type of object graph.</typeparam>
+ <param name="document">The document to be deserialized.</param>
+ <returns>An object graph of the specified type.</returns>
+ </member>
<member name="T:EventStore.StreamNotFoundException">
<summary>
Represents an attempt to commit the same information more than once.
@@ -348,10 +399,11 @@
Provides the ability to serialize and deserialize an object graph.
</summary>
</member>
- <member name="M:EventStore.Serialization.ISerialize.Serialize(System.IO.Stream,System.Object)">
+ <member name="M:EventStore.Serialization.ISerialize.Serialize``1(System.IO.Stream,``0)">
<summary>
Serializes the object graph provided and writes a serialized representation to the output stream provided.
</summary>
+ <typeparam name="T">The type of object to be serialized</typeparam>
<param name="output">The stream into which the serialized object graph should be written.</param>
<param name="graph">The object graph to be serialized.</param>
</member>
@@ -434,45 +486,16 @@
<returns>The streams for which the head and snapshot revisions differ by at least the threshold specified.</returns>
<exception cref="T:EventStore.Persistence.StorageException" />
</member>
- <member name="T:EventStore.Persistence.StorageException">
- <summary>
- Represents a general failure of the storage engine or persistence infrastructure.
- </summary>
- </member>
- <member name="M:EventStore.Persistence.StorageException.#ctor">
- <summary>
- Initializes a new instance of the StorageException class.
- </summary>
- </member>
- <member name="M:EventStore.Persistence.StorageException.#ctor(System.String)">
- <summary>
- Initializes a new instance of the StorageException class.
- </summary>
- <param name="message">The message that describes the error.</param>
- </member>
- <member name="M:EventStore.Persistence.StorageException.#ctor(System.String,System.Exception)">
- <summary>
- Initializes a new instance of the StorageException class.
- </summary>
- <param name="message">The message that describes the error.</param>
- <param name="innerException">The message that is the cause of the current exception.</param>
- </member>
- <member name="M:EventStore.Persistence.StorageException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
- <summary>
- Initializes a new instance of the StorageException class.
- </summary>
- <param name="info">The SerializationInfo that holds the serialized object data of the exception being thrown.</param>
- <param name="context">The StreamingContext that contains contextual information about the source or destination.</param>
- </member>
<member name="T:EventStore.Serialization.SerializationExtensions">
<summary>
Implements extension methods that make call to the serialization infrastructure more simple.
</summary>
</member>
- <member name="M:EventStore.Serialization.SerializationExtensions.Serialize(EventStore.Serialization.ISerialize,System.Object)">
+ <member name="M:EventStore.Serialization.SerializationExtensions.Serialize``1(EventStore.Serialization.ISerialize,``0)">
<summary>
Serializes the object provided.
</summary>
+ <typeparam name="T">The type of object to be serialized</typeparam>
<param name="serializer">The serializer to use.</param>
<param name="value">The object graph to be serialized.</param>
<returns>A serialized representation of the object graph provided.</returns>

0 comments on commit 9509c51

Please sign in to comment.