ingo@100: /* ingo@100: * Copyright (c) 2010 by Intevation GmbH ingo@100: * ingo@100: * This program is free software under the LGPL (>=v2.1) ingo@100: * Read the file LGPL.txt coming with the software for details ingo@100: * or visit http://www.gnu.org/licenses/ if it does not exist. ingo@100: */ ingo@100: teichmann@475: package org.dive4elements.artifactdatabase; sascha@2: teichmann@475: import org.dive4elements.artifactdatabase.rest.HTTPServer; sascha@19: ingo@83: sascha@5: /** sascha@5: * Starting point of the artifact database. sascha@5: * sascha@77: * @author Sascha L. Teichmann sascha@5: */ sascha@2: public class App sascha@2: { sascha@87: /** sascha@87: * Starts the artifact database. sascha@87: * @param args The commandline arguments. Unused. sascha@87: */ sascha@2: public static void main(String[] args) { sascha@19: sascha@5: FactoryBootstrap bootstrap = new FactoryBootstrap(); sascha@5: sascha@5: bootstrap.boot(); sascha@13: ingo@128: Backend backend = Backend.getInstance(); sascha@32: sascha@32: ArtifactDatabaseImpl db = new ArtifactDatabaseImpl( sascha@32: bootstrap, backend); sascha@32: sascha@30: DatabaseCleaner cleaner = new DatabaseCleaner( teichmann@541: bootstrap.getContext(), teichmann@541: backend, teichmann@541: backend.getSQLExecutor(), teichmann@541: backend.getConfig()); sascha@30: sascha@263: HTTPServer httpServer = bootstrap.getHTTPServer(); sascha@263: ingo@79: bootstrap = null; ingo@79: sascha@32: backend.setCleaner(cleaner); sascha@30: sascha@230: cleaner.setLockedIdsProvider(db); sascha@13: sascha@32: cleaner.start(); sascha@19: sascha@304: db.start(); sascha@304: sascha@263: httpServer.startAsServer(db); sascha@2: } sascha@2: } ingo@79: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :