Connector

A Pedestal application always works in the context of a network connector such as Jetty 12; the network connector is responsible for the low-level HTTP/HTTPs networking, including support for Websockets and server-sent events.

Once a request has been received, it is passed through an interceptor chain to be processed using the Interceptors pipeline.

A Pedestal connector is created from a connector map; the Pedestal connector manages the lifecycle of the network connector, and transforms from the network connector’s APIs to Pedestal’s.

The namespaces io.pedestal.connector and io.pedestal.connector.dev provide functions to create and configure the connector map.

Embedded

Pedestal applications are primarily run in embedded mode, where the network connector is a library that is part of the runtime classpath.

The service map is passed to a connector factory function.

Pedestal connectors implement the PedestalConnector protocol. When started, the Pedestal connector will create, configure, and start the network connector.

Once started, the network connector will receive incoming requests and pass those along to Pedestal for actual processing.

WAR (Web Application Archive)

The alternate setup for a Pedestal application is a WAR file - a packaged version of an application, its code and libraries, configuration, and public resources - that runs inside a standalone servlet connector. WAR deployments have a different lifecycle, as the network connector (such as Jetty 12) is its own running process, that unpacks and loads the contents of the WAR file. This means that there isn’t a Pedestal connector, just the Servlet Interceptor.

This all requires some careful setup, including omitting certain dependencies from the classpath.

More discussion of WAR deployment is forthcoming.