コード例 #1
0
 public DiscoveryService(
     UniqueId id,
     ITransportConnection transportConnection,
     IProtocolImplementation protocol)
 {
     _log = LogManager.GetLogger <DiscoveryService>(id.ToString());
     _transportConnection = transportConnection;
     _protocol            = protocol;
 }
コード例 #2
0
 public DiscoveryRequestHandler(
     IAppLifecycleManager connectionTracker,
     IProtocolImplementation protocol,
     IRegistryService registryService)
 {
     _connectionTracker = connectionTracker;
     _protocol          = protocol;
     _registryService   = registryService;
 }
コード例 #3
0
 public OutcomingInvocationFactory(
     [NotNull] ITransportConnection connection,
     [NotNull] IProtocolImplementation protocol,
     [NotNull] IMarshallerProvider marshaller)
 {
     _connection = connection ?? throw new ArgumentNullException(nameof(connection));
     _protocol   = protocol ?? throw new ArgumentNullException(nameof(protocol));
     _marshaller = marshaller ?? throw new ArgumentNullException(nameof(marshaller));
 }
コード例 #4
0
 public AuthenticationHandler(
     IAppLifecycleManager connectionTracker,
     IProtocolImplementation protocol,
     IRegistryService registryService)
 {
     _messageFactory    = protocol.MessageFactory;
     _serializer        = protocol.Serializer;
     _connectionTracker = connectionTracker;
     _registryService   = registryService;
 }
コード例 #5
0
 public DiscoveryRequestHandler(
     IAppLifecycleManager appLifecycleManager,
     IProtocolImplementation protocol,
     IRegistryService registryService,
     IContextLinkageManager contextLinkageManager)
 {
     _appLifecycleManager   = appLifecycleManager;
     _protocol              = protocol;
     _registryService       = registryService;
     _contextLinkageManager = contextLinkageManager;
 }
コード例 #6
0
 public InvocationRequestHandler(
     IClientConnectionTracker clientConnectionTracker,
     IProtocolImplementation protocol,
     IRegistryService registryService)
 {
     _clientConnectionTracker        = clientConnectionTracker;
     _protocolMessageFactory         = protocol.MessageFactory;
     _protocolSerializer             = protocol.Serializer;
     _registryService                = registryService;
     _createRequestHandler           = new InvocationTargetHandler <IInvocationStartRequested, IClientConnection>(CreateInvocationTarget, CreateInvocationTarget);
     _resolveTargetConnectionHandler = new InvocationTargetHandler <ValueTask <IClientConnection>, IClientConnection>(ResolveTargetConnectionAsync, ResolveTargetConnectionAsync);
 }
コード例 #7
0
 public InvocationRequestHandler(
     IAppLifecycleManager appLifecycleManager,
     IProtocolImplementation protocol,
     IRegistryService registryService)
 {
     _appLifecycleManager            = appLifecycleManager;
     _protocolMessageFactory         = protocol.MessageFactory;
     _protocolSerializer             = protocol.Serializer;
     _registryService                = registryService;
     _createRequestHandler           = new InvocationTargetHandler <IInvocationStartRequested, IAppConnection>(CreateInvocationTarget, CreateInvocationTarget);
     _resolveTargetConnectionHandler = new InvocationTargetHandler <ValueTask <IAppConnection>, IAppConnection>(ResolveTargetConnectionAsync, ResolveTargetConnectionAsync);
     _stopwatch.Start();
 }
コード例 #8
0
 public OutcomingInvocation(
     OutcomingInvocationDescriptor descriptor,
     ITransportChannel channel,
     IProtocolImplementation protocol,
     IMarshaller <TRequest> requestMarshaller,
     IMarshaller <TResponse> responseMarshaller)
     : base(channel, protocol, requestMarshaller, responseMarshaller)
 {
     _channel  = channel;
     _log      = LogManager.GetLogger <OutcomingInvocation <TRequest, TResponse> >(_channel.Id.ToString());
     Info      = descriptor;
     _protocol = protocol;
 }
