package nl.tehdreamteam.se42.web;

import nl.tehdreamteam.se42.web.soap.SoapWebService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * The {@code Application} class gathers all services (Such as SOAP, REST, etc.), and starts them.
 */
public class Application {

    private static final Logger logger = LogManager.getLogger(Application.class.getSimpleName());

    /**
     * Starts all services.
     *
     * @param args The command-line arguments.
     */
    public static void main(String[] args) {
        Service soap = new SoapWebService();

        try {
            soap.start();
        } catch (Exception e) {
            logger.fatal("Failed to start soap service.", e);
        }
    }

}

@@ -28,16 +28,274 @@
 2.web;%0A%0A
+import nl.tehdreamteam.se42.web.command.CommandHandler;%0Aimport nl.tehdreamteam.se42.web.command.impl.ExitApplicationCommand;%0Aimport nl.tehdreamteam.se42.web.command.impl.StartServicesCommand;%0Aimport nl.tehdreamteam.se42.web.command.impl.StopServicesCommand;%0A
 import n
@@ -424,16 +424,43 @@
 ogger;%0A%0A
+import java.util.Scanner;%0A%0A
 /**%0A * T
@@ -565,16 +565,22 @@
 %0Apublic 
+final 
 class Ap
@@ -853,16 +853,83 @@
 vice
- soap = 
+Container container = new ServiceContainer();%0A        container.addService(
 new 
@@ -944,16 +944,17 @@
 ervice()
+)
 ;%0A%0A     
@@ -978,18 +978,26 @@
     
-soap
+container
 .start
+All
 ();%0A
@@ -1074,27 +1074,589 @@
 art 
-soap service.%22, e);
+all services.%22, e);%0A        %7D%0A%0A        CommandHandler handler = new CommandHandler();%0A        handler.register(new StartServicesCommand(container));%0A        handler.register(new StopServicesCommand(container));%0A        handler.register(new ExitApplicationCommand(container));%0A%0A        startReadingCommandLine(handler);%0A    %7D%0A%0A    private static void startReadingCommandLine(CommandHandler handler) %7B%0A        try (Scanner sc = new Scanner(System.in)) %7B%0A            String line;%0A            while ((line = sc.nextLine()) != null) %7B%0A                handler.handle(line);%0A            %7D
 %0A   

Make the Application use the Command framework.