File tree Expand file tree Collapse file tree 3 files changed +29
-17
lines changed
src/main/java/io/github/amayaframework/jetty Expand file tree Collapse file tree 3 files changed +29
-17
lines changed Original file line number Diff line number Diff line change 5
5
import org .eclipse .jetty .server .Server ;
6
6
7
7
/**
8
- *
8
+ * An interface describing an abstract jetty {@link Server} factory.
9
9
*/
10
10
public interface JettyFactory {
11
11
12
12
/**
13
- * @param handler
14
- * @param options
15
- * @return
13
+ * Creates a {@link Server} instance with the specified {@link Handler} implementation and {@link OptionSet}.
14
+ *
15
+ * @param handler the final handler that contains the logic for processing the http request, must be executed last
16
+ * @param options the option set containing jetty server options
17
+ * @return the {@link Server} instance
16
18
*/
17
19
Server create (Handler handler , OptionSet options );
18
20
19
21
/**
20
- * @param handler
21
- * @return
22
+ * Creates a {@link Server} instance with the specified {@link Handler} implementation.
23
+ *
24
+ * @param handler the final handler that contains the logic for processing the http request, must be executed last
25
+ * @return the {@link Server} instance
22
26
*/
23
27
Server create (Handler handler );
24
28
}
Original file line number Diff line number Diff line change 1
1
package io .github .amayaframework .jetty ;
2
2
3
3
/**
4
- *
4
+ * A class containing the names of the main server options supported by the {@link JettyServerFactory}.
5
5
*/
6
6
public final class JettyOptions {
7
7
/**
8
+ * The name of the server options group.
8
9
*
10
+ * @see io.github.amayaframework.options.GroupOptionSet
9
11
*/
10
12
public static final String GROUP = "jetty" ;
11
13
/**
12
- *
14
+ * The name of the listen port option. Required type: {@link Integer}.
13
15
*/
14
16
public static final String PORT = "port" ;
15
17
/**
16
- *
18
+ * The name of the listen ports option. Required type: {@link Iterable} of {@link Integer}.
17
19
*/
18
20
public static final String PORTS = "ports" ;
19
21
/**
20
- *
22
+ * The name of the listen ip option. Required type: {@link java.net.InetSocketAddress}.
21
23
*/
22
24
public static final String IP = "ip" ;
23
25
/**
24
- *
26
+ * The name of the listen ips option. Required type: {@link Iterable} of {@link java.net.InetSocketAddress}.
25
27
*/
26
28
public static final String IPS = "ips" ;
27
29
/**
28
- *
30
+ * The name of the initial http version. Required type: {@link io.github.amayaframework.http.HttpVersion}.
29
31
*/
30
32
public static final String HTTP_VERSION = "http_version" ;
31
33
/**
32
- *
34
+ * The name of the flag determines whether the server will support http sessions. Required type: {@link Boolean}.
33
35
*/
34
36
public static final String ENABLE_SESSIONS = "enable_sessions" ;
35
37
Original file line number Diff line number Diff line change 15
15
import java .util .function .Supplier ;
16
16
17
17
/**
18
- *
18
+ * A class that implements {@link HttpServerFactory}. Creates an implementations of {@link HttpServer}
19
+ * based on jetty {@link Server}.
19
20
*/
20
21
public final class JettyServerFactory implements HttpServerFactory {
21
22
private final JettyFactory factory ;
22
23
private final Supplier <ThreadPool > supplier ;
23
24
24
25
/**
25
- * @param factory
26
+ * Constructs a {@link JettyServerFactory} instance with the given {@link JettyFactory}.
27
+ *
28
+ * @param factory the specified factory that will be used to create the {@link Server} instance
26
29
*/
27
30
public JettyServerFactory (JettyFactory factory ) {
28
31
this .factory = factory ;
29
32
this .supplier = null ;
30
33
}
31
34
32
35
/**
33
- * @param supplier
36
+ * Constructs a {@link JettyServerFactory} instance with the given supplier of {@link ThreadPool}.
37
+ *
38
+ * @param supplier the specified supplier provides {@link ThreadPool} instance
34
39
*/
35
40
public JettyServerFactory (Supplier <ThreadPool > supplier ) {
36
41
this .factory = null ;
37
42
this .supplier = supplier ;
38
43
}
39
44
40
45
/**
41
- *
46
+ * Constructs a {@link JettyServerFactory} instance which will use the default settings
47
+ * ({@link org.eclipse.jetty.util.thread.QueuedThreadPool} and {@link Server} with sessions support).
42
48
*/
43
49
public JettyServerFactory () {
44
50
this .factory = null ;
You can’t perform that action at this time.
0 commit comments