All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.cinchapi.quest.router.Routine Maven / Gradle / Ivy

Go to download

Quest is a JVM framework for quickly defining both api endpoints and view controllers in a web application

The newest version!
package org.cinchapi.quest.router;

/**
 * A {@link Routine} is a {@link Route} that does not return a payload or render
 * a view. It is generally used to check for some common preconditions before
 * executing other routes.
 * 

* A Routine matches every other route for the Router in which it was defined. * For example, a Routine defined in the {@code HelloWorldRouter} will match all * requests to {@code /hello/world/*}. Routines are meant to be catch-alls so * there is no way to further specify the paths a Routine should match. *

* * @author jnelson */ public abstract class Routine extends AbstractRewritableRoute { /** * Construct a new instance. */ protected Routine() { super("/*"); } @Override protected final Object handle() { run(); return ""; } /** * Run the routine. If, for some reason, the routine fails, you may call * {@link #halt()}, or redirect to another route or throw an exception. */ protected abstract void run(); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy