2016-12-11 14:08:58 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Reflection;
|
2017-01-31 11:01:08 +00:00
|
|
|
|
using System.Threading.Tasks;
|
2016-12-11 14:08:58 +00:00
|
|
|
|
|
|
|
|
|
namespace Tapeti.Config
|
|
|
|
|
{
|
|
|
|
|
public delegate object ValueFactory(IMessageContext context);
|
2017-01-31 11:01:08 +00:00
|
|
|
|
public delegate Task ResultHandler(IMessageContext context, object value);
|
2016-12-11 14:08:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public interface IBindingContext
|
|
|
|
|
{
|
|
|
|
|
Type MessageClass { get; set; }
|
2017-01-31 11:01:08 +00:00
|
|
|
|
|
|
|
|
|
MethodInfo Method { get; }
|
2016-12-11 14:08:58 +00:00
|
|
|
|
IReadOnlyList<IBindingParameter> Parameters { get; }
|
2017-01-31 11:01:08 +00:00
|
|
|
|
IBindingResult Result { get; }
|
|
|
|
|
|
|
|
|
|
void Use(IBindingFilter filter);
|
|
|
|
|
void Use(IMessageMiddleware middleware);
|
2016-12-11 14:08:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public interface IBindingParameter
|
|
|
|
|
{
|
|
|
|
|
ParameterInfo Info { get; }
|
|
|
|
|
bool HasBinding { get; }
|
|
|
|
|
|
|
|
|
|
void SetBinding(ValueFactory valueFactory);
|
|
|
|
|
}
|
2017-01-31 11:01:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public interface IBindingResult
|
|
|
|
|
{
|
|
|
|
|
ParameterInfo Info { get; }
|
|
|
|
|
bool HasHandler { get; }
|
|
|
|
|
|
|
|
|
|
void SetHandler(ResultHandler resultHandler);
|
|
|
|
|
}
|
2016-12-11 14:08:58 +00:00
|
|
|
|
}
|