|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface StateHandler
This interface is an alternative for external state classes produced inside expresso. In the case of a state handler, all that happens is that this class is allocated and called within the function call to the state. It allows delegation to keep Expresso controllers from becoming behemoths, assists in grouping behavior together and is a step towards taming the wild 'all-in-one' class behavior that has become common in Expresso controllers.
Method Summary | |
---|---|
void |
handleRequest(ExpressoRequest request,
ExpressoResponse response)
Called to handle the request. |
Method Detail |
---|
void handleRequest(ExpressoRequest request, ExpressoResponse response) throws DBException, ControllerException
Controller
state handler. It is assumed
that the class MyHandler
implements the StateHandler
interface.
protected void runMyState(final ControllerRequest request,
final ControllerResponse response) throws ControllerException, DBException {
MyHander handler = new MyHandler();
handler.handleRequest(request,response);
}
request
- ControllerRequest The Function's ControllerRequest object.response
- ControllerResponse The Function's ControllerResponse object.
DBException
- upon underlying database exception error.
ControllerException
- upon underlying ControllerException error.
NonHandleableException
- if the state attempts a transition that
throws a NonHandleableException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |