Container for services

Service container

Moonshine introduces an organizational unit bigger than a class - Service

What the Service is?
  • while class groups fields and methods, Service groups classes
  • contains exposed (public) and private classes
  • can depend on other services
  • has a lifecycle - can be started and stopped
What is Moonshine for?
  • structuring complex applications
  • promoting reusability
  • maintaining code flexibility
  • exceptionally easy and powerful testing
  • allows true Test Driven Development
  • can easily test multiple implementations
  • JUnit support - container starts as a part of your tests
  • only one central configuration file
  • allows tests specific configuration
  • enables multiple configurations testing
Legal info
  • Apache licensed - free to use for everyone, for both commercial and non-commercial uses

How to start?

1. Bootstrap new project


mvn archetype:generate \
	-DarchetypeGroupId=org.atteo.moonshine \

2. Select the services

Add selected services to the POM file


3. Create REST service

Create file 'src/main/java/'


public class HelloWorldResource {
	public String get() {
		return "Hello World!";

4. Start the container

Execute the following line from console:

mvn exec:java -Djetty.port=8080

Go to http://localhost:8080/ to see the result


Tutorial - a quick introduction to the basic features

Manual - in-depth description of the framework

Examples - sample projects

Javadocs - find your service description