示例#1
0
文件: AuRedirect.java 项目: apextw/zk
 public void init(WebApp wapp) throws Exception {
   if (DHtmlUpdateServlet.getAuExtension(wapp, URI_PREFIX) == null) {
     try {
       DHtmlUpdateServlet.addAuExtension(wapp, URI_PREFIX, this);
     } catch (Throwable ex) {
       log.error("could not initialize AuRedirect extension", ex);
       throw new IllegalStateException("could not initialize AuRedirect extension", ex);
     }
   }
 }
示例#2
0
 /**
  * Returns the AU extension that is associated the specified prefix.
  *
  * @since 5.0.0
  */
 public static final AuExtension getAuExtension(WebApp wapp, String prefix) {
   DHtmlUpdateServlet upsv = DHtmlUpdateServlet.getUpdateServlet(wapp);
   if (upsv == null) {
     synchronized (DHtmlUpdateServlet.class) {
       upsv = DHtmlUpdateServlet.getUpdateServlet(wapp);
       if (upsv == null) {
         Map aues = (Map) wapp.getAttribute(ATTR_AU_PROCESSORS);
         return aues != null ? (AuExtension) aues.get(prefix) : null;
       }
     }
   }
   return upsv.getAuExtension(prefix);
 }