Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: d02b1fc7f0444e78d6c60f73c7f445677fcbda46 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*******************************************************************************
 * Copyright (c) 2008, 2011 Gunnar Wagenknecht, IBM Corporation and others
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 * 
 * Contributors:
 *     Gunnar Wagenknecht - initial API and implementation
 *     IBM Corporation - improvements and ongoing maintenance
 *******************************************************************************/
package org.eclipse.equinox.http.jetty;

import java.util.Dictionary;

/**
 * Jetty Customizer allows one to customize Jetty contexts and connectors.
 * <p>
 * This abstract class must be extended by clients which wish to customize
 * the created Jetty contexts or connectors further.
 * </p>
 * @since 1.1
 */
public abstract class JettyCustomizer {

	/**
	 * Called by the framework when the Jetty context has been created
	 * and initialized.
	 * <p>
	 * Implementors may perform additional configuration of the Jetty context.
	 * However, they must be aware that changing certain central functionalities
	 * of the context such as class loading are already configured by the 
	 * framework. Changing those may cause breakage and thus must be avoided.
	 * </p>
	 * @param context 
	 *             	the Jetty context; in case of Jetty 7 the context is of 
	 *             	type <code>org.eclipse.jetty.servlet.ServletContextHandler</code>
	 * @param settings
	 * 				the settings as passed to {@link JettyConfigurator#startServer(String, Dictionary)}
	 * @return context
	 *             	the customized context; in case of Jetty 7 the context is of 
	 *             	type <code>org.eclipse.jetty.servlet.ServletContextHandler</code>
	 */
	public Object customizeContext(Object context, Dictionary<String, ?> settings) {
		return context;
	}

	/**
	 * Called by the framework when the Jetty Http Connector has been created
	 * and initialized.
	 * <p>
	 * Implementors may perform additional configuration of the Jetty Connector.
	 * </p>
	 * @param connector 
	 *             	the Jetty connector; in case of Jetty 7 the context is of 
	 *             	type <code>org.eclipse.jetty.server.Connector</code>
	 * @param settings
	 * 				the settings as passed to {@link JettyConfigurator#startServer(String, Dictionary)}
	 * @return connector
	 *             	the customized connector; in case of Jetty 6 the connector is of 
	 *             	type <code>org.eclipse.jetty.server.Connector</code>
	 */
	public Object customizeHttpConnector(Object connector, Dictionary<String, ?> settings) {
		return connector;
	}

	/**
	 * Called by the framework when the Jetty Https Connector has been created
	 * and initialized.
	 * <p>
	 * Implementors may perform additional configuration of the Jetty Connector.
	 * </p>
	 * @param connector 
	 *             	the Jetty connector; in case of Jetty 7 the connector is of 
	 *             	type <code>oorg.eclipse.jetty.server.Connector</code>
	 * @param settings
	 * 				the settings as passed to {@link JettyConfigurator#startServer(String, Dictionary)}
	 * @return connector
	 *             	the customized connector; in case of Jetty 7 the connector is of 
	 *             	type <code>org.eclipse.jetty.server.Connector</code>
	 */
	public Object customizeHttpsConnector(Object connector, Dictionary<String, ?> settings) {
		return connector;
	}
}

Back to the top