Class EmbeddedConnection
- All Implemented Interfaces:
AdaptrisComponent,AdaptrisConnection,ComponentLifecycle,ComponentLifecycleExtension,JettyServletRegistrar,StateManagedComponent
This is designed to be a replacement for HttpConnection and HttpsConnection and allows you to configure a single jetty
instance according to your requirements which can be re-used across many channels. Of course if you have not enabled a global jetty
instance, then exceptions will be thrown if you attempt to configure an instance of this class.
If you use this connection; you may have to delete ROOT.war from the jetty webapps directory. The default servlet that is
registered with the default web application might interfere with the registering of servlets against arbitrary locations; if you get HTTP
404 errors, then enable logging for the org.eclipse.jetty category and check how the request is routed by the Jetty engine.
In the adapter configuration file this class is aliased as jetty-embedded-connection which is the preferred alternative to the fully qualified classname when building your configuration.
-
Field Summary
Fields inherited from class com.adaptris.core.AdaptrisConnectionImp
log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddServlet(ServletWrapper wrapper) Add a servlet to the jetty engine.protected voidClose the underlying connection.protected voidInitialise the underlying connection.protected voidvoidremoveServlet(ServletWrapper wrapper) Remove a servlet from the jetty engine.protected voidStart the underlying connection.protected voidStop the underlying connection.Methods inherited from class com.adaptris.core.AdaptrisConnectionImp
addExceptionListener, addMessageConsumer, addMessageProducer, changeState, cloneForTesting, close, connectionErrorHandler, connectionStateHandler, getConnectionErrorHandler, getConnectionStateHandler, getRuntimeComponent, getUniqueId, getWorkersFirstOnShutdown, init, prepare, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, retrieveConnection, retrieveExceptionListeners, retrieveMessageConsumers, retrieveMessageProducers, setConnectionErrorHandler, setConnectionStateHandler, setRuntimeComponent, setUniqueId, setWorkersFirstOnShutdown, start, stop, workersFirstOnShutdown
-
Constructor Details
-
EmbeddedConnection
public EmbeddedConnection()
-
-
Method Details
-
closeConnection
protected void closeConnection()Description copied from class:AdaptrisConnectionImpClose the underlying connection.- Specified by:
closeConnectionin classAdaptrisConnectionImp
-
initConnection
Description copied from class:AdaptrisConnectionImpInitialise the underlying connection.- Specified by:
initConnectionin classAdaptrisConnectionImp- Throws:
CoreException- wrapping any exception.
-
startConnection
Description copied from class:AdaptrisConnectionImpStart the underlying connection.- Specified by:
startConnectionin classAdaptrisConnectionImp- Throws:
CoreException- wrapping any exception.- See Also:
-
stopConnection
protected void stopConnection()Description copied from class:AdaptrisConnectionImpStop the underlying connection.- Specified by:
stopConnectionin classAdaptrisConnectionImp- See Also:
-
prepareConnection
- Specified by:
prepareConnectionin classAdaptrisConnectionImp- Throws:
CoreException
-
addServlet
Description copied from interface:JettyServletRegistrarAdd a servlet to the jetty engine.- Specified by:
addServletin interfaceJettyServletRegistrar- Throws:
CoreException
-
removeServlet
Description copied from interface:JettyServletRegistrarRemove a servlet from the jetty engine.- Specified by:
removeServletin interfaceJettyServletRegistrar- Parameters:
wrapper- the servlet wrapper- Throws:
CoreException
-