Mercurial > dive4elements > framework
view artifact-database/src/main/java/de/intevation/artifactdatabase/rest/BaseResource.java @ 45:9449f296cd54
Fixed inconsistencies in documentation after changes in h2-config
artifacts/trunk@162 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Hans Plum <hans.plum@intevation.de> |
---|---|
date | Wed, 30 Sep 2009 10:32:45 +0000 |
parents | af22d4de275c |
children | 4ae4dc99127d |
line wrap: on
line source
package de.intevation.artifactdatabase.rest; import org.apache.log4j.Logger; import org.restlet.resource.ServerResource; import org.restlet.resource.ResourceException; import org.restlet.representation.Representation; /** * @author Sascha L. Teichmann (sascha.teichmann@intevation) */ public class BaseResource extends ServerResource { private static Logger logger = Logger.getLogger(BaseResource.class); public BaseResource() { } protected Representation post(Representation requestRepr) throws ResourceException { try { return innerPost(requestRepr); } catch (ResourceException re) { throw re; } catch (RuntimeException re) { logger.error(re.getLocalizedMessage(), re); throw re; } } protected Representation innerPost(Representation requestRepr) throws ResourceException { return super.post(requestRepr); } protected Representation get() throws ResourceException { try { return innerGet(); } catch (ResourceException re) { throw re; } catch (RuntimeException re) { logger.error(re.getLocalizedMessage(), re); throw re; } } protected Representation innerGet() throws ResourceException { return super.get(); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: