RSP is a protocol and framework for managing application server runtimes (WildFly, JBoss EAP, Tomcat, Jetty, etc.). It is modeled after the Language Server Protocol (LSP) — same communication library (Eclipse LSP4J / JSON-RPC), but a completely different set of protocol objects and operations focused on server lifecycle management rather than language features.
The RSP server runs as an OSGi application on Apache Felix. Clients (IDE extensions, CLI tools) connect over TCP and interact via JSON-RPC request/response and notification messages.
Eclipse Tycho (Maven + OSGi). All modules use eclipse-plugin packaging. Dependencies are resolved via an Eclipse target platform definition (targetplatform/), not Maven <dependency> elements. The per-bundle pom.xml files are typically minimal.
| Module | Purpose |
|---|---|
api/ |
Protocol interfaces (RSPServer, RSPClient) and ~50 DAO classes serialized as JSON over the wire |
framework/ |
Core server framework — 10 OSGi bundles providing the SPI, server core, generic server support, launching, logging, security, etc. |
runtimes/ |
Concrete server type implementations bundled with this repo (WildFly/EAP, Minishift/CRC, Red Hat download provider) |
client/ |
CLI client JAR |
distribution/ |
Felix-based distribution packaging and integration tests |
targetplatform/ |
Eclipse target platform definition |
site/ |
P2 update site |
| Bundle | Role |
|---|---|
org.jboss.tools.rsp.server.spi |
SPI layer — all key interfaces (IServerType, IServerDelegate, IServer, IServerModel, RSPExtensionBundle, discovery, polling, publishing, launchers) |
org.jboss.tools.rsp.server |
Core server implementation — ServerManagementServerImpl (implements RSPServer), AbstractServerDelegate, ServerManagementModel, ServerManagementServerLauncher (TCP accept loop) |
org.jboss.tools.rsp.server.generic |
JSON-descriptor-driven server type framework — GenericServerActivator, GenericServerBehavior, GenericServerExtensionModel. Downstream bundles can define entire server types via a servers.json with minimal Java. |
org.jboss.tools.rsp.foundation.core |
Core launchers and tasks |
org.jboss.tools.rsp.launching |
Launch utilities, JSONMemento (JSON-backed config tree) |
org.jboss.tools.rsp.launching.java |
Java-specific launch support (VM detection, classpath) |
org.jboss.tools.rsp.runtime.core |
Runtime discovery/installer model, DownloadRuntime |
org.jboss.tools.rsp.secure |
Security / secure storage |
org.jboss.tools.rsp.logging |
Logging |
org.jboss.tools.rsp.stacks.core |
Stacks support |
| Bundle | Role |
|---|---|
org.jboss.tools.rsp.server.wildfly |
WildFly / JBoss AS / EAP / EAP XP — 38+ server type definitions, full programmatic implementation |
org.jboss.tools.rsp.server.minishift |
Minishift / CDK / CRC — container-based runtimes |
org.jboss.tools.rsp.server.redhat.download |
Red Hat download runtime provider |
Communication uses JSON-RPC 2.0 over raw TCP sockets, built on org.eclipse.lsp4j.jsonrpc.
-
RSPServer(api/.../RSPServer.java) — Server-side interface annotated@JsonSegment("server"). Methods use@JsonRequest(request/response returningCompletableFuture<T>) and@JsonNotification(fire-and-forget). Covers: discovery, server CRUD, attributes, launching, publishing, runtime downloads, server actions, and jobs. -
RSPClient(api/.../RSPClient.java) — Client-side callback interface annotated@JsonSegment("client"). Mostly@JsonNotificationmethods the server calls to push events:serverAdded,serverRemoved,serverStateChanged,serverProcess*,job*,discoveryPath*,messageBox. One@JsonRequest:promptString(). -
SocketLauncher<T>— Wraps LSP4J'sLauncherto bind JSON-RPC to aSocket. -
ServerManagementServerLauncher— Main entry point. Opens aServerSocket, accepts connections in a loop, creates anRSPServerSocketLauncherper client. Each client gets its own proxy ofRSPClientfor callbacks. Subclassed by downstream distributions to provide amain(). -
ServerManagementServerImpl— ImplementsRSPServer, delegates all operations toIServerManagementModel. -
DAO objects (
api/.../dao/) — ~50 POJOs (e.g.,ServerType,ServerHandle,ServerState,ServerBean,Attributes,LaunchParameters,DeployableReference,WorkflowResponse) that are serialized/deserialized as JSON. JSON Schema definitions exist underapi/docs/.
The type system is a factory pattern: IServerType defines what a server type is, and creates IServerDelegate instances that define how a server behaves.
-
IServerType— Declares: id, name, description, required/optional attributes, launch modes. Factory methodcreateServerDelegate(IServer)creates the behavioral delegate for a server instance. -
AbstractServerType— Base implementation with id/name/desc fields and default workflow handling. -
IServerDelegate— Behavioral contract for a server instance. Lifecycle:start(mode),stop(force). State:getServerRunState(),getServerState(). Publishing:canAddDeployable(),publish(). Actions:listServerActions(),executeServerAction(). Validation:validate(). Defaults:setDefaults(),setDependentDefaults(). -
AbstractServerDelegate— Large abstract base in the server core bundle. Manages state transitions, process monitoring, debug event listening, publish model lifecycle, stream listeners, and polling coordination. -
IServer/IServerWorkingCopy— The server data model. Holds attributes as typed key-value pairs.IServeris read-only;IServerWorkingCopyallows mutation andsave().
Integer constants: STATE_UNKNOWN(0), STATE_STARTING(1), STATE_STARTED(2), STATE_STOPPING(3), STATE_STOPPED(4). State transitions are managed by AbstractServerDelegate, typically driven by pollers.
Polling: IServerStatePoller implementations check whether a server is up or down. PollThread runs a poller in the background and notifies an IPollResultListener when a result is available. Built-in pollers include WebPortPoller (HTTP probe). The generic framework adds JSON-configured pollers: webPoller, automaticSuccess, delayedSuccess, noOpPoller.
Discovery detects installed server runtimes on the filesystem.
-
ServerBeanType(abstract) — Given a filesystem path, determines if it's a server installation of a particular type. Key methods:isServerRoot(File),getFullVersion(File),getServerAdapterTypeId(String version). -
IServerBeanTypeProvider— Returns an array ofServerBeanType[]contributed by a bundle. -
IServerBeanTypeManager— Registry. Bundles calladdTypeProvider()/removeTypeProvider(). -
ServerBeanLoader— Iterates all registeredServerBeanTypes against a path to find matches.
The generic framework provides three JSON-configured discovery strategies: ExplodedManifestDiscovery (reads exploded JAR manifest), JarManifestDiscovery (reads manifest from a JAR), PropertiesFileDiscovery (reads .properties files).
-
IPublishController— Per-server-type publish strategy:publishModule(),canAddDeployable(), etc. -
AbstractFilesystemPublishController— Base for controllers that copy deployments to a filesystem location. -
IServerPublishModel— Per-server-instance model tracking deployables, their states, and resource deltas.
-
IServerStartLauncher/IServerShutdownLauncher— Contracts for starting/stopping a server process. -
AbstractJavaLauncher— ImplementsIServerStartLauncher. Provides the full Java launch lifecycle (VM runner, classpath, args, env). Subclasses implement:getWorkingDirectory(),getMainTypeName(),getVMArguments(),getProgramArguments(),getClasspath(). -
The generic framework reads launch configuration from JSON (
launchType: "java-launch","noOp","terminateProcess").
IServerManagementModel — Top-level model facade (code comment notes it "should probably be called IRSPModel"). Provides access to all sub-models:
getServerModel()— Server type/instance CRUDgetServerBeanTypeManager()— Discovery registrationgetDownloadRuntimeModel()— Downloadable runtimesgetDiscoveryPathModel()— Filesystem paths to scangetVMInstallModel()— JVM installationsgetCapabilityManagement()— Client capabilitiesgetSecureStorageProvider()— Secure storagegetJobManager()— Background jobsgetFileWatcherService()— Filesystem monitoring
LauncherSingleton — Global accessor: LauncherSingleton.getDefault().getLauncher().getModel() gives any bundle access to the IServerManagementModel.
All extension bundles subclass RSPExtensionBundle (which implements BundleActivator). The mechanism handles OSGi startup ordering:
- Bundle's
start(BundleContext)callsaddExtensions(targetBundleId, context). - If the target bundle (typically
org.jboss.tools.rsp.server) is alreadyACTIVE,addExtensions()runs immediately. - If not yet active, the bundle registers with
DelayedExtensionManager. The server core'sServerCoreActivator.start()processes all delayed extensions once it's ready.
Every extension registers up to three things into IServerManagementModel:
- Server types via
model.getServerModel().addServerType() - Discovery providers via
model.getServerBeanTypeManager().addTypeProvider() - Download providers via
model.getDownloadRuntimeModel().addDownloadRuntimeProvider()
Used by the WildFly bundle and any server type needing deep behavioral customization. The bundle:
- Extends
RSPExtensionBundledirectly for its activator - Defines
IServerTypesubclasses with hardcoded attributes, launch modes, etc. - Defines
IServerDelegatesubclasses (viaAbstractServerDelegate) with custom start/stop, publish, action, and discovery logic - Registers everything in an
ExtensionHandler
WildFly class hierarchy:
IServerType → AbstractServerType → BaseJBossServerType → WildFlyServerType / JBossASServerType / EapXpServerType
IServerDelegate → AbstractServerDelegate → AbstractJBossServerDelegate → WildFlyServerDelegate / JBossASServerDelegate / EapXpServerDelegate
ServerBeanType → ServerBeanTypeWildfly80 / ServerBeanTypeEAP70 / ... (30+ subclasses)
The WildFly bundle defines 38+ server type constants in WildFlyServerTypes covering WildFly 7–38, JBoss AS 3.2–7.1, EAP 4.3–8.0, and EAP XP. It includes deep customization: version-specific launch argument generators, extended properties per server version, custom publish controllers, server actions (edit config, open browser), and download runtime providers.
Used by downstream projects that define server types primarily through a servers.json file with minimal Java. The bundle:
- Extends
GenericServerActivator(which extendsRSPExtensionBundle) for its activator - Provides
getBundleId()andgetServerTypeModelStream()(returnsservers.jsonas anInputStream) - Optionally provides
getDelegateProvider()returning anIServerBehaviorFromJSONProviderfactory - Optionally extends
GenericServerBehavior(which extendsAbstractServerDelegate) for custom behavior
GenericServerActivator.addExtensions() creates a GenericServerExtensionModel which parses the JSON and registers all server types, discovery providers, and download providers.
servers.json structure:
{
"serverTypes": {
"server.type.id": {
"template": "template-name",
"discoveries": [ ... ],
"downloads": { ... },
"type": {
"name": "Display Name",
"description": "...",
"launchModes": "run,debug",
"attributes": {
"required": { ... },
"optional": { ... },
"staticDefaults": { ... }
},
"behavior": {
"publish": { "deployPath": "...", "approvedSuffixes": "..." },
"startup": {
"launchType": "java-launch",
"poller": "webPoller",
"pollerProperties": { "url": "..." },
"onProcessTerminated": "setServerStateStopped",
...launch args...
},
"shutdown": { "launchType": "terminateProcess" },
"actions": { ... }
}
}
}
},
"templates": {
"template-name": { ...shared config inherited by serverTypes referencing it... }
}
}The JSON model supports a template system (TemplateExtensionModelUtility.generateEffectiveMemento()) where server type entries reference a named template and the effective configuration is a merge of template + server-type-specific overrides.
GenericServerBehavior reads all its behavior from the JSON memento: launcher type (java-launch, noOp, terminateProcess), poller type, publish config, process termination handling, and server actions. Subclasses can override specific methods:
setDependentDefaults()— compute dependent attribute valuesgetDeploymentUrls()— custom context root / URL generationcreatePublishController()— custom publish behaviorlistServerActions()/executeServerAction()— custom server actionsgetExternalVariableResolver()— resolve custom variables from server config files (e.g., read port from a config file)
Variable substitution: The generic framework supports ${varName} substitution in JSON values. ServerStringVariableManager resolves variables from server attributes, and IExternalVariableResolver allows server-type-specific resolution (e.g., reading jetty.port from start.d/http.ini).
To add a new server type via the generic framework, a downstream OSGi bundle needs:
servers.json— JSON descriptor defining server types, discovery, downloads, and behavior- Activator — Extends
GenericServerActivator, implementsgetBundleId(),getServerTypeModelStream(), and optionallygetDelegateProvider() META-INF/MANIFEST.MF— OSGi manifest withBundle-ActivatorandImport-Packagepom.xml—eclipse-pluginpackaging
Optionally:
5. Custom delegate — Extends GenericServerBehavior for behavior that can't be expressed in JSON
6. ServerMain — Extends ServerManagementServerLauncher for standalone (non-OSGi) execution
The simplest possible server type (like a folder-deploy adapter) needs no custom delegate at all — just the JSON descriptor and a three-method activator. More complex types (like Jetty with config-file-driven ports) add a delegate subclass that overrides specific methods.
org.jboss.tools.rsp.api— Protocol interfaces and DAOsorg.jboss.tools.rsp.server.spi.servertype—IServerType,IServerDelegate,IServer,IServerWorkingCopyorg.jboss.tools.rsp.server.spi.model—IServerManagementModel,IServerModel, polling, listenersorg.jboss.tools.rsp.server.spi.discovery—ServerBeanType,IServerBeanTypeProvider,IServerBeanTypeManagerorg.jboss.tools.rsp.server.spi.launchers—AbstractJavaLauncher,IServerStartLauncher,IServerShutdownLauncherorg.jboss.tools.rsp.server.spi.publishing—IPublishController,AbstractFilesystemPublishControllerorg.jboss.tools.rsp.server.spi—RSPExtensionBundleorg.jboss.tools.rsp.server.generic—GenericServerActivator,GenericServerExtensionModel,GenericServerBehaviororg.jboss.tools.rsp.server.generic.servertype— Generic server type and behavior classesorg.jboss.tools.rsp.server.wildfly.servertype.impl— WildFly server types and delegatesorg.jboss.tools.rsp.server.wildfly.beans.impl— WildFly discovery (30+ServerBeanTypesubclasses)