2019-08-15 16:00:04 +02:00
|
|
|
|
using System.Reflection;
|
2019-08-15 12:04:03 +02:00
|
|
|
|
using Tapeti.Config;
|
|
|
|
|
|
|
|
|
|
namespace Tapeti.Flow.Default
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Default implementation for IFlowHandlerContext
|
|
|
|
|
/// </summary>
|
|
|
|
|
internal class FlowHandlerContext : IFlowHandlerContext
|
|
|
|
|
{
|
2021-05-29 21:51:58 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// </summary>
|
2022-11-23 09:13:38 +01:00
|
|
|
|
public FlowHandlerContext(ITapetiConfig config, object? controller, MethodInfo method)
|
2019-08-15 12:04:03 +02:00
|
|
|
|
{
|
2022-11-23 09:13:38 +01:00
|
|
|
|
Config = config;
|
|
|
|
|
Controller = controller;
|
|
|
|
|
Method = method;
|
2019-08-15 12:04:03 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-05-29 21:51:58 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// </summary>
|
2021-09-02 16:16:11 +02:00
|
|
|
|
public FlowHandlerContext(IMessageContext source)
|
2019-08-15 12:04:03 +02:00
|
|
|
|
{
|
2022-11-23 09:13:38 +01:00
|
|
|
|
var controllerPayload = source.Get<ControllerMessageContextPayload>();
|
2021-09-02 16:16:11 +02:00
|
|
|
|
|
2019-08-15 12:04:03 +02:00
|
|
|
|
Config = source.Config;
|
2021-09-02 16:16:11 +02:00
|
|
|
|
Controller = controllerPayload.Controller;
|
|
|
|
|
Method = controllerPayload.Binding.Method;
|
|
|
|
|
MessageContext = source;
|
2019-08-15 12:04:03 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public void Dispose()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2022-11-23 09:13:38 +01:00
|
|
|
|
public ITapetiConfig Config { get; }
|
2019-08-15 12:04:03 +02:00
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2022-11-23 09:13:38 +01:00
|
|
|
|
public object? Controller { get; }
|
2019-08-15 12:04:03 +02:00
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2022-11-23 09:13:38 +01:00
|
|
|
|
public MethodInfo Method { get; }
|
2019-08-15 12:04:03 +02:00
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2022-11-23 09:13:38 +01:00
|
|
|
|
public IMessageContext? MessageContext { get; }
|
2019-08-15 12:04:03 +02:00
|
|
|
|
}
|
|
|
|
|
}
|