or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

application-providers.mddeployment-management.mdgraph-system.mdindex.mdlifecycle-management.md
tile.json

tessl/maven-org-eclipse-jetty--jetty-deploy

Jetty deployers - Webapp Deploy Management component

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
mavenpkg:maven/org.eclipse.jetty/jetty-deploy@12.0.x

To install, run

npx @tessl/cli install tessl/maven-org-eclipse-jetty--jetty-deploy@12.0.0

index.mddocs/

Jetty Deploy

Jetty Deploy provides a comprehensive web application deployment management system for the Eclipse Jetty web server. It implements a sophisticated deployment lifecycle management framework that can automatically detect, deploy, start, stop, and undeploy web applications from various sources including file system directories, WAR files, and other deployable artifacts.

Package Information

  • Package Name: org.eclipse.jetty:jetty-deploy
  • Package Type: maven
  • Language: Java
  • Installation: Add to your Maven pom.xml:
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-deploy</artifactId>
    <version>12.0.21</version>
</dependency>

Core Imports

import org.eclipse.jetty.deploy.DeploymentManager;
import org.eclipse.jetty.deploy.App;
import org.eclipse.jetty.deploy.AppProvider;
import org.eclipse.jetty.deploy.providers.ContextProvider;

Basic Usage

import org.eclipse.jetty.deploy.DeploymentManager;
import org.eclipse.jetty.deploy.providers.ContextProvider;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.ContextHandlerCollection;

// Create deployment manager
DeploymentManager deploymentManager = new DeploymentManager();
deploymentManager.setContexts(new ContextHandlerCollection());

// Add a context provider for scanning webapps
ContextProvider contextProvider = new ContextProvider();
contextProvider.setMonitoredDirName("webapps");
deploymentManager.addAppProvider(contextProvider);

// Add to server
Server server = new Server(8080);
server.addBean(deploymentManager);
server.start();

Architecture

Jetty Deploy is built around several key components:

  • DeploymentManager: Central orchestrator that manages the complete deployment lifecycle of applications
  • AppProvider: Pluggable interface for discovering and creating applications from various sources
  • App: Wrapper representing an application with its metadata, lifecycle state, and context handler
  • AppLifeCycle: State machine defining the deployment lifecycle with 8 standard states
  • Graph System: Directed graph implementation for modeling state transitions and routing
  • Bindings: Pluggable actions that execute during lifecycle state transitions

Capabilities

Deployment Management

Core deployment orchestration functionality providing centralized control over application lifecycles, provider management, and state coordination.

public class DeploymentManager extends ContainerLifeCycle {
    public DeploymentManager();
    public void addApp(App app);
    public void addAppProvider(AppProvider provider);
    public void requestAppGoal(App app, String nodeName);
    public Collection<App> getApps();
    public App getApp(String appId);
    public void undeployAll();
}

Deployment Management

Application Providers

Provider system for discovering and deploying applications from various sources like directories, WAR files, and XML descriptors.

public interface AppProvider extends LifeCycle {
    void setDeploymentManager(DeploymentManager deploymentManager);
    ContextHandler createContextHandler(App app) throws Exception;
    String getEnvironmentName();
}

public class ContextProvider extends ScanningAppProvider {
    public ContextProvider();
    public void setMonitoredDirName(String dir);
    public void setScanInterval(int scanInterval);
}

Application Providers

Lifecycle Management

State machine-based deployment lifecycle with standard states, bindings, and transition management.

public class AppLifeCycle extends Graph {
    public static final String UNDEPLOYED = "undeployed";
    public static final String DEPLOYING = "deploying";
    public static final String DEPLOYED = "deployed";
    public static final String STARTING = "starting";
    public static final String STARTED = "started";
    public static final String STOPPING = "stopping";
    public static final String UNDEPLOYING = "undeploying";
    public static final String FAILED = "failed";
    
    public void addBinding(AppLifeCycle.Binding binding);
    public void runBindings(Node node, App app, DeploymentManager deploymentManager) throws Throwable;
}

Lifecycle Management

Graph-based State Machine

Directed graph system for modeling deployment states, transitions, and path finding through the deployment lifecycle.

public class Graph {
    public Graph();
    public void addNode(Node node);
    public void addEdge(Edge edge);
    public Route getPath(Node from, Node to);
    public Set<Node> getNodes();
}

public final class Node {
    public Node(String name);
    public String getName();
}

Graph System

Types

Core Types

public class App {
    public App(DeploymentManager manager, AppProvider provider, Path path);
    public DeploymentManager getDeploymentManager();
    public AppProvider getAppProvider();
    public Path getPath();
    public String getContextPath();
    public ContextHandler getContextHandler() throws Exception;
    public Map<String, String> getProperties();
}

public static class DeploymentManager.AppEntry {
    public App getApp();
    public Node getLifecyleNode();
    public Map<Node, Long> getStateTimestamps();
    public int getVersion();
}

Lifecycle Types

public interface AppLifeCycle.Binding {
    String[] getBindingTargets();
    void processBinding(Node node, App app) throws Exception;
}

Graph Types

public final class Edge {
    public Edge(Node from, Node to);
    public Node getFrom();
    public Node getTo();
}

public class Route {
    public Route();
    public void add(Edge edge);
    public List<Node> getNodes();
    public Node firstNode();
    public Node lastNode();
    public boolean isEmpty();
}