sascha@2: package de.intevation.artifactdatabase; sascha@2: sascha@19: import de.intevation.artifactdatabase.rest.Standalone; sascha@19: sascha@19: import java.io.File; sascha@19: sascha@19: import java.net.MalformedURLException; sascha@19: sascha@19: import org.apache.log4j.PropertyConfigurator; sascha@19: sascha@5: /** sascha@5: * Starting point of the artifact database. sascha@5: * sascha@5: * @author Sascha L. Teichmann (sascha.teichmann@intevation.de) sascha@5: */ sascha@2: public class App sascha@2: { sascha@19: public static final String LOG4J_PROPERTIES = sascha@19: "log4j.properties"; sascha@19: sascha@19: public static final void configureLogging() { sascha@19: File configDir = Config.getConfigDirectory(); sascha@19: File propFile = new File(configDir, LOG4J_PROPERTIES); sascha@19: sascha@19: if (propFile.isFile() && propFile.canRead()) { sascha@19: try { sascha@19: PropertyConfigurator.configure(propFile.toURI().toURL()); sascha@19: } sascha@19: catch (MalformedURLException mue) { sascha@19: mue.printStackTrace(System.err); sascha@19: } sascha@19: } sascha@19: } sascha@19: sascha@2: public static void main(String[] args) { sascha@19: sascha@19: configureLogging(); sascha@19: sascha@5: FactoryBootstrap bootstrap = new FactoryBootstrap(); sascha@5: sascha@5: bootstrap.boot(); sascha@13: sascha@32: Backend backend = new Backend(); sascha@32: sascha@32: ArtifactDatabaseImpl db = new ArtifactDatabaseImpl( sascha@32: bootstrap, backend); sascha@32: sascha@30: DatabaseCleaner cleaner = new DatabaseCleaner( sascha@30: bootstrap.getContext()); sascha@30: sascha@32: backend.setCleaner(cleaner); sascha@30: sascha@32: cleaner.setFilter(db); sascha@13: sascha@32: cleaner.start(); sascha@19: sascha@19: Standalone.startAsServer(db); sascha@2: } sascha@2: } sascha@2: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: