private void Initialize(FabricTransportRemotingSettings remotingSettings,
                                IServiceRemotingCallbackMessageHandler remotingCallbackMessageHandler,
                                IServicePartitionResolver servicePartitionResolver,
                                IEnumerable <IExceptionHandler> exceptionHandlers,
                                string traceId,
                                IServiceRemotingMessageSerializationProvider serializationProvider,
                                IServiceRemotingMessageHeaderSerializer headerSerializer = null)
        {
            remotingSettings = remotingSettings ?? FabricTransportRemotingSettings.GetDefault();

            if (headerSerializer == null)
            {
                headerSerializer = new ServiceRemotingMessageHeaderSerializer(new BufferPoolManager(remotingSettings.HeaderBufferSize, remotingSettings.HeaderMaxBufferCount));
            }

            var serializersManager = new ServiceRemotingMessageSerializersManager(serializationProvider,
                                                                                  headerSerializer);


            this.Initialize(remotingSettings,
                            remotingCallbackMessageHandler,
                            servicePartitionResolver,
                            exceptionHandlers,
                            traceId,
                            serializersManager.GetSerializationProvider().CreateMessageBodyFactory(),
                            serializersManager);
        }
Ejemplo n.º 2
0
        private static ActorRemotingSerializationManager IntializeSerializationManager(IServiceRemotingMessageSerializationProvider serializationProvider, FabricTransportRemotingSettings settings)
        {
            settings = settings ?? FabricTransportRemotingSettings.GetDefault();

            return(new ActorRemotingSerializationManager(serializationProvider,
                                                         new ActorRemotingMessageHeaderSerializer(settings.HeaderBufferSize, settings.HeaderMaxBufferCount)));
        }
        /// <summary>
        ///     Creates a service remoting client factory to connect to the remoted actor interfaces.
        /// </summary>
        /// <param name="callbackClient">
        ///     Client implementation where the callbacks should be dispatched.
        /// </param>
        /// <returns>
        ///     A <see cref="Microsoft.ServiceFabric.Actors.Remoting.FabricTransport.FabricTransportActorRemotingClientFactory "/>
        ///     as <see cref="Microsoft.ServiceFabric.Services.Remoting.Client.IServiceRemotingClientFactory"/>
        ///     that can be used with <see cref="Microsoft.ServiceFabric.Actors.Client.ActorProxyFactory"/> to
        ///     generate actor proxy to talk to the actor over remoted actor interface.
        /// </returns>
        public override IServiceRemotingClientFactory CreateServiceRemotingClientFactory(
            IServiceRemotingCallbackClient callbackClient)
        {
            var settings = FabricTransportRemotingSettings.GetDefault();

            settings.MaxMessageSize   = this.GetAndValidateMaxMessageSize(settings.MaxMessageSize);
            settings.OperationTimeout = this.GetandValidateOperationTimeout(settings.OperationTimeout);
            settings.KeepAliveTimeout = this.GetandValidateKeepAliveTimeout(settings.KeepAliveTimeout);
            settings.ConnectTimeout   = this.GetConnectTimeout(settings.ConnectTimeout);
            return(new FabricTransportActorRemotingClientFactory(settings, callbackClient));
        }
 public FabricTransportServiceRemotingClientFactoryImpl(
     Remoting.FabricTransport.FabricTransportRemotingSettings fabricTransportRemotingSettings = null,
     IServiceRemotingCallbackClient callbackHandler     = null,
     IServicePartitionResolver servicePartitionResolver = null,
     IEnumerable <IExceptionHandler> exceptionHandlers  = null,
     string traceId = null)
     : base(
         servicePartitionResolver,
         GetExceptionHandlers(exceptionHandlers),
         traceId)
 {
     this.settings = fabricTransportRemotingSettings ?? FabricTransportRemotingSettings.GetDefault();
     this.fabricTransportRemotingCallbackMessageHandler =
         new FabricTransportRemotingCallbackMessageHandler(callbackHandler);
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="remotingSettings"></param>
 /// <param name="remotingCallbackMessageHandler"></param>
 /// <param name="servicePartitionResolver"></param>
 /// <param name="exceptionHandlers"></param>
 /// <param name="traceId"></param>
 /// <param name="serializersManager"></param>
 public FabricTransportServiceRemotingClientFactoryImpl(
     ServiceRemotingMessageSerializersManager serializersManager,
     FabricTransportRemotingSettings remotingSettings,
     IServiceRemotingCallbackMessageHandler remotingCallbackMessageHandler = null,
     IServicePartitionResolver servicePartitionResolver = null,
     IEnumerable <IExceptionHandler> exceptionHandlers  = null,
     string traceId = null)
     : base(
         servicePartitionResolver,
         GetExceptionHandlers(exceptionHandlers),
         traceId)
 {
     this.settings           = remotingSettings ?? FabricTransportRemotingSettings.GetDefault();
     this.serializersManager = serializersManager;
     this.disposer           = new NativeFabricTransportMessageDisposer();
     this.fabricTransportRemotingCallbackMessageHandler = new FabricTransportRemotingCallbackMessageHandler(remotingCallbackMessageHandler, this.serializersManager);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Constructs a fabric transport based actor remoting client factory.
 /// </summary>
 /// <param name="callbackClient">
 ///     The callback client that receives the callbacks from the service.
 /// </param>
 public FabricTransportActorRemotingClientFactory(
     IServiceRemotingCallbackClient callbackClient)
     : this(FabricTransportRemotingSettings.GetDefault(), callbackClient)
 {
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Constructs a fabric transport based actor remoting client factory.
 /// </summary>
 /// <param name="callbackMessageHandler">
 ///     The callback client that receives the callbacks from the service.
 /// </param>
 public FabricTransportActorRemotingClientFactory(
     IServiceRemotingCallbackMessageHandler callbackMessageHandler)
     : this(FabricTransportRemotingSettings.GetDefault(), callbackMessageHandler)
 {
 }