@ComponentProfile(summary="Connection that creates its own jetty engine instance and listens on the specified port", tag="connections,http,jetty") public class HttpConnection extends JettyConnection
By default all fields are left as null. This will cause Jetty to use its internal defaults. Consult the Jetty Documentation for information on the behaviour and configuration required.
The key from the server-connector-properties
element should match the name of the underlying ServerConnector
setter.
<server-connector-properties>
<key-value-pair>
<key>ReuseAddress</key>
<value>true</value>
</key-value-pair>
</server-connector-properties>
will invoke ServerConnector#setReuseAddress(boolean)
, setting the ReuseAddress property to true. Note that no
validation of the various properties is performed and will be passed as-is to the AbstractConnector
with an attempt to
transform into the correct type. Invalid combinations may result in undefined behaviour. Similarly additional
HttpConfiguration
properties can be configured via the http-connection
element.
In the adapter configuration file this class is aliased as jetty-http-connection which is the preferred alternative to the fully qualified classname when building your configuration.
Modifier and Type | Class and Description |
---|---|
static class |
HttpConnection.HttpConfigurationProperty
Standard
HttpConfiguration properties for use with setHttpConfiguration(KeyValuePairSet) . |
static class |
HttpConnection.ServerConnectorProperty
Standard
ServerConnector properties for use with setServerConnectorProperties(KeyValuePairSet) . |
context, server
log
Constructor and Description |
---|
HttpConnection() |
Modifier and Type | Method and Description |
---|---|
protected org.eclipse.jetty.server.ServerConnector |
configure(org.eclipse.jetty.server.ServerConnector connector) |
protected org.eclipse.jetty.server.HttpConfiguration |
createConfig() |
protected org.eclipse.jetty.server.ConnectionFactory[] |
createConnectionFactory() |
KeyValuePairSet |
getHttpConfiguration() |
int |
getPort()
Get the port to listen on for HTTP traffic.
|
SecurityHandlerWrapper |
getSecurityHandler() |
KeyValuePairSet |
getServerConnectorProperties() |
protected void |
prepareConnection() |
void |
setHttpConfiguration(KeyValuePairSet kvps) |
void |
setPort(int i)
Set the port to listen on.
|
void |
setSecurityHandler(SecurityHandlerWrapper s)
Specify the SecurityHandler implementation.
|
void |
setServerConnectorProperties(KeyValuePairSet httpProperties) |
addServlet, asArray, closeConnection, initConnection, removeServlet, startConnection, stopConnection
addExceptionListener, addMessageConsumer, addMessageProducer, changeState, cloneForTesting, close, connectionErrorHandler, getConnectionErrorHandler, getLookupName, getUniqueId, getWorkersFirstOnShutdown, init, prepare, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, retrieveConnection, retrieveExceptionListeners, retrieveMessageConsumers, retrieveMessageProducers, setConnectionErrorHandler, setLookupName, setUniqueId, setWorkersFirstOnShutdown, start, stop, workersFirstOnShutdown
protected org.eclipse.jetty.server.ConnectionFactory[] createConnectionFactory() throws java.lang.Exception
java.lang.Exception
protected org.eclipse.jetty.server.HttpConfiguration createConfig() throws java.lang.Exception
java.lang.Exception
protected org.eclipse.jetty.server.ServerConnector configure(org.eclipse.jetty.server.ServerConnector connector) throws java.lang.Exception
java.lang.Exception
public void setPort(int i)
i
- the port, by default it is 8080public int getPort()
public KeyValuePairSet getServerConnectorProperties()
public void setServerConnectorProperties(KeyValuePairSet httpProperties)
public SecurityHandlerWrapper getSecurityHandler()
public void setSecurityHandler(SecurityHandlerWrapper s)
s
- the securityHandler wrapper implementation.protected void prepareConnection() throws CoreException
prepareConnection
in class AdaptrisConnectionImp
CoreException
public KeyValuePairSet getHttpConfiguration()
public void setHttpConfiguration(KeyValuePairSet kvps)
kvps
- the httpConfiguration to set