コード例 #9
0
ファイル: Invocation.cs プロジェクト: yamiacat/plexus-interop
 protected Invocation(
     ITransportChannel channel,
     IProtocolImplementation protocol,
     IMarshaller <TRequest> requestMarshaller,
     IMarshaller <TResponse> responseMarshaller)
 {
     _log      = LogManager.GetLogger <Invocation <TRequest, TResponse> >(channel.Id.ToString());
     _channel  = channel;
     _sender   = new InvocationSendProcessor <TRequest>(channel.Id, channel.Out, protocol, requestMarshaller, _invocationState);
     _receiver = new InvocationReceiveProcessor <TResponse>(channel.Id, channel.In, protocol, responseMarshaller, _sender, _invocationState);
     _sender.RequestStream.PropagateCompletionFrom(_sender.Completion);
     OnStop(_sender.Stop);
     OnStop(_receiver.Stop);
 }
コード例 #10
0
 internal ClientOptions(
     string applicationId,
     UniqueId applicationInstanceId,
     ITransportClient transport,
     IProtocolImplementation protocol,
     IMarshallerProvider marshaller,
     IEnumerable <ProvidedServiceDefinition> services)
 {
     ApplicationId         = applicationId;
     ApplicationInstanceId = applicationInstanceId;
     Transport             = transport;
     Marshaller            = marshaller;
     Protocol           = protocol;
     Services           = new List <ProvidedServiceDefinition>(services);
     ServicesDictionary = Services.ToDictionary(x => (x.Id, x.Alias), x => x);
 }
コード例 #11
0
 public InvocationRequestHandler(
     IAppLifecycleManager appLifecycleManager,
     IProtocolImplementation protocol,
     IRegistryService registryService,
     IInvocationEventProvider invocationEventProvider,
     IContextLinkageManager contextLinkageManager)
 {
     _appLifecycleManager            = appLifecycleManager;
     _protocolMessageFactory         = protocol.MessageFactory;
     _protocolSerializer             = protocol.Serializer;
     _registryService                = registryService;
     _invocationEventProvider        = invocationEventProvider;
     _contextLinkageManager          = contextLinkageManager;
     _createRequestHandler           = new InvocationTargetHandler <IInvocationStartRequested, IAppConnection>(CreateInvocationTarget, CreateInvocationTarget);
     _resolveTargetConnectionHandler = new InvocationTargetHandler <ValueTask <IAppConnection>, IAppConnection, ITransportChannel, IContextLinkageOptions>(ResolveTargetConnectionAsync, ResolveTargetConnectionAsync);
     _stopwatch.Start();
 }
コード例 #12
0
 public InvocationReceiveProcessor(
     UniqueId id,
     IReadableChannel <TransportMessageFrame> transport,
     IProtocolImplementation protocol,
     IMarshaller <TResponse> marshaller,
     IWritableChannel <IInvocationMessage> sender,
     InvocationState invocationState)
 {
     _log             = LogManager.GetLogger <InvocationReceiveProcessor <TResponse> >(id.ToString());
     _transport       = transport;
     _protocol        = protocol;
     _marshaller      = marshaller;
     _sender          = sender;
     _invocationState = invocationState;
     _incomingHandler = new InvocationMessageHandler <Nothing, Nothing>(
         HandleIncomingMessageHeader,
         HandleIncomingConfirmation,
         HandleIncomingCompletion);
 }
コード例 #13
0
        public IClient Create(
            string appId,
            ITransportClient transport,
            IProtocolImplementation protocol,
            IMarshallerProvider marshaller,
            Func <ClientOptionsBuilder, ClientOptionsBuilder> setup = default)
        {
            var builder = new ClientOptionsBuilder()
                          .WithApplicationId(appId)
                          .WithMarshaller(marshaller)
                          .WithProtocol(protocol)
                          .WithTransport(transport);

            if (setup != default)
            {
                builder = setup(builder);
            }
            return(new Client(builder.Build()));
        }
コード例 #14
0
 public IncomingInvocationFactory(IProtocolImplementation protocol, IMarshallerProvider marshaller)
 {
     _protocol   = protocol;
     _marshaller = marshaller;
 }