Package org.eclipse.jetty.util

Examples of org.eclipse.jetty.util.Scanner$TimeNSize


                    System.out.println("  " + f.getAbsolutePath());
                    webappcontext.setExtraClasspath(f.getAbsolutePath());
                }
                System.out.println("");

                Scanner scanner = new Scanner();
                scanner.setScanInterval(interval);

                scanner.setRecursive(true);
                scanner.addListener(new Scanner.BulkListener() {
                    @Override
                    public void filesChanged(List<String> filenames)
                            throws Exception {
                        webappcontext.stop();
                        server.stop();
                        webappcontext.start();
                        server.start();
                    }
                });
                scanner.setReportExistingFilesOnStartup(false);
                scanner.setFilenameFilter(new FilenameFilter() {
                    @Override
                    public boolean accept(File folder, String name) {
                        return name.endsWith(".class");
                    }
                });

                scanner.setScanDirs(classFolders);
                scanner.start();
                server.getContainer().addBean(scanner);
            }
        }

        // Read web.xml to find all configured servlets
View Full Code Here


        System.err.println("add to scan list:"+item);
      }
    }

    // startScanner
    Scanner scanner = new Scanner();
    scanner.setScanInterval(scanIntervalSeconds);
    scanner.setScanDirs(scanList);
    scanner.setRecursive(true);
    scanner.setReportExistingFilesOnStartup(false);
    scanner.addListener(new RJRFileChangeListener(web,config));
    System.err.println("Starting scanner at interval of "
        + scanIntervalSeconds + " seconds.");
    try {
      scanner.start();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

        }
      }
    }

    // startScanner
    Scanner scanner = new Scanner();
    scanner.setReportExistingFilesOnStartup(false);
    scanner.setScanInterval(scanIntervalSeconds);
    scanner.setScanDirs(scanList);
    scanner.addListener(new Scanner.BulkListener() {

      public void filesChanged(@SuppressWarnings("rawtypes") List changes) {
        try {
          // boolean reconfigure = changes.contains(getProject()
          // .getFile().getCanonicalPath());
          System.err.println("Stopping webapp ...");

          web.stop();

          if (webAppClassPath != null) {
            ProjectClassLoader loader = new ProjectClassLoader(web,
                webAppClassPath, false);
            web.setClassLoader(loader);
          }
          System.err.println("Restarting webapp ...");
          web.start();
          System.err.println("Restart completed.");
        } catch (Exception e) {
          System.err
              .println("Error reconfiguring/restarting webapp after change in watched files");
          e.printStackTrace();
        }
      }
    });
    System.err.println("Starting scanner at interval of "
        + scanIntervalSeconds + " seconds.");
    try {
      scanner.start();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

        System.err.println("add to scan list:"+item);
      }
    }

    // startScanner
    Scanner scanner = new Scanner();
    scanner.setScanInterval(scanIntervalSeconds);
    scanner.setScanDirs(scanList);
    scanner.setRecursive(true);
    scanner.setReportExistingFilesOnStartup(false);
    scanner.addListener(new RJRFileChangeListener(web,config));
    System.err.println("Starting scanner at interval of "
        + scanIntervalSeconds + " seconds.");
    try {
      scanner.start();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      } catch (MalformedURLException e) {
      } catch (IOException e) {
      }
    }
    // startScanner
    Scanner scanner = new Scanner();
    scanner.setReportExistingFilesOnStartup(false);
    scanner.setScanInterval(scanIntervalSeconds);
    scanner.setScanDirs(scanList);
    scanner.setRecursive(true);
    scanner.addListener(new Scanner.BulkListener() {

      public void filesChanged(@SuppressWarnings("rawtypes") List changes) {
        try {
          // boolean reconfigure = changes.contains(getProject()
          // .getFile().getCanonicalPath());
          System.err.println("Stopping webapp ...");

          web.stop();

          if (webAppClassPath != null) {
            ProjectClassLoader loader = new ProjectClassLoader(web,
                config.getWebAppClassPath(),
                config.getExcludedclasspath(), false);
            web.setClassLoader(loader);
          }
          System.err.println("Restarting webapp ...");
          web.start();
          System.err.println("Restart completed.");
        } catch (Exception e) {
          System.err
              .println("Error reconfiguring/restarting webapp after change in watched files");
          e.printStackTrace();
        }
      }
    });
    System.err.println("Starting scanner at interval of "
        + scanIntervalSeconds + " seconds.");
    try {
      scanner.start();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      } catch (MalformedURLException e) {
      } catch (IOException e) {
      }
    }
    // startScanner
    Scanner scanner = new Scanner();
    scanner.setReportExistingFilesOnStartup(false);
    scanner.setScanInterval(scanIntervalSeconds);
    scanner.setScanDirs(scanList);
    scanner.setRecursive(true);
    scanner.addListener(new Scanner.BulkListener() {

      public void filesChanged(@SuppressWarnings("rawtypes") List changes) {
        try {
          // boolean reconfigure = changes.contains(getProject()
          // .getFile().getCanonicalPath());
          System.err.println("Stopping webapp ...");

          web.stop();

          if (webAppClassPath != null) {
            ProjectClassLoader loader = new ProjectClassLoader(web,
                config.getWebAppClassPath(),
                config.getExcludedclasspath(), false);
            web.setClassLoader(loader);
          }
          System.err.println("Restarting webapp ...");
          web.start();
          System.err.println("Restart completed.");
        } catch (Exception e) {
          System.err
              .println("Error reconfiguring/restarting webapp after change in watched files");
          e.printStackTrace();
        }
      }
    });
    System.err.println("Starting scanner at interval of "
        + scanIntervalSeconds + " seconds.");
    try {
      scanner.start();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

        }
      }
    }

    // startScanner
    Scanner scanner = new Scanner();
    scanner.setReportExistingFilesOnStartup(false);
    scanner.setScanInterval(scanIntervalSeconds);
    scanner.setScanDirs(scanList);
    scanner.addListener(new Scanner.BulkListener() {

      public void filesChanged(@SuppressWarnings("rawtypes") List changes) {
        try {
          // boolean reconfigure = changes.contains(getProject()
          // .getFile().getCanonicalPath());
          System.err.println("Stopping webapp ...");

          web.stop();

          if (webAppClassPath != null) {
            ProjectClassLoader loader = new ProjectClassLoader(web,
                webAppClassPath, false);
            web.setClassLoader(loader);
          }
          System.err.println("Restarting webapp ...");
          web.start();
          System.err.println("Restart completed.");
        } catch (Exception e) {
          System.err
              .println("Error reconfiguring/restarting webapp after change in watched files");
          e.printStackTrace();
        }
      }
    });
    System.err.println("Starting scanner at interval of "
        + scanIntervalSeconds + " seconds.");
    try {
      scanner.start();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

        }
      }
    }

    // startScanner
    Scanner scanner = new Scanner();
    scanner.setReportExistingFilesOnStartup(false);
    scanner.setScanInterval(scanIntervalSeconds);
    scanner.setScanDirs(scanList);
    scanner.addListener(new Scanner.BulkListener() {

      public void filesChanged(@SuppressWarnings("rawtypes") List changes) {
        try {
          // boolean reconfigure = changes.contains(getProject()
          // .getFile().getCanonicalPath());
          System.err.println("Stopping webapp ...");

          web.stop();

          if (webAppClassPath != null) {
            ProjectClassLoader loader = new ProjectClassLoader(web,
                webAppClassPath, false);
            web.setClassLoader(loader);
          }
          System.err.println("Restarting webapp ...");
          web.start();
          System.err.println("Restart completed.");
        } catch (Exception e) {
          System.err
              .println("Error reconfiguring/restarting webapp after change in watched files");
          e.printStackTrace();
        }
      }
    });
    System.err.println("Starting scanner at interval of "
        + scanIntervalSeconds + " seconds.");
    try {
      scanner.start();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

        }
      }
    }

    // startScanner
    Scanner scanner = new Scanner();
    scanner.setReportExistingFilesOnStartup(false);
    scanner.setScanInterval(scanIntervalSeconds);
    scanner.setScanDirs(scanList);
    scanner.addListener(new Scanner.BulkListener() {

      public void filesChanged(@SuppressWarnings("rawtypes") List changes) {
        try {
          // boolean reconfigure = changes.contains(getProject()
          // .getFile().getCanonicalPath());
          System.err.println("Stopping webapp ...");

          web.stop();

          if (webAppClassPath != null) {
            ProjectClassLoader loader = new ProjectClassLoader(web,
                webAppClassPath, false);
            web.setClassLoader(loader);
          }
          System.err.println("Restarting webapp ...");
          web.start();
          System.err.println("Restart completed.");
        } catch (Exception e) {
          System.err
              .println("Error reconfiguring/restarting webapp after change in watched files");
          e.printStackTrace();
        }
      }
    });
    System.err.println("Starting scanner at interval of "
        + scanIntervalSeconds + " seconds.");
    try {
      scanner.start();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      } catch (MalformedURLException e) {
      } catch (IOException e) {
      }
    }
    // startScanner
    Scanner scanner = new Scanner();
    scanner.setReportExistingFilesOnStartup(false);
    scanner.setScanInterval(scanIntervalSeconds);
    scanner.setScanDirs(scanList);
    scanner.setRecursive(true);
    scanner.addListener(new Scanner.BulkListener() {

      public void filesChanged(@SuppressWarnings("rawtypes") List changes) {
        try {
          // boolean reconfigure = changes.contains(getProject()
          // .getFile().getCanonicalPath());
          System.err.println("Stopping webapp ...");

          web.stop();

          if (webAppClassPath != null) {
            ProjectClassLoader loader = new ProjectClassLoader(web,
                config.getWebAppClassPath(),
                config.getExcludedclasspath(), false);
            web.setClassLoader(loader);
          }
          System.err.println("Restarting webapp ...");
          web.start();
          System.err.println("Restart completed.");
        } catch (Exception e) {
          System.err
              .println("Error reconfiguring/restarting webapp after change in watched files");
          e.printStackTrace();
        }
      }
    });
    System.err.println("Starting scanner at interval of "
        + scanIntervalSeconds + " seconds.");
    try {
      scanner.start();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.util.Scanner$TimeNSize

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.