Exemplo n.º 1
0
  public void loadTipi(TipiContext newContext, String fileName, ExtensionDefinition ed)
      throws IOException, TipiException {
    logger.info("Context: " + newContext + " filename: " + fileName);
    InputStream in = newContext.getTipiResourceStream(fileName);

    if (in != null) {
      newContext.parseStream(in, ed);
      newContext.switchToDefinition("startup");
      in.close();

    } else {
      throw new TipiException("Error loading tipi: " + fileName);
    }
  }
Exemplo n.º 2
0
 private Map checkForProperties(TipiContext context, Enumeration e) {
   Map result = new HashMap();
   while (e.hasMoreElements()) {
     String current = (String) e.nextElement();
     if (current.startsWith("-D")) {
       String prop = current.substring(2);
       try {
         StringTokenizer st = new StringTokenizer(prop, "=");
         String name = st.nextToken();
         String value = st.nextToken();
         System.setProperty(name, value);
         result.put(name, value);
       } catch (NoSuchElementException ex) {
         logger.info("Error parsing system property");
       }
     }
     if ("tipidef".equals(current)) {
       tipiDef = myServletConfig.getInitParameter(current);
       logger.info("Startup def: " + tipiDef);
       continue;
     }
     context.setSystemProperty(current, myServletConfig.getInitParameter(current));
   }
   return result;
 }
Exemplo n.º 3
0
  public Window init() {
    try {
      startup();
    } catch (IOException e) {
      logger.error("Error: ", e);
    }
    TipiScreen echo = (TipiScreen) context.getDefaultTopLevel();

    TipiFrame w = (TipiFrame) echo.getTipiComponent("init");
    if (w == null) {
      throw new RuntimeException("No toplevel found!");
    }
    echo.setWindow(w.getWindow());
    return w.getWindow();
  }
Exemplo n.º 4
0
 public void finalize() {
   if (context != null) {
     context.exit();
   }
 }