Package net.sf.qxs.messenger

Examples of net.sf.qxs.messenger.Messenger


    reporter = createMessenger(svr);
  }
 
  private Messenger createMessenger(ServerConfig cfg) throws FileNotFoundException
  {
    Messenger reporter;
    if (svr.getErrorLogFile() != null)
      reporter = new OutputStreamMessenger(new FileOutputStream(svr.getErrorLogFile(), true));
    else
      reporter = new OutputStreamMessenger(System.err);
View Full Code Here


    }
    */
   
    try
    {
      Messenger modlogger = new PrefixMessenger(mod.getTitle()+": ", reporter);
      ServletModuleData data = new ServletModuleData(mod, cfg.getResourceLoader(), request, modlogger);
      ModuleInstance instance = mod.getCachePolicy().createCachedModuleJob(mod, data, modlogger);
      boolean result = instance.run();
      data.close(result);
     
View Full Code Here

    }

    ConfigurationFileResource backup_resource = new ConfigurationFileResource(DEFAULT_CONFIGFILE);
    ConfigurationResource empty_resource = new ConfigurationDefaultResource();
   
    Messenger reporter = new MessageReporterDialog();
    EditorConfig cfg = readEditorConfig(reporter);

    if (cfgfile == null)
      cfgfile = cfg.getWorkingFile();

    Configuration pipesetup = null;
    boolean file_modified = false;
   
    if (cfgfile != null && cfg.getWorkingFile() != null && cfgfile.equals(cfg.getWorkingFile()) && DEFAULT_CONFIGFILE.lastModified() > cfgfile.lastModified())
    {
      int recover = JOptionPane.showConfirmDialog(null,
          "There may be unsaved changes to this file. Try to recover?",
                  "Recover",
                  JOptionPane.YES_NO_OPTION,
          JOptionPane.QUESTION_MESSAGE);
     
      if (recover == JOptionPane.YES_OPTION)
      {
        try {
          pipesetup = backup_resource.read();
          file_modified = true;
        } catch (Throwable e) {
        }
      }
    }
   
    if (pipesetup == null && cfgfile != null)
      pipesetup = parseConfigurationFile(cfg, cfgfile, reporter);
   
    if (pipesetup == null)
    {
      try {
        pipesetup = backup_resource.read();
      } catch (Throwable e) {
        e.printStackTrace();
        reporter.warn("Unable to load backup pipeline setup: "+e.getMessage());
      }
    }

    if (pipesetup == null)
    {
      try {
        pipesetup = empty_resource.read();
      } catch (Throwable e) {
        reporter.warn("Unable to load empty pipeline setup: "+e.toString());
      }
    }
   
    if (pipesetup == null)
      System.exit(1);
View Full Code Here

  public static void main(String[] args)
  {
    if (args.length != 1)
      usage();

    Messenger msgr = new OutputStreamMessenger(System.err);

    InputStream is = null;
    if (args[0].equals("-"))
      is = System.in;
    else
    {
      try
      {
        is = new FileInputStream(args[0]);
      }
      catch (FileNotFoundException e)
      {
        msgr.fatal("File not found: "+e.getMessage());
        System.exit(1);
      }
    }

    if (!Worker.doWork(is, System.out, msgr))
View Full Code Here

TOP

Related Classes of net.sf.qxs.messenger.Messenger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.