Lobster Application Wrapper

Overview

The Service Wrapper is a Java-based application that allows you to run and manage Java applications as system services on both Windows and Linux platforms. It provides a unified interface for service installation, management, and monitoring across different operating systems.

Features

  • Cross-platform support: Works on Windows (using Service Control Manager) and Linux (using systemd)

  • Multi-application management: Can start and manage multiple Java applications simultaneously

  • Service lifecycle management: Install, uninstall, start, stop, restart services

  • Automatic startup configuration: Enable/disable automatic service startup (Linux only)

  • Console mode: Run applications directly in console for development and testing

System Requirements

  • Java 8 or higher

  • Administrator/root privileges for service installation

  • Windows: Windows Service Control Manager

  • Linux: systemd service management

Installation and Setup

1. Verify Installation Files

The wrapper files are already included in your installation:

script
./bin/wrapper.jar # Main wrapper application
./wrapper.json # Service configuration (DO NOT MODIFY)
./bin/bridge.json # Bridge service configuration (MODIFIABLE)
./bin/updater.json # Updater service configuration (DO NOT MODIFY)

2. Service Installation

Install the wrapper as a system service:

script
java -jar ./bin/wrapper.jar --install-service

Note: On both Windows and Linux, services are automatically configured for automatic startup during installation.

Service Management Commands

Installation Commands

Command

Description

Platform

--install-service

Install Starter as a system service (automatically enables startup)

Windows, Linux

--uninstall-service

Uninstall the Starter service

Windows, Linux

Service Control

Command

Description

Platform

--start-service

Start the Starter service

Windows, Linux

--stop-service

Stop the Starter service

Windows, Linux

--restart-service

Restart the Starter service

Windows, Linux

--service-status

Show service status information

Windows, Linux

Startup Configuration

Command

Description

Platform

--enable-service

Enable service for automatic startup

Linux only

--disable-service

Disable automatic startup

Linux only

Note: These commands are only available on Linux for managing the automatic startup behavior after installation. The service is automatically enabled during installation on both platforms.

Development Mode

Command

Description

Platform

--run

Run in console mode (for development/testing)

Windows, Linux

Configuration Files

wrapper.json

⚠️ DO NOT MODIFY THIS FILE

This file is pre-configured and defines which services the wrapper should start:

{
"Starting": [
{
"name": "updater",
"path": "./bin/updater.json"
},
{
"name": "bridge",
"path": "./bin/bridge.json"
}
]
}

updater.json

⚠️ DO NOT MODIFY THIS FILE

This file contains the pre-configured settings for the Updater service and should not be modified.

bridge.json

THIS FILE CAN BE MODIFIED

This is the main configuration file for the Bridge service. You can modify JVM arguments, classpath, and program arguments here:

{
"name": "Bridge",
"mainClass": "de.lobster.link.Server",
"jvmArgs": [
"-Dhsqldb.method_class_names=java.lang.Math",
"-Djava.io.tmpdir=%APP_DIR%/tmpIO",
"-Xms4096M",
"-Xmx4096M",
"-server",
"-Dhub.datawizard.handleIllegalData=true",
"-Dhub.home=%APP_DIR%",
"-Dhub.log=%APP_DIR%/logs",
"-Dmail.mime.encodefilename=true",
"-Dnetworkaddress.cache.ttl=300",
"-Dnetworkaddress.cache.negative.ttl=10",
"-XX:-OmitStackTraceInFastThrow",
"-Dhub.datawizard.acceptEmptyFtpFiles=true",
"-Dhub.datawizard.doNotDeleteX400Mails=false",
"-DHUB_CONSOLE=false",
"-DLOG_FILE=%APP_DIR%/logs/yyyy_mm_dd_server.log",
"-Dhub.service.factory.startRegistry=False",
"-Dhub.service.factory.rmiClient=False",
"-Dhub.skipStartClusterManager=true",
"-Dlobster-api.host=api-test.lobster-world.com"
],
"classpath": [
"./lib/tools.jar",
"./ext",
"./patch",
"./lib/*",
"./extlib/*",
"./etc/dtd/*"
],
"programArgs": [
"%APP_DIR%/etc/hub.xml",
"%APP_DIR%/etc/dummy.xml"
]
}

Configuration Parameters

Parameter

Description

name

Display name of the service

mainClass

Java main class to execute

jvmArgs

Array of JVM arguments (memory, system properties, etc.)

classpath

Array of classpath entries

programArgs

Array of command-line arguments passed to the main class

Variable Substitution

The wrapper supports automatic variable substitution:

  • %APP_DIR% - DO NOT CHANGE - This is automatically replaced with the application directory path by the wrapper

Important: The %APP_DIR% variable is a system variable that gets automatically replaced by the wrapper with the actual application directory path. Do not modify or remove these placeholders in the configuration.

Platform-Specific Installation

Windows Installation

script
# Install the service (automatically enabled for automatic startup)
java -jar .\bin\wrapper.jar --install-service

# Start the service
java -jar .\bin\wrapper.jar --start-service

# Check service status
java -jar .\bin\wrapper.jar --service-status

Linux Installation

script
# Install the service (automatically enabled for automatic startup)
java -jar ./bin/wrapper.jar --install-service

# Start the service
java -jar ./bin/wrapper.jar --start-service

# Check service status
java -jar ./bin/wrapper.jar --service-status

Common Usage Scenarios

Initial Setup - Windows

script
# Install and start the service
java -jar .\bin\wrapper.jar --install-service
java -jar .\bin\wrapper.jar --start-service
java -jar .\bin\wrapper.jar --service-status

Initial Setup - Linux

script
# Install and start the service
java -jar ./bin/wrapper.jar --install-service
java -jar ./bin/wrapper.jar --start-service
java -jar ./bin/wrapper.jar --service-status

Development and Testing

script
# Run in console mode for development (both platforms)
java -jar ./bin/wrapper.jar --run

Service Management

script
# Stop the service
java -jar ./bin/wrapper.jar --stop-service

# Restart the service
java -jar ./bin/wrapper.jar --restart-service

# Check service status
java -jar ./bin/wrapper.jar --service-status

Disable Automatic Startup (Linux Only)

If you want to prevent the service from starting automatically on system boot:

script
# Linux only - disable automatic startup
java -jar ./bin/wrapper.jar --disable-service

# Linux only - re-enable automatic startup
java -jar ./bin/wrapper.jar --enable-service

Complete Uninstallation - Windows

script
# Stop and uninstall the service
java -jar .\bin\wrapper.jar --stop-service
java -jar .\bin\wrapper.jar --uninstall-service

Complete Uninstallation - Linux

script
# Stop and uninstall the service
java -jar ./bin/wrapper.jar --stop-service
java -jar ./bin/wrapper.jar --uninstall-service