You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Zero/ZeroLevel/Services/Network/Models/ExchangeAttributes.cs

76 lines
2.3 KiB

6 years ago
using System;
namespace ZeroLevel.Network.Microservices
{
public abstract class ExchangeAttribute : Attribute { }
/// <summary>
6 years ago
/// Marks the method that is the default message handler
6 years ago
/// </summary>
public sealed class ExchangeMainHandlerAttribute : ExchangeAttribute { }
/// <summary>
6 years ago
/// Marks the method that is the default message handler
6 years ago
/// </summary>
public sealed class ExchangeMainReplierAttribute : ExchangeAttribute { }
/// <summary>
6 years ago
/// Marks a message handler method for an inbox with the specified name.
6 years ago
/// </summary>
public sealed class ExchangeHandlerAttribute : ExchangeAttribute
{
public string Inbox { get; }
public ExchangeHandlerAttribute(string inbox)
{
this.Inbox = inbox;
}
}
/// <summary>
6 years ago
/// Marks a message handler method for an inbox with the specified name.
6 years ago
/// </summary>
public sealed class ExchangeReplierAttribute : ExchangeAttribute
{
public string Inbox { get; }
public ExchangeReplierAttribute(string inbox)
{
this.Inbox = inbox;
}
}
/// <summary>
6 years ago
/// Marks a message handler method for an inbox with the specified name.
6 years ago
/// </summary>
public sealed class ExchangeMainReplierWithoutArgAttribute : ExchangeAttribute { }
/// <summary>
6 years ago
/// Marks a message handler method for an inbox with the specified name.
6 years ago
/// </summary>
public sealed class ExchangeReplierWithoutArgAttribute : ExchangeAttribute
{
public string Inbox { get; }
public ExchangeReplierWithoutArgAttribute(string inbox)
{
this.Inbox = inbox;
}
}
public class ExchangeServerAttribute : Attribute
{
public string Protocol { get; }
public ExchangeServerAttribute(string protocol)
{
if (string.IsNullOrWhiteSpace(protocol)) throw new ArgumentNullException(nameof(protocol));
this.Protocol = protocol;
}
}
public class ExchangeClientAttribute : Attribute
{
public string Protocol { get; }
public ExchangeClientAttribute(string protocol)
{
if (string.IsNullOrWhiteSpace(protocol)) throw new ArgumentNullException(nameof(protocol));
this.Protocol = protocol;
}
}
}

Powered by TurnKey Linux.