1 29 30 package nextapp.echo2.webrender.service; 31 32 import java.io.IOException ; 33 34 import nextapp.echo2.webrender.Connection; 35 import nextapp.echo2.webrender.ContentType; 36 import nextapp.echo2.webrender.Service; 37 import nextapp.echo2.webrender.UserInstance; 38 39 48 public abstract class AsyncMonitorService 49 implements Service { 50 51 54 public static final String SERVICE_ID = "Echo.AsyncMonitor"; 55 56 59 public String getId() { 60 return SERVICE_ID; 61 } 62 63 66 public int getVersion() { 67 return DO_NOT_CACHE; 68 } 69 70 78 protected abstract boolean isSynchronizationRequired(UserInstance userInstance); 79 80 83 public void service(Connection conn) throws IOException { 84 conn.setContentType(ContentType.TEXT_XML); 85 if (isSynchronizationRequired(conn.getUserInstance())) { 86 conn.getWriter().write("<async-monitor request-sync=\"true\"/>"); 87 } else { 88 conn.getWriter().write("<async-monitor request-sync=\"false\"/>"); 89 } 90 } 91 } 92 | Popular Tags |