view artifact-database/src/main/java/de/intevation/artifactdatabase/rest/JettyServer.java @ 405:e1738650bfca

FacetActivity: use Chain-of-responsibility pattern to figure out if facet should be active. artifacts/trunk@5154 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 29 Jul 2012 11:38:40 +0000
parents c42a07be9aee
children
line wrap: on
line source
package de.intevation.artifactdatabase.rest;

import de.intevation.artifacts.ArtifactDatabase;

import org.restlet.Component;
import org.restlet.Server;

import org.restlet.ext.jetty.HttpServerHelper;

import org.apache.log4j.Logger;

public class JettyServer
extends      Standalone
{
    private static Logger logger = Logger.getLogger(JettyServer.class);

    @Override
    public void startAsServer(ArtifactDatabase db) {

        Component component = new Component();

        RestApp app = new RestApp(db);

        Server server = createServer();

        // TODO: Do more sophisticated Jetty server configuration here.

        component.getServers().add(server);

        component.getDefaultHost().attach(app);

        logServerStart();

        HttpServerHelper serverHelper = new HttpServerHelper(server);

        try {
            serverHelper.start();
        }
        catch (Exception e) {
            logger.error(e.getLocalizedMessage(), e);
        }
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org