Skip to content

Base functionality for webservices based on the service API in state-machine

License

Notifications You must be signed in to change notification settings

paulmackinlay/service-base

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

service-base

This repo contains base functionality for the service API. It is a collection of fundamental subsystems and tools to be used as the basis of any app or microservice. It includes:

  • A subsystem that bootstraps application configuration based on properties
  • A subsystem that prepares and logs fundamental information useful for 3rd line support
  • Utilities to help with command line arguments, properties and starting a process
  • Small dependency footprint consisting of a service API and a logging API
  • Extensively tested

In the docs you will find examples of how to use this library.

Minimum Java Version

This project uses a Java language specification version 17, it is compatible with Java 17 and higher.

Use service-base with maven or gradle

This project is in maven central, to start using it just add this dependency to your POM.

<dependency>
    <groupId>com.webotech</groupId>
    <artifactId>service-base</artifactId>
    <version>0.0.8</version>
</dependency>

or this dependency in gradle

implementation 'com.webotech:service-base:0.0.8'

Please use the latest version available in maven central - the version in this page may be old.

Quick start

  • Create a service class that extends AbstractAppService<BasicAppContext>
  • Use ServiceUtil to provide a BasicAppContext equipped with recommended Subsystems
  • The service needs a main method that uses ServiceUtil to start it

Example App

public class ExampleApp extends AbstractAppService<BasicAppContext> {

  ExampleApp(String[] args) {
    super(ServiceUtil.equipBasicContext("ExampleApp", args));
  }

  public static void main(String[] args) {
    ServiceUtil.startService(new ExampleApp(args));
  }
}

About

Base functionality for webservices based on the service API in state-machine

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages