示例#1
0
  /**
   * Inits the DesignManager.
   *
   * @throws RuntimeException is thrown if <code>SystemException</code> will be thrown by <code>
   *     getXMLFile</code> or <code>XML2Design</code>.
   * @see #getXMLFile()
   * @see #XML2Design()
   */
  private static synchronized void init() {
    if (gsInit) return;
    Reloader.addReloader(DesignManager.class);

    synchronized (LOCK_DESIGNMANAGER) {
      gsBuffer = new Hashtable();
      try {
        getXMLFile();
        XML2Design();
      } catch (SystemException e) {
        LogManager.write("DesignManager.init: Unable to init the DesignManager\n" + e);
        throw new RuntimeException("DesignManager.init: Unable to init the DesignManager\n" + e);
      }
      gsInit = true;
    }
  }
示例#2
0
 /**
  * Returns the default design which is "eva".
  *
  * @return default design
  */
 public static Design getDefaultDesign() {
   if (gsBuffer == null || gsDefaultDesign == null) {
     LogManager.write("DefaultDesign is NULL");
     return null;
   } else {
     /*
      * Debug!!!
      * Sometimes there are NullpointerException that sould be threw here.
      */
     try {
       synchronized (gsBuffer) {
         synchronized (gsDefaultDesign) {
           return (Design) gsBuffer.get(gsDefaultDesign);
         }
       }
     } catch (Exception e) {
       throw new RuntimeException(
           "DesignManager.getDefaultDesign: DEBUG-EXCEPTION - "
               + gsDefaultDesign
               + ", "
               + gsBuffer);
     }
   }
 }