17
17
18
18
namespace Microsoft . AspNetCore . Server . Kestrel
19
19
{
20
- public class KestrelConfigurationBuilder : IKestrelConfigurationBuilder
20
+ public class KestrelConfigurationLoader : IKestrelConfigurationLoader
21
21
{
22
- internal KestrelConfigurationBuilder ( KestrelServerOptions options , IConfiguration configuration )
22
+ internal KestrelConfigurationLoader ( KestrelServerOptions options , IConfiguration configuration )
23
23
{
24
24
Options = options ?? throw new ArgumentNullException ( nameof ( options ) ) ;
25
25
Configuration = configuration ?? throw new ArgumentNullException ( nameof ( configuration ) ) ;
@@ -29,13 +29,13 @@ internal KestrelConfigurationBuilder(KestrelServerOptions options, IConfiguratio
29
29
public IConfiguration Configuration { get ; }
30
30
private IDictionary < string , Action < EndpointConfiguration > > EndpointConfigurations { get ; }
31
31
= new Dictionary < string , Action < EndpointConfiguration > > ( 0 ) ;
32
- // Actions that will be delayed until Build so that they aren't applied if the configuration builder is replaced.
32
+ // Actions that will be delayed until Load so that they aren't applied if the configuration loader is replaced.
33
33
private IList < Action > EndpointsToAdd { get ; } = new List < Action > ( ) ;
34
34
35
35
/// <summary>
36
36
/// Specifies a configuration Action to run when an endpoint with the given name is loaded from configuration.
37
37
/// </summary>
38
- public KestrelConfigurationBuilder Endpoint ( string name , Action < EndpointConfiguration > configureOptions )
38
+ public KestrelConfigurationLoader Endpoint ( string name , Action < EndpointConfiguration > configureOptions )
39
39
{
40
40
if ( string . IsNullOrEmpty ( name ) )
41
41
{
@@ -49,12 +49,12 @@ public KestrelConfigurationBuilder Endpoint(string name, Action<EndpointConfigur
49
49
/// <summary>
50
50
/// Bind to given IP address and port.
51
51
/// </summary>
52
- public KestrelConfigurationBuilder Endpoint ( IPAddress address , int port ) => Endpoint ( address , port , _ => { } ) ;
52
+ public KestrelConfigurationLoader Endpoint ( IPAddress address , int port ) => Endpoint ( address , port , _ => { } ) ;
53
53
54
54
/// <summary>
55
55
/// Bind to given IP address and port.
56
56
/// </summary>
57
- public KestrelConfigurationBuilder Endpoint ( IPAddress address , int port , Action < ListenOptions > configure )
57
+ public KestrelConfigurationLoader Endpoint ( IPAddress address , int port , Action < ListenOptions > configure )
58
58
{
59
59
if ( address == null )
60
60
{
@@ -67,12 +67,12 @@ public KestrelConfigurationBuilder Endpoint(IPAddress address, int port, Action<
67
67
/// <summary>
68
68
/// Bind to given IP endpoint.
69
69
/// </summary>
70
- public KestrelConfigurationBuilder Endpoint ( IPEndPoint endPoint ) => Endpoint ( endPoint , _ => { } ) ;
70
+ public KestrelConfigurationLoader Endpoint ( IPEndPoint endPoint ) => Endpoint ( endPoint , _ => { } ) ;
71
71
72
72
/// <summary>
73
73
/// Bind to given IP address and port.
74
74
/// </summary>
75
- public KestrelConfigurationBuilder Endpoint ( IPEndPoint endPoint , Action < ListenOptions > configure )
75
+ public KestrelConfigurationLoader Endpoint ( IPEndPoint endPoint , Action < ListenOptions > configure )
76
76
{
77
77
if ( endPoint == null )
78
78
{
@@ -95,13 +95,13 @@ public KestrelConfigurationBuilder Endpoint(IPEndPoint endPoint, Action<ListenOp
95
95
/// Listens on ::1 and 127.0.0.1 with the given port. Requesting a dynamic port by specifying 0 is not supported
96
96
/// for this type of endpoint.
97
97
/// </summary>
98
- public KestrelConfigurationBuilder LocalhostEndpoint ( int port ) => LocalhostEndpoint ( port , options => { } ) ;
98
+ public KestrelConfigurationLoader LocalhostEndpoint ( int port ) => LocalhostEndpoint ( port , options => { } ) ;
99
99
100
100
/// <summary>
101
101
/// Listens on ::1 and 127.0.0.1 with the given port. Requesting a dynamic port by specifying 0 is not supported
102
102
/// for this type of endpoint.
103
103
/// </summary>
104
- public KestrelConfigurationBuilder LocalhostEndpoint ( int port , Action < ListenOptions > configure )
104
+ public KestrelConfigurationLoader LocalhostEndpoint ( int port , Action < ListenOptions > configure )
105
105
{
106
106
if ( configure == null )
107
107
{
@@ -119,12 +119,12 @@ public KestrelConfigurationBuilder LocalhostEndpoint(int port, Action<ListenOpti
119
119
/// <summary>
120
120
/// Listens on all IPs using IPv6 [::], or IPv4 0.0.0.0 if IPv6 is not supported.
121
121
/// </summary>
122
- public KestrelConfigurationBuilder AnyIPEndpoint ( int port ) => AnyIPEndpoint ( port , options => { } ) ;
122
+ public KestrelConfigurationLoader AnyIPEndpoint ( int port ) => AnyIPEndpoint ( port , options => { } ) ;
123
123
124
124
/// <summary>
125
125
/// Listens on all IPs using IPv6 [::], or IPv4 0.0.0.0 if IPv6 is not supported.
126
126
/// </summary>
127
- public KestrelConfigurationBuilder AnyIPEndpoint ( int port , Action < ListenOptions > configure )
127
+ public KestrelConfigurationLoader AnyIPEndpoint ( int port , Action < ListenOptions > configure )
128
128
{
129
129
if ( configure == null )
130
130
{
@@ -142,12 +142,12 @@ public KestrelConfigurationBuilder AnyIPEndpoint(int port, Action<ListenOptions>
142
142
/// <summary>
143
143
/// Bind to given Unix domain socket path.
144
144
/// </summary>
145
- public KestrelConfigurationBuilder UnixSocketEndpoint ( string socketPath ) => UnixSocketEndpoint ( socketPath , _ => { } ) ;
145
+ public KestrelConfigurationLoader UnixSocketEndpoint ( string socketPath ) => UnixSocketEndpoint ( socketPath , _ => { } ) ;
146
146
147
147
/// <summary>
148
148
/// Bind to given Unix domain socket path.
149
149
/// </summary>
150
- public KestrelConfigurationBuilder UnixSocketEndpoint ( string socketPath , Action < ListenOptions > configure )
150
+ public KestrelConfigurationLoader UnixSocketEndpoint ( string socketPath , Action < ListenOptions > configure )
151
151
{
152
152
if ( socketPath == null )
153
153
{
@@ -173,12 +173,12 @@ public KestrelConfigurationBuilder UnixSocketEndpoint(string socketPath, Action<
173
173
/// <summary>
174
174
/// Open a socket file descriptor.
175
175
/// </summary>
176
- public KestrelConfigurationBuilder HandleEndpoint ( ulong handle ) => HandleEndpoint ( handle , _ => { } ) ;
176
+ public KestrelConfigurationLoader HandleEndpoint ( ulong handle ) => HandleEndpoint ( handle , _ => { } ) ;
177
177
178
178
/// <summary>
179
179
/// Open a socket file descriptor.
180
180
/// </summary>
181
- public KestrelConfigurationBuilder HandleEndpoint ( ulong handle , Action < ListenOptions > configure )
181
+ public KestrelConfigurationLoader HandleEndpoint ( ulong handle , Action < ListenOptions > configure )
182
182
{
183
183
if ( configure == null )
184
184
{
@@ -193,14 +193,14 @@ public KestrelConfigurationBuilder HandleEndpoint(ulong handle, Action<ListenOpt
193
193
return this ;
194
194
}
195
195
196
- public void Build ( )
196
+ public void Load ( )
197
197
{
198
- if ( Options . ConfigurationBuilder == null )
198
+ if ( Options . ConfigurationLoader == null )
199
199
{
200
- // The builder has already been built .
200
+ // The loader has already been run .
201
201
return ;
202
202
}
203
- Options . ConfigurationBuilder = null ;
203
+ Options . ConfigurationLoader = null ;
204
204
205
205
var configReader = new ConfigurationReader ( Configuration ) ;
206
206
0 commit comments