package com.bunjlabs.fugaframework;


import com.bunjlabs.fugaframework.configuration.Configuration;
import com.bunjlabs.fugaframework.network.HttpServer;
import com.bunjlabs.fugaframework.router.Router;
import com.bunjlabs.fugaframework.services.ServiceManager;
import com.bunjlabs.fugaframework.sessions.SessionManager;
import com.bunjlabs.fugaframework.sessions.SessionService;
import com.bunjlabs.fugaframework.templates.TemplateEngine;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public abstract class FugaApp {

    private static final Logger log = LogManager.getLogger(FugaApp.class);
    private final Configuration config;
    private final Router hmap = new Router();
    private final SessionManager sessionManager;
    private final TemplateEngine templateEngine;
    private final ServiceManager serviceManager;
    private final Map<String, Object> objects;
    private HttpServer httpserver;
    private SocketAddress addr;

    public FugaApp() {
        this.config = new Configuration();

        this.sessionManager = new SessionManager(this);

        this.templateEngine = new TemplateEngine(this);
        this.serviceManager = new ServiceManager(this);
        this.objects = new HashMap<>();

    }

    public Router getRouter() {
        return hmap;
    }

    public void start() throws Exception {
        log.info("Fuga Framework 0.2.1-SNAPSHOT");
        
        prepare();

        serviceManager.registerService(new SessionService(this), config.getInt("fuga.sessions.refreshtime", 15), TimeUnit.SECONDS);
        addr = new InetSocketAddress(config.get("fuga.http.bindhost", "localhost"), config.getInt("fuga.http.bindport", 8080));
        httpserver = new HttpServer(addr, this);
        httpserver.start();
    }

    public ServiceManager getServiceManager() {
        return serviceManager;
    }

    public SessionManager getSessionManager() {
        return sessionManager;
    }

    public Object getObject(String name) {
        return objects.get(name);
    }

    public void putObject(String name, Object obj) {
        objects.put(name, obj);
    }

    public TemplateEngine getTemplateEngine() {
        return templateEngine;
    }

    public Configuration getConfiguration() {
        return config;
    }

    public abstract void prepare();
}

@@ -504,56 +504,8 @@
 ss;%0A
-import java.util.HashMap;%0Aimport java.util.Map;%0A
 impo
@@ -538,16 +538,16 @@
 meUnit;%0A
+
 import o
@@ -968,55 +968,8 @@
 er;%0A
-    private final Map%3CString, Object%3E objects;%0A
     
@@ -1271,48 +1271,8 @@
 is);
-%0A        this.objects = new HashMap%3C%3E();
 %0A%0A  
@@ -1929,32 +1929,32 @@
 sionManager() %7B%0A
+
         return s
@@ -1979,184 +1979,8 @@
  %7D%0A%0A
-    public Object getObject(String name) %7B%0A        return objects.get(name);%0A    %7D%0A%0A    public void putObject(String name, Object obj) %7B%0A        objects.put(name, obj);%0A    %7D%0A%0A
     

Remove unnecessary get/setObject methods from FugaApp