Вы находитесь на странице: 1из 224

Model Specification Phase 01 Page: 1

Table of Contents
Model Detail .................................................................................................................................. 6
NServiceBus_Source ................................................................................................................. 6
Grid ......................................................................................................................................... 6
ManagedEndpoint .............................................................................................................. 7
Manager ............................................................................................................................. 9
Worker ............................................................................................................................. 11
MsmqWorkerAvailabilityManager ...................................................................................... 12
MsmqWorkerAvailabilityManager .................................................................................. 13
NServiceBus ......................................................................................................................... 14
CompletionResult ............................................................................................................ 15
IBus .................................................................................................................................. 16
ICallback .......................................................................................................................... 19
IMessage .......................................................................................................................... 19
IMessageCreator .............................................................................................................. 20
IMessageHandler ............................................................................................................. 21
IMessageModule .............................................................................................................. 22
IStartableBus .................................................................................................................... 23
Attributes ........................................................................................................................... 23
RecoverableAttribute .................................................................................................... 24
TimeToBeReceivedAttribute ........................................................................................ 25
Config ................................................................................................................................ 26
Configure ...................................................................................................................... 26
DbSubscriptionStorageConfig ...................................................................................... 28
MessageEndpointMapping ........................................................................................... 28
MessageEndpointMappingCollection ........................................................................... 29
MsmqSubscriptionStorageConfig ................................................................................. 30
MsmqTransportConfig .................................................................................................. 31
UnicastBusConfig ......................................................................................................... 31
Grid .................................................................................................................................... 32
MessageHandlers ........................................................................................................... 32
ChangeNumberOfWorkerThreadsMessageHandler .................................................. 32
GetNumberOfWorkerThreadsMessageHandler ........................................................ 34
GridInterceptingMessageHandler .............................................................................. 35
Messages ........................................................................................................................ 37
ChangeNumberOfWorkerThreadsMessage ............................................................... 37
GetNumberOfWorkerThreadsMessage ..................................................................... 38
GotNumberOfWorkerThreadsMessage ..................................................................... 38
MessageInterfaces ............................................................................................................. 39
IMessageMapper ........................................................................................................... 40
MessageMapper ............................................................................................................. 40
Reflection .................................................................................................................... 40
MessageMapper ...................................................................................................... 41
Messages ........................................................................................................................... 43
Model Specification Phase 01 Page: 2

ReadyMessage .............................................................................................................. 44
Multicast ............................................................................................................................ 45
Bus ................................................................................................................................ 45
Transport ........................................................................................................................ 46
IMulticastTransport.................................................................................................... 47
ObjectBuilder .................................................................................................................... 48
CastleWindsor ................................................................................................................ 48
ConfigureComponentAdapter .................................................................................... 48
RecordPropertySet ..................................................................................................... 49
WindsorObjectBuilder ............................................................................................... 50
Common ......................................................................................................................... 52
CommonObjectBuilder .............................................................................................. 53
IBuilderInternal .......................................................................................................... 54
IContainInternalBuilder ............................................................................................. 55
Config .......................................................................................................................... 56
ConfigureCommon ................................................................................................. 56
Spring ............................................................................................................................. 57
ComponentConfig ...................................................................................................... 58
ConfigAdvice ............................................................................................................. 59
ConfigAdvisor............................................................................................................ 60
SetterPointcut .......................................................................................................... 60
SpringObjectBuilder .................................................................................................. 61
Synchronized .................................................................................................................. 63
SynchronizedObjectBuilder ....................................................................................... 64
Proxy ................................................................................................................................. 65
Proxy ............................................................................................................................. 66
ProxyData ..................................................................................................................... 69
IProxyDataStorage ........................................................................................................ 70
ISubscriberStorage ........................................................................................................ 70
Host ................................................................................................................................ 71
NServiceBusProxyConfig .......................................................................................... 71
Program ...................................................................................................................... 72
InMemoryImpl ............................................................................................................... 72
ProxyDataStorage ...................................................................................................... 73
SubscriberStorage ...................................................................................................... 74
Saga ................................................................................................................................... 75
Configure ...................................................................................................................... 75
IFindSagas..................................................................................................................... 80
Using .......................................................................................................................... 80
Saga ............................................................................................................................... 81
TimeoutMessage ........................................................................................................... 83
HasCompleted ............................................................................................................... 85
IFinder ........................................................................................................................... 85
ISaga ............................................................................................................................. 86
ISaga ............................................................................................................................. 86
ISagaEntity.................................................................................................................... 87
Model Specification Phase 01 Page: 3

ISagaMessage ............................................................................................................... 87
ISagaPersister ................................................................................................................ 88
ISagaStartedBy ............................................................................................................. 89
ITimeoutable ................................................................................................................. 89
Impl ................................................................................................................................ 90
EmptySagaFinder ....................................................................................................... 90
GuidCombGenerator .................................................................................................. 91
SagaEntityFinder........................................................................................................ 92
SagaMessageHandler ................................................................................................. 93
SagaPersisters .................................................................................................................... 95
NHibernate ..................................................................................................................... 95
NHibernateMessageModule ...................................................................................... 96
SagaPersister .............................................................................................................. 97
Serialization ....................................................................................................................... 98
IMessageSerializer ........................................................................................................ 98
Serializers .......................................................................................................................... 99
Binary ............................................................................................................................. 99
MessageSerializer .................................................................................................... 100
XML ............................................................................................................................. 101
MessageSerializer .................................................................................................... 102
Risk .......................................................................................................................... 106
IM1 ........................................................................................................................... 107
Test ............................................................................................................................ 108
Class1 .................................................................................................................... 108
M1 ......................................................................................................................... 110
M2 ......................................................................................................................... 110
SomeEnum ............................................................................................................ 111
IM2 ........................................................................................................................ 112
XsdGenerator ............................................................................................................ 113
ComplexType ........................................................................................................ 113
ComplexTypeWriter ............................................................................................. 115
Element ................................................................................................................. 116
ElementWriter ....................................................................................................... 119
Events .................................................................................................................... 120
Program ................................................................................................................. 121
Reflect ................................................................................................................... 122
Repository ............................................................................................................. 123
SimpleTypeWriter................................................................................................. 124
Strings ................................................................................................................... 124
Testing ............................................................................................................................. 126
Saga ............................................................................................................................. 127
Tools ................................................................................................................................ 131
Management ................................................................................................................. 131
Errors ......................................................................................................................... 132
ReturnToSourceQueue ........................................................................................... 132
Class1 ................................................................................................................. 132
Model Specification Phase 01 Page: 4

Unicast ............................................................................................................................. 133


BusAsyncResult .......................................................................................................... 134
BusAsyncResultEventArgs ......................................................................................... 136
Callback ...................................................................................................................... 137
HeaderAdapter ............................................................................................................ 138
SubscriptionsManager................................................................................................. 140
UnicastBus .................................................................................................................. 141
IUnicastBus ................................................................................................................. 154
Config ........................................................................................................................... 155
ConfigUnicastBus .................................................................................................... 156
Distributor .................................................................................................................... 157
Distributor ................................................................................................................ 158
ReadyMessageHandler ............................................................................................ 160
IWorkerAvailabilityManager ................................................................................... 162
Runner ....................................................................................................................... 163
Initalizer ................................................................................................................ 163
Program ................................................................................................................. 164
Subscriptions ................................................................................................................ 164
ISubscriptionStorage ................................................................................................ 165
DB ............................................................................................................................. 166
SubscriptionStorage .............................................................................................. 167
Config ..................................................................................................................... 169
ConfigDbSubscriptionStorage ........................................................................... 170
Msmq ......................................................................................................................... 171
Entry...................................................................................................................... 172
MsmqSubscriptionStorage .................................................................................... 174
Config ..................................................................................................................... 177
ConfigMsmqSubscriptionStorage ...................................................................... 177
Transport ...................................................................................................................... 178
CompletionMessage ................................................................................................. 179
HeaderInfo ............................................................................................................... 179
SubscriptionMessage ............................................................................................... 180
SubscriptionType ..................................................................................................... 181
TransportMessage .................................................................................................... 182
TransportMessageReceivedEventArgs .................................................................... 184
ITransport ................................................................................................................. 185
Msmq ......................................................................................................................... 187
AbortHandlingCurrentMessageException ............................................................ 189
MsmqTransport ..................................................................................................... 189
Config ..................................................................................................................... 197
ConfigMsmqTransport ....................................................................................... 198
Utils ................................................................................................................................. 199
TransactionWrapper .................................................................................................... 200
WorkerThread ............................................................................................................. 201
ObjectBuilder ..................................................................................................................... 202
ComponentCallModelEnum .......................................................................................... 203
Model Specification Phase 01 Page: 5

IBuilder .......................................................................................................................... 204


IComponentConfig ........................................................................................................ 205
IConfigureComponents .................................................................................................. 206
ReturnToSourceQueue ....................................................................................................... 207
Program .......................................................................................................................... 208
Timeout .............................................................................................................................. 208
Manager ........................................................................................................................... 208
Program ....................................................................................................................... 209
MessageHandlers ............................................................................................................ 209
TimeoutMessageHandler ............................................................................................ 210
UI ........................................................................................................................................ 211
Form1 ............................................................................................................................. 212
Form1 ............................................................................................................................. 218
Program .......................................................................................................................... 222
Properties ......................................................................................................................... 222
Resources .................................................................................................................... 223
Settings ........................................................................................................................ 224
Model Specification Phase 01 Page: 6

Model Documentation

Model Detail
This document provides a complete overview of all element details. For simpler and more focused reports, simply
copy this initial template and turn off the sections not required.

NServiceBus_Source
Type: Package
Status: Proposed. Version . Phase 1.0.
Package: Model
Detail: Created on 21/12/2008 09:35:55. Last modified on 21/12/2008 09:35:55
GUID: {8C2FA27E-1C90-43d3-A2B4-EA81F5DC8D1C}

Grid
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus_Source
Detail: Created on 21/12/2008 09:37:47. Last modified on 21/12/2008 09:37:47
GUID: {5F40370F-3466-43eb-84F3-89E343221492}

Grid - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {97D32718-A5F4-40b8-B65A-E03E48538707}
Model Specification Phase 01 Page: 7

class Grid

Manager

- bus: IBus
- endpoints: List<ManagedEndpoint> = new List<Manage...
- path: string = "storage.txt" {readOnly}
- refreshInterval: int = 5 {readOnly}
- timer: Timer = new Timer(Check... {readOnly}

- CheckNumberOfMessages(object) : void
+ GetManagedEndpoints() : List<ManagedEndpoint>
- Manager()
+ RefreshNumberOfWorkerThreads(string) : void
+ Save() : void
+ SetBus(IBus) : void
+ SetNumberOfWorkerThreads(string, int) : void
+ StoreManagedEndpoints(List<ManagedEndpoint>) : void
~ UpdateNumberOfWorkerThreads(string, int) : void
«property»
+ RefreshInterval() : int

ManagedEndpoint

- name: string
- numberOfMessages: int
- queue: string
- workers: List<Worker> = new List<Worker>()

+ SetNumberOfMessages(int) : void
+ ToString() : string
«property»
+ Name() : string
+ NumberOfMessages() : int
+ Queue() : string
+ Workers() : IList<Worker>

Worker

- numberOfWorkerThreads: int
- queue: string

+ SetNumberOfWorkerThreads(int) : void
+ ToString() : string
«property»
+ NumberOfWorkerThreads() : int
+ Queue() : string

Figure: 1

ManagedEndpoint
Model Specification Phase 01 Page: 8

Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Grid Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {1D1D949E-65E2-4c9e-8428-6A2953D2A55C}

Custom Properties
 isActive = False

Tagged Values
 Attribute = [Serializable].

Connections
Connector Source Target Notes
Association Public Private current
Source -> Destination Form1 ManagedEndpoint

Attributes
Attribute Notes Constraints and tags
name string Default:
Private

numberOfMessages int Default:


Private

queue string Default:


Private
Model Specification Phase 01 Page: 9

Attribute Notes Constraints and tags


workers List<Worker> Default: new List<Worker>()
Private new
List<Worker>()

Operations
Method Notes Parameters
Name() string
Public
NumberOfMessages() int
Public
Queue() string
Public
SetNumberOfMessages() int number
void [in]
Public

ToString() string
Public
Workers() IList<Worker>
Public

Manager
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Grid Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {6B390BA7-2544-4cb8-A0A9-85176539B091}

Custom Properties
 isActive = False

Tagged Values
 static = true.

Connections
Connector Source Target Notes
Association Public Private bus
Source -> Destination Manager IBus
Model Specification Phase 01 Page: 10

Connector Source Target Notes

Attributes
Attribute Notes Constraints and tags
bus IBus Default:
Private Static

endpoints Default: new


List<ManagedEndpoint> List<ManagedEndpoint>()
Private Static new
List<ManagedEndpoint>()

path string Default: "storage.txt"


Private Static Const
"storage.txt"

refreshInterval int Default: 5


Private Static Const 5

timer Timer Default: new


Private Static Const Timer(CheckNumberOfMessages)
new
Timer(CheckNumberOfMe
ssages)

Operations
Method Notes Parameters
Static object state
CheckNumberOfMessage [in]
s() void
Private
Model Specification Phase 01 Page: 11

Method Notes Parameters


Static
GetManagedEndpoints()
List<ManagedEndpoint>
Public
Static Manager()
Private
Static RefreshInterval()
int
Public
Static string queue
RefreshNumberOfWorke [in]
rThreads() void
Public
Static Save() void
Public
Static SetBus() void IBus b
Public [in]

Static string queue


SetNumberOfWorkerThr [in]
eads() void
Public int number
[in]

Static List<ManagedEndpoint> points


StoreManagedEndpoints( [in]
) void
Public
Static string queue
UpdateNumberOfWorke [in]
rThreads() void
Internal int number
[in]

Worker
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Grid Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {A0A7E091-7F55-4bad-B132-AAC05535F411}

Custom Properties
 isActive = False
Model Specification Phase 01 Page: 12

Tagged Values
 Attribute = [Serializable].

Connections
Connector Source Target Notes
Association Public Private worker
Source -> Destination Form1 Worker

Attributes
Attribute Notes Constraints and tags
numberOfWorkerThread Default:
s int
Private

queue string Default:


Private

Operations
Method Notes Parameters
NumberOfWorkerThrea
ds() int
Public
Queue() string
Public
SetNumberOfWorkerThr int number
eads() void [in]
Public

ToString() string
Public

MsmqWorkerAvailabilityManager
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus_Source
Model Specification Phase 01 Page: 13

Detail: Created on 21/12/2008 09:37:16. Last modified on 21/12/2008 09:37:16


GUID: {B4DD1A7B-B9E0-4791-A049-959E7C8FBE20}

MsmqWorkerAvailabilityManager - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {D52A71E0-7C0E-4fb4-BC06-BA2C5A000B41}

class MsmqWorkerAv ailabilityManager

MsmqWorkerAv ailabilityManager

- locker: object = new object()


- storageQueue: MessageQueue

+ ClearAvailabilityForWorker(string) : void
+ PopAvailableWorker() : string
+ WorkerAvailable(string) : void
«property»
+ StorageQueue() : string

Figure: 2

MsmqWorkerAvailabilityManager
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: MsmqWorkerAvailabilityManager Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {24A1CAC4-1B5F-46d4-999E-8A9BA38B9201}

An implementation of <see cref="IWorkerAvailabilityManager"/> for MSMQ to be used with the <see


cref="Distributor"/> class.

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination MsmqWorkerAvailabili IWorkerAvailabilityMa
tyManager nager
Model Specification Phase 01 Page: 14

Attributes
Attribute Notes Constraints and tags
locker object Default: new object()
Private new object()

storageQueue Default:
MessageQueue
Private

Operations
Method Notes Parameters
ClearAvailabilityForWor Removes all entries from the worker string address
ker() void availability queue with the specified address. [in] The address of the worker to
Public remove from the availability list.

PopAvailableWorker() Pops the next available worker from the


string available worker queue and returns its address.
Public
@returns The address of the next available
worker.

StorageQueue() string Sets the path to the queue that will be used for
Public storing worker availability.

@remark The queue provided must be


transactional.

WorkerAvailable() void Signal that a worker is available to receive a string address


Public dispatched message. [in] The address of the worker that
will accept the dispatched message.

NServiceBus
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus_Source
Detail: Created on 21/12/2008 09:37:09. Last modified on 21/12/2008 09:37:09
Model Specification Phase 01 Page: 15

GUID: {BDED8190-154A-480f-AE9B-90AFAC8AA85E}

NServiceBus - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {F4A92197-E9C2-41ef-8AA6-B205FF3DAD7D}

class NServ iceBus

«interface» «interface»
IBus ICallback
+ DoNotContinueDispatchingCurrentMessageToHandlers() : void + Register(AsyncCallback, object) : IAsyncResult
+ HandleCurrentMessageLater() : void
+ Publish(T[]) : void
+ Publish(Action<T>) : void
+ Reply(IMessage[]) : void
+ Reply(Action<T>) : void
+ Return(int) : void
+ Send(IMessage[]) : ICallback CompletionResult
+ Send(Action<T>) : ICallback
+ Send(string, IMessage[]) : ICallback «property»
+ Send(string, Action<T>) : ICallback + ErrorCode() : int
+ SendLocal(IMessage[]) : void + Messages() : IMessage[]
+ SendLocal(Action<T>) : void + State() : object
+ Subscribe(Type) : void
+ Subscribe() : void
+ Subscribe(Type, Predicate<IMessage>) : void
+ Subscribe(Predicate<T>) : void
+ Unsubscribe(Type) : void
+ Unsubscribe() : void «interface» «interface»
«property» IMessageHandler IMessage
+ IncomingHeaders() : IDictionary<string, string>
+ OutgoingHeaders() : IDictionary<string, string> + Handle(T) : void
+ SourceOfMessageBeingHandled() : string

«interface» IDisposable «interface»


IMessageCreator «interface» IMessageModule

+ CreateInstance() : T IStartableBus + HandleBeginMessage() : void


+ CreateInstance(Action<T>) : T + Start(Action<IBuilder>[]) : IBus + HandleEndMessage() : void
+ CreateInstance(Type) : object

Figure: 3

CompletionResult
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {9C14FC52-459C-4727-912D-E61328486851}

The object found in <see cref="IAsyncResult"/>.AsyncState returned by the <see cref="AsyncCallback"/> passed to
the Send method of the bus.
Model Specification Phase 01 Page: 16

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private result
Source -> Destination BusAsyncResult CompletionResult

Operations
Method Notes Parameters
ErrorCode() int If <see cref="IBus.Return"/> was called, this
Public contains the value passed to it.

Messages() IMessage If <see cref="IBus.Reply"/> was called, this


Public contains the messages passed to it.

State() object An object that can contain state information for


Public the method.

IBus
Type: Interface IMessageCreator
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {C82B10E4-7560-4f96-8B24-8BBBF8E66C9F}

Defines a bus to be used with NServiceBus.

Connections
Connector Source Target Notes
Dependency Public Public
Source -> Destination IStartableBus IBus

Association Public Private bus


Source -> Destination Saga IBus

Dependency Public Public


Source -> Destination IBus ICallback

Generalization Public Public


Source -> Destination IBus IMessageCreator
Model Specification Phase 01 Page: 17

Connector Source Target Notes


Generalization Public Public
Source -> Destination IUnicastBus IBus

Association Public Private bus


Source -> Destination Saga IBus

Association Public Private bus


Source -> Destination Manager IBus

Operations
Method Notes Parameters
DoNotContinueDispatchi Tells the bus to stop dispatching the current
ngCurrentMessageToHa message to additional handlers.
ndlers() void
Public
HandleCurrentMessageL Moves the message being handled to the back
ater() void of the list of available messages so it can be
Public handled later.

IncomingHeaders() Gets the list of key/value pairs found in the


IDictionary<string, string> header of the message being handled by the
Public current thread.

OutgoingHeaders() Gets the list of key/value pairs that will be in


IDictionary<string, string> the header of messages being sent by the same
Public thread. This value will be cleared when a
thread receives a message.

Publish() void Publishes the list of messages to subscribers. If T[] messages


Public publishing multiple messages, they should all [in] A list of messages. The first
be of the same type since subscribers are message's type is used for looking
identified by the first message in the list. up subscribers.

Publish() void Instantiates a message of type T and publishes Action<T> messageConstructor


Public it. [in] An action which initializes
properties of the message

Reply() void Sends all messages to the destination found in IMessage[] messages
Public <see [in] The messages to send.
cref="SourceOfMessageBeingHandled"/>.

Reply() void Instantiates a message of type T and performs a Action<T> messageConstructor


Public regular <see cref="Reply"/>. [in] An action which initializes
properties of the message

Return() void Returns a completion message with the int errorCode


Public specified error code to the sender of the [in] A code specifying the result.
message being handled.

Send() ICallback Sends the list of provided messages. IMessage[] messages


Model Specification Phase 01 Page: 18

Method Notes Parameters


Public [in] The list of messages to send.
@remark All the messages will be sent to the
destination configured for the first message in
the list.

Send() ICallback Instantiates a message of type T and sends it. Action<T> messageConstructor
Public [in] An action which initializes
@remark The message will be sent to the properties of the message
destination configured for T

Send() ICallback Sends the list of provided messages. string destination


Public [in] The address of the destination
to which the messages will be sent.

IMessage[] messages
[in] The list of messages to send.

Send() ICallback Instantiates a message of type T and send it to string destination


Public the given destination. [in] The destination to which the
message will be sent.
@returns
Action<T> messageConstructor
[in] An action which initializes
properties of the message

SendLocal() void Sends the list of messages back to the current IMessage[] messages
Public bus. [in] The messages to send.

SendLocal() void Instantiates a message of type T and sends it Action<T> messageConstructor


Public back to the current bus. [in] An action which initializes
properties of the message

SourceOfMessageBeingH Gets the address from which the message being


andled() string handled was sent.
Public
Subscribe() void Subcribes to recieve published messages of the Type messageType
Public specified type. This method is only necessary if [in] The type of message to
you turned off auto-subscribe. subscribe to.

Subscribe() void Subscribes to recieve published messages of


Public type T. This method is only necessary if you
turned off auto-subscribe.

Subscribe() void Subscribes to receive published messages of Type messageType


Public the specified type. When messages arrive, the [in] The type of message to
condition is evaluated to see if they should be subscribe to.
handled.
Predicate<IMessage> condition
[in] The condition with which to
evaluate messages.
Model Specification Phase 01 Page: 19

Method Notes Parameters

Subscribe() void Subscribes to receive published messages of Predicate<T> condition


Public the specified type. When messages arrive, the [in] The condition with which to
condition is evaluated to see if they should be evaluate messages.
handled.

Unsubscribe() void Unsubscribes from receiving published Type messageType


Public messages of the specified type. [in]

Unsubscribe() void Unsubscribes from receiving published


Public messages of the specified type.

ICallback
Type: Interface
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {A947EBE1-ABB3-4ad4-AF8D-7740C3C741D8}

Connections
Connector Source Target Notes
Dependency Public Public
Source -> Destination IBus ICallback

Realisation Public Public


Source -> Destination Callback ICallback

Operations
Method Notes Parameters
Register() IAsyncResult AsyncCallback callback
Public [in]

object state
[in]

IMessage
Type: Interface
Status: Proposed. Version 1.0. Phase 1.0.
Model Specification Phase 01 Page: 20

Package: NServiceBus Keywords:


Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {A1957632-2A22-4732-B3A5-6A626E8DEA7C}

Marker interface to indicate that a class is a message suitable for transmission and handling by an NServiceBus.

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination ChangeNumberOfWork IMessage
erThreadsMessage

Realisation Public Public


Source -> Destination GetNumberOfWorkerT IMessage
hreadsMessage

Realisation Public Public


Source -> Destination GotNumberOfWorkerT IMessage
hreadsMessage

Realisation Public Public


Source -> Destination ReadyMessage IMessage

Generalization Public Public


Source -> Destination ISagaMessage IMessage

Generalization Public Public


Source -> Destination IM1 IMessage

Realisation Public Public


Source -> Destination CompletionMessage IMessage

Realisation Public Public


Source -> Destination SubscriptionMessage IMessage

Association Public Private body


Source -> Destination TransportMessage IMessage

Dependency Public Public


Source -> Destination IMessageHandler IMessage

IMessageCreator
Type: Interface
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {68615874-022F-4769-80AD-657D003B439D}
Model Specification Phase 01 Page: 21

Connections
Connector Source Target Notes
Generalization Public Public
Source -> Destination IBus IMessageCreator

Association Public Private messageCreator


Source -> Destination Saga IMessageCreator

Generalization Public Public


Source -> Destination IMessageMapper IMessageCreator

Operations
Method Notes Parameters
CreateInstance() T
Public
CreateInstance() T Action<T> action
Public [in]

CreateInstance() object Type messageType


Public [in]

IMessageHandler
Type: Interface
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {8245939C-DD7C-4668-ABFB-505AFE574B8F}

Defines a message handler.

Tagged Values
 genericConstraints = where T : IMessage.

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination ChangeNumberOfWork IMessageHandler
erThreadsMessageHand
Model Specification Phase 01 Page: 22

Connector Source Target Notes


ler

Realisation Public Public


Source -> Destination GetNumberOfWorkerT IMessageHandler
hreadsMessageHandler

Realisation Public Public


Source -> Destination GridInterceptingMessag IMessageHandler
eHandler

Realisation Public Public


Source -> Destination ReadyMessageHandler IMessageHandler

Generalization Public Public


Source -> Destination ISagaStartedBy IMessageHandler

Realisation Public Public


Source -> Destination SagaMessageHandler IMessageHandler

Dependency Public Public


Source -> Destination IMessageHandler IMessage

Realisation Public Public


Source -> Destination TimeoutMessageHandl IMessageHandler
er

Operations
Method Notes Parameters
Handle() void Handles a message. T message
Public [in] The message to handle.
@remark This method will be called when a
message arrives on the bus and should contain
the custom logic to execute when the message
is received.

IMessageModule
Type: Interface
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {B82684CF-4CCC-4e75-9EB5-E645BB331F6D}

This interface describes a message module - an object that will be called before and after all message handlers.

Connections
Model Specification Phase 01 Page: 23

Connector Source Target Notes


Realisation Public Public
Source -> Destination NHibernateMessageMo IMessageModule
dule

Operations
Method Notes Parameters
HandleBeginMessage() This method is called before any message
void handlers are called.
Public
HandleEndMessage() This method is called after all message handlers
void have been called.
Public

IStartableBus
Type: Interface IDisposable
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {0343580E-7753-472d-8027-29D069C524B1}

Connections
Connector Source Target Notes
Dependency Public Public
Source -> Destination IStartableBus IBus

Association Public Private controlBus


Source -> Destination Distributor IStartableBus

Realisation Public Public


Source -> Destination UnicastBus IStartableBus

Operations
Method Notes Parameters
Start() IBus Starts the bus. Action<IBuilder>[] startupActions
Public [in]

Attributes
Type: Package
Model Specification Phase 01 Page: 24

Status: Proposed. Version 1.0. Phase 1.0.


Package: NServiceBus
Detail: Created on 21/12/2008 09:44:36. Last modified on 21/12/2008 09:44:36
GUID: {32428BE8-47F8-4686-8B1A-BA13D4E12184}

Attributes - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {7C5B044E-E9E6-4028-AA8A-6FAFB29280EC}

class Attributes

Attribute
Recov erableAttribute

Attribute
TimeToBeReceiv edAttribute

- timeToBeReceived: TimeSpan = TimeSpan.MaxValue {readOnly}

+ TimeToBeReceivedAttribute()
+ TimeToBeReceivedAttribute(string)
«property»
+ TimeToBeReceived() : TimeSpan

Figure: 4

RecoverableAttribute
Type: Class Attribute
Status: Proposed. Version 1.0. Phase 1.0.
Package: Attributes Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {0B1C95CE-C0E6-42b6-B3A4-E107622431FF}

Attribute to indicate that a message is recoverable.

@remark This attribute should be applied to classes that implement <see cref="IMessage"/> to indicate that they
should be treated as a recoverable message. A recoverable message is stored locally at every step along the route so
that in the event of a failure of a machine along the route a copy of the message will be recovered and delivery will
continue when the machine is brought back online.
Model Specification Phase 01 Page: 25

Custom Properties
 isActive = False

Tagged Values
 Attribute = [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)].

TimeToBeReceivedAttribute
Type: Class Attribute
Status: Proposed. Version 1.0. Phase 1.0.
Package: Attributes Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {02A1A2B9-8CD4-4010-A28A-B554A0C4BADA}

Attribute to indicate that a message has a period of time in which to be received.

Custom Properties
 isActive = False

Tagged Values
 Attribute = [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)].

