@@ -27,87 +27,95 @@ public abstract class HttpServerHandler
27
27
/// </summary>
28
28
/// <param name="server">The Http server entity which is starting.</param>
29
29
/// <definition>
30
- /// public virtual void OnSetupHttpServer(HttpServer server)
30
+ /// protected virtual void OnSetupHttpServer(HttpServer server)
31
31
/// </definition>
32
32
/// <type>
33
33
/// Virtual method
34
34
/// </type>
35
- public virtual void OnServerStarting ( HttpServer server ) { }
35
+ protected virtual void OnServerStarting ( HttpServer server ) { }
36
+ internal void InvokeOnServerStarting ( HttpServer server ) => OnServerStarting ( server ) ;
36
37
37
38
/// <summary>
38
39
/// Method that is called immediately after starting the <see cref="HttpServer"/>, when it's
39
40
/// ready and listening.
40
41
/// </summary>
41
42
/// <param name="server">The Http server entity which is ready.</param>
42
43
/// <definition>
43
- /// public virtual void OnServerStarted(HttpServer server)
44
+ /// protected virtual void OnServerStarted(HttpServer server)
44
45
/// </definition>
45
46
/// <type>
46
47
/// Virtual method
47
48
/// </type>
48
- public virtual void OnServerStarted ( HttpServer server ) { }
49
+ protected virtual void OnServerStarted ( HttpServer server ) { }
50
+ internal void InvokeOnServerStarted ( HttpServer server ) => OnServerStarted ( server ) ;
49
51
50
52
/// <summary>
51
53
/// Method that is called when an <see cref="Router"/> is binded to the Http server.
52
54
/// </summary>
53
55
/// <param name="router">The router entity which is binded.</param>
54
56
/// <definition>
55
- /// public virtual void OnSetupRouter(Router router)
57
+ /// protected virtual void OnSetupRouter(Router router)
56
58
/// </definition>
57
59
/// <type>
58
60
/// Virtual method
59
61
/// </type>
60
- public virtual void OnSetupRouter ( Router router ) { }
62
+ protected virtual void OnSetupRouter ( Router router ) { }
63
+
64
+ internal void InvokeOnSetupRouter ( Router router ) => OnSetupRouter ( router ) ;
61
65
62
66
/// <summary>
63
67
/// Method that is called when an <see cref="HttpContextBagRepository"/> is created within an
64
68
/// <see cref="HttpRequest"/> object.
65
69
/// </summary>
66
70
/// <param name="contextBag">The creating context bag.</param>
67
71
/// <definition>
68
- /// public virtual void OnContextBagCreated(HttpContextBagRepository contextBag)
72
+ /// protected virtual void OnContextBagCreated(HttpContextBagRepository contextBag)
69
73
/// </definition>
70
74
/// <type>
71
75
/// Virtual method
72
76
/// </type>
73
- public virtual void OnContextBagCreated ( HttpContextBagRepository contextBag ) { }
77
+ protected virtual void OnContextBagCreated ( HttpContextBagRepository contextBag ) { }
78
+ internal void InvokeOnContextBagCreated ( HttpContextBagRepository contextBag ) => OnContextBagCreated ( contextBag ) ;
74
79
75
80
/// <summary>
76
81
/// Method that is called when an <see cref="HttpRequest"/> is received in the
77
82
/// Http server.
78
83
/// </summary>
79
84
/// <param name="request">The connecting Http request entity.</param>
80
85
/// <definition>
81
- /// public virtual void OnHttpRequestOpen(HttpRequest request)
86
+ /// protected virtual void OnHttpRequestOpen(HttpRequest request)
82
87
/// </definition>
83
88
/// <type>
84
89
/// Virtual method
85
90
/// </type>
86
- public virtual void OnHttpRequestOpen ( HttpRequest request ) { }
91
+ protected virtual void OnHttpRequestOpen ( HttpRequest request ) { }
92
+ internal void InvokeOnHttpRequestOpen ( HttpRequest request ) => OnHttpRequestOpen ( request ) ;
87
93
88
94
/// <summary>
89
95
/// Method that is called when an <see cref="HttpRequest"/> is closed in the
90
96
/// Http server.
91
97
/// </summary>
92
98
/// <param name="result">The result of the execution of the request.</param>
93
99
/// <definition>
94
- /// public virtual void OnHttpRequestClose(HttpServerExecutionResult result)
100
+ /// protected virtual void OnHttpRequestClose(HttpServerExecutionResult result)
95
101
/// </definition>
96
102
/// <type>
97
103
/// Virtual method
98
104
/// </type>
99
- public virtual void OnHttpRequestClose ( HttpServerExecutionResult result ) { }
105
+ protected virtual void OnHttpRequestClose ( HttpServerExecutionResult result ) { }
106
+ internal void InvokeOnHttpRequestClose ( HttpServerExecutionResult result ) => OnHttpRequestClose ( result ) ;
100
107
101
108
/// <summary>
102
109
/// Method that is called when an exception is caught in the Http server. This method is called
103
110
/// regardless of whether <see cref="HttpServerConfiguration.ThrowExceptions"/> is enabled or not.
104
111
/// </summary>
105
112
/// <param name="exception">The exception object.</param>
106
113
/// <definition>
107
- /// public virtual void OnException(Exception exception)
114
+ /// protected virtual void OnException(Exception exception)
108
115
/// </definition>
109
116
/// <type>
110
117
/// Virtual method
111
118
/// </type>
112
- public virtual void OnException ( Exception exception ) { }
119
+ protected virtual void OnException ( Exception exception ) { }
120
+ internal void InvokeOnException ( Exception exception ) => OnException ( exception ) ;
113
121
}
0 commit comments