コード例 #1
0
		public static IEndpoint New(CreateEndpointSettings settings)
		{
			try
			{
				Guard.Against.Null(settings.Address, "An address for the endpoint must be specified");
				Guard.Against.Null(settings.ErrorAddress, "An error address for the endpoint must be specified");
				Guard.Against.Null(settings.Serializer, "A message serializer for the endpoint must be specified");

				var transport = new NmsTransport(settings.Address);

				var errorSettings = new CreateEndpointSettings(settings.ErrorAddress, settings);
				ITransport errorTransport = new NmsTransport(errorSettings.Address);

				var endpoint = new NmsEndpoint(settings.Address, settings.Serializer, transport, errorTransport);

				return endpoint;
			}
			catch (Exception ex)
			{
				throw new EndpointException(settings.Address.Uri, "Failed to create NMS endpoint", ex);
			}
		}
コード例 #2
0
        public static IEndpoint New(CreateEndpointSettings settings)
        {
            try
            {
                Guard.Against.Null(settings.Address, "An address for the endpoint must be specified");
                Guard.Against.Null(settings.ErrorAddress, "An error address for the endpoint must be specified");
                Guard.Against.Null(settings.Serializer, "A message serializer for the endpoint must be specified");

                var transport = new NmsTransport(settings.Address);

                var        errorSettings  = new CreateEndpointSettings(settings.ErrorAddress, settings);
                ITransport errorTransport = new NmsTransport(errorSettings.Address);

                var endpoint = new NmsEndpoint(settings.Address, settings.Serializer, transport, errorTransport);

                return(endpoint);
            }
            catch (Exception ex)
            {
                throw new EndpointException(settings.Address.Uri, "Failed to create NMS endpoint", ex);
            }
        }