Service
Type parameters
▪ T: SuperConstructor
▪ T: SuperConstructor
Hierarchy
SuperPrototypeSelector‹CommandHandlingMixin | EventHandlingMixin, this› & CommandHandlingMixin‹this› & EventHandlingMixin‹this›
SuperPrototypeSelector‹CommandHandlingMixin | EventHandlingMixin, this› & CommandHandlingMixin‹this› & EventHandlingMixin‹this›
↳ Service
Implements
- Controller
- Sender
- Controller
- Publisher
- Controller
- Sender
- Controller
- Publisher
Index
Constructors
Properties
Methods
- ensureHandleability
- getHandleableTypes
- getHandled
- getHandledCommands
- getHandledEvents
- getHandledMessages
- getHandledTypes
- getHandledTypesNames
- getHandler
- getHandlerOrThrow
- getHandlers
- getSubscribedEvents
- getTypeByHandler
- handle
- handles
- hasHandler
- initialize
- isHandleabe
- on
- overrideHandler
- publish
- registerCommandHandler
- registerEventHandler
- registerHandler
- removeHandler
- send
- setHandleableTypes
- subscribeTo
- subscribes
Constructors
constructor
+ new Service(): Service
Inherited from HandlingMixin.constructor
Overrides HandlingMixin.constructor
Returns: Service
Properties
commandBus
• commandBus: CommandBus
Overrides CommandHandlingMixin.commandBus
eventBus
• eventBus: EventBus
Overrides EventHandlingMixin.eventBus
Methods
ensureHandleability
▸ ensureHandleability(messageType
: MessageType‹Message›, handleableTypes?
: MessageType‹Message› | MessageType‹Message›[]): boolean
Implementation of Publisher
Inherited from HandlingMixin.ensureHandleability
Overrides HandlingMixin.ensureHandleability
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
handleableTypes? | MessageType‹Message› | MessageType‹Message›[] |
Returns: boolean
getHandleableTypes
▸ getHandleableTypes(): MessageType‹Message›[]
Implementation of Publisher
Inherited from HandlingMixin.getHandleableTypes
Overrides HandlingMixin.getHandleableTypes
Returns: MessageType‹Message›[]
getHandled
▸ getHandled(messageType
: MessageType‹Message›): MessageType‹Message›[]
Implementation of Publisher
Inherited from HandlingMixin.getHandled
Overrides HandlingMixin.getHandled
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
Returns: MessageType‹Message›[]
getHandledCommands
▸ getHandledCommands(): MessageType‹Command›[]
Inherited from HandlingMixin.getHandledCommands
Overrides HandlingMixin.getHandledCommands
Returns: MessageType‹Command›[]
getHandledEvents
▸ getHandledEvents(): MessageType‹Event›[]
Inherited from HandlingMixin.getHandledEvents
Overrides HandlingMixin.getHandledEvents
Returns: MessageType‹Event›[]
getHandledMessages
▸ getHandledMessages(): MessageType‹Message›[]
Inherited from HandlingMixin.getHandledMessages
Overrides HandlingMixin.getHandledMessages
Returns: MessageType‹Message›[]
getHandledTypes
▸ getHandledTypes(): MessageType‹Message›[]
Implementation of Publisher
Inherited from HandlingMixin.getHandledTypes
Overrides HandlingMixin.getHandledTypes
Returns: MessageType‹Message›[]
getHandledTypesNames
▸ getHandledTypesNames(): TypeName[]
Inherited from HandlingMixin.getHandledTypesNames
Overrides HandlingMixin.getHandledTypesNames
Returns: TypeName[]
getHandler
▸ getHandler(messageType
: MessageType‹Message›): Handler | undefined
Implementation of Publisher
Inherited from OneToOneHandlingMixin.getHandler
Overrides OneToManyHandlingMixin.getHandler
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
Returns: Handler | undefined
getHandlerOrThrow
▸ getHandlerOrThrow(messageType
: MessageType‹Message›): Handler
Implementation of Publisher
Inherited from OneToOneHandlingMixin.getHandlerOrThrow
Overrides OneToManyHandlingMixin.getHandlerOrThrow
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
Returns: Handler
getHandlers
▸ getHandlers(): Map‹MessageType‹Message›, Handler | Handler[]›
Implementation of Publisher
Inherited from HandlingMixin.getHandlers
Overrides HandlingMixin.getHandlers
Returns: Map‹MessageType‹Message›, Handler | Handler[]›
getSubscribedEvents
▸ getSubscribedEvents(): MessageType‹Event›[]
Inherited from EventHandlingMixin.getSubscribedEvents
Overrides void
Returns: MessageType‹Event›[]
getTypeByHandler
▸ getTypeByHandler(handlerReference
: Handler): any | undefined
Inherited from OneToOneHandlingMixin.getTypeByHandler
Overrides OneToManyHandlingMixin.getTypeByHandler
Parameters:
Name | Type |
---|---|
handlerReference | Handler |
Returns: any | undefined
handle
▸ handle(message
: Message): Promise‹any›
Inherited from OneToOneHandlingMixin.handle
Overrides OneToManyHandlingMixin.handle
Parameters:
Name | Type |
---|---|
message | Message |
Returns: Promise‹any›
handles
▸ handles(): Map‹MessageType‹Command›, Handler›
Implementation of Publisher
Inherited from HandlingMixin.handles
Overrides HandlingMixin.handles
Returns: Map‹MessageType‹Command›, Handler›
hasHandler
▸ hasHandler(messageType
: MessageType‹Message›): boolean
Implementation of Publisher
Inherited from HandlingMixin.hasHandler
Overrides HandlingMixin.hasHandler
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
Returns: boolean
initialize
▸ initialize(): void
Implementation of Publisher
Overrides CommandHandlingMixin.initialize
Initializes Service.
Returns: void
isHandleabe
▸ isHandleabe(messageType
: MessageType‹Message›, handleableTypes?
: MessageType‹Message› | MessageType‹Message›[]): boolean
Inherited from HandlingMixin.isHandleabe
Overrides HandlingMixin.isHandleabe
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
handleableTypes? | MessageType‹Message› | MessageType‹Message›[] |
Returns: boolean
on
▸ on(event
: Event): Promise‹void›
Inherited from EventHandlingMixin.on
Overrides void
Parameters:
Name | Type |
---|---|
event | Event |
Returns: Promise‹void›
overrideHandler
▸ overrideHandler(messageType
: MessageType‹Message›, handler
: Handler): void
Implementation of Publisher
Inherited from HandlingMixin.overrideHandler
Overrides HandlingMixin.overrideHandler
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
handler | Handler |
Returns: void
publish
▸ publish(event
: Event): Promise‹void›
Implementation of Publisher
Inherited from EventHandlingMixin.publish
Overrides void
Parameters:
Name | Type |
---|---|
event | Event |
Returns: Promise‹void›
registerCommandHandler
▸ registerCommandHandler(commandType
: MessageType‹Command›, handler
: Handler, shouldOverride?
: boolean): void
Inherited from CommandHandlingMixin.registerCommandHandler
Overrides void
Parameters:
Name | Type |
---|---|
commandType | MessageType‹Command› |
handler | Handler |
shouldOverride? | boolean |
Returns: void
registerEventHandler
▸ registerEventHandler(eventType
: MessageType‹Event›, handler
: Handler, shouldOverride?
: boolean): void
Inherited from EventHandlingMixin.registerEventHandler
Overrides void
Parameters:
Name | Type |
---|---|
eventType | MessageType‹Event› |
handler | Handler |
shouldOverride? | boolean |
Returns: void
registerHandler
▸ registerHandler(messageType
: MessageType‹Message›, handler
: Handler, shouldOverride?
: boolean): void
Implementation of Publisher
Inherited from OneToOneHandlingMixin.registerHandler
Overrides HandlingMixin.registerHandler
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
handler | Handler |
shouldOverride? | boolean |
Returns: void
removeHandler
▸ removeHandler(messageType
: MessageType‹Message›): void
Implementation of Publisher
Inherited from HandlingMixin.removeHandler
Overrides HandlingMixin.removeHandler
Parameters:
Name | Type |
---|---|
messageType | MessageType‹Message› |
Returns: void
send
▸ send(command
: Command): Promise‹any›
Implementation of Sender
Inherited from CommandHandlingMixin.send
Overrides void
Parameters:
Name | Type |
---|---|
command | Command |
Returns: Promise‹any›
setHandleableTypes
▸ setHandleableTypes(handleableTypes
: MessageType‹Message› | MessageType‹Message›[]): void
Implementation of Publisher
Inherited from HandlingMixin.setHandleableTypes
Overrides HandlingMixin.setHandleableTypes
Parameters:
Name | Type |
---|---|
handleableTypes | MessageType‹Message› | MessageType‹Message›[] |
Returns: void
subscribeTo
▸ subscribeTo(eventType
: MessageType‹Event›, handler
: Handler, shouldOverride?
: boolean): void
Inherited from EventHandlingMixin.subscribeTo
Overrides void
Parameters:
Name | Type |
---|---|
eventType | MessageType‹Event› |
handler | Handler |
shouldOverride? | boolean |
Returns: void
subscribes
▸ subscribes(): Map‹MessageType‹Event›, Handler›
Implementation of Publisher
Inherited from HandlingMixin.subscribes
Overrides HandlingMixin.subscribes
Returns: Map‹MessageType‹Event›, Handler›