Attributes
Attribute Notes Constraints and tags
timeToBeReceived Default: TimeSpan.MaxValue
TimeSpan
Private Const
TimeSpan.MaxValue

Operations
Method Notes Parameters
TimeToBeReceived() Gets the maximum time in which a message
TimeSpan must be received.
Public
@remark If the interval specified by the
TimeToBeReceived property expires before the
Model Specification Phase 01 Page: 26

Method Notes Parameters


message is received by the destination of the
message the message will automatically be
cancelled.

TimeToBeReceivedAttrib Sets the time to be received to be unlimited.


ute()
Public
TimeToBeReceivedAttrib Sets the time to be received. string timeSpan
ute() [in] A timespan that can be
Public interpreted by <see
cref="TimeSpan.Parse"/>.

Config
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus
Detail: Created on 21/12/2008 09:37:33. Last modified on 21/12/2008 09:37:33
GUID: {BA5510C1-442D-455e-96EB-9A23C9DEF25F}

Config - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {0C838156-B597-4b14-AD83-084FF727A45A}

class Config

ConfigurationSection ConfigurationElementCollection ConfigurationElement ConfigurationSection


UnicastBusConfig MessageEndpointMappingCollection MessageEndpointMapping MsmqSubscriptionStorageConfig

«property» + Add(MessageEndpointMapping) : void «property» «property»


+ DistributorControlAddress() : string # BaseAdd(ConfigurationElement) : void + Endpoint() : string + Queue() : string
+ DistributorDataAddress() : string + Clear() : void + Messages() : string
+ MessageEndpointMappings() : MessageEndpointMappingCollection # CreateNewElement() : ConfigurationElement
# CreateNewElement(string) : ConfigurationElement
# GetElementKey(ConfigurationElement) : Object
+ IndexOf(MessageEndpointMapping) : int
+ MessageEndpointMappingCollection()
+ Remove(MessageEndpointMapping) : void
+ Remove(string) : void
+ RemoveAt(int) : void
«property»
+ AddElementName() : string
+ ClearElementName() : string
+ CollectionType() : ConfigurationElementCollectionType
+ Count() : int
+ RemoveElementName() : string
«indexer»
+ this(int) : MessageEndpointMapping
+ this(string) : MessageEndpointMapping

ConfigurationSection ConfigurationSection
DbSubscriptionStorageConfig MsmqTransportConfig

«property» «property»
+ ConnectionString() : string + ErrorQueue() : string
+ ProviderInvariantName() : string + InputQueue() : string
+ MaxRetries() : int
+ NumberOfWorkerThreads() : int

Figure: 5
Model Specification Phase 01 Page: 27

Configure
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Config Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {85ACAADA-D8E2-4249-B44A-2728611AA762}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private instance
Source -> Destination Configure Configure

Generalization Public Public


Source -> Destination ConfigUnicastBus Configure

Generalization Public Public


Source -> Destination ConfigMsmqTransport Configure

Generalization Public Public


Source -> Destination ConfigDbSubscriptionS Configure
torage

Generalization Public Public


Source -> Destination ConfigMsmqSubscripti Configure
onStorage

Attributes
Attribute Notes Constraints and tags
instance Configure Default:
Private Static

Operations
Method Notes Parameters
Builder() IBuilder
Public
Configure()
Protected
Model Specification Phase 01 Page: 28

Method Notes Parameters


Configurer()
IConfigureComponents
Public
CreateBus() IStartableBus
Public
Static ObjectBuilder()
IBuilder
Public
Static With() Configure
Public

DbSubscriptionStorageConfig
Type: Class ConfigurationSection
Status: Proposed. Version 1.0. Phase 1.0.
Package: Config Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {3DBE2DDE-907F-442d-BCAD-63C68F0B48EA}

Custom Properties
 isActive = False

Operations
Method Notes Parameters
ConnectionString() string
Public
ProviderInvariantName()
string
Public

MessageEndpointMapping
Type: Class ConfigurationElement
Status: Proposed. Version 1.0. Phase 1.0.
Package: Config Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {DA90C4C6-EA43-495b-A5DD-FD9F2A8875BC}

Custom Properties
 isActive = False
Model Specification Phase 01 Page: 29

Operations
Method Notes Parameters
Endpoint() string
Public
Messages() string
Public

MessageEndpointMappingCollection
Type: Class ConfigurationElementCollection
Status: Proposed. Version 1.0. Phase 1.0.
Package: Config Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {6AD29664-661D-407c-8AE2-69C7EACEBBD3}

Custom Properties
 isActive = False

Operations
Method Notes Parameters
Add() void MessageEndpointMapping
Public mapping
[in]

AddElementName() string
Public
BaseAdd() void ConfigurationElement element
Protected [in]

Clear() void
Public
ClearElementName()
string
Public
CollectionType()
ConfigurationElementColl
ectionType
Public
Count() int
Public
CreateNewElement()
ConfigurationElement
Protected
CreateNewElement() string elementName
ConfigurationElement [in]
Model Specification Phase 01 Page: 30

Method Notes Parameters


Protected

GetElementKey() Object ConfigurationElement element


Protected [in]

IndexOf() int MessageEndpointMapping


Public mapping
[in]

MessageEndpointMappin
gCollection()
Public
Remove() void MessageEndpointMapping
Public mapping
[in]

Remove() void string name


Public [in]

RemoveAt() void int index


Public [in]

RemoveElementName()
string
Public
this() int index
MessageEndpointMapping [in]
Public

this() string Name


MessageEndpointMapping [in]
Public

MsmqSubscriptionStorageConfig
Type: Class ConfigurationSection
Status: Proposed. Version 1.0. Phase 1.0.
Package: Config Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {42D33A8E-96E1-41cc-B37E-1C6916A32342}

Custom Properties
 isActive = False
Model Specification Phase 01 Page: 31

Operations
Method Notes Parameters
Queue() string
Public

MsmqTransportConfig
Type: Class ConfigurationSection
Status: Proposed. Version 1.0. Phase 1.0.
Package: Config Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {544FC285-2E21-4c0d-87E1-3F21E43110E2}

Custom Properties
 isActive = False

Operations
Method Notes Parameters
ErrorQueue() string
Public
InputQueue() string
Public
MaxRetries() int
Public
NumberOfWorkerThrea
ds() int
Public

UnicastBusConfig
Type: Class ConfigurationSection
Status: Proposed. Version 1.0. Phase 1.0.
Package: Config Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {48F9C162-33B7-4cac-A3D4-D486ACF4D26C}

Custom Properties
 isActive = False
Model Specification Phase 01 Page: 32

Operations
Method Notes Parameters
DistributorControlAddre
ss() string
Public
DistributorDataAddress()
string
Public
MessageEndpointMappin
gs()
MessageEndpointMapping
Collection
Public

Grid
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus
Detail: Created on 21/12/2008 09:37:19. Last modified on 21/12/2008 09:37:19
GUID: {56DD094B-E75C-4636-BAF2-8EAE19BDF53E}

MessageHandlers
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Grid
Detail: Created on 21/12/2008 09:37:19. Last modified on 21/12/2008 09:37:19
GUID: {BD6C9AFD-F0F0-439a-8BC8-F2FAFD929065}

MessageHandlers - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {AD91D17E-F333-48e9-A566-B977EB042826}

class MessageHandlers

GridInterceptingMessageHandler GetNumberOfWorkerThreadsMessageHandler ChangeNumberOfWorkerThreadsMessageHandler

- disabled: bool - logger: ILog = LogManager.GetL... {readOnly} - logger: ILog = LogManager.GetL... {readOnly}
- logger: ILog = LogManager.GetL... {readOnly} - transport: ITransport - transport: ITransport
- unicastBus: IUnicastBus - unicastBus: IUnicastBus
+ Handle(GetNumberOfWorkerThreadsMessage) : void
+ Handle(IMessage) : void «property» + Handle(ChangeNumberOfWorkerThreadsMessage) : void
«property» + Bus() : IBus «property»
+ Bus() : IBus + Transport() : ITransport + Transport() : ITransport
+ Disabled() : bool + UnicastBus() : IUnicastBus
+ UnicastBus() : IUnicastBus
«event»
+ DisabledChanged() : EventHandler

Figure: 6
Model Specification Phase 01 Page: 33

ChangeNumberOfWorkerThreadsMessageHandler
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: MessageHandlers Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {50018BFC-6D44-498d-9042-4CED0A1EC0F0}

Handles <see cref="ChangeNumberOfWorkerThreadsMessage"/>.

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private transport
Source -> Destination ChangeNumberOfWork ITransport
erThreadsMessageHand
ler

Association Public Private unicastBus


Source -> Destination ChangeNumberOfWork IUnicastBus
erThreadsMessageHand
ler

Realisation Public Public


Source -> Destination ChangeNumberOfWork IMessageHandler
erThreadsMessageHand
ler

Attributes
Attribute Notes Constraints and tags
logger ILog Default:
Private Static Const LogManager.GetLogger("NService
LogManager.GetLogger(" bus.Grid")
NServicebus.Grid")

transport ITransport Default:


Private
Model Specification Phase 01 Page: 34

Attribute Notes Constraints and tags


unicastBus IUnicastBus Default:
Private

Operations
Method Notes Parameters
Handle() void ChangeNumberOfWorkerThread
Public sMessage message
[in]

Transport() ITransport This is kept separate from the bus because the
Public distributor will be using this class on its control
bus to change the number of worker threads on
its data bus. For regular cases, the transport
should be the same as is configured for the bus.

UnicastBus() IUnicastBus
Public

GetNumberOfWorkerThreadsMessageHandler
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: MessageHandlers Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {E97AE45B-9DE6-4abe-BC5E-ECABFF816622}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private transport
Source -> Destination GetNumberOfWorkerT ITransport
hreadsMessageHandler

Realisation Public Public


Source -> Destination GetNumberOfWorkerT IMessageHandler
hreadsMessageHandler
Model Specification Phase 01 Page: 35

Attributes
Attribute Notes Constraints and tags
logger ILog Default:
Private Static Const LogManager.GetLogger("NService
LogManager.GetLogger(" bus.Grid")
NServicebus.Grid")

transport ITransport Default:


Private

Operations
Method Notes Parameters
Bus() IBus
Public
Handle() void GetNumberOfWorkerThreadsMe
Public ssage message
[in]

Transport() ITransport
Public

GridInterceptingMessageHandler
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: MessageHandlers Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {0603AD73-1A53-46f8-A689-89BE7DC46095}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Model Specification Phase 01 Page: 36

Connector Source Target Notes


Association Public Private unicastBus
Source -> Destination GridInterceptingMessag IUnicastBus
eHandler

Realisation Public Public


Source -> Destination GridInterceptingMessag IMessageHandler
eHandler

Attributes
Attribute Notes Constraints and tags
disabled bool Default:
Private Static
[volatile = true ]

logger ILog Default:


Private Static Const LogManager.GetLogger("NService
LogManager.GetLogger(" bus.Grid")
NServicebus.Grid")

unicastBus IUnicastBus Default:


Private

Operations
Method Notes Parameters
Bus() IBus
Public
Static Disabled() bool
Public
Static DisabledChanged()
EventHandler
Public
Handle() void IMessage message
Public [in]

UnicastBus() IUnicastBus
Public
Model Specification Phase 01 Page: 37

Messages
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Grid
Detail: Created on 21/12/2008 09:37:20. Last modified on 21/12/2008 09:37:20
GUID: {1F59993C-F45E-433e-910C-AC8D39E697BF}

Messages - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {F8AC8DEF-E410-40d7-BE3F-AFACCC17C52C}

class Messages

GotNumberOfWorkerThreadsMessage GetNumberOfWorkerThreadsMessage ChangeNumberOfWorkerThreadsMessage

«property» «property»
+ NumberOfWorkerThreads() : int + NumberOfWorkerThreads() : int

Figure: 7

ChangeNumberOfWorkerThreadsMessage
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Messages Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {6172F4B5-DA8D-4f07-B246-23C78AD76E81}

Message sent to request that the bus change the number of worker threads handling messages.

Custom Properties
 isActive = False

Tagged Values
 Attribute = [Serializable].

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination ChangeNumberOfWork IMessage
Model Specification Phase 01 Page: 38

Connector Source Target Notes


erThreadsMessage

Operations
Method Notes Parameters
NumberOfWorkerThrea
ds() int
Public

GetNumberOfWorkerThreadsMessage
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Messages Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {237AF6CC-81B9-4f76-BBD1-0F5875BFAC7B}

Request message sent to a bus to get the number of worker threads. Response is a <see
cref="GotNumberOfWorkerThreadsMessage"/>.

Custom Properties
 isActive = False

Tagged Values
 Attribute = [Serializable].

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination GetNumberOfWorkerT IMessage
hreadsMessage

GotNumberOfWorkerThreadsMessage
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Messages Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {20D8AC20-58FC-4a79-B349-BE4BEC07DC4B}

Response message returned by the bus as a result of a <see cref="GetNumberOfWorkerThreadsMessage"/>.


Model Specification Phase 01 Page: 39

Custom Properties
 isActive = False

Tagged Values
 Attribute = [Serializable].

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination GotNumberOfWorkerT IMessage
hreadsMessage

Operations
Method Notes Parameters
NumberOfWorkerThrea
ds() int
Public

MessageInterfaces
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus
Detail: Created on 21/12/2008 09:37:20. Last modified on 21/12/2008 09:37:20
GUID: {FD4F1765-C295-42cb-A3BD-3502EBBED8EF}

MessageInterfaces - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {71984702-570B-4f54-9E68-39FEA00781E7}
Model Specification Phase 01 Page: 40

class MessageInterfaces

IMessageCreator
«interface»
IMessageMapper
+ GetMappedTypeFor(Type) : Type
+ GetMappedTypeFor(string) : Type
+ Initialize(Type[]) : void

Figure: 8

IMessageMapper
Type: Interface IMessageCreator
Status: Proposed. Version 1.0. Phase 1.0.
Package: MessageInterfaces Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {46D1D251-D9F4-49b0-AF12-FA9E92459DDB}

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination MessageMapper IMessageMapper

Association Public Private messageMapper


Source -> Destination UnicastBus IMessageMapper

Generalization Public Public


Source -> Destination IMessageMapper IMessageCreator

Operations
Method Notes Parameters
GetMappedTypeFor() Type t
Type [in]
Public

GetMappedTypeFor() string typeName


Type [in]
Public

Initialize() void Type[] types


Public [in]
Model Specification Phase 01 Page: 41

MessageMapper
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: MessageInterfaces
Detail: Created on 21/12/2008 09:37:20. Last modified on 21/12/2008 09:37:20
GUID: {5BAA1050-BE3C-4f99-8D27-240E95771B3D}

Reflection
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: MessageMapper
Detail: Created on 21/12/2008 09:37:20. Last modified on 21/12/2008 09:37:20
GUID: {90682306-5801-4e27-B707-5DA7E6612913}

Reflection - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {95FC1FAD-0AAF-4ea6-896B-61DC9B622E98}

class Reflection

MessageMapper

- concreteToInterfaceTypeMapping: Dictionary<Type, Type> = new Dictionary<... {readOnly}


- interfaceToConcreteTypeMapping: Dictionary<Type, Type> = new Dictionary<... {readOnly}
- nameToType: Dictionary<string, Type> = new Dictionary<... {readOnly}
- SUFFIX: string = ".__Impl" {readOnly}
- typeToConstructor: Dictionary<Type, ConstructorInfo> = new Dictionary<... {readOnly}

+ CreateInstance(Action<T>) : T
+ CreateInstance() : T
+ CreateInstance(Type) : object
+ CreateTypeFrom(Type, ModuleBuilder) : Type
- GetAllProperties(Type) : IEnumerable<PropertyInfo>
+ GetMappedTypeFor(Type) : Type
+ GetMappedTypeFor(string) : Type
+ GetNewTypeName(Type) : string
+ Initialize(Type[]) : void
+ InitType(Type, ModuleBuilder) : void

Figure: 9

MessageMapper
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Model Specification Phase 01 Page: 42

Package: Reflection Keywords:


Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {84A47C07-D48B-475f-B40A-A4AF8AE5D48A}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination MessageMapper IMessageMapper

Attributes
Attribute Notes Constraints and tags
concreteToInterfaceType Default: new Dictionary<Type,
Mapping Type>()
Dictionary<Type, Type>
Private Static Const
new Dictionary<Type,
Type>()

interfaceToConcreteType Default: new Dictionary<Type,


Mapping Type>()
Dictionary<Type, Type>
Private Static Const
new Dictionary<Type,
Type>()

nameToType Default: new Dictionary<string,


Dictionary<string, Type> Type>()
Private Static Const
new Dictionary<string,
Type>()

SUFFIX string Default: ".__Impl"


Private Static Const
".__Impl"
Model Specification Phase 01 Page: 43

Attribute Notes Constraints and tags


typeToConstructor Default: new Dictionary<Type,
Dictionary<Type, ConstructorInfo>()
ConstructorInfo>
Private Static Const
new Dictionary<Type,
ConstructorInfo>()

Operations
Method Notes Parameters
CreateInstance() T Action<T> action
Public [in]

CreateInstance() T
Public
CreateInstance() object Type t
Public [in]

CreateTypeFrom() Type Type t


Public [in]

ModuleBuilder moduleBuilder
[in]

GetAllProperties() Type t
IEnumerable<PropertyInfo [in]
>
Private
GetMappedTypeFor() Type t
Type [in]
Public

GetMappedTypeFor() string typeName


Type [in]
Public

GetNewTypeName() Type t
string [in]
Public

Initialize() void Type[] types


Public [in]

InitType() void Type t


Public [in]

ModuleBuilder moduleBuilder
[in]
Model Specification Phase 01 Page: 44

Method Notes Parameters

Messages
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus
Detail: Created on 21/12/2008 09:37:12. Last modified on 21/12/2008 09:37:12
GUID: {7EB0645F-25C7-434a-8CEC-458C7EBD29EB}

Messages - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {C21844F9-3FD8-4775-AF3E-24A5C0D6CBBD}

class Messages

ReadyMessage

«property»
+ ClearPreviousFromThisAddress() : bool

Figure: 10

ReadyMessage
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Messages Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {D3D954D3-7A0C-48f2-AD77-3CC14F59F08D}

Defines a message indicating that a transport is ready to receive a message.

Custom Properties
 isActive = False

Tagged Values
 Attribute = [Serializable].
Model Specification Phase 01 Page: 45

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination ReadyMessage IMessage

Operations
Method Notes Parameters
ClearPreviousFromThis Exposes whether or not previous ready
Address() bool messages from the same sender should be
Public cleared.

Multicast
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus
Detail: Created on 21/12/2008 09:37:39. Last modified on 21/12/2008 09:37:39
GUID: {C8AA5508-9285-4464-8477-FC13166EF186}

Multicast - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {2CC6A39E-FAC9-4123-B8BB-890C44197DBA}

class Multicast

UnicastBus
Bus

- subscribeToTopics: IList<string> = new List<string>()

+ Publish(T[]) : void
+ Start(Action<IBuilder>[]) : IBus
+ Subscribe(Type) : void
+ Subscribe(Type, Predicate<IMessage>) : void
+ Unsubscribe(Type) : void
«property»
+ SubscribeToTopics() : IList<string>

Figure: 11

Bus
Model Specification Phase 01 Page: 46

Type: Class UnicastBus


Status: Proposed. Version 1.0. Phase 1.0.
Package: Multicast Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {75828087-48E9-49fa-AE9A-74A4BF789DED}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Generalization Public Public
Source -> Destination Bus UnicastBus

Attributes
Attribute Notes Constraints and tags
subscribeToTopics Default: new List<string>()
IList<string>
Private new
List<string>()

Operations
Method Notes Parameters
Publish() void T[] messages
Public [in]

Start() IBus Action<IBuilder>[] startupActions


Public [in]

Subscribe() void Type messageType


Public [in]

Subscribe() void Type messageType


Public [in]

Predicate<IMessage> condition
[in]
Model Specification Phase 01 Page: 47

Method Notes Parameters


SubscribeToTopics()
IList<string>
Public
Unsubscribe() void Type messageType
Public [in]

Transport
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Multicast
Detail: Created on 21/12/2008 09:37:39. Last modified on 21/12/2008 09:37:39
GUID: {CB104039-ABB3-42e2-B239-775C88583B6C}

Transport - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {B69FCAA3-EE7C-4a15-AA8E-67EB56FB57D1}

class Transport

ITransport
«interface»
IMulticastTransport
+ Publish(TransportMessage, string) : void
+ Subscribe(string) : void
+ Unsubscribe(string) : void

Figure: 12

IMulticastTransport
Type: Interface ITransport
Status: Proposed. Version 1.0. Phase 1.0.
Package: Transport Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {033DDD0C-C624-4b97-9AFD-A172CAAEB3E5}

Connections
Connector Source Target Notes
Model Specification Phase 01 Page: 48

Connector Source Target Notes


Generalization Public Public
Source -> Destination IMulticastTransport ITransport

Operations
Method Notes Parameters
Publish() void TransportMessage message
Public [in]

string address
[in]

Subscribe() void string address


Public [in]

Unsubscribe() void string address


Public [in]

ObjectBuilder
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus
Detail: Created on 21/12/2008 09:37:21. Last modified on 21/12/2008 09:37:21
GUID: {A6A232B2-5913-46dd-A4FB-093F8301566D}

CastleWindsor
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: ObjectBuilder
Detail: Created on 21/12/2008 09:37:21. Last modified on 21/12/2008 09:37:21
GUID: {780E1D4C-44B7-4d33-BEFB-7C2531A3B8C1}

CastleWindsor - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {056A3880-B6BC-4b3e-A99F-53150560A238}
Model Specification Phase 01 Page: 49

class CastleWindsor

IInterceptor
WindsorObj ectBuilder ConfigureComponentAdapter
RecordPropertySet
- proxyGenerator: ProxyGenerator = new ProxyGenerator() {readOnly} - handler: IHandler {readOnly}
- componentConfig: IComponentConfig {readOnly}
+ Build(Type) : object + ConfigureComponentAdapter(IHandler)
+ BuildAll(Type) : IEnumerable<object> + Intercept(IInvocation) : void + ConfigureProperty(string, object) : IComponentConfig
+ BuildAndDispatch(Type, Action<object>) : void + RecordPropertySet(IComponentConfig)
+ Configure(Type, ComponentCallModelEnum) : object
+ ConfigureComponent(Type, ComponentCallModelEnum) : IComponentConfig
- GetAllServiceTypesFor(Type) : IEnumerable<Type>
- GetLifestyleTypeFrom(ComponentCallModelEnum) : LifestyleType
+ WindsorObjectBuilder()
+ WindsorObjectBuilder(IWindsorContainer)
«property»
+ Container() : IWindsorContainer

Figure: 13

ConfigureComponentAdapter
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: CastleWindsor Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {2327DB9C-FE4E-464c-8490-BFD75822C57E}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination ConfigureComponentA IComponentConfig
dapter

Attributes
Attribute Notes Constraints and tags
handler IHandler Default:
Private Const

Operations
Method Notes Parameters
ConfigureComponentAd IHandler handler
apter() [in]
Public
Model Specification Phase 01 Page: 50

Method Notes Parameters

ConfigureProperty() string name


IComponentConfig [in]
Public
object value
[in]

RecordPropertySet
Type: Class IInterceptor
Status: Proposed. Version 1.0. Phase 1.0.
Package: CastleWindsor Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {A126E100-9DCE-4f0c-8ED2-B883CDFAC6CD}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private
Source -> Destination RecordPropertySet componentConfig
IComponentConfig

Attributes
Attribute Notes Constraints and tags
componentConfig Default:
IComponentConfig
Private Const

Operations
Method Notes Parameters
Intercept() void IInvocation invocation
Public [in]

RecordPropertySet() IComponentConfig
Model Specification Phase 01 Page: 51

Method Notes Parameters


Public componentConfig
[in]

WindsorObjectBuilder
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: CastleWindsor Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {FD288768-3D6D-48c2-980B-C5C2B30E4E0E}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination WindsorObjectBuilder IBuilderInternal

Attributes
Attribute Notes Constraints and tags
proxyGenerator Default: new ProxyGenerator()
ProxyGenerator
Private Const new
ProxyGenerator()

Operations
Method Notes Parameters
Build() object Type typeToBuild
Public [in]

BuildAll() Type typeToBuild


IEnumerable<object> [in]
Public

BuildAndDispatch() void Type typeToBuild


Public [in]
Model Specification Phase 01 Page: 52

Method Notes Parameters

Action<object> action
[in]

Configure() object Type concreteType


Public [in]

ComponentCallModelEnum
callModel
[in]

ConfigureComponent() Type concreteComponent


IComponentConfig [in]
Public
ComponentCallModelEnum
callModel
[in]

Container()
IWindsorContainer
Public
GetAllServiceTypesFor() Type t
IEnumerable<Type> [in]
Private

GetLifestyleTypeFrom() ComponentCallModelEnum
LifestyleType callModel
Private [in]

WindsorObjectBuilder()
Public
WindsorObjectBuilder() IWindsorContainer container
Public [in]

Common
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: ObjectBuilder
Detail: Created on 21/12/2008 09:37:22. Last modified on 21/12/2008 09:37:22
GUID: {277E16C3-1DF9-4169-8735-9C2DCF4EDAF8}

Common - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Model Specification Phase 01 Page: 53

Version: 1.0. False


GUID: {179E22F1-9C36-44d1-BF39-A2695236C402}

class Common

«interface»
«interface»
IBuilderInternal
IContainInternalBuilder
+ Build(Type) : object
«property» + BuildAll(Type) : IEnumerable<object>
+ Builder() : IBuilderInternal + BuildAndDispatch(Type, Action<object>) : void
+ Configure(Type, ComponentCallModelEnum) : object
+ ConfigureComponent(Type, ComponentCallModelEnum) : IComponentConfig

CommonObj ectBuilder

+ Build() : T
+ Build(Type) : object
+ BuildAll(Type) : IEnumerable<object>
+ BuildAll() : IEnumerable<T>
+ BuildAndDispatch(Type, Action<object>) : void
+ ConfigureComponent(ComponentCallModelEnum) : T
+ ConfigureComponent(Type, ComponentCallModelEnum) : IComponentConfig
«property»
+ Builder() : IBuilderInternal

Figure: 14

CommonObjectBuilder
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Common Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {0A1E07AA-D20A-44c4-8FD8-6DBB76B47226}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination CommonObjectBuilder IBuilder

Realisation Public Public


Source -> Destination CommonObjectBuilder IConfigureComponents

Realisation Public Public


Source -> Destination CommonObjectBuilder IContainInternalBuilder
Model Specification Phase 01 Page: 54

Operations
Method Notes Parameters
Build() T
Public
Build() object Type typeToBuild
Public [in]

BuildAll() Type typeToBuild


IEnumerable<object> [in]
Public

BuildAll()
IEnumerable<T>
Public
BuildAndDispatch() void Type typeToBuild
Public [in]

Action<object> action
[in]

Builder() IBuilderInternal
Public
ConfigureComponent() T ComponentCallModelEnum
Public callModel
[in]

ConfigureComponent() Type concreteComponent


IComponentConfig [in]
Public
ComponentCallModelEnum
callModel
[in]

IBuilderInternal
Type: Interface
Status: Proposed. Version 1.0. Phase 1.0.
Package: Common Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {418F3FCB-F68F-4eee-8BBE-5C2289FE1417}

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination WindsorObjectBuilder IBuilderInternal
Model Specification Phase 01 Page: 55

Connector Source Target Notes

Realisation Public Public


Source -> Destination SpringObjectBuilder IBuilderInternal

Realisation Public Public


Source -> Destination SynchronizedObjectBui IBuilderInternal
lder

Operations
Method Notes Parameters
Build() object Type typeToBuild
Public [in]

BuildAll() Type typeToBuild


IEnumerable<object> [in]
Public

BuildAndDispatch() void Type typeToBuild


Public [in]

Action<object> action
[in]

Configure() object Type concreteComponent


Public [in]

ComponentCallModelEnum
callModel
[in]

ConfigureComponent() Type concreteComponent


IComponentConfig [in]
Public
ComponentCallModelEnum
callModel
[in]

IContainInternalBuilder
Type: Interface
Status: Proposed. Version 1.0. Phase 1.0.
Package: Common Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {FBC6B638-0332-4d3c-A775-0CE562C15317}
Model Specification Phase 01 Page: 56

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination CommonObjectBuilder IContainInternalBuilder

Realisation Public Public


Source -> Destination SynchronizedObjectBui IContainInternalBuilder
lder

Operations
Method Notes Parameters
Builder() IBuilderInternal
Public

Config
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Common
Detail: Created on 21/12/2008 09:37:23. Last modified on 21/12/2008 09:37:23
GUID: {5FE83544-4E86-44e2-B245-6C7B30C207AF}

Config - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {75BED846-D8C3-47a4-A1E0-634B98352DA4}

class Config

ConfigureCommon

+ With(Configure, IBuilderInternal, Action<IConfigureComponents>[]) : void

Figure: 15

ConfigureCommon
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Config Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {9AB1C594-48E9-446a-A032-B1C9A0DAC516}
Model Specification Phase 01 Page: 57

Custom Properties
 isActive = False

Tagged Values
 static = true.

Operations
Method Notes Parameters
Static With() void Configure config
Public [in]

IBuilderInternal builder
[in]

Action<IConfigureComponents>[
] configActions
[in]

Spring
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: ObjectBuilder
Detail: Created on 21/12/2008 09:37:24. Last modified on 21/12/2008 09:37:24
GUID: {98AD12B4-5670-4aa1-B881-8D0A01F9A571}

Spring - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {A43A6B2F-9237-4577-8EC1-B856F671329A}
Model Specification Phase 01 Page: 58

class Spring

IPointcut DefaultPointcutAdvisor
SpringObj ectBuilder
ConfigAdv isor::SetterPointcut ConfigAdv isor
- componentProperties: Dictionary<Type, ComponentConfig> = new Dictionary<... {readOnly}
- context: GenericApplicationContext - methodMatcher: IMethodMatcher = TrueMethodMatch... + ConfigAdvisor(Type, IComponentConfig)
- factory: DefaultObjectDefinitionFactory = new DefaultObje... - typeFilter: ITypeFilter
- initialized: bool
- typeHandleLookup: Dictionary<Type, ComponentCallModelEnum> = new Dictionary<... {readOnly} + SetterPointcut(Type)
«property»
+ Build(Type) : object + MethodMatcher() : IMethodMatcher
+ BuildAll(Type) : IEnumerable<object> + TypeFilter() : ITypeFilter
+ BuildAndDispatch(Type, Action<object>) : void
+ Configure(Type, ComponentCallModelEnum) : object
+ ConfigureComponent(Type, ComponentCallModelEnum) : IComponentConfig
- Init() : void
+ SpringObjectBuilder()
+ SpringObjectBuilder(GenericApplicationContext)
- WarnAboutNonVirtualProperties(Type) : void

IMethodInterceptor
ComponentConfig
ConfigAdv ice
- properties: Dictionary<string, object> = new Dictionary<... {readOnly}
- config: IComponentConfig {readOnly}
+ Configure(ObjectDefinitionBuilder) : void
+ ConfigAdvice(IComponentConfig) + ConfigureProperty(string, object) : IComponentConfig
- GetName(string) : string
+ Invoke(IMethodInvocation) : Object
- IsSetter(MethodInfo) : bool

Figure: 16

ComponentConfig
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Spring Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {61CDBA0D-E5DB-46cc-8067-6BFB4EF397E5}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination ComponentConfig IComponentConfig

Attributes
Attribute Notes Constraints and tags
properties Default: new Dictionary<string,
Dictionary<string, object> object>()
Private Const new
Dictionary<string,
object>()
Model Specification Phase 01 Page: 59

Operations
Method Notes Parameters
Configure() void ObjectDefinitionBuilder builder
Public [in]

ConfigureProperty() string name


IComponentConfig [in]
Public
object value
[in]

ConfigAdvice
Type: Class IMethodInterceptor
Status: Proposed. Version 1.0. Phase 1.0.
Package: Spring Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {97D9A280-F85C-4379-91FC-668AC1F7BD51}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private config
Source -> Destination ConfigAdvice IComponentConfig

Attributes
Attribute Notes Constraints and tags
config IComponentConfig Default:
Private Const

Operations
Method Notes Parameters
ConfigAdvice() IComponentConfig config
Model Specification Phase 01 Page: 60

Method Notes Parameters


Public [in]

Static GetName() string string setterName


Private [in]

Invoke() Object IMethodInvocation invocation


Public [in]

Static IsSetter() bool MethodInfo method


Private [in]

ConfigAdvisor
Type: Class DefaultPointcutAdvisor
Status: Proposed. Version 1.0. Phase 1.0.
Package: Spring Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {47533757-256C-4986-A975-3D7321FDBD01}

Custom Properties
 isActive = False

Operations
Method Notes Parameters
ConfigAdvisor() Type type
Public [in]

IComponentConfig config
[in]

SetterPointcut
Type: Class IPointcut
Status: Proposed. Version 1.0. Phase 1.0.
Package: Spring Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {4417058C-6054-4604-8FF9-2519470DCE7D}
Model Specification Phase 01 Page: 61

Custom Properties
 isActive = False

Attributes
Attribute Notes Constraints and tags
methodMatcher Default: TrueMethodMatcher.True
IMethodMatcher
Private
TrueMethodMatcher.True

typeFilter ITypeFilter Default:


Private

Operations
Method Notes Parameters
MethodMatcher()
IMethodMatcher
Public
SetterPointcut() Type type
Public [in]

TypeFilter() ITypeFilter
Public

SpringObjectBuilder
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Spring Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {77DE202E-DEE8-4b1d-BB03-DB43231B417A}

Custom Properties
 isActive = False
Model Specification Phase 01 Page: 62

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination SpringObjectBuilder IBuilderInternal

Attributes
Attribute Notes Constraints and tags
componentProperties Default: new Dictionary<Type,
Dictionary<Type, ComponentConfig>()
ComponentConfig>
Private Const new
Dictionary<Type,
ComponentConfig>()

context Default:
GenericApplicationContext
Private Static

factory Default: new


DefaultObjectDefinitionFa DefaultObjectDefinitionFactory()
ctory
Private new
DefaultObjectDefinitionFa
ctory()

initialized bool Default:


Private

typeHandleLookup Default: new Dictionary<Type,


Dictionary<Type, ComponentCallModelEnum>()
ComponentCallModelEnu
m>
Private Const new
Dictionary<Type,
ComponentCallModelEnu
m>()
Model Specification Phase 01 Page: 63

Operations
Method Notes Parameters
Build() object Type typeToBuild
Public [in]

BuildAll() Type typeToBuild


IEnumerable<object> [in]
Public

BuildAndDispatch() void Type typeToBuild


Public [in]

Action<object> action
[in]

Configure() object Type concreteComponent


Public [in]

ComponentCallModelEnum
callModel
[in]

ConfigureComponent() Type concreteComponent


IComponentConfig [in]
Public
ComponentCallModelEnum
callModel
[in]

Init() void
Private
SpringObjectBuilder()
Public
SpringObjectBuilder() GenericApplicationContext
Public container
[in]

Static Type concreteComponent


WarnAboutNonVirtualP [in]
roperties() void
Private

Synchronized
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: ObjectBuilder
Detail: Created on 21/12/2008 09:37:25. Last modified on 21/12/2008 09:37:25
Model Specification Phase 01 Page: 64

GUID: {39E5B8B4-9E22-40c3-BFA8-0DD965A55D25}

Synchronized - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {57FE2730-F3B0-4afa-BCDD-F6F47335C3C4}

class Synchronized

ContextBoundObject
SynchronizedObj ectBuilder

+ Build(Type) : object
+ BuildAll(Type) : IEnumerable<object>
+ BuildAndDispatch(Type, Action<object>) : void
+ Configure(Type, ComponentCallModelEnum) : object
+ ConfigureComponent(Type, ComponentCallModelEnum) : IComponentConfig
«property»
+ Builder() : IBuilderInternal

Figure: 17

SynchronizedObjectBuilder
Type: Class ContextBoundObject
Status: Proposed. Version 1.0. Phase 1.0.
Package: Synchronized Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {423DBDAB-A9E0-49f8-8E2D-4CD8B8578E83}

Custom Properties
 isActive = False

Tagged Values
 Attribute = [Synchronization(SynchronizationAttribute.REQUIRED)].

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination SynchronizedObjectBui IBuilderInternal
lder
Model Specification Phase 01 Page: 65

Connector Source Target Notes

Realisation Public Public


Source -> Destination SynchronizedObjectBui IContainInternalBuilder
lder

Operations
Method Notes Parameters
Build() object Type typeToBuild
Public [in]

BuildAll() Type typeToBuild


IEnumerable<object> [in]
Public

BuildAndDispatch() void Type typeToBuild


Public [in]

Action<object> action
[in]

Builder() IBuilderInternal
Public
Configure() object Type concreteComponent
Public [in]

ComponentCallModelEnum
callModel
[in]

ConfigureComponent() Type concreteComponent


IComponentConfig [in]
Public
ComponentCallModelEnum
callModel
[in]

Proxy
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus
Detail: Created on 21/12/2008 09:37:41. Last modified on 21/12/2008 09:37:41
GUID: {3099A909-78EF-4d46-AB2D-D605C6712DEC}
Model Specification Phase 01 Page: 66

Proxy - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {E54993F9-508C-4a7e-AA84-E4230C379FB4}

class Proxy

«interface» «interface»
ISubscriberStorage IProxyDataStorage ProxyData
+ GetAllSubscribers() : IEnumerable<string> + GetAndRemove(string) : ProxyData + ClientAddress: string
+ Remove(string) : void + Save(ProxyData) : void + CorrelationId: string
+ Store(string) : void + Id: string

-subscribers -storage

Proxy

- externalTransport: ITransport
- internalTransport: ITransport
- remoteServer: string
- storage: IProxyDataStorage
- subscribers: ISubscriberStorage

- externalTransport_TransportMessageReceived(object, TransportMessageReceivedEventArgs) : void


- GenerateId() : string
- HandledPublish(TransportMessage) : bool
- HandledSubscription(TransportMessage) : bool
- internalTransport_TransportMessageReceived(object, TransportMessageReceivedEventArgs) : void
+ Start() : void
«property»
+ ExternalTransport() : ITransport
+ InternalTransport() : ITransport
+ RemoteServer() : string
+ Storage() : IProxyDataStorage
+ Subscribers() : ISubscriberStorage

Figure: 18

Proxy
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Proxy Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {4A223A98-344C-4caa-89F7-881DA4DE022D}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private
Source -> Destination Proxy externalTransport
Model Specification Phase 01 Page: 67

Connector Source Target Notes


ITransport

Association Public Private


Source -> Destination Proxy internalTransport
ITransport

Association Public Private storage


Source -> Destination Proxy IProxyDataStorage

Association Public Private subscribers


Source -> Destination Proxy ISubscriberStorage

Attributes
Attribute Notes Constraints and tags
externalTransport Default:
ITransport
Private

internalTransport Default:
ITransport
Private

remoteServer string Default:


Private

storage IProxyDataStorage Default:


Private
Model Specification Phase 01 Page: 68

Attribute Notes Constraints and tags


subscribers Default:
ISubscriberStorage
Private

Operations
Method Notes Parameters
ExternalTransport()
ITransport
Public
externalTransport_Trans object sender
portMessageReceived() [in]
void
Private TransportMessageReceivedEvent
Args e
[in]

Static GenerateId() string


Private
HandledPublish() bool Assumes that no data could be found using TransportMessage message
Private correlation id. [in]

@returns

HandledSubscription() TransportMessage
bool transportMessage
Private [in]

InternalTransport()
ITransport
Public
internalTransport_Trans object sender
portMessageReceived() [in]
void
Private TransportMessageReceivedEvent
Args e
[in]

RemoteServer() string
Public
Start() void
Public
Storage()
IProxyDataStorage
Public
Subscribers()
Model Specification Phase 01 Page: 69

Method Notes Parameters


ISubscriberStorage
Public

ProxyData
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Proxy Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {09BC21D2-F380-430a-B394-1344AB97ECA6}

Custom Properties
 isActive = False

Tagged Values
 Attribute = [Serializable].

Attributes
Attribute Notes Constraints and tags
ClientAddress string Default:
Public

CorrelationId string Default:


Public

Id string Default:
Public
Model Specification Phase 01 Page: 70

IProxyDataStorage
Type: Interface
Status: Proposed. Version 1.0. Phase 1.0.
Package: Proxy Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {A094D1AF-74B3-439d-AF53-D05BAC311CC8}

Connections
Connector Source Target Notes
Association Public Private storage
Source -> Destination Proxy IProxyDataStorage

Realisation Public Public


Source -> Destination ProxyDataStorage IProxyDataStorage

Operations
Method Notes Parameters
GetAndRemove() string id
ProxyData [in]
Public

Save() void ProxyData data


Public [in]

ISubscriberStorage
Type: Interface
Status: Proposed. Version 1.0. Phase 1.0.
Package: Proxy Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {9D358C91-2352-4fc9-935A-8C737DBB3D2D}

Connections
Connector Source Target Notes
Association Public Private subscribers
Source -> Destination Proxy ISubscriberStorage

Realisation Public Public


Source -> Destination SubscriberStorage ISubscriberStorage
Model Specification Phase 01 Page: 71

Operations
Method Notes Parameters
GetAllSubscribers()
IEnumerable<string>
Public
Remove() void string subscriber
Public [in]

Store() void string subscriber


Public [in]

Host
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Proxy
Detail: Created on 21/12/2008 09:37:42. Last modified on 21/12/2008 09:37:42
GUID: {0A3DDDC5-D292-47fa-A7D0-F6426C7A5930}

Host - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {F25A16B5-2424-44cc-AD71-F0F3AA3DB8B0}

class Host

ConfigurationSection
Program
NServ iceBusProxyConfig
- ConfigureSelfWith(IBuilder) : Proxy
- Main(string[]) : void «property»
+ RemoteServer() : string

Figure: 19

NServiceBusProxyConfig
Type: Class ConfigurationSection
Status: Proposed. Version 1.0. Phase 1.0.
Package: Host Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {80D25E0D-ECF8-4e8e-8D52-FC21FF51DDF8}
Model Specification Phase 01 Page: 72

Custom Properties
 isActive = False

Operations
Method Notes Parameters
RemoteServer() string
Public

Program
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Host Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {5B791D44-6947-4b85-9D66-1165B0C5086B}

Custom Properties
 isActive = False

Operations
Method Notes Parameters
Static IBuilder builder
ConfigureSelfWith() [in]
Proxy
Private
Static Main() void string[] args
Private [in]

InMemoryImpl
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Proxy
Detail: Created on 21/12/2008 09:37:42. Last modified on 21/12/2008 09:37:42
GUID: {E151DD97-03D4-4f89-B4DC-7E65EBA6210A}

InMemoryImpl - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
Model Specification Phase 01 Page: 73

GUID: {2AA8975A-2F36-4da6-B269-E649E26A92E9}

class InMemoryImpl

SubscriberStorage ProxyDataStorage

- storage: IList<string> = new List<string>() {readOnly} - storage: IDictionary<string, ProxyData> = new Dictionary<...

+ GetAllSubscribers() : IEnumerable<string> + GetAndRemove(string) : ProxyData


+ Remove(string) : void + Save(ProxyData) : void
+ Store(string) : void

Figure: 20

ProxyDataStorage
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: InMemoryImpl Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {21A5541B-A9CC-4449-B4AD-1EBF2A5269E4}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination ProxyDataStorage IProxyDataStorage

Attributes
Attribute Notes Constraints and tags
storage IDictionary<string, Default: new Dictionary<string,
ProxyData> ProxyData>()
Private new
Dictionary<string,
ProxyData>()

Operations
Method Notes Parameters
GetAndRemove() string id
ProxyData [in]
Public
Model Specification Phase 01 Page: 74

Method Notes Parameters

Save() void ProxyData data


Public [in]

SubscriberStorage
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: InMemoryImpl Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {453BA323-07EF-4c42-84B7-687B786D7486}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination SubscriberStorage ISubscriberStorage

Attributes
Attribute Notes Constraints and tags
storage IList<string> Default: new List<string>()
Private Const new
List<string>()

Operations
Method Notes Parameters
GetAllSubscribers()
IEnumerable<string>
Public
Remove() void string subscriber
Public [in]

Store() void string subscriber


Public [in]
Model Specification Phase 01 Page: 75

Method Notes Parameters

Saga
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus
Detail: Created on 21/12/2008 09:37:12. Last modified on 21/12/2008 09:37:12
GUID: {4A5BEC9E-7C65-46dd-B967-57EF8932F534}

Saga - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {17D24BA1-CAD5-403f-8765-A2638EE83771}
class Saga

Configure

- builderStatic: IBuilder
- configurer: IConfigureComponents
- finderTypeToMessageToMethodInfoLookup: IDictionary<Type, IDictionary<Type, MethodInfo>> = new Dictionary<... {readOnly}
- finderTypeToSagaEntityTypeLookup: IDictionary<Type, Type> = new Dictionary<... {readOnly}
- messageTypeToSagaTypesLookup: IDictionary<Type, List<Type>> = new Dictionary<... {readOnly}
- sagaEntityTypeToSagaTypeLookup: IDictionary<Type, Type> = new Dictionary<... {readOnly}
- sagaTypeToHandleMethodLookup: IDictionary<Type, IDictionary<Type, MethodInfo>> = new Dictionary<... {readOnly}
- sagaTypeToMessagTypesRequiringSagaStartLookup: IDictionary<Type, List<Type>> = new Dictionary<... {readOnly}
- sagaTypeToSagaEntityTypeLookup: IDictionary<Type, Type> = new Dictionary<... {readOnly}

- Configure()
- ConfigureFinder(Type) : void
T
«interface» «interface» «interface» «interface» IMessage - ConfigureSaga(Type) : void «interface» «interface» IMessageHandler
HasCompleted ITimeoutable IFinder ISagaPersister «interface» - CreateAdditionalFindersAsNecessary() : void Impl:: ISaga ISagaEntity «interface»
IFindSagas + GetFindByMethodForFinder(IFinder, IMessage) : MethodInfo
ISagaMessage GuidCombGenerator ISagaStartedBy
«property» + Timeout(object) : void + Complete(ISagaEntity) : void + GetFindersFor(IMessage) : IEnumerable<IFinder> «property» «property»
+ Completed() : bool + Get(Guid) : ISagaEntity + GetHandleMethodForSagaAndMessage(object, IMessage) : MethodInfo + Data() : T + Id() : Guid
«property» + Generate() : Guid
+ Save(ISagaEntity) : void - GetMessagesCorrespondingToFilterOnSaga(Type, Type) : IEnumerable<Type> + Originator() : string
+ SagaId() : Guid
+ Update(ISagaEntity) : void - GetMessageTypesHandledBySaga(Type) : IEnumerable<Type>
-persister-persister - GetMessageTypesThatRequireStartingTheSaga(Type) : IEnumerable<Type>
+ GetSagaEntityTypeForSagaType(Type) : Type
+ GetSagaTypeForSagaEntityType(Type) : Type
+ GetSagaTypesForMessageType(Type) : List<Type>
+ GetSagaTypeToStartIfMessageNotFoundByFinder(IMessage, IFinder) : Type
- IsCompatible(Type, Type) : bool
- IsFinderType(Type) : bool
+ IsMessageTypeHandledBySaga(Type) : bool
- IsSagaType(Type) : bool
- MapMessageTypeToSagaType(Type, Type) : void
- MapSagaTypeToSagaEntityType(Type, Type) : void
- MessageTypeRequiresStartingSaga(Type, Type) : void
+ SagasInAssemblies(Assembly[]) : void
+ With(IConfigureComponents, IBuilder) : Configure

Impl::SagaMessageHandler

- builder: IBuilder TimeoutMessage


# logger: ILog = LogManager.GetL... {readOnly}
- persister: ISagaPersister - expires: DateTime
T
«interface» «interface» Impl::SagaEntityFinder # CallHandleMethodOnSaga(object, IMessage) : void + HasNotExpired() : bool
ISaga IFindSagas::Using + GenerateSagaId() : Guid + TimeoutMessage()
Impl:: - persister: ISagaPersister
+ Handle(IMessage) : void + TimeoutMessage(DateTime, ISagaEntity, object)
«property» + FindBy(M) : T EmptySagaFinder
# HaveSagaHandleMessage(ISaga, IMessage, bool) : void + TimeoutMessage(TimeSpan, ISagaEntity, object)
+ FindBy(ISagaMessage) : ISagaEntity
+ Bus() : IBus # LogIfSagaIsFinished(ISaga) : void + TimeoutMessage(ISagaEntity, bool)
+ Entity() : ISagaEntity + FindBy(IMessage) : T «property» + NeedToHandle(IMessage) : bool «property»
+ Persister() : ISagaPersister # NotifyTimeoutManagerThatSagaHasCompleted(ISaga) : void + ClearTimeout() : bool
- UseFinderToFindSaga(IFinder, IMessage) : ISagaEntity + Expires() : DateTime
«property» + SagaId() : Guid
+ Builder() : IBuilder + State() : object
+ Persister() : ISagaPersister

Saga

- bus: IBus
- completed: bool
- data: T

# MarkAsComplete() : void
# ReplyToOriginator(IMessage[]) : void
# ReplyToOriginator(Action<K>) : void
# RequestTimeout(TimeSpan, object) : void
# RequestTimeout(DateTime, object) : void
+ Timeout(object) : void
«property»
+ Bus() : IBus
+ Completed() : bool
+ Data() : T
+ Entity() : ISagaEntity

Figure: 21

Configure
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Saga Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {935F49B7-3584-4029-94D0-9AF368FE42FF}

Custom Properties
 isActive = False
Model Specification Phase 01 Page: 76

Connections
Connector Source Target Notes
Association Public Private builderStatic
Source -> Destination Configure IBuilder

Association Public Private configurer


Source -> Destination Configure IConfigureComponents

Attributes
Attribute Notes Constraints and tags
builderStatic IBuilder Default:
Private Static

configurer Default:
IConfigureComponents
Private

finderTypeToMessageTo Default: new Dictionary<Type,


MethodInfoLookup IDictionary<Type, MethodInfo>>()
IDictionary<Type,
IDictionary<Type,
MethodInfo>>
Private Static Const
new Dictionary<Type,
IDictionary<Type,
MethodInfo>>()
finderTypeToSagaEntity Default: new Dictionary<Type,
TypeLookup Type>()
IDictionary<Type, Type>
Private Static Const
new Dictionary<Type,
Type>()

messageTypeToSagaType Default: new Dictionary<Type,


sLookup List<Type>>()
IDictionary<Type,
List<Type>>
Private Static Const
new Dictionary<Type,
List<Type>>()
Model Specification Phase 01 Page: 77

Attribute Notes Constraints and tags


sagaEntityTypeToSagaT Default: new Dictionary<Type,
ypeLookup Type>()
IDictionary<Type, Type>
Private Static Const
new Dictionary<Type,
Type>()

sagaTypeToHandleMeth Default: new Dictionary<Type,


odLookup IDictionary<Type, MethodInfo>>()
IDictionary<Type,
IDictionary<Type,
MethodInfo>>
Private Static Const
new Dictionary<Type,
IDictionary<Type,
MethodInfo>>()
sagaTypeToMessagTypes Default: new Dictionary<Type,
RequiringSagaStartLook List<Type>>()
up IDictionary<Type,
List<Type>>
Private Static Const
new Dictionary<Type,
List<Type>>()

sagaTypeToSagaEntityT Default: new Dictionary<Type,


ypeLookup Type>()
IDictionary<Type, Type>
Private Static Const
new Dictionary<Type,
Type>()

Operations
Method Notes Parameters
Configure()
Private
Static ConfigureFinder() Type t
void [in]
Private

Static ConfigureSaga() Type t


void [in]
Private

CreateAdditionalFinders
AsNecessary() void
Private
Static IFinder finder
GetFindByMethodForFin [in]
der() MethodInfo
Model Specification Phase 01 Page: 78

Method Notes Parameters


Public IMessage message
[in]

Static GetFindersFor() IMessage m


IEnumerable<IFinder> [in]
Public

Static object saga


GetHandleMethodForSa [in]
gaAndMessage()
MethodInfo IMessage message
Public [in]

Static Type sagaType


GetMessagesCorrespondi [in]
ngToFilterOnSaga()
IEnumerable<Type> Type filter
Private [in]

Static Type sagaType


GetMessageTypesHandle [in]
dBySaga()
IEnumerable<Type>
Private
Static Type sagaType
GetMessageTypesThatRe [in]
quireStartingTheSaga()
IEnumerable<Type>
Private
Static Returns the entity type configured for the given Type sagaType
GetSagaEntityTypeForSa saga type. [in]
gaType() Type
Public @returns

Static Returns the saga type configured for the given Type sagaEntityType
GetSagaTypeForSagaEnt entity type. [in]
ityType() Type
Public @returns

Static Finds the types of sagas that can handle the Type messageType
GetSagaTypesForMessag given concrete message type. [in] A concrete type for a message
eType() List<Type> object
Public @returns The list of saga types.

Static IMessage message


GetSagaTypeToStartIfM [in]
essageNotFoundByFinder
() Type IFinder finder
Public [in]

Static IsCompatible() bool Type t


Model Specification Phase 01 Page: 79

Method Notes Parameters


Private [in]

Type source
[in]

Static IsFinderType() bool Type t


Private [in]

Static Indicates if a saga has been configured to Type messageType


IsMessageTypeHandledB handle the given message type. [in]
ySaga() bool
Public @returns

Static IsSagaType() bool Type t


Private [in]

Static Type messageType


MapMessageTypeToSaga [in]
Type() void
Private Type sagaType
[in]

Static Type sagaType


MapSagaTypeToSagaEnt [in]
ityType() void
Private Type sagaEntityType
[in]

Static Type messageType


MessageTypeRequiresSta [in]
rtingSaga() void
Private Type sagaType
[in]

SagasInAssemblies() void Assembly[] assemblies


Public [in]

Static With() Configure IConfigureComponents configurer


Public [in]

IBuilder builder
[in]

IFindSagas
Model Specification Phase 01 Page: 80

Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Saga Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {7FDAFC2F-583C-48a3-A58F-C16A2FF20FAF}

Custom Properties
 isActive = False

Tagged Values
 genericConstraints = where T : ISagaEntity.

Connections
Connector Source Target Notes
Generalization Public Public
Source -> Destination EmptySagaFinder IFindSagas

Generalization Public Public


Source -> Destination SagaEntityFinder IFindSagas

Using
Type: Interface IFinder
Status: Proposed. Version 1.0. Phase 1.0.
Package: Saga Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {5AE582B2-63C3-4329-92D5-2952D1549FA0}

Tagged Values
 genericConstraints = where M : IMessage.

Connections
Connector Source Target Notes
Generalization Public Public
Source -> Destination Using IFinder

Operations
Method Notes Parameters
FindBy() T M message
Model Specification Phase 01 Page: 81

Method Notes Parameters


Public [in]

Saga
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Saga Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {C7A3F17F-881E-41af-9CF8-B76293284A90}

This class is used to define sagas containing data and handling a message. To handle more message types,
implement <see cref="IMessageHandler{T}"/> for the relevant types. To signify that the receipt of a message
should start this saga, implement <see cref="ISagaStartedBy{T}"/> for the relevant message type.

@see ="ISagaEntity" .</typeparam

Custom Properties
 isActive = False

Tagged Values
 genericConstraints = where T : ISagaEntity.

Connections
Connector Source Target Notes
Association Public Private bus
Source -> Destination Saga IBus

Realisation Public Public


Source -> Destination Saga ISaga

Attributes
Attribute Notes Constraints and tags
bus IBus Default:
Private
Model Specification Phase 01 Page: 82

Attribute Notes Constraints and tags


completed bool Default:
Private

data T Default:
Private

Operations
Method Notes Parameters
Bus() IBus
Public
Completed() bool
Public
Data() T
Public
Entity() ISagaEntity
Public
MarkAsComplete() void
Protected
ReplyToOriginator() void IMessage[] messages
Protected [in]

ReplyToOriginator() void Action<K> messageConstructor


Protected [in]

RequestTimeout() void TimeSpan at


Protected [in]

object withState
[in]

RequestTimeout() void DateTime at


Protected [in]

object withState
[in]

Timeout() void Notifies that the timeout it previously requested object state
Public occurred. [in] The object passed as the
Model Specification Phase 01 Page: 83

Method Notes Parameters


"withState" parameter to
RequestTimeout.

TimeoutMessage
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Saga Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {F755A404-151B-4e3b-AFD9-E241765FD5A1}

A message to signal a saga that a reminder was set.

Custom Properties
 isActive = False

Tagged Values
 Attribute = [Serializable];[Recoverable].

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination TimeoutMessage ISagaMessage

Attributes
Attribute Notes Constraints and tags
expires DateTime Default:
Private

Operations
Method Notes Parameters
ClearTimeout() bool When true, signals to the timeout manager that
Public all other <see cref="TimeoutMessage"/>
objects can be cleared for the given <see
Model Specification Phase 01 Page: 84

Method Notes Parameters


cref="SagaId"/>.

Expires() DateTime Gets/sets the date and time at which the timeout
Public message is due to expire.

HasNotExpired() bool Gets whether or not the TimeoutMessage has


Public expired.

@returns true if the message has expired,


otherwise false.

SagaId() Guid Gets/sets the Id of the workflow the


Public TimeoutMessage is connected to.

State() object Should be used for data to differentiate between


Public various timeout occurrences.

TimeoutMessage()
Public
TimeoutMessage() DateTime expiration
Public [in]

ISagaEntity saga
[in]

object state
[in]

TimeoutMessage() TimeSpan expireIn


Public [in]

ISagaEntity saga
[in]

object state
[in]

TimeoutMessage() Signal to the timeout manager that all other ISagaEntity saga
Public <see cref="TimeoutMessage"/> objects can be [in]
cleared for the given <see cref="saga"/>.
bool clear
[in]

HasCompleted
Type: Interface
Status: Proposed. Version 1.0. Phase 1.0.
Package: Saga Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {C24D2447-B139-4a08-8273-AEAA9AB5594B}
Model Specification Phase 01 Page: 85

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination ISaga HasCompleted

Operations
Method Notes Parameters
Completed() bool
Public

IFinder
Type: Interface
Status: Proposed. Version 1.0. Phase 1.0.
Package: Saga Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {7AF2EBBE-2371-4c84-8C55-3CD20CCBF276}

Connections
Connector Source Target Notes
Generalization Public Public
Source -> Destination Using IFinder

ISaga
Type: Interface ISaga
Status: Proposed. Version 1.0. Phase 1.0.
Package: Saga Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {514132F5-5745-49e4-A6E3-90A27D6AD2EF}

Tagged Values
 genericConstraints = where T : ISagaEntity.

Connections
Model Specification Phase 01 Page: 86

Connector Source Target Notes


Generalization Public Public
Source -> Destination ISaga ISaga

Operations
Method Notes Parameters
Data() T
Public

ISaga
Type: Interface ITimeoutable
Status: Proposed. Version 1.0. Phase 1.0.
Package: Saga Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {F8240D0C-5558-45b4-98E5-15F90068644A}

This interface is used by <see cref="Configure"/> to identify sagas.

Connections
Connector Source Target Notes
Generalization Public Public
Source -> Destination ISaga ITimeoutable

Realisation Public Public


Source -> Destination ISaga HasCompleted

Realisation Public Public


Source -> Destination Saga ISaga

Operations
Method Notes Parameters
Bus() IBus
Public
Entity() ISagaEntity
Public

ISagaEntity
Type: Interface
Status: Proposed. Version 1.0. Phase 1.0.
Package: Saga Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {27EE2AC6-D40E-4629-96F2-B5DEF63370B8}
Model Specification Phase 01 Page: 87

Defines the basic data used by long-running processes.

Connections
Connector Source Target Notes
Association Public Private sagaData
Source -> Destination Saga ISagaEntity

Operations
Method Notes Parameters
Id() Guid Gets/sets the Id of the process. Do NOT
Public generate this value in your code. The value of
the Id will be generated automatically to
provide the best performance for saving in a
database.

@remark The reason Guid is used for process


Id is that messages containing this Id need to be
sent by the process even before it is persisted.

Originator() string Contains the return address of the sender that


Public caused the process to run.

ISagaMessage
Type: Interface IMessage
Status: Proposed. Version 1.0. Phase 1.0.
Package: Saga Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {3B17B254-BB51-4477-84DD-475EB2410EC3}

A marker interface that also defines the properties of a message involved in an NServiceBus workflow.

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination TimeoutMessage ISagaMessage

Generalization Public Public


Source -> Destination ISagaMessage IMessage

Operations
Model Specification Phase 01 Page: 88

Method Notes Parameters


SagaId() Guid Gets/sets the Id of the workflow the message is
Public related to.

ISagaPersister
Type: Interface
Status: Proposed. Version 1.0. Phase 1.0.
Package: Saga Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {472F85E7-826A-44c6-B825-F9F290405FD8}

Defines the basic functionality of a persister for storing and retrieving a saga.

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination SagaPersister ISagaPersister

Association Public Private persister


Source -> Destination SagaEntityFinder ISagaPersister

Association Public Private persister


Source -> Destination SagaMessageHandler ISagaPersister

Operations
Method Notes Parameters
Complete() void Sets a saga as completed and removes it from ISagaEntity saga
Public the active saga list in the persistence store. [in] The saga to complete.

Get() ISagaEntity Gets a saga entity from the persistence store by Guid sagaId
Public its Id. [in] The Id of the saga entity to get.

@returns

Save() void Saves the saga entity to the persistence store. ISagaEntity saga
Public [in] The saga entity to save.

Update() void Updates an existing saga entity in the ISagaEntity saga


Public persistence store. [in] The saga entity to updated.
Model Specification Phase 01 Page: 89

ISagaStartedBy
Type: Interface IMessageHandler
Status: Proposed. Version 1.0. Phase 1.0.
Package: Saga Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {AB0193FD-DD36-4247-A38F-4EDAB15DF135}

Use this interface to signify that when a message of the given type is received, if a saga cannot be found by an <see
cref="IFindSagas{T}"/> the saga will be created.

Tagged Values
 genericConstraints = where T : IMessage.

Connections
Connector Source Target Notes
Generalization Public Public
Source -> Destination ISagaStartedBy IMessageHandler

ITimeoutable
Type: Interface
Status: Proposed. Version 1.0. Phase 1.0.
Package: Saga Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {C640BEF7-F932-445f-A784-3864E49A3BA7}

Connections
Connector Source Target Notes
Generalization Public Public
Source -> Destination ISaga ITimeoutable

Operations
Method Notes Parameters
Timeout() void object state
Public [in]
Model Specification Phase 01 Page: 90

Impl
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Saga
Detail: Created on 21/12/2008 09:51:12. Last modified on 21/12/2008 09:51:12
GUID: {563A300F-7F14-4b7d-A47E-A9992181F7EF}

Impl - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {CE7EFBBB-86BF-490d-BCB3-944592C76DB1}

class Impl

T
SagaMessageHandler
GuidCombGenerator
IFindSagas
- builder: IBuilder
+ Generate() : Guid EmptySagaFinder
# logger: ILog = LogManager.GetL... {readOnly}
- persister: ISagaPersister
+ FindBy(IMessage) : T
# CallHandleMethodOnSaga(object, IMessage) : void
+ GenerateSagaId() : Guid
+ Handle(IMessage) : void
# HaveSagaHandleMessage(ISaga, IMessage, bool) : void IFindSagas
# LogIfSagaIsFinished(ISaga) : void SagaEntityFinder
+ NeedToHandle(IMessage) : bool
- persister: ISagaPersister
# NotifyTimeoutManagerThatSagaHasCompleted(ISaga) : void
- UseFinderToFindSaga(IFinder, IMessage) : ISagaEntity
+ FindBy(ISagaMessage) : ISagaEntity
«property»
«property»
+ Builder() : IBuilder
+ Persister() : ISagaPersister
+ Persister() : ISagaPersister

Figure: 22

EmptySagaFinder
Type: Class IFindSagas
Status: Proposed. Version 1.0. Phase 1.0.
Package: Impl Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {A40827BC-6D3F-4088-B5B6-C76E7AD81159}

Generated for sagas that don't come with their own finder.

Custom Properties
 isActive = False

Tagged Values
 genericConstraints = where T : ISagaEntity.
Model Specification Phase 01 Page: 91

Connections
Connector Source Target Notes
Generalization Public Public
Source -> Destination EmptySagaFinder IFindSagas

Operations
Method Notes Parameters
FindBy() T IMessage message
Public [in]

GuidCombGenerator
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Impl Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {DF232043-ED3B-4b75-A604-B54263714FEE}

Generates <see cref="System.Guid"/> values using a strategy suggested Jimmy Nilsson's


<a href="http://www.informit.com/articles/article.asp?p=25862">article</a> on <a
href="http://www.informit.com">informit.com</a>.

@remark <p> The <c>comb</c> algorithm is designed to make the use of GUIDs as Primary Keys, Foreign Keys,
and Indexes nearly as efficient as ints.
</p>
<p> This code was modifed based on Donald Mull's contributor to the NHibernate source.
</p>

Custom Properties
 isActive = False

Tagged Values
 static = true.

Operations
Method Notes Parameters
Static Generate() Guid Generate a new <see cref="Guid"/> using the
Public comb algorithm.

SagaEntityFinder
Model Specification Phase 01 Page: 92

Type: Class IFindSagas


Status: Proposed. Version 1.0. Phase 1.0.
Package: Impl Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {8A21DE4F-D76A-43cb-A93A-46FC7ECC19F5}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private persister
Source -> Destination SagaEntityFinder ISagaPersister

Generalization Public Public


Source -> Destination SagaEntityFinder IFindSagas

Attributes
Attribute Notes Constraints and tags
persister ISagaPersister Default:
Private

Operations
Method Notes Parameters
FindBy() ISagaEntity ISagaMessage message
Public [in]

Persister() ISagaPersister
Public

SagaMessageHandler
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Impl Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {CCAE02AD-5A59-4058-898E-B7497A680AB3}
Model Specification Phase 01 Page: 93

A message handler that supports sagas.

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private builder
Source -> Destination SagaMessageHandler IBuilder

Association Public Private persister


Source -> Destination SagaMessageHandler ISagaPersister

Realisation Public Public


Source -> Destination SagaMessageHandler IMessageHandler

Attributes
Attribute Notes Constraints and tags
builder IBuilder Default:
Private

logger ILog Default:


Protected Const LogManager.GetLogger(typeof(Sag
LogManager.GetLogger(ty aMessageHandler))
peof(SagaMessageHandler
))

persister ISagaPersister Default:


Private

Operations
Method Notes Parameters
Builder() IBuilder Gets/sets an <see cref="IBuilder"/> that will be
Model Specification Phase 01 Page: 94

Method Notes Parameters


Public used for resolving the <see
cref="ISagaPersister"/> implementation to be
used for saga persistence.

CallHandleMethodOnSa Invokes the handler method on the saga for the object saga
ga() void message. [in] The saga on which to call the
Protected handle method.

IMessage message
[in] The message to pass to the
handle method.

GenerateSagaId() Guid
Public
Handle() void Handles a message. IMessage message
Public [in] The message to handle.
@remark If the message received needs to start
a new saga, then a new saga instance will be
created and will be saved using the <see
cref="ISagaPersister"/> implementation
provided in the configuration. Any other
message implementing
<see cref="ISagaMessage"/> will cause the
existing saga instance with which it is
associated to continue.

HaveSagaHandleMessage ISaga saga


() void [in]
Protected
IMessage message
[in]

bool sagaIsPersistent
[in]

LogIfSagaIsFinished() Logs that a saga has completed. ISaga saga


void [in]
Protected

NeedToHandle() bool IMessage message


Public [in]

NotifyTimeoutManagerT ISaga saga


hatSagaHasCompleted() [in]
void
Protected
Persister() ISagaPersister
Public
UseFinderToFindSaga() IFinder finder
ISagaEntity [in]
Private
IMessage message
Model Specification Phase 01 Page: 95

Method Notes Parameters


[in]

SagaPersisters
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus
Detail: Created on 21/12/2008 09:37:26. Last modified on 21/12/2008 09:37:26
GUID: {55B6D08E-9D8A-4c67-B45B-B2F8B3737193}

NHibernate
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: SagaPersisters
Detail: Created on 21/12/2008 09:37:26. Last modified on 21/12/2008 09:37:26
GUID: {D32FD400-2B5E-4549-8C7D-C6EA81B2280B}

NHibernate - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {69C514EB-DD50-486f-ADE6-E92E77A054EF}

class NHibernate

SagaPersister NHibernateMessageModule

- sessionFactory: ISessionFactory - sessionFactory: ISessionFactory

+ Complete(ISagaEntity) : void + HandleBeginMessage() : void


+ Get(Guid) : ISagaEntity + HandleEndMessage() : void
+ Save(ISagaEntity) : void «property»
+ Update(ISagaEntity) : void + SessionFactory() : ISessionFactory
«property»
+ SessionFactory() : ISessionFactory

Figure: 23

NHibernateMessageModule
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Model Specification Phase 01 Page: 96

Package: NHibernate Keywords:


Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {685676E9-B37D-4594-83A8-AB550E4953DD}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination NHibernateMessageMo IMessageModule
dule

Attributes
Attribute Notes Constraints and tags
sessionFactory Default:
ISessionFactory
Private

Operations
Method Notes Parameters
HandleBeginMessage()
void
Public
HandleEndMessage()
void
Public
SessionFactory()
ISessionFactory
Public

SagaPersister
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: NHibernate Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {9B025641-B3B9-4698-8EAE-4D831096488F}
Model Specification Phase 01 Page: 97

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination SagaPersister ISagaPersister

Attributes
Attribute Notes Constraints and tags
sessionFactory Default:
ISessionFactory
Private

Operations
Method Notes Parameters
Complete() void ISagaEntity saga
Public [in]

Get() ISagaEntity Guid sagaId


Public [in]

Save() void ISagaEntity saga


Public [in]

SessionFactory()
ISessionFactory
Public
Update() void ISagaEntity saga
Public [in]

Serialization
Type: Package
Model Specification Phase 01 Page: 98

Status: Proposed. Version 1.0. Phase 1.0.


Package: NServiceBus
Detail: Created on 21/12/2008 09:37:15. Last modified on 21/12/2008 09:37:15
GUID: {3FA5E537-C0CE-4207-874D-68834D9C0CEC}

Serialization - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {9B33FDA3-8207-4e16-911F-D2B025E01C19}

class Serialization

«interface»
IMessageSerializer
+ Deserialize(Stream) : IMessage[]
+ Initialize(Type[]) : void
+ Serialize(IMessage[], Stream) : void

Figure: 24

IMessageSerializer
Type: Interface
Status: Proposed. Version 1.0. Phase 1.0.
Package: Serialization Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {9A0FAE63-5309-40f3-B43C-1BA182417333}

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination MessageSerializer IMessageSerializer

Association Public Private


Source -> Destination MsmqTransport messageSerializer
IMessageSerializer

Realisation Public Public


Source -> Destination MessageSerializer IMessageSerializer

Operations
Method Notes Parameters
Deserialize() IMessage Stream stream
Public [in]
Model Specification Phase 01 Page: 99

Method Notes Parameters

Initialize() void Type[] types


Public [in]

Serialize() void IMessage[] messages


Public [in]

Stream stream
[in]

Serializers
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus
Detail: Created on 21/12/2008 09:37:28. Last modified on 21/12/2008 09:37:28
GUID: {289729DA-6F81-47b6-A9DE-5A26991DBA60}

Binary
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Serializers
Detail: Created on 21/12/2008 09:37:28. Last modified on 21/12/2008 09:37:28
GUID: {02ED98B2-251C-457b-8BB1-1EE0C3F9073B}

Binary - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {CE809413-C303-4639-A3D1-E067275ECF77}

class Binary

MessageSerializer

- binaryFormatter: BinaryFormatter = new BinaryForma... {readOnly}

+ Deserialize(Stream) : IMessage[]
+ Initialize(Type[]) : void
+ Serialize(IMessage[], Stream) : void
Model Specification Phase 01 Page: 100

Figure: 25

MessageSerializer
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Binary Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {5E2CDBD1-58A0-4d19-A9B9-2CCCF933DDE8}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination MessageSerializer IMessageSerializer

Attributes
Attribute Notes Constraints and tags
binaryFormatter Default: new BinaryFormatter()
BinaryFormatter
Private Const new
BinaryFormatter()

Operations
Method Notes Parameters
Deserialize() IMessage Stream stream
Public [in]

Initialize() void Type[] types


Public [in]

Serialize() void IMessage[] messages


Public [in]

Stream stream
[in]
Model Specification Phase 01 Page: 101

XML
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Serializers
Detail: Created on 21/12/2008 09:37:29. Last modified on 21/12/2008 09:37:29
GUID: {61EA04F1-0DF8-402c-BF8B-03C8004759D3}

XML - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {0406FFF5-AA1B-45d5-B993-1B5C6E292DDD}

class XML

IMessage
Risk MessageSerializer
«interface»
IM1 - defaultNameSpace: string
«property» - nameSpace: string = "http://tempuri.net"
+ Accuracy() : decimal
«property» - namespacesToPrefix: IDictionary<string, string>
+ Annum() : bool - prefixesToNamespaces: IDictionary<string, string>
+ Address() : string
+ Percent() : double - typesToCreateForArrays: Dictionary<Type, Type> = new Dictionary<... {readOnly}
+ Age() : float
+ Int() : int - typeToFields: Dictionary<Type, IEnumerable<FieldInfo>> = new Dictionary<... {readOnly}
+ Name() : string - typeToProperties: Dictionary<Type, IEnumerable<PropertyInfo>> = new Dictionary<... {readOnly}
+ Risk() : Risk - XMLPREFIX: string = "d1p1" {readOnly}
- XMLTYPE: string = XMLPREFIX + ":type" {readOnly}

+ Deserialize(Stream) : IMessage[]
- FormatAsString(object) : string
- GetAllFieldsForType(Type) : IEnumerable<FieldInfo>
- GetAllPropertiesForType(Type) : IEnumerable<PropertyInfo>
+ GetField(Type, string) : FieldInfo
- GetNamespaces(IMessage[], IMessageMapper) : List<string>
+ GetObjectOfTypeFromNode(Type, XmlNode) : object
+ GetProperty(Type, string) : PropertyInfo
+ GetPropertyValue(Type, XmlNode, object) : object
+ Initialize(Type[]) : void
+ InitType(Type) : void
- Process(XmlNode, object) : object
+ Serialize(IMessage[], Stream) : void
+ Write(StringBuilder, Type, object) : void
+ WriteEntry(string, Type, object, StringBuilder) : void
+ WriteObject(string, Type, object, StringBuilder) : void
«property»
+ AdditionalTypes() : List<Type>
+ MessageMapper() : IMessageMapper
+ Namespace() : string

Figure: 26

MessageSerializer
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: XML Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {0BC0292E-E759-4502-B0E9-6DE353E8D7BE}
Model Specification Phase 01 Page: 102

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination MessageSerializer IMessageSerializer

Attributes
Attribute Notes Constraints and tags
defaultNameSpace string Default:
Private Static
[Attribute = [ThreadStatic] ]

nameSpace string Default: "http://tempuri.net"


Private
"http://tempuri.net"

namespacesToPrefix Used for serialization Default:


IDictionary<string, string>
Private Static [Attribute = [ThreadStatic] ]

prefixesToNamespaces Used for deserialization Default:


IDictionary<string, string>
Private Static [Attribute = [ThreadStatic] ]
Model Specification Phase 01 Page: 103

Attribute Notes Constraints and tags


typesToCreateForArrays Default: new Dictionary<Type,
Dictionary<Type, Type> Type>()
Private Static Const
new Dictionary<Type,
Type>()

typeToFields Default: new Dictionary<Type,


Dictionary<Type, IEnumerable<FieldInfo>>()
IEnumerable<FieldInfo>>
Private Static Const
new Dictionary<Type,
IEnumerable<FieldInfo>>(
)

typeToProperties Default: new Dictionary<Type,


Dictionary<Type, IEnumerable<PropertyInfo>>()
IEnumerable<PropertyInfo
>>
Private Static Const
new Dictionary<Type,
IEnumerable<PropertyInfo
>>()
XMLPREFIX string Default: "d1p1"
Private Static Const
"d1p1"

XMLTYPE string Default: XMLPREFIX + ":type"


Private Static Const
XMLPREFIX + ":type"

Operations
Method Notes Parameters
AdditionalTypes()
List<Type>
Public
Deserialize() IMessage Stream stream
Public [in]

FormatAsString() string object value


Private [in]
Model Specification Phase 01 Page: 104

Method Notes Parameters

GetAllFieldsForType() Type t
IEnumerable<FieldInfo> [in]
Private

GetAllPropertiesForType Type t
() [in]
IEnumerable<PropertyInfo
>
Private
GetField() FieldInfo Type t
Public [in]

string name
[in]

Static GetNamespaces() IMessage[] messages


List<string> [in]
Private
IMessageMapper mapper
[in]

GetObjectOfTypeFromN Type t
ode() object [in]
Public
XmlNode node
[in]

GetProperty() Type t
PropertyInfo [in]
Public
string name
[in]

GetPropertyValue() Type type


object [in]
Public
XmlNode n
[in]

object parent
[in]

Initialize() void Type[] types


Public [in]

InitType() void Type t


Public [in]
Model Specification Phase 01 Page: 105

Method Notes Parameters

MessageMapper()
IMessageMapper
Public
Namespace() string
Public
Process() object XmlNode node
Private [in]

object parent
[in]

Serialize() void IMessage[] messages


Public [in]

Stream stream
[in]

Write() void StringBuilder builder


Public [in]

Type t
[in]

object obj
[in]

WriteEntry() void string name


Public [in]

Type type
[in]

object value
[in]

StringBuilder builder
[in]

WriteObject() void string name


Public [in]

Type type
[in]

object value
[in]

StringBuilder builder
[in]
Model Specification Phase 01 Page: 106

Method Notes Parameters

Risk
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: XML Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {5FDC8792-E832-4d3b-851F-D1F168B7325B}

Custom Properties
 isActive = False

Tagged Values
 Attribute = [Serializable].

Operations
Method Notes Parameters
Accuracy() decimal
Public
Annum() bool
Public
Percent() double
Public

IM1
Type: Interface IMessage
Status: Proposed. Version 1.0. Phase 1.0.
Package: XML Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {6FACCA68-53BA-4c65-9D17-2B264EF13890}

Connections
Connector Source Target Notes
Generalization Public Public
Source -> Destination IM2 IM1

Realisation Public Public


Model Specification Phase 01 Page: 107

Connector Source Target Notes


Source -> Destination M1 IM1

Generalization Public Public


Source -> Destination IM1 IMessage

Operations
Method Notes Parameters
Address() string
Public
Age() float
Public
Int() int
Public
Name() string
Public
Risk() Risk
Public

Test
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: XML
Detail: Created on 21/12/2008 09:37:29. Last modified on 21/12/2008 09:37:29
GUID: {25E4978F-F408-454f-92FF-DA6DEABBA39C}

Test - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {F86B25D5-E5C0-4d34-A5B1-B9F7C075101B}

class Test

IM1
Class1 «interface»
M1 IM2
- number: int = 1
- numberOfIterations: int = 100
«property» «enumeratio...
«property»
+ Duration() : TimeSpan SomeEnum
+ Address() : string - CreateM2() : M2
+ Id() : Guid
+ Age() : float - DataContractSerialize(XmlWriterSettings, DataContractSerializer, IMessage[], Stream) : void
+ MoreNames() : IM1[] A
+ Int() : int + Test() : void
+ Names() : List<IM1> B
+ Name() : string - TestDataContractSerializer() : void
+ Parent() : IM1
+ Risk() : Risk + TestInterfaces() : void
+ Some() : SomeEnum
+ TestSchemaValidation() : void
+ Start() : DateTime
- Time(IMessage[], IMessageSerializer) : void
+ State() : object

M2

«property»
+ Duration() : TimeSpan
+ Id() : Guid
+ Names() : List<M1>
+ Parent() : M1
+ Some() : SomeEnum
+ Start() : DateTime

Figure: 27
Model Specification Phase 01 Page: 108

Class1
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Test Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {A30B315B-CE39-42d1-9D9A-28514F39CAF7}

Custom Properties
 isActive = False

Attributes
Attribute Notes Constraints and tags
number int Default: 1
Private 1

numberOfIterations int Default: 100


Private 100

Operations
Method Notes Parameters
CreateM2() M2
Private
DataContractSerialize() XmlWriterSettings xws
void [in]
Private
DataContractSerializer dcs
[in]

IMessage[] messages
[in]

Stream str
[in]
Model Specification Phase 01 Page: 109

Method Notes Parameters


Test() void
Public
TestDataContractSerializ
er() void
Private
TestInterfaces() void
Public
TestSchemaValidation()
void
Public
Time() void IMessage[] messages
Private [in]

IMessageSerializer serializer
[in]

M1
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Test Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {E7262F6B-E48B-44e8-959B-A8987885103C}

Custom Properties
 isActive = False

Tagged Values
 Attribute = [Serializable].

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination M1 IM1

Generalization Public Public


Source -> Destination M2 M1

Operations
Method Notes Parameters
Address() string
Public
Model Specification Phase 01 Page: 110

Method Notes Parameters


Age() float
Public
Int() int
Public
Name() string
Public
Risk() Risk
Public

M2
Type: Class M1
Status: Proposed. Version 1.0. Phase 1.0.
Package: Test Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {4380E9BB-A022-4bc0-80C1-68FA17C4CDC8}

Custom Properties
 isActive = False

Tagged Values
 Attribute = [Serializable].

Connections
Connector Source Target Notes
Generalization Public Public
Source -> Destination M2 M1

Operations
Method Notes Parameters
Duration() TimeSpan
Public
Id() Guid
Public
Names() List<M1>
Public
Parent() M1
Public
Some() SomeEnum
Public
Start() DateTime
Public
Model Specification Phase 01 Page: 111

SomeEnum
Type: Enumeration
Status: Proposed. Version 1.0. Phase 1.0.
Package: Test Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {3EBDC84D-6922-4a86-BDD0-81B56CAB2938}

Custom Properties
 isActive = False

Attributes
Attribute Notes Constraints and tags
A Default:
Public

B Default:
Public

IM2
Type: Interface IM1
Status: Proposed. Version 1.0. Phase 1.0.
Package: Test Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {0863D443-408A-4d0f-B3C4-804F1AD98A7C}

Connections
Connector Source Target Notes
Generalization Public Public
Source -> Destination IM2 IM1
Model Specification Phase 01 Page: 112

Operations
Method Notes Parameters
Duration() TimeSpan
Public
Id() Guid
Public
MoreNames() IM1
Public
Names() List<IM1>
Public
Parent() IM1
Public
Some() SomeEnum
Public
Start() DateTime
Public
State() object
Public

XsdGenerator
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: XML
Detail: Created on 21/12/2008 09:37:30. Last modified on 21/12/2008 09:37:30
GUID: {F77B8AA9-4B81-4378-AF8E-2651B1EB40A5}

XsdGenerator - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {BF4D4699-EFFB-4d67-84BB-514D63739A5E}
class XsdGenerator

Element

- minOccurs: int = 1
- name: string
ComplexType - nameSpace: string
- nillable: bool Program Repository
- baseName: string - type: string
- elements: IList<Element> = new List<Element>() {readOnly} - unboundedMaxOccurs: bool - baseNameSpace: string = "http://tempuri.net" - simpleTypesToCreate: IList<Type> = new List<Type>() {readOnly}
- name: string Events - nameSpace: string - types: IDictionary<Type, ComplexType> = new Dictionary<... {readOnly}
- needToGenerateGuid: bool Reflect SimpleTypeWriter Strings
+ DoesNotNeedToOccur() : void
- ComplexType() - Element() + FoundGuid() : void + Handle(Type) : void + ArrayOf: string = "ArrayOf" {readOnly}
- CurrentDomain_UnhandledException(object, UnhandledExceptionEventArgs) : void + GetEnumeratedTypeFrom(Type) : Type + IsNormalizedList(Type) : bool + Write(Type) : string
- IsInList(PropertyInfo, ICollection<PropertyInfo>) : bool + MakeNillable() : void «event» + GuidXsd: string = "<?xml version=... {readOnly}
- GenerateXsdString() : string + GetTypeNameFrom(Type) : string - Normalize(Type) : Type
+ Scan(Type) : ComplexType + Scan(Type, string) : Element + GuidDetected() : EventHandler + NamespacePrefix: string = "q1" {readOnly}
+ UnboundMaxOccurs() : void - GetFileName() : string
«property» «property»
- Main(string[]) : void
+ BaseName() : string «property» + ComplexTypes() : IEnumerable<ComplexType>
+ Scan(Type) : void
+ Elements() : IEnumerable<Element> + MinOccurs() : int + SimpleTypes() : IEnumerable<Type>
+ TopLevelScan(Type) : void
+ Name() : string + Name() : string
+ NameSpace() : string
-complex
+ Nillable() : bool
+ Type() : string
+ UnboundedMaxOccurs() : bool
-
e

ComplexTypeWriter
ElementWriter
- beginBaseFormat: string = "<xs:complexCon... {readOnly}
- beginSequence: string = "<xs:sequence>" {readOnly} - e: Element {readOnly}
- beginTopFormat: string = "<xs:complexTyp... {readOnly} - nameFormat: string = "\" name=\"{0}\" " {readOnly}
- complex: ComplexType {readOnly} - namespaceFormat: string = "xmlns:" + Stri... {readOnly}
- endBaseFormat: string = "</xs:extension... {readOnly} - startFormat: string = "<xs:element mi... {readOnly}
- endSequence: string = "</xs:sequence>" {readOnly} - typeFormat: string = "type=\"{0}\" />\n" {readOnly}
- endTopFormat: string = "</xs:complexTy... {readOnly}
- ElementWriter(Element)
- ComplexTypeWriter(ComplexType) + Write(Element) : string
+ Write(ComplexType) : string + Write() : string
+ Write() : string

Figure: 28

ComplexType
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: XsdGenerator Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {17F7FF12-57F4-4431-92CF-CB3C81D2BE24}
Model Specification Phase 01 Page: 113

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private complex
Source -> Destination ComplexTypeWriter ComplexType

Attributes
Attribute Notes Constraints and tags
baseName string Default:
Private

elements IList<Element> Default: new List<Element>()


Private Const new
List<Element>()

name string Default:


Private

Operations
Method Notes Parameters
BaseName() string
Public
ComplexType()
Private
Elements()
IEnumerable<Element>
Public
Static IsInList() bool PropertyInfo prop
Model Specification Phase 01 Page: 114

Method Notes Parameters


Private [in]

ICollection<PropertyInfo>
propsToIgnore
[in]

Name() string
Public
Static Scan() Type type
ComplexType [in]
Public

ComplexTypeWriter
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: XsdGenerator Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {F3715A06-9FE1-4dbd-971F-51D9EF7E6D73}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private complex
Source -> Destination ComplexTypeWriter ComplexType

Attributes
Attribute Notes Constraints and tags
beginBaseFormat string Default: "<xs:complexContent
Private Const mixed=\"false\">\n<xs:extension
"<xs:complexContent base=\"{0}\">\n"
mixed=\"false\">\n<xs:exte
nsion base=\"{0}\">\n"
Model Specification Phase 01 Page: 115

Attribute Notes Constraints and tags


beginSequence string Default: "<xs:sequence>"
Private Const
"<xs:sequence>"

beginTopFormat string Default: "<xs:complexType


Private Const name=\"{0}\">\n"
"<xs:complexType
name=\"{0}\">\n"

complex ComplexType Default:


Private Const

endBaseFormat string Default:


Private Const "</xs:extension>\n</xs:complexCo
"</xs:extension>\n</xs:co ntent>\n"
mplexContent>\n"

endSequence string Default: "</xs:sequence>"


Private Const
"</xs:sequence>"

endTopFormat string Default: "</xs:complexType>\n"


Private Const
"</xs:complexType>\n"

Operations
Method Notes Parameters
ComplexTypeWriter() ComplexType complex
Model Specification Phase 01 Page: 116

Method Notes Parameters


Private [in]

Static Write() string ComplexType complex


Public [in]

Write() string
Public

Element
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: XsdGenerator Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {7D3883E5-4005-4b7e-AD8B-AABCD39ED931}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private e
Source -> Destination ElementWriter Element

Attributes
Attribute Notes Constraints and tags
minOccurs int Default: 1
Private 1

name string Default:


Private
Model Specification Phase 01 Page: 117

Attribute Notes Constraints and tags


nameSpace string Default:
Private

nillable bool Default:


Private

type string Default:


Private

unboundedMaxOccurs Default:
bool
Private

Operations
Method Notes Parameters
DoesNotNeedToOccur()
void
Public
Element()
Private
MakeNillable() void
Public
MinOccurs() int
Public
Name() string
Public
NameSpace() string
Public
Nillable() bool
Public
Static Scan() Element Type t
Public [in]
Model Specification Phase 01 Page: 118

Method Notes Parameters

string name
[in]

Type() string
Public
UnboundedMaxOccurs()
bool
Public
UnboundMaxOccurs()
void
Public

ElementWriter
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: XsdGenerator Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {C5D8534C-B66E-447f-8A76-E495919D78A9}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private e
Source -> Destination ElementWriter Element

Attributes
Attribute Notes Constraints and tags
e Element Default:
Private Const
Model Specification Phase 01 Page: 119

Attribute Notes Constraints and tags


nameFormat string Default: "\" name=\"{0}\" "
Private Const "\"
name=\"{0}\" "

namespaceFormat string Default: "xmlns:" +


Private Const Strings.NamespacePrefix +
"xmlns:" + "=\"{0}\" "
Strings.NamespacePrefix +
"=\"{0}\" "

startFormat string Default: "<xs:element


Private Const minOccurs=\"{0}\" maxOccurs=\""
"<xs:element
minOccurs=\"{0}\"
maxOccurs=\""

typeFormat string Default: "type=\"{0}\" />\n"


Private Const
"type=\"{0}\" />\n"

Operations
Method Notes Parameters
ElementWriter() Element e
Private [in]

Static Write() string Element e


Public [in]

Write() string
Public

Events
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: XsdGenerator Keywords:
Model Specification Phase 01 Page: 120

Detail: Created on 21/12/2008. Last modified on.21/12/2008.


GUID: {6378B0C7-3C6E-4f2d-B995-C9C0F6C7BEF1}

Custom Properties
 isActive = False

Tagged Values
 static = true.

Operations
Method Notes Parameters
Static FoundGuid() void
Public
Static GuidDetected()
EventHandler
Public

Program
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: XsdGenerator Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {720A9561-48BA-4427-B9DC-5289DC37FA86}

Custom Properties
 isActive = False

Attributes
Attribute Notes Constraints and tags
baseNameSpace string Default: "http://tempuri.net"
Private Static
"http://tempuri.net"
Model Specification Phase 01 Page: 121

Attribute Notes Constraints and tags


nameSpace string Default:
Private Static

needToGenerateGuid Default:
bool
Private Static

Operations
Method Notes Parameters
Static object sender
CurrentDomain_Unhand [in]
ledException() void
Private UnhandledExceptionEventArgs e
[in]

Static
GenerateXsdString()
string
Private
Static GetFileName()
string
Private
Static Main() void string[] args
Private [in]

Static Scan() void Type type


Public [in]

Static TopLevelScan() Type type


void [in]
Public

Reflect
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: XsdGenerator Keywords:
Model Specification Phase 01 Page: 122

Detail: Created on 21/12/2008. Last modified on.21/12/2008.


GUID: {A1B805BC-3F26-4fca-9F04-E86FF55D5D31}

Custom Properties
 isActive = False

Tagged Values
 static = true.

Operations
Method Notes Parameters
Static Type t
GetEnumeratedTypeFro [in]
m() Type
Public
Static Type t
GetTypeNameFrom() [in]
string
Public

Repository
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: XsdGenerator Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {0139A4AF-3B9F-4796-9AB2-A017CCD5E47A}

Custom Properties
 isActive = False

Tagged Values
 static = true.

Attributes
Attribute Notes Constraints and tags
Model Specification Phase 01 Page: 123

Attribute Notes Constraints and tags


simpleTypesToCreate Default: new List<Type>()
IList<Type>
Private Static Const
new List<Type>()

types IDictionary<Type, Default: new Dictionary<Type,


ComplexType> ComplexType>()
Private Static Const
new Dictionary<Type,
ComplexType>()

Operations
Method Notes Parameters
Static ComplexTypes() Returns types in the order they were handled
IEnumerable<ComplexTyp
e>
Public
Static Handle() void Type type
Public [in]

Static IsNormalizedList() Type type


bool [in]
Public

Static Normalize() Type Type type


Private [in]

Static SimpleTypes()
IEnumerable<Type>
Public

SimpleTypeWriter
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: XsdGenerator Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {1066F5E4-8480-4efb-B5B2-F351A6C171F9}

Custom Properties
Model Specification Phase 01 Page: 124

Custom Properties
 isActive = False

Operations
Method Notes Parameters
Static Write() string Type t
Public [in]

Strings
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: XsdGenerator Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {09DD34BA-DBEC-457a-8624-A76B4F27CDAD}

Custom Properties
 isActive = False

Tagged Values
 static = true.

Attributes
Attribute Notes Constraints and tags
ArrayOf string Default: "ArrayOf"
Public Static Const
"ArrayOf"

GuidXsd string Default: "<?xml version=\"1.0\"


Public Static Const encoding=\"utf-8\"?>\n" +
"<?xml version=\"1.0\"
encoding=\"utf-8\"?>\n" + "<xs:schema
xmlns:tns=\"http://microsoft.com/w
"<xs:schema sdl/types/\"
xmlns:tns=\"http://microsof elementFormDefault=\"qualified\"
t.com/wsdl/types/\" targetNamespace=\"http://microsoft.
elementFormDefault=\"qua com/wsdl/types/\"
lified\" xmlns:xs=\"http://www.w3.org/200
Model Specification Phase 01 Page: 125

Attribute Notes Constraints and tags


targetNamespace=\"http:// 1/XMLSchema\">\n" +
microsoft.com/wsdl/types/\
" "\t<xs:simpleType
xmlns:xs=\"http://www.w3 name=\"guid\">\n" +
.org/2001/XMLSchema\">\
n" + "\t\t<xs:restriction
base=\"xs:string\">\n" +
"\t<xs:simpleType
name=\"guid\">\n" + "\t\t\t<xs:pattern
value=\"[0-9a-fA-F]{8}-[0-9a-fA-F]
"\t\t<xs:restriction {4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}
base=\"xs:string\">\n" + -[0-9a-fA-F]{12}\" />\n" +

"\t\t\t<xs:pattern "\t\t</xs:restriction>\n" +
value=\"[0-9a-fA-F]{8}-[0-
9a-fA-F]{4}-[0-9a-fA-F]{4 "\t</xs:simpleType>\n" +
}-[0-9a-fA-F]{4}-[0-9a-fA
-F]{12}\" />\n" + "</xs:schema>\n"

"\t\t</xs:restriction>\n" +

"\t</xs:simpleType>\n" +

"</xs:schema>\n"
NamespacePrefix string Default: "q1"
Public Static Const
"q1"

Testing
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus
Detail: Created on 21/12/2008 09:37:43. Last modified on 21/12/2008 09:37:43
GUID: {7F5D42E2-49E6-4751-AD5D-FACA702F682E}

Testing - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {3E04C501-3A3B-419b-BB05-CF8F2C96F887}
Model Specification Phase 01 Page: 126

class Testing

Saga

- bus: IBus {readOnly}


- clientAddress: string
- delegates: List<Delegate> = new List<Delegate>() {readOnly}
- incomingHeaders: IDictionary<string, string> = new Dictionary<...
- m: MockRepository {readOnly}
- messageCreator: IMessageCreator {readOnly}
- messageTypes: List<Type> = new List<Type>() {readOnly}
- outgoingHeaders: IDictionary<string, string> = new Dictionary<...
- sagaData: ISagaEntity

+ CreateInstance() : T
+ CreateInstance(Action<T>) : T
- ExpectCallToPublish(BusPublishDelegate<T>) : void
- ExpectCallToReply(BusSendDelegate) : void
- ExpectCallToReturn(ReturnPredicate) : void
- ExpectCallToSend(BusSendDelegate) : void
- ExpectCallToSend(BusSendWithDestinationDelegate) : void
- ExpectCallToSendLocal(BusSendDelegate) : void
+ ExpectPublish(PublishPredicate<T>) : Saga
+ ExpectReply(SendPredicate<T>) : Saga
+ ExpectReturn(ReturnPredicate) : Saga
+ ExpectSend(SendPredicate<T>) : Saga
+ ExpectSendLocal(SendPredicate<T>) : Saga
+ ExpectSendToDestination(SendToDestinationPredicate<T>) : Saga
+ PrepareBusGenericMethods() : void
- Saga(MockRepository, IBus, ISagaEntity, IMessageCreator, List<Type>)
+ SetIncomingHeaders(IDictionary<string, string>) : Saga
+ Test(T*) : Saga
+ When(HandleMessageDelegate) : void
+ WhenReceivesMessageFrom(string) : Saga
«property»
+ OutgoingHeaders() : IDictionary<string, string>

Figure: 29

Saga
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Testing Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {24F11527-CCC2-4e59-8361-62D0252B37BB}

Custom Properties
 isActive = False
Model Specification Phase 01 Page: 127

Connections
Connector Source Target Notes
Association Public Private bus
Source -> Destination Saga IBus

Association Public Private messageCreator


Source -> Destination Saga IMessageCreator

Association Public Private sagaData


Source -> Destination Saga ISagaEntity

Attributes
Attribute Notes Constraints and tags
bus IBus Default:
Private Const

clientAddress string Default:


Private

delegates List<Delegate> Default: new List<Delegate>()


Private Const new
List<Delegate>()

incomingHeaders Default: new Dictionary<string,


IDictionary<string, string> string>()
Private new
Dictionary<string,
string>()
Model Specification Phase 01 Page: 128

Attribute Notes Constraints and tags


m MockRepository Default:
Private Const

messageCreator Default:
IMessageCreator
Private Const

messageTypes List<Type> Default: new List<Type>()


Private Const new
List<Type>()

outgoingHeaders Default: new Dictionary<string,


IDictionary<string, string> string>()
Private new
Dictionary<string,
string>()

sagaData ISagaEntity Default:


Private

Operations
Method Notes Parameters
CreateInstance() T
Public
CreateInstance() T Action<T> action
Public [in]

ExpectCallToPublish() BusPublishDelegate<T> callback


void [in]
Private
Model Specification Phase 01 Page: 129

Method Notes Parameters

ExpectCallToReply() void BusSendDelegate callback


Private [in]

ExpectCallToReturn() ReturnPredicate callback


void [in]
Private

ExpectCallToSend() void BusSendDelegate callback


Private [in]

ExpectCallToSend() void BusSendWithDestinationDelegate


Private callback
[in]

ExpectCallToSendLocal() BusSendDelegate callback


void [in]
Private

ExpectPublish() Saga PublishPredicate<T> check


Public [in]

ExpectReply() Saga SendPredicate<T> check


Public [in]

ExpectReturn() Saga ReturnPredicate check


Public [in]

ExpectSend() Saga SendPredicate<T> check


Public [in]

ExpectSendLocal() Saga SendPredicate<T> check


Public [in]

ExpectSendToDestinatio SendToDestinationPredicate<T>
n() Saga check
Public [in]

OutgoingHeaders()
IDictionary<string, string>
Public
PrepareBusGenericMeth
ods() void
Public
Saga() MockRepository mocks
Model Specification Phase 01 Page: 130

Method Notes Parameters


Private [in]

IBus b
[in]

ISagaEntity sagaData
[in]

IMessageCreator messageCreator
[in]

List<Type> types
[in]

SetIncomingHeaders() IDictionary<string, string>


Saga headers
Public [in]

Static Test() Saga T saga


Public [out]

When() void HandleMessageDelegate handle


Public [in]

WhenReceivesMessageFr string client


om() Saga [in]
Public

Tools
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus
Detail: Created on 21/12/2008 09:37:45. Last modified on 21/12/2008 09:37:45
GUID: {C702677E-31F1-47b3-A5F9-34B1F91E6B95}

Management
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Tools
Detail: Created on 21/12/2008 09:37:45. Last modified on 21/12/2008 09:37:45
GUID: {111FC81D-D9D3-4b8a-B01D-FB8A9B5775E3}
Model Specification Phase 01 Page: 131

Errors
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Management
Detail: Created on 21/12/2008 09:37:45. Last modified on 21/12/2008 09:37:45
GUID: {70EF948F-01C9-4cb2-A568-9056C68CBC25}

ReturnToSourceQueue
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Errors
Detail: Created on 21/12/2008 09:37:45. Last modified on 21/12/2008 09:37:45
GUID: {610C5662-47EF-4802-BD77-8F1DA53A3D54}

ReturnToSourceQueue - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {D384AA02-8D9C-4335-8EA9-FD76027473D8}

class ReturnToSourceQueue

Class1

- queue: MessageQueue

+ ReturnAll() : void
+ ReturnMessageToSourceQueue(string) : void
«property»
+ InputQueue() : string

Figure: 30

Class1
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: ReturnToSourceQueue Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {2AB8E3FB-1ABC-4628-BEF7-6D495CE67617}

Custom Properties
 isActive = False
Model Specification Phase 01 Page: 132

Attributes
Attribute Notes Constraints and tags
queue MessageQueue Default:
Private

Operations
Method Notes Parameters
InputQueue() string
Public
ReturnAll() void
Public
ReturnMessageToSource May throw a timeout exception if a message string messageId
Queue() void with the given id cannot be found. [in]
Public

Unicast
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus
Detail: Created on 21/12/2008 09:37:17. Last modified on 21/12/2008 09:37:17
GUID: {624B809B-3A87-4f0f-860E-A213B9B9DFE5}

Unicast - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {BA1EA040-9D82-4012-9617-21DF6C8C89C3}
Model Specification Phase 01 Page: 133

class Unicast

IDictionary
HeaderAdapter

- headers: List<HeaderInfo> = new List<Header... {readOnly}

+ Add(string, string) : void


IAsyncResult
+ Add(KeyValuePair<string, string>) : void
BusAsyncResult
+ Clear() : void
Callback
- callback: AsyncCallback {readOnly} + Contains(KeyValuePair<string, string>) : bool
- completed: bool - messageId: string {readOnly} + ContainsKey(string) : bool
IBus
SubscriptionsManager + CopyTo(KeyValuePair<string, string>[], int) : void
- result: CompletionResult {readOnly} «interface»
- sync: ManualResetEvent {readOnly} + Callback(string) + From(IDictionary<string, string>) : List<HeaderInfo>
IUnicastBus - locker: object = new object() {readOnly}
+ Register(AsyncCallback, object) : IAsyncResult + GetEnumerator() : IEnumerator<KeyValuePair<string, string>>
- messageTypeToConditionLookup: IDictionary<Type, List<Predicate<IMessage>>> = new Dictionary<... {readOnly}
+ BusAsyncResult(AsyncCallback, object) + ContinueSendingReadyMessages() : void - GetEnumerator() : IEnumerator
«property»
+ Complete(int, IMessage[]) : void + SkipSendingReadyMessageOnce() : void + HeaderAdapter(List<HeaderInfo>)
+ AddConditionForSubscriptionToMessageType(Type, Predicate<IMessage>) : void + MessageId() : string
+ StopSendingReadyMessages() : void + Remove(string) : bool
«property» + GetConditionsForMessage(IMessage) : IList<Predicate<IMessage>>
«event» + Remove(KeyValuePair<string, string>) : bool
+ AsyncState() : object + Registered() : EventHandler<BusAsyncResultEventArgs>
#subscriptionsManager + TryGetValue(string, string*) : bool
+ AsyncWaitHandle() : WaitHandle
+ CompletedSynchronously() : bool «property»
+ IsCompleted() : bool + Count() : int
+ IsReadOnly() : bool
-result + Keys() : ICollection<string>
+ Values() : ICollection<string>
«indexer»
+ this(string) : string

UnicastBus

- autoSubscribe: bool = true


- builder: IBuilder
- canSendReadyMessages: bool = true
- disableMessageHandling: bool = false
- distributorControlAddress: string
- distributorDataAddress: string
- doNotContinueDispatchingCurrentMessageToHandlers: bool = false
- forwardReceivedMessagesTo: string
- handlerList: IDictionary<Type, List<Type>> = new Dictionary<... {readOnly}
- handlerToMessageTypeToHandleMethodMap: IDictionary<Type, IDictionary<Type, MethodInfo>> = new Dictionary<... {readOnly}
- impersonateSender: bool
- log: ILog = LogManager.GetL... {readOnly}
- messageBeingHandled: TransportMessage
- messageIdToAsyncResultLookup: IDictionary<string, BusAsyncResult> = new Dictionary<... {readOnly}
- messageMapper: IMessageMapper
- messageTypes: List<Type> = new List<Type>(... {readOnly}
- messageTypeToDestinationLookup: IDictionary<Type, string> = new Dictionary<... {readOnly}
- outgoingHeaders: IDictionary<string, string>
- propogateReturnAddressOnSend: bool = false
- recoverableMessageTypes: IList<Type> = new List<Type>() {readOnly}
- skipSendingReadyMessageOnce: bool
- started: bool = false
- starting: bool = false
- startLocker: object = new object() {readOnly}
# subscriptionsManager: SubscriptionsManager = new Subscriptio...
# subscriptionStorage: ISubscriptionStorage
- timeToBeReceivedPerMessageType: IDictionary<Type, TimeSpan> = new Dictionary<... {readOnly}
# transport: ITransport

+ AddMessageType(Type) : void
+ AddTypesFromAssembly(Assembly) : void
# AssertBusIsStarted() : void
- ConfigureMessageOwners(IDictionary) : void
+ ContinueSendingReadyMessages() : void
+ CreateInstance() : T
+ CreateInstance(Action<T>) : T
+ CreateInstance(Type) : object
- DispatchMessageToHandlersBasedOnType(IMessage, Type) : void
+ Dispose() : void
+ DoNotContinueDispatchingCurrentMessageToHandlers() : void
- ForwardMessageIfNecessary(TransportMessage) : void
- GetAction(T) : Action<object>
# GetDestinationForMessageType(Type) : string
- GetHandlerTypes(Type) : IEnumerable<Type>
EventArgs - GetInnermostException(Exception) : Exception
BusAsyncResultEv entArgs - GetMessageTypesIfIsMessageHandler(Type) : IEnumerable<Type>
- GetReturnAddressFor(string) : string
- messageId: string {readOnly} # GetTransportMessageFor(string, IMessage[]) : TransportMessage
- result: BusAsyncResult {readOnly} - HandleCorellatedMessage(TransportMessage) : void
+ HandleCurrentMessageLater() : void
+ BusAsyncResultEventArgs(BusAsyncResult, string) + HandleMessage(TransportMessage) : void
- If_Type_Is_MessageHandler_Then_Load(Type) : void
«property»
- InitializeSelf() : void
+ MessageId() : string
- IsInitializationMessage(TransportMessage) : bool
+ Result() : BusAsyncResult
+ MessageReceivedDelegate(TransportMessage) : void
- MustNotOverrideExistingConfiguration(Type, bool) : bool
+ Publish(Action<T>) : void
+ Publish(T[]) : void
+ RegisterMessageType(Type, string, bool) : void
+ Reply(IMessage[]) : void
+ Reply(Action<T>) : void
+ Return(int) : void
+ Send(Action<T>) : ICallback
+ Send(IMessage[]) : ICallback
+ Send(string, Action<T>) : ICallback
+ Send(string, IMessage[]) : ICallback
+ SendLocal(Action<T>) : void
+ SendLocal(IMessage[]) : void
- SendReadyMessage(bool) : void
+ SkipSendingReadyMessageOnce() : void
+ Start(Action<IBuilder>[]) : IBus
+ StopSendingReadyMessages() : void
+ Subscribe() : void
+ Subscribe(Type) : void
+ Subscribe(Predicate<T>) : void
+ Subscribe(Type, Predicate<IMessage>) : void
- transport_FinishedMessageProcessing(object, EventArgs) : void
- transport_StartedMessageProcessing(object, EventArgs) : void
- transport_TransportMessageReceived(object, TransportMessageReceivedEventArgs) : void
+ Unsubscribe() : void
+ Unsubscribe(Type) : void
«property»
+ AutoSubscribe() : bool
+ Builder() : IBuilder
+ DisableMessageHandling() : bool
+ DistributorControlAddress() : string
+ DistributorDataAddress() : string
+ ForwardReceivedMessagesTo() : string
+ ImpersonateSender() : bool
+ IncomingHeaders() : IDictionary<string, string>
+ MessageHandlerAssemblies() : IList
+ MessageMapper() : IMessageMapper
+ MessageOwners() : IDictionary
+ OutgoingHeaders() : IDictionary<string, string>
+ PropogateReturnAddressOnSend() : bool
+ SourceOfMessageBeingHandled() : string
+ SubscriptionStorage() : ISubscriptionStorage
+ Transport() : ITransport
«event»
+ MessageReceived() : MessageReceivedDelegate

Figure: 31

BusAsyncResult
Type: Class IAsyncResult
Status: Proposed. Version 1.0. Phase 1.0.
Package: Unicast Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {C972BCFD-3CE0-42d2-BE9F-721113E6C276}

Custom Properties
 isActive = False
Model Specification Phase 01 Page: 134

Connections
Connector Source Target Notes
Association Public Private result
Source -> Destination BusAsyncResult CompletionResult

Association Public Private result


Source -> Destination BusAsyncResultEventA BusAsyncResult
rgs

Attributes
Attribute Notes Constraints and tags
callback AsyncCallback Default:
Private Const

completed bool Default:


Private
[volatile = true ]

result CompletionResult Default:


Private Const

sync ManualResetEvent Default:


Private Const

Operations
Method Notes Parameters
AsyncState() object
Public
AsyncWaitHandle()
WaitHandle
Public
Model Specification Phase 01 Page: 135

Method Notes Parameters


BusAsyncResult() AsyncCallback callback
Public [in]

object state
[in]

Complete() void int errorCode


Public [in]

IMessage[] messages
[in]

CompletedSynchronously
() bool
Public
IsCompleted() bool
Public

BusAsyncResultEventArgs
Type: Class EventArgs
Status: Proposed. Version 1.0. Phase 1.0.
Package: Unicast Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {9BCDADE6-06FF-492f-A38B-70F377AF0EE8}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private result
Source -> Destination BusAsyncResultEventA BusAsyncResult
rgs

Attributes
Attribute Notes Constraints and tags
Model Specification Phase 01 Page: 136

Attribute Notes Constraints and tags


messageId string Default:
Private Const

result BusAsyncResult Default:


Private Const

Operations
Method Notes Parameters
BusAsyncResultEventAr BusAsyncResult result
gs() [in]
Public
string messageId
[in]

MessageId() string
Public
Result() BusAsyncResult
Public

Callback
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Unicast Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {C4F7DC28-048A-45bd-8A97-DDD0EC309031}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination Callback ICallback
Model Specification Phase 01 Page: 137

Connector Source Target Notes

Association Public Private


Source -> Destination WorkerThread methodToRunInLoop
Callback

Attributes
Attribute Notes Constraints and tags
messageId string Default:
Private Const

Operations
Method Notes Parameters
Callback() string messageId
Public [in]

MessageId() string
Public
Register() IAsyncResult AsyncCallback callback
Public [in]

object state
[in]

Registered()
EventHandler<BusAsyncR
esultEventArgs>
Public

HeaderAdapter
Type: Class IDictionary
Status: Proposed. Version 1.0. Phase 1.0.
Package: Unicast Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {546A20F0-6349-4943-8367-5C649B9EBE84}

Custom Properties
 isActive = False
Model Specification Phase 01 Page: 138

Attributes
Attribute Notes Constraints and tags
headers List<HeaderInfo> Default: new List<HeaderInfo>()
Private Const new
List<HeaderInfo>()

Operations
Method Notes Parameters
Add() void string key
Public [in]

string value
[in]

Add() void KeyValuePair<string, string>


Public item
[in]

Clear() void
Public
Contains() bool KeyValuePair<string, string>
Public item
[in]

ContainsKey() bool string key


Public [in]

CopyTo() void KeyValuePair<string, string>[]


Public array
[in]

int arrayIndex
[in]

Count() int
Public
Static From() IDictionary<string, string> source
List<HeaderInfo> [in]
Public

GetEnumerator()
Model Specification Phase 01 Page: 139

Method Notes Parameters


IEnumerator<KeyValuePai
r<string, string>>
Public
GetEnumerator()
IEnumerator
Private
HeaderAdapter() List<HeaderInfo> headers
Public [in]

IsReadOnly() bool
Public
Keys() ICollection<string>
Public
Remove() bool string key
Public [in]

Remove() bool KeyValuePair<string, string>


Public item
[in]

this() string string key


Public [in]

TryGetValue() bool string key


Public [in]

string value
[out]

Values()
ICollection<string>
Public

SubscriptionsManager
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Unicast Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {B90A7CEC-9D87-4913-B9AB-E132428553B1}

Manages subscriptions and predicates for messages published by other endpoints and subscribed to by the local bus.

@remark Thread safe.

Custom Properties
Model Specification Phase 01 Page: 140

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Protected
Source -> Destination UnicastBus subscriptionsManager
SubscriptionsManager

Attributes
Attribute Notes Constraints and tags
locker object Default: new object()
Private Const new
object()

messageTypeToConditio Default: new Dictionary<Type,


nLookup List<Predicate<IMessage>>>()
IDictionary<Type,
List<Predicate<IMessage>
>>
Private Const new
Dictionary<Type,
List<Predicate<IMessage>
>>()

Operations
Method Notes Parameters
AddConditionForSubscri Adds a condition to a message type. Type messageType
ptionToMessageType() [in] The message type to add a
void @remark All conditions added to a message condition to.
Public type must be met if the messages of that type
are to be published to a subscriber. Predicate<IMessage> condition
[in] The condition to add.

GetConditionsForMessag Gets the list of conditions associated with a IMessage message


e() message. [in] The message to get conditions
IList<Predicate<IMessage for.
>> @returns A list of conditions that are
Public associated with type of message provided.

UnicastBus
Model Specification Phase 01 Page: 141

Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Unicast Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {60CCDB2B-0E29-4603-8CA1-D6F069162A64}

A unicast implementation of <see cref="IBus"/> for NServiceBus.

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private messageMapper
Source -> Destination UnicastBus IMessageMapper

Association Public Protected


Source -> Destination UnicastBus subscriptionsManager
SubscriptionsManager

Association Public Protected


Source -> Destination UnicastBus subscriptionStorage
ISubscriptionStorage

Association Public Protected transport


Source -> Destination UnicastBus ITransport

Association Public Private builder


Source -> Destination UnicastBus IBuilder

Realisation Public Public


Source -> Destination UnicastBus IUnicastBus

Realisation Public Public


Source -> Destination UnicastBus IStartableBus

Association Public Private bus


Source -> Destination ConfigUnicastBus UnicastBus

Association Public Private


Source -> Destination UnicastBus messageBeingHandled
TransportMessage

Generalization Public Public


Source -> Destination Bus UnicastBus

Attributes
Model Specification Phase 01 Page: 142

Attribute Notes Constraints and tags


autoSubscribe bool Default: true
Private true

builder IBuilder Default:


Private

canSendReadyMessages Accessed by multiple threads. Default: true


bool
Private true [volatile = true ]

disableMessageHandling Default: false


bool
Private false

distributorControlAddre Default:
ss string
Private

distributorDataAddress Default:
string
Private
Model Specification Phase 01 Page: 143

Attribute Notes Constraints and tags


doNotContinueDispatchi Default: false
ngCurrentMessageToHa
ndlers bool [Attribute = [ThreadStatic] ]
Private Static false

forwardReceivedMessage Default:
sTo string
Private

handlerList Default: new Dictionary<Type,


IDictionary<Type, List<Type>>()
List<Type>>
Private Const new
Dictionary<Type,
List<Type>>()

handlerToMessageTypeT Default: new Dictionary<Type,


oHandleMethodMap IDictionary<Type, MethodInfo>>()
IDictionary<Type,
IDictionary<Type,
MethodInfo>>
Private Const new
Dictionary<Type,
IDictionary<Type,
MethodInfo>>()
impersonateSender bool Default:
Private

log ILog Default:


Private Static Const LogManager.GetLogger(typeof(Uni
LogManager.GetLogger(ty castBus))
peof(UnicastBus))
Model Specification Phase 01 Page: 144

Attribute Notes Constraints and tags


messageBeingHandled @remark ThreadStatic Default:
TransportMessage
Private Static [Attribute = [ThreadStatic] ]

messageIdToAsyncResult Default: new Dictionary<string,


Lookup BusAsyncResult>()
IDictionary<string,
BusAsyncResult>
Private Const new
Dictionary<string,
BusAsyncResult>()

messageMapper Default:
IMessageMapper
Private

messageTypes List<Type> Default: new List<Type>(new


Private Const new Type[] {
List<Type>(new Type[] { typeof(CompletionMessage),
typeof(CompletionMessag typeof(SubscriptionMessage),
e), typeof(ReadyMessage),
typeof(SubscriptionMessag typeof(IMessage[]) })
e), typeof(ReadyMessage),
typeof(IMessage[]) })
messageTypeToDestinati @remark Accessed by multiple threads - needs Default: new Dictionary<Type,
onLookup appropriate locking string>()
IDictionary<Type, string>
Private Const new
Dictionary<Type, string>()

outgoingHeaders Default:
IDictionary<string, string>
Private Static [Attribute = [ThreadStatic] ]
Model Specification Phase 01 Page: 145

Attribute Notes Constraints and tags


propogateReturnAddress Default: false
OnSend bool
Private false

recoverableMessageType Default: new List<Type>()


s IList<Type>
Private Const new
List<Type>()

skipSendingReadyMessa ThreadStatic Default:


geOnce bool
Private Static [Attribute = [ThreadStatic] ]

started bool Default: false


Private false
[volatile = true ]

starting bool Default: false


Private false
[volatile = true ]

startLocker object Default: new object()


Private Const new
object()
Model Specification Phase 01 Page: 146

Attribute Notes Constraints and tags


subscriptionsManager Gets/sets the subscription manager to use for Default: new
SubscriptionsManager the bus. SubscriptionsManager()
Protected new
SubscriptionsManager()

subscriptionStorage Default:
ISubscriptionStorage
Protected

timeToBeReceivedPerMe Default: new Dictionary<Type,


ssageType TimeSpan>()
IDictionary<Type,
TimeSpan>
Private Const new
Dictionary<Type,
TimeSpan>()

transport ITransport Default:


Protected

Operations
Method Notes Parameters
AddMessageType() void Should be used by programmer, not Type messageType
Public administrator. [in]

AddTypesFromAssembly Adds types from an assembly to the list of Assembly a


() void registered message types and handlers for the [in] The assembly to process.
Public bus.

@remark If a type implements <see


cref="IMessage"/> it will be added to the list of
message types registered to the bus. If a type
implements IMessageHandler it will be added
to the list of message handlers for the bus.

AssertBusIsStarted() void
Protected
AutoSubscribe() bool When set, when starting up, the bus performs a
Model Specification Phase 01 Page: 147

Method Notes Parameters


Public subscribe operation for message types for
which it has handlers and that are owned by a
different endpoint. Default is true.

Builder() IBuilder Should be used by programmer, not


Public administrator. Sets <see cref="IBuilder"/>
implementation that will be used to
dynamically instantiate and execute message
handlers.

ConfigureMessageOwner Sets up known types needed for XML IDictionary owners


s() void serialization as well as to which address to send [in] A dictionary of message_type,
Private which message. address pairs.

ContinueSendingReadyM
essages() void
Public
CreateInstance() T Creates an instance of the specified type. Used
Public primarily for instantiating interface-based
messages.

@returns An instance of the specified type.

CreateInstance() T Creates an instance of the specified type. Used Action<T> action


Public primarily for instantiating interface-based [in] An action to perform on the
messages. result

@returns

CreateInstance() object Creates an instance of the specified type. Used Type messageType
Public primarily for instantiating interface-based [in] The type to instantiate.
messages.

@returns An instance of the specified type.

DisableMessageHandling Should be used by programmer, not


() bool administrator. Disables the handling of
Public incoming messages.

DispatchMessageToHand Finds the message handlers associated with the IMessage toHandle
lersBasedOnType() void message type and dispatches the message to the [in] The message to dispatch to the
Private found handlers. handlers.

@returns Type messageType


@remark If during the dispatch, a message [in] The message type by which to
handler calls the <see locate the correct handlers.
cref="DoNotContinueDispatchingCurrentMess
ageToHandlers"/> method, this prevents the
message from being further dispatched. This
includes generic message handlers (of
IMessage), and handlers for the specific
messageType.

Dispose() void
Model Specification Phase 01 Page: 148

Method Notes Parameters


Public
DistributorControlAddre Should be used by administrator, not
ss() string programmer. Sets the address of the distributor
Public control queue.

@remark Notifies the given distributor when a


thread is now available to handle a new
message.

DistributorDataAddress() Should be used by administrator, not


string programmer. Sets the address to which the
Public messages received on this bus will be sent
when the method HandleCurrentMessageLater
is called.

DoNotContinueDispatchi Tells the bus to stop dispatching the current


ngCurrentMessageToHa message to additional handlers.
ndlers() void
Public
ForwardMessageIfNecess Sends the Msg to the address found in the field TransportMessage m
ary() void <see cref="forwardReceivedMessagesTo"/> if [in] The message to forward
Private it isn't null.

ForwardReceivedMessag Should be used by administrator, not


esTo() string programmer. Sets the address to which all
Public messages received on this bus will be
forwarded to (not including subscription
messages). This is primarily useful for smart
client scenarios where both client and server
software are installed on the mobile device.
The server software will have this field set to
the address of the real server.

GetAction() T message
Action<object> [in]
Private

GetDestinationForMessa Gets the destination address for a message type. Type messageType
geType() string [in] The message type to get the
Protected @returns The address of the destination destination for.
associated with the message type.

GetHandlerTypes() Gets a list of handler types associated with a Type messageType


IEnumerable<Type> message type. [in] The type of message to get the
Private handlers for.
@returns The list of handler types associated
with the message type.

Static Gets the inner most exception from an Exception e


GetInnermostException() exception stack. [in] The exception to get the inner
Exception most exception for.
Private @returns The innermost exception.
@remark If the exception has no inner
exceptions the provided exception will be
returned.
Model Specification Phase 01 Page: 149

Method Notes Parameters

GetMessageTypesIfIsMes If the type is a message handler, returns all the Type type
sageHandler() message types that it handles [in]
IEnumerable<Type>
Private @returns

GetReturnAddressFor() string destination


string [in]
Private

GetTransportMessageFo Wraps the provided messages in an string destination


r() TransportMessage NServiceBus envelope. [in] The destination to which to
Protected send the messages.
@returns The envelope containing the
messages. IMessage[] messages
[in] The messages to wrap.

HandleCorellatedMessag If the message contains a correlationId, TransportMessage msg


e() void attempts to invoke callbacks for that Id. [in] The message to evaluate.
Private

HandleCurrentMessageL Causes the message being handled to be moved


ater() void to the back of the list of available messages so
Public it can be handled later.

HandleMessage() void Handles a received message. TransportMessage m


Public [in] The received message.
@remark run by multiple threads so must be
thread safe public for testing

If_Type_Is_MessageHan Evaluates a type and loads it if it implements Type t


dler_Then_Load() void IMessageHander<T>. [in] The type to evaluate.
Private

ImpersonateSender() bool Should be used by programmer, not


Public administrator. Sets whether or not the bus
should impersonate the sender of a message it
has received when re-sending the message.
What occurs is that the thread sets its current
principal to the value found in the <see
cref="TransportMessage.WindowsIdentityNam
e" /> when that thread handles a message.

IncomingHeaders()
IDictionary<string, string>
Public
InitializeSelf() void
Private
IsInitializationMessage() Checks whether a received message is an TransportMessage msg
bool initialization message. [in] The message to check.
Private
@returns true if the message is an initialization
message, otherwise false.
@remark A <see cref="CompletionMessage"/>
Model Specification Phase 01 Page: 150

Method Notes Parameters


is used out of convenience as the initialization
message.

MessageHandlerAssembli Sets the list of assemblies which contain a


es() IList message handlers for the bus.
Public
MessageMapper()
IMessageMapper
Public
MessageOwners() Should be used by administrator, not
IDictionary programmer. Sets the message types associated
Public with the bus.

@remark This property accepts a dictionary


where the key can be the name of a type
implementing
<see cref="IMessage"/> or the name of an
assembly that contains message types. The
value of each entry is the address of the owner
of the message type defined in the key. If an
assembly is specified then all the the types in
the assembly implementing <see
cref="IMessage"/> will be registered against
the address defined in the value of the entry.

MessageReceived() Event raised when a message is received.


MessageReceivedDelegate
Public
MessageReceivedDelegat A delegate for a method that will handle the TransportMessage message
e() void <see cref="MessageReceived"/> event. [in] The message received.
Public

MustNotOverrideExistin Checks whether or not the existing Type messageType


gConfiguration() bool configuration can be overridden for a message [in] The type of message to check
Private type. the configuration for.

@returns true if it is acceptable to override the bool configuredByAssembly


configuration, otherwise false. [in] Indicates whether or not this
check is related to a type configured
from an assembly.

OutgoingHeaders()
IDictionary<string, string>
Public
PropogateReturnAddress Should be used by programmer, not
OnSend() bool administrator. Sets whether or not the return
Public address of a received message should be
propogated when the message is forwarded.
This field is used primarily for the Distributor.

Publish() void Action<T> messageConstructor


Public [in]
Model Specification Phase 01 Page: 151

Method Notes Parameters


Publish() void Publishes the first message in the list to all T[] messages
Public subscribers of that message type. [in] A list of messages. Only the
first will be published.

RegisterMessageType() Registers a message type to a destination. Type messageType


void [in] A message type implementing
Public @remark Since the same message type may be <see cref="IMessage"/>.
configured specifically to one address and via
its assembly to a different address, the <see string destination
cref="configuredByAssembly"/> parameter [in] The address of the destination
dictates that the specific message type data is to the message type is registered to.
be used.
bool configuredByAssembly
[in] Indicates whether or not this
registration call is related to a type
configured from an assembly.

Reply() void Sends all messages to the destination found in IMessage[] messages
Public <see [in] The messages to send.
cref="SourceOfMessageBeingHandled"/>.

Reply() void Action<T> messageConstructor


Public [in]

Return() void Returns an completion message with the int errorCode


Public specified error code to the sender of the [in] An code specifying the result.
message being handled.

Send() ICallback Action<T> messageConstructor


Public [in]

Send() ICallback Sends the list of provided messages and calls IMessage[] messages
Public the provided <see cref="AsyncCallback"/> [in] The list of messages to send.
delegate when the message is completed.

@remark All the messages will be sent to the


destination configured for the first message in
the list.

Send() ICallback string destination


Public [in]

Action<T> messageConstructor
[in]

Send() ICallback Sends the list of provided messages and calls string destination
Public the provided <see cref="AsyncCallback"/> [in] The address of the destination
delegate when the message is completed. to send the messages to.

IMessage[] messages
Model Specification Phase 01 Page: 152

Method Notes Parameters


[in] The list of messages to send.

SendLocal() void Action<T> messageConstructor


Public [in]

SendLocal() void Sends the list of messages back to the current IMessage[] messages
Public bus. [in] The messages to send.

SendReadyMessage() If this bus is configured to feed off of a bool startup


void distributor, it will send a <see [in]
Private cref="ReadyMessage"/> to its control address.

SkipSendingReadyMessa
geOnce() void
Public
SourceOfMessageBeingH Gets the address from which the message being
andled() string handled was sent.
Public
Start() IBus Starts the bus. Action<IBuilder>[] startupActions
Public [in]

StopSendingReadyMessa
ges() void
Public
Subscribe() void
Public
Subscribe() void Subcribes to recieve published messages of the Type messageType
Public specified type. [in] The type of message to
subscribe to.

Subscribe() void Predicate<T> condition


Public [in]

Subscribe() void Subscribes to receive published messages of Type messageType


Public the specified type if they meet the provided [in] The type of message to
condition. subscribe to.

Predicate<IMessage> condition
[in] The condition under which to
receive the message.

SubscriptionStorage() Should be used by programmer, not


ISubscriptionStorage administrator. Sets an <see
Public cref="ISubscriptionStorage"/> implementation
to be used for subscription storage for the bus.

Transport() ITransport Should be used by programmer, not


Public administrator. Sets an <see cref="ITransport"/>
Model Specification Phase 01 Page: 153

Method Notes Parameters


implementation to use as the message transport
for the bus.

transport_FinishedMessa Handles the FinishedMessageProcessing event object sender


geProcessing() void of ITransport. [in]
Private
EventArgs e
[in]

transport_StartedMessag object sender


eProcessing() void [in]
Private
EventArgs e
[in]

transport_TransportMes Handles the <see object sender


sageReceived() void cref="ITransport.TransportMessageReceived"/ [in] The sender of the event.
Private > event from the <see cref="ITransport"/> used
for the bus. TransportMessageReceivedEvent
Args e
@remark When the transport passes up the [in] The arguments for the event.
<see cref="TransportMessage"/> its received,
the bus checks for initializiation, sets the
message as that which is currently being
handled for the current thread and, depending
on <see cref="DisableMessageHandling"/>,
attempts to handle the message.

Unsubscribe() void
Public
Unsubscribe() void Unsubscribes from receiving published Type messageType
Public messages of the specified type. [in]

IUnicastBus
Type: Interface IBus
Status: Proposed. Version 1.0. Phase 1.0.
Package: Unicast Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {64B6ED89-3BFD-4430-8C9C-3D621C86FB1A}

Connections
Connector Source Target Notes
Association Public Private unicastBus
Source -> Destination ChangeNumberOfWork IUnicastBus
Model Specification Phase 01 Page: 154

Connector Source Target Notes


erThreadsMessageHand
ler

Association Public Private unicastBus


Source -> Destination GridInterceptingMessag IUnicastBus
eHandler

Generalization Public Public


Source -> Destination IUnicastBus IBus

Realisation Public Public


Source -> Destination UnicastBus IUnicastBus

Operations
Method Notes Parameters
ContinueSendingReadyM Instructs the bus to continue sending <see
essages() void cref="ReadyMessage"/>s when it has a
Public distributor configured.

SkipSendingReadyMessa Instructs the bus to not send a <see


geOnce() void cref="ReadyMessage"/> at the end of
Public processing the current message on the specific
thread on which it was called.

StopSendingReadyMessa Instructs the bus to stop sending <see


ges() void cref="ReadyMessage"/>s when it has a
Public distributor configured.

Config
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Unicast
Detail: Created on 21/12/2008 09:37:51. Last modified on 21/12/2008 09:37:51
GUID: {42077161-AD9D-49c5-A90C-EF63806781C2}

Config - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {3738FF04-2464-4e6c-9ED4-C75DC333C53E}
Model Specification Phase 01 Page: 155

class Config

Configure
ConfigUnicastBus

- bus: UnicastBus

+ ConfigUnicastBus()
+ Configure(Configure) : void
- ConfigureSagasAndMessageHandlersIn(Assembly[]) : void
+ DoNotAutoSubscribe() : ConfigUnicastBus
+ ForwardReceivedMessagesTo(string) : ConfigUnicastBus
+ GetMessageTypeFromMessageHandler(Type) : Type
+ ImpersonateSender(bool) : ConfigUnicastBus
+ IsMessageHandler(Type) : bool
+ PropogateReturnAddressOnSend(bool) : ConfigUnicastBus
+ SetMessageHandlersFromAssembliesInOrder(Assembly[]) : ConfigUnicastBus

Figure: 32

ConfigUnicastBus
Type: Class Configure
Status: Proposed. Version 1.0. Phase 1.0.
Package: Config Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {D7E05EA5-1361-4e80-9E0B-9780302C52AC}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private bus
Source -> Destination ConfigUnicastBus UnicastBus

Generalization Public Public


Source -> Destination ConfigUnicastBus Configure

Attributes
Attribute Notes Constraints and tags
Model Specification Phase 01 Page: 156

Attribute Notes Constraints and tags


bus UnicastBus Default:
Private

Operations
Method Notes Parameters
ConfigUnicastBus()
Public
Configure() void Configure config
Public [in]

ConfigureSagasAndMess Assembly[] assemblies


ageHandlersIn() void [in]
Private

DoNotAutoSubscribe()
ConfigUnicastBus
Public
ForwardReceivedMessag string value
esTo() ConfigUnicastBus [in]
Public

Static Type t
GetMessageTypeFromM [in]
essageHandler() Type
Public
ImpersonateSender() bool value
ConfigUnicastBus [in]
Public

Static Type t
IsMessageHandler() bool [in]
Public

PropogateReturnAddress bool value


OnSend() [in]
ConfigUnicastBus
Public
SetMessageHandlersFro Assembly[] assemblies
mAssembliesInOrder() [in]
ConfigUnicastBus
Public

Distributor
Model Specification Phase 01 Page: 157

Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Unicast
Detail: Created on 21/12/2008 09:37:17. Last modified on 21/12/2008 09:37:17
GUID: {D9007915-DDFE-43dd-B333-EC105A25776F}

Distributor - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {92A12D60-692B-47f7-B8CB-07220FE56145}

class Distributor

«interface»
IWorkerAvailabilityManager

+ ClearAvailabilityForWorker(string) : void
+ PopAvailableWorker() : string
+ WorkerAvailable(string) : void

-workerManager -workerManager

Distributor

- controlBus: IStartableBus
- disabled: bool
- logger: ILog = LogManager.GetL... {readOnly}
ReadyMessageHandler
- messageBusTransport: ITransport
- millisToWaitIfCannotDispatchToWorker: int = 50 - logger: ILog = LogManager.GetL... {readOnly}
- workerManager: IWorkerAvailabilityManager - workerManager: IWorkerAvailabilityManager

- messageBusTransport_TransportMessageReceived(object, TransportMessageReceivedEventArgs) : void + Handle(ReadyMessage) : void


- Rollback() : void
«property»
+ Start() : void
+ Bus() : IBus
+ Stop() : void
+ WorkerManager() : IWorkerAvailabilityManager
«property»
+ ControlBus() : IStartableBus
+ MessageBusTransport() : ITransport
+ MillisToWaitIfCannotDispatchToWorker() : int
+ WorkerManager() : IWorkerAvailabilityManager

Figure: 33

Distributor
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Distributor Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {10D14B77-C2BF-4d45-B98E-F075C9AB8DA5}

Provides functionality for distributing messages from a bus to multiple workers when using a unicast transport.

Custom Properties
 isActive = False

Connections
Model Specification Phase 01 Page: 158

Connector Source Target Notes


Association Public Private workerManager
Source -> Destination Distributor IWorkerAvailabilityMa
nager

Association Public Private controlBus


Source -> Destination Distributor IStartableBus

Association Public Private


Source -> Destination Distributor messageBusTransport
ITransport

Attributes
Attribute Notes Constraints and tags
controlBus IStartableBus Default:
Private

disabled bool Default:


Private
[volatile = true ]

logger ILog Default:


Private Static Const LogManager.GetLogger(typeof(Dist
LogManager.GetLogger(ty ributor))
peof(Distributor))

messageBusTransport Default:
ITransport
Private
Model Specification Phase 01 Page: 159

Attribute Notes Constraints and tags


millisToWaitIfCannotDis Default: 50
patchToWorker int
Private 50

workerManager Default:
IWorkerAvailabilityManag
er
Private

Operations
Method Notes Parameters
ControlBus() Sets the <see cref="IBus"/> implementation
IStartableBus that will be used for transporting control
Public information.

MessageBusTransport() Sets the <see cref="ITransport"/>


ITransport implementation that will be used to access the
Public bus containing messages to distribute.

messageBusTransport_T Handles reciept of a message on the bus to object sender


ransportMessageReceive distribute for. [in]
d() void
Private @remark This method checks whether a TransportMessageReceivedEvent
worker is available to handle the message and Args e
forwards it if one is found. [in]

MillisToWaitIfCannotDis
patchToWorker() int
Public
Rollback() void
Private
Start() void Starts the Distributor.
Public
Stop() void Stops the Distributor.
Public
WorkerManager() Sets the <see
IWorkerAvailabilityManag cref="IWorkerAvailabilityManager"/>
er implementation that will be used to determine
Public whether or not a worker is available.

ReadyMessageHandler
Model Specification Phase 01 Page: 160

Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Distributor Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {9F9A0E79-3293-4355-8A22-EDE1241D53AB}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination ReadyMessageHandler IMessageHandler

Association Public Private workerManager


Source -> Destination ReadyMessageHandler IWorkerAvailabilityMa
nager

Attributes
Attribute Notes Constraints and tags
logger ILog Default:
Private Static Const LogManager.GetLogger(typeof(Rea
LogManager.GetLogger(ty dyMessageHandler))
peof(ReadyMessageHandle
r))

workerManager Default:
IWorkerAvailabilityManag
er
Private

Operations
Method Notes Parameters
Bus() IBus
Public
Handle() void ReadyMessage message
Public [in]

WorkerManager()
Model Specification Phase 01 Page: 161

Method Notes Parameters


IWorkerAvailabilityManag
er
Public

IWorkerAvailabilityManager
Type: Interface
Status: Proposed. Version 1.0. Phase 1.0.
Package: Distributor Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {78626693-78FA-44f2-B2B2-DBA74A6BDCEA}

Defines a manager class that determines the availability of a worker for the <see cref="Distributor"/>.

Connections
Connector Source Target Notes
Association Public Private workerManager
Source -> Destination Distributor IWorkerAvailabilityMa
nager

Association Public Private workerManager


Source -> Destination ReadyMessageHandler IWorkerAvailabilityMa
nager

Realisation Public Public


Source -> Destination MsmqWorkerAvailabili IWorkerAvailabilityMa
tyManager nager

Operations
Method Notes Parameters
ClearAvailabilityForWor Removes all entries from the worker string address
ker() void availability list with the specified address. [in] The address of the worker to
Public remove from the availability list.

PopAvailableWorker() Pops the next available worker from the


string available worker list and returns its address.
Public
@returns The address of the next available
worker.

WorkerAvailable() void Signal that a worker is available to receive a string address


Public dispatched message. [in] The address of the worker that
will accept the dispatched message.
Model Specification Phase 01 Page: 162

Runner
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Distributor
Detail: Created on 21/12/2008 09:37:18. Last modified on 21/12/2008 09:37:18
GUID: {17A81183-2BFB-45c3-997D-905BC1284773}

Runner - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {B29EBC7E-C1EB-4ee5-92AF-21566592DDAD}

class Runner

Program Initalizer

- Main() : void + Init(Func<Configure, Configure>) : void

Figure: 34

Initalizer
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Runner Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {6A1109E8-CADD-4f0b-AC7A-F5F0AA0097F2}

Custom Properties
 isActive = False

Tagged Values
 static = true.

Operations
Method Notes Parameters
Static Init() void Assumes that an <see Func<Configure, Configure>
Public cref="IMessageSerializer"/> was already setupSerialization
configured in the given builder. [in]
Model Specification Phase 01 Page: 163

Method Notes Parameters

@param ="builder"
@returns

Program
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Runner Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {014CF452-D562-4cc4-847E-2C9B5609D8A9}

Application for creating and executing a <see cref="Distributor"/>.

Custom Properties
 isActive = False

Operations
Method Notes Parameters
Static Main() void
Private

Subscriptions
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Unicast
Detail: Created on 21/12/2008 09:37:35. Last modified on 21/12/2008 09:37:35
GUID: {68622DD0-1D89-41d0-A70D-EFD0857F3549}

Subscriptions - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {4AA267E2-8303-4be6-A2BB-96167AA3B2D7}
Model Specification Phase 01 Page: 164

class Subscriptions

«interface»
ISubscriptionStorage
+ GetSubscribersForMessage(Type) : IList<string>
+ HandleSubscriptionMessage(TransportMessage) : void
+ Init(IList<Type>) : void

Figure: 35

ISubscriptionStorage
Type: Interface
Status: Proposed. Version 1.0. Phase 1.0.
Package: Subscriptions Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {91704F42-5915-4aed-A415-A3D9B0D60748}

Defines storage for subscriptions

Connections
Connector Source Target Notes
Association Public Protected
Source -> Destination UnicastBus subscriptionStorage
ISubscriptionStorage

Realisation Public Public


Source -> Destination SubscriptionStorage ISubscriptionStorage

Realisation Public Public


Source -> Destination MsmqSubscriptionStora ISubscriptionStorage
ge

Operations
Method Notes Parameters
GetSubscribersForMessa Returns a list of addresses of subscribers that Type messageType
ge() IList<string> previously requested to be notified of messages [in] The logical message type that
Public of the same type as <see the bus wishes to publish.
cref="messageType"/>.

@returns List of addresses of subscribers.

HandleSubscriptionMess Check to see if <see cref="msg"/> is a <see TransportMessage msg


age() void cref="SubscriptionMessage"/>. If so, performs [in] The message received in the
Public the relevant subscribe/unsubscribe. bus.
Model Specification Phase 01 Page: 165

Method Notes Parameters

Init() void Notifies the subscription storage that now is the IList<Type> messageTypes
Public time to perform any initialization work [in] The logical message types that
the bus will be publishing.

DB
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Subscriptions
Detail: Created on 21/12/2008 09:37:35. Last modified on 21/12/2008 09:37:35
GUID: {B7816044-9507-446b-8461-AEB0831BE030}

DB - (Logical diagram)
Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {4D850E45-5662-4c88-8FDE-3DB3D06A0DE1}

class DB

SubscriptionStorage

- compatibleTypes: IDictionary<Type, IList<Type>> = new Dictionary<...


- connectionString: string
- factory: DbProviderFactory
- isolationLevel: IsolationLevel = IsolationLevel....
- messageTypeParameterName: string
- subscriberParameterName: string
- table: string

- Execute(DbTransaction, string, string, string) : void


- GetConnection() : DbConnection
+ GetSubscribersForMessage(Type) : IList<string>
+ HandleSubscriptionMessage(TransportMessage) : void
+ Init(IList<Type>) : void
- RegisterMapping(Type, Type) : void
- ScanBase(Type) : void
«property»
+ ConnectionString() : string
+ IsolationLevel() : IsolationLevel
+ MessageTypeParameterName() : string
+ ProviderInvariantName() : string
+ SubscriberParameterName() : string
+ Table() : string
Model Specification Phase 01 Page: 166

Figure: 36

SubscriptionStorage
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: DB Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {6DFAF410-73F1-4a86-BD77-77BB5B8E125F}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private storage
Source -> Destination ConfigDbSubscriptionS SubscriptionStorage
torage

Realisation Public Public


Source -> Destination SubscriptionStorage ISubscriptionStorage

Attributes
Attribute Notes Constraints and tags
compatibleTypes Default: new Dictionary<Type,
IDictionary<Type, IList<Type>>()
IList<Type>>
Private new
Dictionary<Type,
IList<Type>>()

connectionString string Default:


Private
Model Specification Phase 01 Page: 167

Attribute Notes Constraints and tags


factory DbProviderFactory Default:
Private

isolationLevel Default:
IsolationLevel IsolationLevel.ReadCommitted
Private
IsolationLevel.ReadCommi
tted

messageTypeParameterN Default:
ame string
Private

subscriberParameterNa Default:
me string
Private

table string Default:


Private

Operations
Method Notes Parameters
ConnectionString() string
Public
Execute() void DbTransaction tx
Private [in]

string sql
[in]

string subscriber
Model Specification Phase 01 Page: 168

Method Notes Parameters


[in]

string messageType
[in]

GetConnection()
DbConnection
Private
GetSubscribersForMessa Type messageType
ge() IList<string> [in]
Public

HandleSubscriptionMess TransportMessage msg


age() void [in]
Public

Init() void IList<Type> messageTypes


Public [in]

IsolationLevel()
IsolationLevel
Public
MessageTypeParameterN
ame() string
Public
ProviderInvariantName()
string
Public
RegisterMapping() void Type specific
Private [in]

Type generic
[in]

ScanBase() void Type msgType


Private [in]

SubscriberParameterNa
me() string
Public
Table() string
Public

Config
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: DB
Model Specification Phase 01 Page: 169

Detail: Created on 21/12/2008 09:37:35. Last modified on 21/12/2008 09:37:35


GUID: {DD35E39F-74E4-4bd9-84CB-A6121B48AC10}

Config - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {28DE9264-A2AD-43a3-9D8B-64C4711F74CC}

class Config

Configure
ConfigDbSubscriptionStorage

- storage: SubscriptionStorage

+ ConfigDbSubscriptionStorage()
+ Configure(Configure) : void
+ IsolationLevel(IsolationLevel) : ConfigDbSubscriptionStorage
+ MessageTypeParameterName(string) : ConfigDbSubscriptionStorage
+ SubscriberEndpointParameterName(string) : ConfigDbSubscriptionStorage
+ Table(string) : ConfigDbSubscriptionStorage

Figure: 37

ConfigDbSubscriptionStorage
Type: Class Configure
Status: Proposed. Version 1.0. Phase 1.0.
Package: Config Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {D7A6F774-37B1-4a93-BE37-D93B60FD22A7}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private storage
Source -> Destination ConfigDbSubscriptionS SubscriptionStorage
torage

Generalization Public Public


Source -> Destination ConfigDbSubscriptionS Configure
torage
Model Specification Phase 01 Page: 170

Attributes
Attribute Notes Constraints and tags
storage Default:
SubscriptionStorage
Private

Operations
Method Notes Parameters
ConfigDbSubscriptionSto
rage()
Public
Configure() void Configure config
Public [in]

IsolationLevel() Default level is ReadCommitted. IsolationLevel value


ConfigDbSubscriptionStor [in]
age @returns
Public
MessageTypeParameterN string value
ame() [in]
ConfigDbSubscriptionStor
age
Public
SubscriberEndpointPara string value
meterName() [in]
ConfigDbSubscriptionStor
age
Public
Table() string value
ConfigDbSubscriptionStor [in]
age
Public

Msmq
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Subscriptions
Detail: Created on 21/12/2008 09:37:37. Last modified on 21/12/2008 09:37:37
GUID: {F8D9640A-43F7-4bcc-BE9F-004BE91D746D}

Msmq - (Logical diagram)


Created By: on 21/12/2008
Model Specification Phase 01 Page: 171

Last Modified: 21/12/2008


Version: 1.0. False
GUID: {E4C1C935-2552-4ef1-A02E-2F2FF037956E}

class Msmq

MsmqSubscriptionStorage Entry

- dontUseExternalTransaction: bool - messageType: string


- entries: List<Entry> = new List<Entry>() - subscriber: string
- locker: object = new object() - TypeOfMessage: Type
- log: ILog = LogManager.GetL...
- lookup: Dictionary<string, Dictionary<string, string>> = new Dictionary<... + Entry(Type, TransportMessage)
- q: MessageQueue + Entry(string, string)
+ Entry()
+ Add(string, string) : void + Matches(object) : bool
- AddToLookup(string, string, string) : void + Matches(Type) : bool
+ GetSubscribersForMessage(Type) : IList<string> «property»
- GetTransactionType() : MessageQueueTransactionType + MessageType() : string
- HandleAddSubscription(TransportMessage, Type, SubscriptionMessage, bool) : void + Subscriber() : string
- HandleRemoveSubscription(TransportMessage, Type, SubscriptionMessage, bool) : void
+ HandleSubscriptionMessage(TransportMessage) : void
- HandleSubscriptionMessage(TransportMessage, bool) : void
+ Init(IList<Type>) : void
+ Remove(string, string) : void
«property»
+ DontUseExternalTransaction() : bool
+ Queue() : string

Figure: 38

Entry
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Msmq Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {896C73A2-019D-42a5-AEE3-137C80901090}

Describes an entry in the list of subscriptions.

Custom Properties
 isActive = False

Tagged Values
 Attribute = [Serializable].

Attributes
Attribute Notes Constraints and tags
Model Specification Phase 01 Page: 172

Attribute Notes Constraints and tags


messageType string Default:
Private

subscriber string Default:


Private

TypeOfMessage Type Default:


Private

Operations
Method Notes Parameters
Entry() Type messageType
Public [in]

TransportMessage msg
[in]

Entry() string messageType


Public [in]

string subscriber
[in]

Entry()
Public
Matches() bool object message
Public [in]

Matches() bool Type msgType


Public [in]

MessageType() string Gets the message type for the subscription


Model Specification Phase 01 Page: 173

Method Notes Parameters


Public entry.

Subscriber() string Gets the subscription request message.


Public

MsmqSubscriptionStorage
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Msmq Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {C3F1D21C-ACA2-4df4-9796-3750B2363917}

Provides functionality for managing message subscriptions using MSMQ.

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination MsmqSubscriptionStora ISubscriptionStorage
ge

Attributes
Attribute Notes Constraints and tags
dontUseExternalTransact Default:
ion bool
Private

entries List<Entry> Default: new List<Entry>()


Private new
List<Entry>()
Model Specification Phase 01 Page: 174

Attribute Notes Constraints and tags


locker object Default: new object()
Private new object()

log ILog Default:


Private LogManager.GetLogger(typeof
LogManager.GetLogger(ty (ISubscriptionStorage))
peof
(ISubscriptionStorage))

lookup Dictionary<string, lookup from subscriber, to message type, to Default: new Dictionary<string,
Dictionary<string, string>> message id Dictionary<string, string>>()
Private new
Dictionary<string,
Dictionary<string,
string>>()

q MessageQueue Default:
Private

Operations
Method Notes Parameters
Add() void Adds a message to the subscription store. string subscriber
Public [in]

string typeName
[in]

AddToLookup() void Adds a message to the lookup to find message string subscriber
Private from subscriber, to message type, to message id [in]

string typeName
[in]

string messageId
[in]
Model Specification Phase 01 Page: 175

Method Notes Parameters


DontUseExternalTransac Gets/sets whether or not to use a trasaction
tion() bool started outside the subscription store.
Public
GetSubscribersForMessa Gets a list of the addresses of subscribers for Type messageType
ge() IList<string> the specified message. [in] The message type to get
Public subscribers for.
@returns A list of subscriber addresses.

GetTransactionType()
MessageQueueTransaction
Type
Private
HandleAddSubscription() Checks the subscription type, and if it is 'Add', TransportMessage msg
void then adds the subscriber. [in] The message to handle.
Private
Type messageType
[in] The message type being
subscribed to.

SubscriptionMessage subMessage
[in] A subscription message.

bool updateQueue
[in] Whether or not to update the
subscription persistence store.

HandleRemoveSubscripti Handles a removing a subscription. TransportMessage msg


on() void [in] The message to handle.
Private
Type messageType
[in] The message type being
subscribed to.

SubscriptionMessage subMessage
[in] A subscription message.

bool updateQueue
[in] Whether or not to update the
subscription persistence store.

HandleSubscriptionMess Attempts to handle a subscription message. TransportMessage msg


age() void [in] The message to attempt to
Public @returns true if the message was a valid handle.
subscription message, otherwise false.

HandleSubscriptionMess Attempts to handle a subscription message TransportMessage msg


age() void allowing specification of whether or not the [in] The message to attempt to
Private subscription persistence store should be handle.
updated.
bool updateQueue
@returns true if the message was a valid [in] Whether or not the subscription
subscription message, otherwise false. persistence store should be updated.
Model Specification Phase 01 Page: 176

Method Notes Parameters

Init() void IList<Type> messageTypes


Public [in]

Queue() string Sets the address of the queue where


Public subscription messages will be stored. For a
local queue, just use its name - msmq specific
info isn't needed. For a remote queue
(supported MSMQ 4.0), use the format
"queue@machine".

Remove() void Removes a message from the subscription string subscriber


Public store. [in]

string typeName
[in]

Config
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Msmq
Detail: Created on 21/12/2008 09:37:37. Last modified on 21/12/2008 09:37:37
GUID: {B818F386-EB39-4967-975D-773337F9CE36}

Config - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {FAD781A3-68CC-4b48-BDCA-E7EBC46AED8D}

class Config

Configure
ConfigMsmqSubscriptionStorage

+ ConfigMsmqSubscriptionStorage()
+ Configure(Configure) : void

Figure: 39

ConfigMsmqSubscriptionStorage
Type: Class Configure
Status: Proposed. Version 1.0. Phase 1.0.
Model Specification Phase 01 Page: 177

Package: Config Keywords:


Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {D01BCF2B-4ADA-4277-B0CD-C56718537142}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Generalization Public Public
Source -> Destination ConfigMsmqSubscripti Configure
onStorage

Operations
Method Notes Parameters
ConfigMsmqSubscription
Storage()
Public
Configure() void Configure config
Public [in]

Transport
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Unicast
Detail: Created on 21/12/2008 09:37:33. Last modified on 21/12/2008 09:37:33
GUID: {94EC1B9E-1694-4efa-9E4E-84A34EFC4D64}

Transport - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {8FD69DCA-9425-457b-89C2-9A9B76C56A0B}
Model Specification Phase 01 Page: 178

class Transport

TransportMessage
IDisposable
- body: IMessage ([]) «interface»
- bodyStream: Stream ITransport
- messages: List<object>
+ AbortHandlingCurrentMessage() : void
- timeToBeReceived: TimeSpan = TimeSpan.MaxValue
+ ChangeNumberOfWorkerThreads(int) : void
SubscriptionMessage
HeaderInfo + GetNumberOfPendingMessages() : int
+ CopyMessagesToBody() : void
CompletionMessage + ReceiveMessageLater(TransportMessage) : void «enumeratio...
«property» + Key: string + SubscriptionMessage()
+ Send(TransportMessage, string) : void SubscriptionType
+ Body() : IMessage[] + Value: string + SubscriptionMessage(string, SubscriptionType)
«property» + Start() : void
+ BodyStream() : Stream «property» Add
+ CorrelationId() : string + ErrorCode() : int «property»
+ HeaderInfo(string, string) + SubscriptionType() : SubscriptionType Remove
+ Headers() : List<HeaderInfo> + Address() : string
+ HeaderInfo() + TypeName() : string
+ Id() : string + MessageTypesToBeReceived() : IList<Type>
+ IdForCorrelation() : string + NumberOfWorkerThreads() : int
+ Messages() : List<object> «event»
+ Recoverable() : bool + FinishedMessageProcessing() : EventHandler
+ ReturnAddress() : string + StartedMessageProcessing() : EventHandler
+ TimeToBeReceived() : TimeSpan + TransportMessageReceived() : EventHandler<TransportMessageReceivedEventArgs>
+ WindowsIdentityName() : string
-message

EventArgs
TransportMessageReceiv edEv entArgs

- message: TransportMessage {readOnly}

+ TransportMessageReceivedEventArgs(TransportMessage)
«property»
+ Message() : TransportMessage

Figure: 40

CompletionMessage
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Transport Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {E0915EAB-8B6B-486f-BD6A-709DF211ED47}

A message that will be sent on completion or error of an NServiceBus message.

Custom Properties
 isActive = False

Tagged Values
 Attribute = [Serializable].

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination CompletionMessage IMessage

Operations
Method Notes Parameters
ErrorCode() int Gets/sets a code specifying the type of error
Public that occurred.

HeaderInfo
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Model Specification Phase 01 Page: 179

Package: Transport Keywords:


Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {3C19B157-A19E-4748-8F4C-0F92854A98E6}

Custom Properties
 isActive = False

Tagged Values
 Attribute = [Serializable].

Attributes
Attribute Notes Constraints and tags
Key string Default:
Public

Value string Default:


Public

Operations
Method Notes Parameters
HeaderInfo() string key
Public [in]

string value
[in]

HeaderInfo()
Public

SubscriptionMessage
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Model Specification Phase 01 Page: 180

Package: Transport Keywords:


Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {E15F9A0D-4398-499b-9372-0414829BD413}

A message representing a subscribe/unsubscribe request to receive messages of a specific type.

Custom Properties
 isActive = False

Tagged Values
 Attribute = [Serializable].

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination SubscriptionMessage IMessage

Operations
Method Notes Parameters
SubscriptionMessage() Initializes a new SubscriptionMessage.
Public
SubscriptionMessage() Initializes a new SubscriptionMessage for the string typeName
Public specified message type that indicates whether [in]
to add or remove a subscription.
SubscriptionType
subscriptionType
[in]

SubscriptionType() Gets/sets whether the SubscriptionMessage is


SubscriptionType to add or remove a subscription.
Public
TypeName() string Gets/sets the name of the message type to
Public subscribe to or unsubscribe from.

SubscriptionType
Type: Enumeration
Status: Proposed. Version 1.0. Phase 1.0.
Package: Transport Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {430CC9C2-98CF-4ce9-B882-57890501C24B}

Describes subscription message types.


Model Specification Phase 01 Page: 181

Custom Properties
 isActive = False

Attributes
Attribute Notes Constraints and tags
Add Add a subscription. Default:
Public

Remove Remove a subscription. Default:


Public

TransportMessage
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Transport Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {34AA1604-2050-4864-AFAD-5A40B3E678A9}

An envelope used by NServiceBus to package messages for transmission.

@remark All messages sent and received by NServiceBus are wrapped in this class. More than one message can be
bundled in the envelope to be transmitted or received by the bus.

Custom Properties
 isActive = False

Tagged Values
 Attribute = [Serializable].
Model Specification Phase 01 Page: 182

Connections
Connector Source Target Notes
Association Public Private body
Source -> Destination TransportMessage IMessage

Association Public Private message


Source -> Destination TransportMessageRecei TransportMessage
vedEventArgs

Association Public Private


Source -> Destination UnicastBus messageBeingHandled
TransportMessage

Attributes
Attribute Notes Constraints and tags
body IMessage Default:
Private Collection

bodyStream Stream Default:


Private

messages List<object> Default:


Private

timeToBeReceived Default: TimeSpan.MaxValue


TimeSpan
Private
TimeSpan.MaxValue

Operations
Method Notes Parameters
Model Specification Phase 01 Page: 183

Method Notes Parameters


Body() IMessage Gets/sets the array of messages in the message
Public bundle.

@remark Since the XmlSerializer doesn't work


well with interfaces, we ask it to ignore this
data and synchronize with the <see
cref="messages"/> field.

BodyStream() Stream Gets/sets a stream to the body content of the


Public message

@remark Used for cases where we can't


deserialize the contents.

CopyMessagesToBody() Recreates the list of messages in the body field


void from the contents of the messages field.
Public
CorrelationId() string Gets/sets the uniqe identifier of another
Public message bundle this message bundle is
associated with.

Headers() Gets/sets other applicative out-of-band


List<HeaderInfo> information.
Public
Id() string Gets/sets the identifier of this message bundle.
Public
IdForCorrelation() string Gets/sets the identifier that is copied to <see
Public cref="CorrelationId"/>.

Messages() List<object> Gets/sets the list of messages in the message


Public bundle.

Recoverable() bool Gets/sets whether or not the message is


Public supposed to be guaranteed deliverable.

ReturnAddress() string Gets/sets the return address of the message


Public bundle.

TimeToBeReceived() Gets/sets the maximum time limit in which the


TimeSpan message bundle must be received.
Public
WindowsIdentityName() Gets/sets the name of the Windows identity the
string message is being sent as.
Public

TransportMessageReceivedEventArgs
Type: Class EventArgs
Status: Proposed. Version 1.0. Phase 1.0.
Package: Transport Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {9AEEE01D-9D72-4b18-9ADD-2C16C0341D76}

Defines the arguments passed to the event handler of the


Model Specification Phase 01 Page: 184

<see cref="ITransport.TransportMessageReceived"/> event.

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private message
Source -> Destination TransportMessageRecei TransportMessage
vedEventArgs

Attributes
Attribute Notes Constraints and tags
message Default:
TransportMessage
Private Const

Operations
Method Notes Parameters
Message() Gets the message received.
TransportMessage
Public
TransportMessageReceiv Initializes a new TransportMessage m
edEventArgs() TransportMessageReceivedEventArgs. [in] The message that was received.
Public

ITransport
Type: Interface IDisposable
Status: Proposed. Version 1.0. Phase 1.0.
Package: Transport Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {A1EECFDA-9AB4-4518-8425-85B400D58699}

Defines the basic functionality of a transport to be used by NServiceBus.


Model Specification Phase 01 Page: 185

Connections
Connector Source Target Notes
Association Public Private transport
Source -> Destination ChangeNumberOfWork ITransport
erThreadsMessageHand
ler

Association Public Private transport


Source -> Destination GetNumberOfWorkerT ITransport
hreadsMessageHandler

Association Public Private


Source -> Destination Distributor messageBusTransport
ITransport

Association Public Protected transport


Source -> Destination UnicastBus ITransport

Generalization Public Public


Source -> Destination IMulticastTransport ITransport

Realisation Public Public


Source -> Destination MsmqTransport ITransport

Association Public Private


Source -> Destination Proxy externalTransport
ITransport

Association Public Private


Source -> Destination Proxy internalTransport
ITransport

Operations
Method Notes Parameters
AbortHandlingCurrentM Causes the current message being handled to
essage() void return to the queue.
Public
Address() string Gets the address at which the transport receives
Public messages.

ChangeNumberOfWorke Changes the number of worker threads running int targetNumberOfWorkerThreads


rThreads() void in the transport. This may stop active worker [in] The requested number of active
Public threads; those threads will finish processing worker threads after the necessary
their current message and then exit. threads have been stopped or
started.

FinishedMessageProcessi Raised after message processing was


ng() EventHandler completed, even in case of an exception in
Public message processing.

GetNumberOfPendingM Access the underlying technology to get the


essages() int number of unhandled messages.
Model Specification Phase 01 Page: 186

Method Notes Parameters


Public
@returns The number of pending messages.

MessageTypesToBeRecei Sets the list of message types to be received by


ved() IList<Type> the transport.
Public
NumberOfWorkerThrea Gets the number of worker threads currently
ds() int running in the transport.
Public
ReceiveMessageLater() Re-queues a message for processing at another TransportMessage m
void time. [in] The message to process later.
Public

Send() void Sends a message to the specified destination. TransportMessage m


Public [in] The message to send.

string destination
[in] The address to send the
message to.

Start() void Starts the transport.


Public
StartedMessageProcessin Raised when a message is available but before
g() EventHandler <see cref="TransportMessageReceived"/> is
Public raised.

TransportMessageReceiv Raised when a message is received at the


ed() transport's <see cref="Address"/>.
EventHandler<TransportM
essageReceivedEventArgs
>
Public

Msmq
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Transport
Detail: Created on 21/12/2008 09:37:33. Last modified on 21/12/2008 09:37:33
GUID: {2836D8B5-5F6A-4ac3-9ED9-AB263E0EA325}

Msmq - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {9751910E-18BB-4772-A74D-D329C9761304}
Model Specification Phase 01 Page: 187

class Msmq

Exception
MsmqTransport
AbortHandlingCurrentMessageException
- _numberOfWorkerThreads: int
- builder: IBuilder
- DIRECTPREFIX: string = "DIRECT=OS:" {readOnly}
- errorQueue: MessageQueue
- errorQueuePath: string
- FAILEDQUEUE: string = "FailedQ" {readOnly}
- failuresPerMessage: IDictionary<string, int> = new Dictionary<... {readOnly}
- failuresPerMessageLocker: ReaderWriterLockSlim = new ReaderWrite... {readOnly}
- headerSerializer: XmlSerializer = new XmlSerializ...
- IDFORCORRELATION: string = "CorrId" {readOnly}
- isolationLevel: IsolationLevel
- isTransactional: bool
- logger: ILog = LogManager.GetL... {readOnly}
- maxRetries: int = 5
- messageSerializer: IMessageSerializer
# modules: List<IMessageModule> = new List<IMessa... {readOnly}
- needToAbort: bool
- PREFIX: string = "FormatName:" +... {readOnly}
- purgeOnStartup: bool = false
- queue: MessageQueue
- secondsToWaitForMessage: int = 10
- skipDeserialization: bool
- transactionTimeout: TimeSpan
- WINDOWSIDENTITYNAME: string = "WinIdName" {readOnly}
- workerThreads: IList<WorkerThread> = new List<Worker... {readOnly}

+ AbortHandlingCurrentMessage() : void
# ActivateEndMethodOnMessageModules() : IList<Exception>
- AddWorkerThread() : WorkerThread
+ ChangeNumberOfWorkerThreads(int) : void
+ Convert(Message) : TransportMessage
+ Dispose() : void
- Extract(Message) : IMessage[]
- FillIdForCorrelationAndWindowsIdentity(TransportMessage, Message) : void
- FillLabel(Message, TransportMessage) : void
- GetExtraTypes(IEnumerable<Type>) : Type[]
+ GetFailedQueue(Message) : string
+ GetFullPath(string) : string
+ GetIndependentAddressForQueue(MessageQueue) : string
+ GetLabelWithoutFailedQueue(Message) : string
+ GetNumberOfPendingMessages() : int
- GetTransactionTypeForReceive() : MessageQueueTransactionType
- GetTransactionTypeForSend() : MessageQueueTransactionType
- MessageHasFailedMaxRetries(Message) : bool
# MoveToErrorQueue(Message) : void
- OnFinishedMessageProcessing() : void
- OnStartedMessageProcessing() : void
+ QueueIsLocal(string) : bool
- Receive() : void
+ ReceiveFromQueue() : void
+ ReceiveMessageLater(TransportMessage) : void
+ Send(TransportMessage, string) : void
- SetLocalQueue(MessageQueue) : void
+ Start() : void
«property»
+ Address() : string
+ Builder() : IBuilder
+ ErrorQueue() : string
+ InputQueue() : string
+ IsolationLevel() : IsolationLevel
+ IsTransactional() : bool
+ MaxRetries() : int
+ MessageSerializer() : IMessageSerializer
+ MessageTypesToBeReceived() : IList<Type>
+ NumberOfWorkerThreads() : int
+ PurgeOnStartup() : bool
+ SecondsToWaitForMessage() : int
+ SkipDeserialization() : bool
+ TransactionTimeout() : TimeSpan
«event»
+ FinishedMessageProcessing() : EventHandler
+ StartedMessageProcessing() : EventHandler
+ TransportMessageReceived() : EventHandler<TransportMessageReceivedEventArgs>
Model Specification Phase 01 Page: 188

Figure: 41

AbortHandlingCurrentMessageException
Type: Class Exception
Status: Proposed. Version 1.0. Phase 1.0.
Package: Msmq Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {8EEE8795-D2E4-4e79-B91C-48051B9B3430}

Custom Properties
 isActive = False

MsmqTransport
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Msmq Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {374CE770-D52C-4c19-A48D-1C1E89395882}

An MSMQ implementation of <see cref="ITransport"/> for use with NServiceBus.

@remark A transport is used by NServiceBus as a high level abstraction from the underlying messaging service
being used to transfer messages.

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private transport
Source -> Destination ConfigMsmqTransport MsmqTransport

Association Public Private builder


Source -> Destination MsmqTransport IBuilder

Association Public Private


Source -> Destination MsmqTransport messageSerializer
IMessageSerializer

Realisation Public Public


Source -> Destination MsmqTransport ITransport
Model Specification Phase 01 Page: 189

Attributes
Attribute Notes Constraints and tags
_numberOfWorkerThrea Default:
ds int
Private

builder IBuilder Default:


Private

DIRECTPREFIX string Default: "DIRECT=OS:"


Private Static Const
"DIRECT=OS:"

errorQueue Default:
MessageQueue
Private

errorQueuePath string Default:


Private

FAILEDQUEUE string Default: "FailedQ"


Private Static Const
"FailedQ"
Model Specification Phase 01 Page: 190

Attribute Notes Constraints and tags


failuresPerMessage Accessed by multiple threads - lock using Default: new Dictionary<string,
IDictionary<string, int> failuresPerMessageLocker. int>()
Private Const new
Dictionary<string, int>()

failuresPerMessageLocke Default: new


r ReaderWriterLockSlim ReaderWriterLockSlim()
Private Const new
ReaderWriterLockSlim()

headerSerializer Default: new


XmlSerializer XmlSerializer(typeof(List<HeaderIn
Private new fo>))
XmlSerializer(typeof(List<
HeaderInfo>))

IDFORCORRELATION Default: "CorrId"


string
Private Static Const
"CorrId"

isolationLevel Default:
IsolationLevel
Private

isTransactional bool Default:


Private
Model Specification Phase 01 Page: 191

Attribute Notes Constraints and tags


logger ILog Default:
Private Static Const LogManager.GetLogger(typeof
LogManager.GetLogger(ty (MsmqTransport))
peof (MsmqTransport))

maxRetries int Default: 5


Private 5

messageSerializer Default:
IMessageSerializer
Private

modules Default: new


List<IMessageModule> List<IMessageModule>()
Protected Const new
List<IMessageModule>()

needToAbort bool Default:


Private Static
[Attribute = [ThreadStatic] ]
[volatile = true ]

PREFIX string Default: "FormatName:" +


Private Static Const DIRECTPREFIX
"FormatName:" +
DIRECTPREFIX
Model Specification Phase 01 Page: 192

Attribute Notes Constraints and tags


purgeOnStartup bool Default: false
Private false

queue MessageQueue Default:


Private

secondsToWaitForMessa Default: 10
ge int
Private 10

skipDeserialization bool Default:


Private

transactionTimeout Default:
TimeSpan
Private

WINDOWSIDENTITYN Default: "WinIdName"


AME string
Private Static Const
"WinIdName"
Model Specification Phase 01 Page: 193

Attribute Notes Constraints and tags


workerThreads Default: new
IList<WorkerThread> List<WorkerThread>()
Private Const new
List<WorkerThread>()

Operations
Method Notes Parameters
AbortHandlingCurrentM
essage() void
Public
ActivateEndMethodOnM
essageModules()
IList<Exception>
Protected
Address() string Gets the address of the input queue.
Public
AddWorkerThread()
WorkerThread
Private
Builder() IBuilder
Public
ChangeNumberOfWorke int targetNumberOfWorkerThreads
rThreads() void [in]
Public

Convert() Converts an MSMQ <see cref="Message"/> Message m


TransportMessage into an NServiceBus message. [in] The MSMQ message to
Public convert.
@returns An NServiceBus message.

Dispose() void Stops all worker threads and disposes the


Public MSMQ queue.

ErrorQueue() string Sets the path to the queue the transport will
Public transfer errors to.

Extract() IMessage Extracts the messages from an MSMQ <see Message message
Private cref="Message"/>. [in] The MSMQ message to extract
from.
@returns An array of handleable messages.

Static TransportMessage result


FillIdForCorrelationAnd [in]
WindowsIdentity() void
Private Message m
[in]

Static FillLabel() void Message toSend


Model Specification Phase 01 Page: 194

Method Notes Parameters


Private [in]

TransportMessage m
[in]

FinishedMessageProcessi
ng() EventHandler
Public
Static GetExtraTypes() Get a list of serializable types from the list of IEnumerable<Type> value
Type types provided. [in] A list of types process.
Private
@returns A list of serializable types.

Static GetFailedQueue() Message m


string [in]
Public

Static GetFullPath() string Turns a '@' separated value into a full msmq string value
Public path. Format is 'queue@machine'. [in]

@returns

Static MessageQueue q
GetIndependentAddressF [in]
orQueue() string
Public
Static Message m
GetLabelWithoutFailedQ [in]
ueue() string
Public
GetNumberOfPendingM
essages() int
Public
GetTransactionTypeFor Gets the transaction type to use when receiving
Receive() a message from the queue.
MessageQueueTransaction
Type @returns The transaction type to use.
Private
GetTransactionTypeForS Gets the transaction type to use when sending a
end() message.
MessageQueueTransaction
Type @returns The transaction type to use.
Private
InputQueue() string Sets the path to the queue the transport will
Public read from. Only specify the name of the queue
- msmq specific address not required. When
using MSMQ v3, only local queues are
supported.

IsolationLevel() Property for getting/setting the isolation level


IsolationLevel of the transaction scope. Only relevant when
Public <see cref="IsTransactional"/> is set to true.

IsTransactional() bool Sets whether or not the transport is


Model Specification Phase 01 Page: 195

Method Notes Parameters


Public transactional.

MaxRetries() int Sets the maximum number of times a message


Public will be retried when an exception is thrown as a
result of handling the message. This value is
only relevant when <see
cref="IsTransactional"/> is true.

@remark Default value is 5.

MessageHasFailedMaxRe Message m
tries() bool [in]
Private

MessageSerializer() Sets the object which will be used to serialize


IMessageSerializer and deserialize messages.
Public
MessageTypesToBeRecei Sets a list of the message types the transport
ved() IList<Type> will receive.
Public
MoveToErrorQueue() Message m
void [in]
Protected

NumberOfWorkerThrea Gets/sets the number of concurrent threads that


ds() int should be created for processing the queue.
Public Get returns the actual number of running
worker threads, which may be different than
the originally configured value. When used as
a setter, this value will be used by the <see
cref="Start"/> method only and will have no
effect if called afterwards. To change the
number of worker threads at runtime, call <see
cref="ChangeNumberOfWorkerThreads"/>.

OnFinishedMessageProce
ssing() void
Private
OnStartedMessageProces
sing() void
Private
PurgeOnStartup() bool Sets whether or not the transport should purge
Public the input queue when it is started.

Static QueueIsLocal() Checks whether or not a queue is local by its string value
bool path. [in] The path to the queue to check.
Public
@returns true if the queue is local, otherwise
false.

Receive() void Waits for a message to become available on the


Private input queue and then receives it.

@remark If the queue is transactional the


receive operation will be wrapped in a
Model Specification Phase 01 Page: 196

Method Notes Parameters


transaction.

ReceiveFromQueue() Receives a message from the input queue.


void
Public @remark If a message is received the <see
cref="TransportMessageReceived"/> event will
be raised.

ReceiveMessageLater() Re-queues a message for processing at another TransportMessage m


void time. [in] The message to process later.
Public
@remark This method will place the message
onto the back of the queue which may break
message ordering.

SecondsToWaitForMessa Sets the maximum interval of time for when a


ge() int thread thinks there is a message in the queue
Public that it tries to receive, until it gives up.
Default value is 10.

Send() void Sends a message to the specified destination. TransportMessage m


Public [in] The message to send.

string destination
[in] The address of the destination
to send the message to.

SetLocalQueue() void Sets the queue on the transport to the specified MessageQueue q
Private MSMQ queue. [in] The MSMQ queue to set.

SkipDeserialization() bool Sets whether or not the transport should


Public deserialize the body of the message placed on
the queue.

Start() void Starts the transport.


Public
StartedMessageProcessin
g() EventHandler
Public
TransactionTimeout() Property for getting/setting the period of time
TimeSpan when the transaction times out. Only relevant
Public when <see cref="IsTransactional"/> is set to
true.

TransportMessageReceiv Event raised when a message has been received


ed() in the input queue.
EventHandler<TransportM
essageReceivedEventArgs
>
Public
Model Specification Phase 01 Page: 197

Config
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Msmq
Detail: Created on 21/12/2008 09:37:33. Last modified on 21/12/2008 09:37:33
GUID: {211C09BB-292D-4767-AA5F-6B1D1F3E6580}

Config - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {CAE6B4A2-B572-4876-BA95-6D210058126A}

class Config

Configure
ConfigMsmqTransport

- transport: MsmqTransport

+ ConfigMsmqTransport()
+ Configure(Configure) : void
+ IsolationLevel(IsolationLevel) : ConfigMsmqTransport
+ IsTransactional(bool) : ConfigMsmqTransport
+ PurgeOnStartup(bool) : ConfigMsmqTransport
+ TransactionTimeout(TimeSpan) : ConfigMsmqTransport

Figure: 42

ConfigMsmqTransport
Type: Class Configure
Status: Proposed. Version 1.0. Phase 1.0.
Package: Config Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {F1DB3D70-DFAA-48c9-A6B8-E3A4A6DF5236}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private transport
Source -> Destination ConfigMsmqTransport MsmqTransport

Generalization Public Public


Model Specification Phase 01 Page: 198

Connector Source Target Notes


Source -> Destination ConfigMsmqTransport Configure

Attributes
Attribute Notes Constraints and tags
transport MsmqTransport Default:
Private

Operations
Method Notes Parameters
ConfigMsmqTransport()
Public
Configure() void Configure config
Public [in]

IsolationLevel() IsolationLevel isolationLevel


ConfigMsmqTransport [in]
Public

IsTransactional() bool value


ConfigMsmqTransport [in]
Public

PurgeOnStartup() bool value


ConfigMsmqTransport [in]
Public

TransactionTimeout() TimeSpan transactionTimeout


ConfigMsmqTransport [in]
Public

Utils
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus
Detail: Created on 21/12/2008 09:37:55. Last modified on 21/12/2008 09:37:55
GUID: {B85BB387-5936-468e-A95E-CCE9484850A5}

Utils - (Logical diagram)


Model Specification Phase 01 Page: 199

Created By: on 21/12/2008


Last Modified: 21/12/2008
Version: 1.0. False
GUID: {F301F390-008A-455e-9C43-0C319147BFED}

class Utils

WorkerThread TransactionWrapper

- _stopRequested: bool + RunInTransaction(Callback) : void


- _toLock: object = new object() {readOnly} + RunInTransaction(Callback, IsolationLevel, TimeSpan) : void
- log: ILog = LogManager.GetL... {readOnly}
- methodToRunInLoop: Callback {readOnly}
- thread: Thread {readOnly}

# Loop() : void
+ Start() : void
+ Stop() : void
+ WorkerThread(Callback)
«event»
+ Stopped() : EventHandler
«property»
# StopRequested() : bool

Figure: 43

TransactionWrapper
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Utils Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {92C8663D-A984-4a63-AFFB-DCDEF0F02157}

Provides functionality for executing a callback in a transaction.

Custom Properties
 isActive = False

Operations
Method Notes Parameters
RunInTransaction() void Executes the provided delegate method in a Callback callback
Public transaction. [in] The delegate method to call.

RunInTransaction() void Executes the provided delegate method in a Callback callback


Public transaction. [in] The delegate method to call.

IsolationLevel isolationLevel
[in] The isolation level of the
transaction.
Model Specification Phase 01 Page: 200

Method Notes Parameters

TimeSpan transactionTimeout
[in] The timeout period of the
transaction.

WorkerThread
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Utils Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {15EC6C88-8CEB-4977-828A-86AC04905F00}

Represents a worker thread that will repeatedly execute a callback.

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Association Public Private
Source -> Destination WorkerThread methodToRunInLoop
Callback

Attributes
Attribute Notes Constraints and tags
_stopRequested bool Default:
Private
[volatile = true ]

_toLock object Default: new object()


Private Const new
object()
Model Specification Phase 01 Page: 201

Attribute Notes Constraints and tags


log ILog Default:
Private Static Const LogManager.GetLogger(typeof(Wo
LogManager.GetLogger(ty rkerThread))
peof(WorkerThread))

methodToRunInLoop Default:
Callback
Private Const

thread Thread Default:


Private Const

Operations
Method Notes Parameters
Loop() void Executes the delegate method until the <see
Protected cref="Stop"/> method is called.

Start() void Starts the worker thread.


Public
Stop() void Stops the worker thread.
Public
Stopped() EventHandler
Public
StopRequested() bool Gets whether or not a stop request has been
Protected received.

WorkerThread() Initializes a new WorkerThread for the Callback methodToRunInLoop


Public specified method to run. [in] The delegate method to execute
in a loop.

ObjectBuilder
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus_Source
Model Specification Phase 01 Page: 202

Detail: Created on 21/12/2008 09:37:40. Last modified on 21/12/2008 09:37:40


GUID: {1072400E-7D2D-4d0f-AE4E-924B88813E62}

ObjectBuilder - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {036E554E-1D2D-41dc-AC80-5C453858832C}

class Obj ectBuilder

«interface»
IBuilder

+ Build(Type) : object
+ Build() : T
+ BuildAll() : IEnumerable<T>
+ BuildAll(Type) : IEnumerable<object>
+ BuildAndDispatch(Type, Action<object>) : void

«interface»
IConfigureComponents
+ ConfigureComponent(Type, ComponentCallModelEnum) : IComponentConfig
+ ConfigureComponent(ComponentCallModelEnum) : T

«interface»
IComponentConfig
+ ConfigureProperty(string, object) : IComponentConfig

«enumeration»
ComponentCallModelEnum

None
Singleton
Singlecall

Figure: 44

ComponentCallModelEnum
Type: Enumeration
Model Specification Phase 01 Page: 203

Status: Proposed. Version 1.0. Phase 1.0.


Package: ObjectBuilder Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {60219E3E-DF24-4dd1-BF59-B0DD7CF31263}

Custom Properties
 isActive = False

Attributes
Attribute Notes Constraints and tags
None Default:
Public

Singleton Default:
Public

Singlecall Default:
Public

IBuilder
Type: Interface
Status: Proposed. Version 1.0. Phase 1.0.
Package: ObjectBuilder Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {23E330CA-F5BA-4d34-A14B-8D8B6EEAC5EE}
Model Specification Phase 01 Page: 204

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination CommonObjectBuilder IBuilder

Association Public Private builderStatic


Source -> Destination Configure IBuilder

Association Public Private builder


Source -> Destination SagaMessageHandler IBuilder

Association Public Private builder


Source -> Destination UnicastBus IBuilder

Association Public Private builder


Source -> Destination MsmqTransport IBuilder

Operations
Method Notes Parameters
Build() object Creates an instance of the given type, injecting Type typeToBuild
Public it with all defined dependencies. [in]

@returns

Build() T Creates an instance of the given type, injecting


Public it with all defined dependencies.

@returns

BuildAll() For each type that is compatible with T, an


IEnumerable<T> instance is created with all dependencies
Public injected, and yeilded to the caller.

@returns

BuildAll() For each type that is compatible with the given Type typeToBuild
IEnumerable<object> type, an instance is created with all [in]
Public dependencies injected.

@returns

BuildAndDispatch() void Builds an instance of the defined type injecting Type typeToBuild
Public it with all defined dependencies and invokes [in]
the given action on the instance.
Action<object> action
[in]

IComponentConfig
Type: Interface
Model Specification Phase 01 Page: 205

Status: Proposed. Version 1.0. Phase 1.0.


Package: ObjectBuilder Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {709F9877-F32D-4e31-A4C5-C3534A1FB59C}

Connections
Connector Source Target Notes
Association Public Private
Source -> Destination RecordPropertySet componentConfig
IComponentConfig

Realisation Public Public


Source -> Destination ConfigureComponentA IComponentConfig
dapter

Realisation Public Public


Source -> Destination ComponentConfig IComponentConfig

Association Public Private config


Source -> Destination ConfigAdvice IComponentConfig

Operations
Method Notes Parameters
ConfigureProperty() string name
IComponentConfig [in]
Public
object value
[in]

IConfigureComponents
Type: Interface
Status: Proposed. Version 1.0. Phase 1.0.
Package: ObjectBuilder Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {5504DBDE-DEB7-418d-A7AD-11D8A9E70913}

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination CommonObjectBuilder IConfigureComponents
Model Specification Phase 01 Page: 206

Connector Source Target Notes


Association Public Private configurer
Source -> Destination Configure IConfigureComponents

Operations
Method Notes Parameters
ConfigureComponent() Configures the given type. Can be used to Type concreteComponent
IComponentConfig configure all kinds of properties. [in]
Public
@returns ComponentCallModelEnum
callModel
[in] Defines whether the type should
have singleton or single call
sematnics.

ConfigureComponent() T Configures the given type. Can only be used to ComponentCallModelEnum


Public configure virtual properties. callModel
[in] Defines whether the type should
@returns An instance of type T. have singleton or single call
sematnics.

ReturnToSourceQueue
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus_Source
Detail: Created on 21/12/2008 09:37:46. Last modified on 21/12/2008 09:37:46
GUID: {FA210A34-2198-4fdc-99E6-072496974138}

ReturnToSourceQueue - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {CCD696DB-8C87-4a51-A190-B04164461D61}

class ReturnToSourceQueue

Program

- Main(string[]) : void

Figure: 45
Model Specification Phase 01 Page: 207

Program
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: ReturnToSourceQueue Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {EFB80022-5D1C-4efe-B5E8-0A8E00626604}

Custom Properties
 isActive = False

Operations
Method Notes Parameters
Static Main() void string[] args
Private [in]

Timeout
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus_Source
Detail: Created on 21/12/2008 09:37:44. Last modified on 21/12/2008 09:37:44
GUID: {0EDB0309-68FC-4c04-BEE2-C8199B033D6B}

Manager
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Timeout
Detail: Created on 21/12/2008 09:37:44. Last modified on 21/12/2008 09:37:44
GUID: {1F597323-69E0-4fe7-8D25-16F889DB99B6}

Manager - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {E32D7051-EC6A-4b27-82CB-8E0A5B7AADD2}
Model Specification Phase 01 Page: 208

class Manager

Program

- Main() : void

Figure: 46

Program
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Manager Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {E860515E-DADF-40d8-A783-C38EEB097EA3}

Custom Properties
 isActive = False

Operations
Method Notes Parameters
Static Main() void
Private

MessageHandlers
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: Timeout
Detail: Created on 21/12/2008 09:37:45. Last modified on 21/12/2008 09:37:45
GUID: {B9EE7D19-7CE0-4aa1-9D45-F913AF8C516B}

MessageHandlers - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {10412060-919A-4c74-BAE3-BBD97F236A7C}
Model Specification Phase 01 Page: 209

class MessageHandlers

TimeoutMessageHandler

- maxSagaIdsToStore: int = 100


- sagaIdsToClear: List<Guid> = new List<Guid>() {readOnly}

+ Handle(TimeoutMessage) : void
«property»
+ Bus() : IBus
+ MaxSagaIdsToStore() : int

Figure: 47

TimeoutMessageHandler
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: MessageHandlers Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {12951066-2DB2-494d-BAC3-F6A696F0AF00}

Custom Properties
 isActive = False

Connections
Connector Source Target Notes
Realisation Public Public
Source -> Destination TimeoutMessageHandl IMessageHandler
er

Attributes
Attribute Notes Constraints and tags
maxSagaIdsToStore int Default: 100
Private 100
Model Specification Phase 01 Page: 210

Attribute Notes Constraints and tags


sagaIdsToClear Default: new List<Guid>()
List<Guid>
Private Static Const
new List<Guid>()

Operations
Method Notes Parameters
Bus() IBus
Public
Handle() void TimeoutMessage message
Public [in]

MaxSagaIdsToStore() int There are cases when the notification about


Public clearing sagas arrives after the timeout has
already occurred. Since we can't know that we
won't get a timeout message with a given id,
this caps the number that are stored so that
memory doesn't leak. For simplicity, we don't
try to decrease the list in the background. The
default value is 100.

UI
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: NServiceBus_Source
Detail: Created on 21/12/2008 09:37:48. Last modified on 21/12/2008 09:37:48
GUID: {9C0975C0-B7AD-449f-A830-3E3828F5C953}

UI - (Logical diagram)
Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {E6AF13B3-1194-4da2-A8B5-1A93120FEC44}
Model Specification Phase 01 Page: 211

class UI

Form
Program Form1
Form1
- Main() : void - ClearManagedEndpoint: System.Windows.Forms.Button
- ClearWorker: System.Windows.Forms.Button - current: ManagedEndpoint
- components: System.ComponentModel.IContainer = null - endpoints: List<ManagedEndpoint>
- DecreaseWorkerThreads: System.Windows.Forms.Button - worker: Worker
- DeleteManagedEndpoint: System.Windows.Forms.Button
- DeleteWorker: System.Windows.Forms.Button - ClearManagedEndpoint_Click(object, EventArgs) : void
- exitToolStripMenuItem: System.Windows.Forms.ToolStripMenuItem - ClearWorker_Click(object, EventArgs) : void
- fileToolStripMenuItem: System.Windows.Forms.ToolStripMenuItem - DecreaseWorkerThreads_Click(object, EventArgs) : void
- groupBox1: System.Windows.Forms.GroupBox - DeleteManagedEndpoint_Click(object, EventArgs) : void
- groupBox2: System.Windows.Forms.GroupBox - DeleteWorker_Click(object, EventArgs) : void
- IncreaseWorkerThreads: System.Windows.Forms.Button - DoAdd() : void
- label1: System.Windows.Forms.Label - DoUpdate() : void
- label2: System.Windows.Forms.Label - DoWorkerAdd() : void
- label3: System.Windows.Forms.Label - DoWorkerUpdate() : void
- label4: System.Windows.Forms.Label - exitToolStripMenuItem_Click(object, EventArgs) : void
- label5: System.Windows.Forms.Label + Form1()
- ManagedEndpointButton: System.Windows.Forms.Button - Form1_FormClosing(object, FormClosingEventArgs) : void
- ManagedEndpointList: System.Windows.Forms.ListBox - IncreaseWorkerThreads_Click(object, EventArgs) : void
- ManagedEndpointName: System.Windows.Forms.TextBox - ManagedEndpointButton_Click(object, EventArgs) : void
- ManagedEndpointQueue: System.Windows.Forms.TextBox - ManagedEndpointList_SelectedIndexChanged(object, EventArgs) : void
- menuStrip1: System.Windows.Forms.MenuStrip # OnLoad(EventArgs) : void
- MessagesInEndpoint: System.Windows.Forms.Label - PrepareForAdd() : void
- NumberOfWorkerThreads: System.Windows.Forms.Label - PrepareForUpdate() : void
- RefreshNumberOfWorkerThreads: System.Windows.Forms.Button - PrepareWorkerForAdd() : void
- saveToolStripMenuItem: System.Windows.Forms.ToolStripMenuItem - PrepareWorkerForUpdate() : void
- splitContainer1: System.Windows.Forms.SplitContainer - RefreshList() : void
- splitContainer2: System.Windows.Forms.SplitContainer - RefreshNumberOfWorkerThreads_Click(object, EventArgs) : void
- splitContainer3: System.Windows.Forms.SplitContainer - RefreshWorkerList() : void
- timer1: System.Windows.Forms.Timer - saveToolStripMenuItem_Click(object, EventArgs) : void
- WorkerButton: System.Windows.Forms.Button - timer1_Tick(object, EventArgs) : void
- WorkerList: System.Windows.Forms.ListBox - UpdateManagedEndpoint() : void
- WorkerQueue: System.Windows.Forms.TextBox - UpdateWorker() : void
- WorkerButton_Click(object, EventArgs) : void
# Dispose(bool) : void - WorkersList_SelectedIndexChanged(object, EventArgs) : void
- InitializeComponent() : void

Figure: 48

Form1
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: UI Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {770FEA40-013F-4b3e-A1B7-78B8B58D899D}

Custom Properties
 isActive = False

Tagged Values
 partial = true.

Attributes
Attribute Notes Constraints and tags
Model Specification Phase 01 Page: 212

Attribute Notes Constraints and tags


ClearManagedEndpoint Default:
System.Windows.Forms.B
utton
Private

ClearWorker Default:
System.Windows.Forms.B
utton
Private

components Required designer variable. Default: null


System.ComponentModel.I
Container
Private null

DecreaseWorkerThreads Default:
System.Windows.Forms.B
utton
Private

DeleteManagedEndpoint Default:
System.Windows.Forms.B
utton
Private

DeleteWorker Default:
System.Windows.Forms.B
utton
Private
Model Specification Phase 01 Page: 213

Attribute Notes Constraints and tags


exitToolStripMenuItem Default:
System.Windows.Forms.T
oolStripMenuItem
Private

fileToolStripMenuItem Default:
System.Windows.Forms.T
oolStripMenuItem
Private

groupBox1 Default:
System.Windows.Forms.G
roupBox
Private

groupBox2 Default:
System.Windows.Forms.G
roupBox
Private

IncreaseWorkerThreads Default:
System.Windows.Forms.B
utton
Private

label1 Default:
System.Windows.Forms.L
abel
Private
Model Specification Phase 01 Page: 214

Attribute Notes Constraints and tags


label2 Default:
System.Windows.Forms.L
abel
Private

label3 Default:
System.Windows.Forms.L
abel
Private

label4 Default:
System.Windows.Forms.L
abel
Private

label5 Default:
System.Windows.Forms.L
abel
Private

ManagedEndpointButton Default:
System.Windows.Forms.B
utton
Private

ManagedEndpointList Default:
System.Windows.Forms.Li
stBox
Private
Model Specification Phase 01 Page: 215

Attribute Notes Constraints and tags


ManagedEndpointName Default:
System.Windows.Forms.T
extBox
Private

ManagedEndpointQueue Default:
System.Windows.Forms.T
extBox
Private

menuStrip1 Default:
System.Windows.Forms.M
enuStrip
Private

MessagesInEndpoint Default:
System.Windows.Forms.L
abel
Private

NumberOfWorkerThrea Default:
ds
System.Windows.Forms.L
abel
Private

RefreshNumberOfWorke Default:
rThreads
System.Windows.Forms.B
utton
Private
Model Specification Phase 01 Page: 216

Attribute Notes Constraints and tags


saveToolStripMenuItem Default:
System.Windows.Forms.T
oolStripMenuItem
Private

splitContainer1 Default:
System.Windows.Forms.S
plitContainer
Private

splitContainer2 Default:
System.Windows.Forms.S
plitContainer
Private

splitContainer3 Default:
System.Windows.Forms.S
plitContainer
Private

timer1 Default:
System.Windows.Forms.Ti
mer
Private

WorkerButton Default:
System.Windows.Forms.B
utton
Private
Model Specification Phase 01 Page: 217

Attribute Notes Constraints and tags


WorkerList Default:
System.Windows.Forms.Li
stBox
Private

WorkerQueue Default:
System.Windows.Forms.T
extBox
Private

Operations
Method Notes Parameters
Dispose() void Clean up any resources being used. bool disposing
Protected [in] true if managed resources
should be disposed; otherwise, false.

InitializeComponent() Required method for Designer support - do not


void modify the contents of this method with the
Private code editor.

Form1
Type: Class Form
Status: Proposed. Version 1.0. Phase 1.0.
Package: UI Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {47248163-C2AC-4827-AB5A-3B301FED68B7}

Custom Properties
 isActive = False

Tagged Values
 partial = true.

Connections
Model Specification Phase 01 Page: 218

Connector Source Target Notes


Association Public Private current
Source -> Destination Form1 ManagedEndpoint

Association Public Private worker


Source -> Destination Form1 Worker

Attributes
Attribute Notes Constraints and tags
current ManagedEndpoint Default:
Private

endpoints Default:
List<ManagedEndpoint>
Private

worker Worker Default:


Private

Operations
Method Notes Parameters
ClearManagedEndpoint_ object sender
Click() void [in]
Private
EventArgs e
[in]

ClearWorker_Click() object sender


void [in]
Private
EventArgs e
[in]

DecreaseWorkerThreads object sender


Model Specification Phase 01 Page: 219

Method Notes Parameters


_Click() void [in]
Private
EventArgs e
[in]

DeleteManagedEndpoint object sender


_Click() void [in]
Private
EventArgs e
[in]

DeleteWorker_Click() object sender


void [in]
Private
EventArgs e
[in]

DoAdd() void
Private
DoUpdate() void
Private
DoWorkerAdd() void
Private
DoWorkerUpdate() void
Private
exitToolStripMenuItem_ object sender
Click() void [in]
Private
EventArgs e
[in]

Form1()
Public
Form1_FormClosing() object sender
void [in]
Private
FormClosingEventArgs e
[in]

IncreaseWorkerThreads_ object sender


Click() void [in]
Private
EventArgs e
[in]

ManagedEndpointButton object sender


_Click() void [in]
Private
EventArgs e
Model Specification Phase 01 Page: 220

Method Notes Parameters


[in]

ManagedEndpointList_S object sender


electedIndexChanged() [in]
void
Private EventArgs e
[in]

OnLoad() void EventArgs e


Protected [in]

PrepareForAdd() void
Private
PrepareForUpdate() void
Private
PrepareWorkerForAdd()
void
Private
PrepareWorkerForUpdat
e() void
Private
RefreshList() void
Private
RefreshNumberOfWorke object sender
rThreads_Click() void [in]
Private
EventArgs e
[in]

RefreshWorkerList() void
Private
saveToolStripMenuItem_ object sender
Click() void [in]
Private
EventArgs e
[in]

timer1_Tick() void object sender


Private [in]

EventArgs e
[in]

UpdateManagedEndpoin
t() void
Private
UpdateWorker() void
Private
Model Specification Phase 01 Page: 221

Method Notes Parameters


WorkerButton_Click() object sender
void [in]
Private
EventArgs e
[in]

WorkersList_SelectedInd object sender


exChanged() void [in]
Private
EventArgs e
[in]

Program
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: UI Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {D81E70A5-69D5-4474-BAA0-9F3C3989A2CF}

Custom Properties
 isActive = False

Tagged Values
 static = true.

Operations
Method Notes Parameters
Static Main() void The main entry point for the application.
Private

Properties
Type: Package
Status: Proposed. Version 1.0. Phase 1.0.
Package: UI
Detail: Created on 21/12/2008 09:37:48. Last modified on 21/12/2008 09:37:48
GUID: {4915399E-52E7-4385-BEDB-B386632DA721}
Model Specification Phase 01 Page: 222

Properties - (Logical diagram)


Created By: on 21/12/2008
Last Modified: 21/12/2008
Version: 1.0. False
GUID: {E19FE593-1EC7-449c-BB73-88645483C96A}

class Properties

Resources System.Configuration.ApplicationSettingsBase
- resourceCulture: global::System.Globalization.CultureInfo Settings
-defaultInstance
{leaf}
- resourceMan: global::System.Resources.ResourceManager

- defaultInstance: Settings = ((Settings)(glo...


~ Resources()
«property»
«property»
~ Culture() : global::System.Globalization.CultureInfo
+ Default() : Settings
~ ResourceManager() : global::System.Resources.ResourceManager

Figure: 49

Resources
Type: Class
Status: Proposed. Version 1.0. Phase 1.0.
Package: Properties Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {B5EE841B-90C8-403b-AE1E-5F19AB194FB0}

A strongly-typed resource class, for looking up localized strings, etc.

Custom Properties
 isActive = False

Tagged Values
 Attribute =
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedRe
sourceBuilder",
"2.0.0.0")];[global::System.Diagnostics.DebuggerNonUserCodeAttribute()];[global::System.Runtime.Com
pilerServices.CompilerGeneratedAttribute()].

Attributes
Attribute Notes Constraints and tags
resourceCulture Default:
global::System.Globalizati
on.CultureInfo
Private Static
Model Specification Phase 01 Page: 223

Attribute Notes Constraints and tags


resourceMan Default:
global::System.Resources.
ResourceManager
Private Static

Operations
Method Notes Parameters
Static Culture() Overrides the current thread's CurrentUICulture
global::System.Globalizati property for all resource lookups using this
on.CultureInfo strongly typed resource class.
Internal
Static ResourceManager() Returns the cached ResourceManager instance
global::System.Resources. used by this class.
ResourceManager
Internal
Resources()
Internal

Settings
Type: Class System.Configuration.ApplicationSettingsBase
Status: Proposed. Version 1.0. Phase 1.0.
Package: Properties Keywords:
Detail: Created on 21/12/2008. Last modified on.21/12/2008.
GUID: {C37490F4-DCF6-4af3-981D-FA8BB83E8BCA}

Custom Properties
 isActive = False

Tagged Values
 Attribute =
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()];[global::System.CodeDom.Co
mpiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGene
rator", "9.0.0.0")].
 partial = true.

Connections
Connector Source Target Notes
Association Public Private defaultInstance
Source -> Destination Settings Settings
Model Specification Phase 01 Page: 224

Connector Source Target Notes

Attributes
Attribute Notes Constraints and tags
defaultInstance Settings Default:
Private Static ((Settings)(global::System.Configur
((Settings)(global::System. ation.ApplicationSettingsBase.Sync
Configuration.Application hronized(new Settings())))
SettingsBase.Synchronized
(new Settings())))

Operations
Method Notes Parameters
Static Default() Settings
Public

Оценить