1 13 package com.tonbeller.wcf.controller; 14 15 import java.util.List ; 16 17 import javax.servlet.http.HttpSession ; 18 19 22 public abstract class Controller implements RequestListener { 23 private static final Controller NULL_CONTROLLER = new Controller() { 24 public void addRequestListener(RequestListener l) { 25 } 26 27 public String getNextView() { 28 return null; 29 } 30 31 public List getRootListeners() { 32 return null; 33 } 34 35 public void removeRequestListener(RequestListener l) { 36 } 37 38 public void setNextView(String uri) { 39 } 40 41 public void request(RequestContext context) throws Exception { 42 } 43 }; 44 public static Controller instance(HttpSession session) { 45 try { 46 return WcfController.instance(session); 47 } catch (IllegalStateException e) { 48 return NULL_CONTROLLER; 50 51 } 52 } 53 54 public abstract void addRequestListener(RequestListener l); 55 public abstract void removeRequestListener(RequestListener l); 56 public abstract void setNextView(String uri); 57 public abstract String getNextView(); 58 59 62 public abstract List getRootListeners(); 63 } 64 | Popular Tags |