Package org.huihoo.willow

Examples of org.huihoo.willow.ContextDeployer


    if (!(context instanceof ContextDeployer))
    {
      return;
    }
    log.debug(sm.getString("contextConfig.undeploying"));
    ContextDeployer deployer = (ContextDeployer) context;
    String xpdlFiles[] = deployer.findDeployedPackages();
    for (int i = 0; i < xpdlFiles.length; i++)
    {
      log.debug(sm.getString("contextConfig.undeploy", xpdlFiles[i]));
      try
      {
View Full Code Here


  /**
   * Deploy directories.
   */
  protected void deployXpdls(File xpdlBase, String[] files)
  {
    ContextDeployer deployer = (ContextDeployer) context;
    for (int i = 0; i < files.length; i++)
    {
      if (deployed.contains(files[i]))
      {
        continue;
      }
      File xpdl = new File(xpdlBase, files[i]);
      if (xpdl.isFile() && xpdl.getName().endsWith(".xpdl"))
      {
        deployed.add(files[i]);
        // Deploy the application in this directory
        log.debug(sm.getString("contextConfig.deployXPDL", files[i]));
        long t1 = System.currentTimeMillis();
        try
        {
          URL url = new URL("file", null, xpdl.getCanonicalPath());
          deployer.install(xpdl.getName(), url);
        }
        catch (Throwable t)
        {
          log(sm.getString("contextConfig.deployXPDL.error", files[i]), t);
        }
View Full Code Here

    File contextBase = context.getAbsoluteAppBase();
    if (!contextBase.exists() || !contextBase.isDirectory())
    {
      return;
    }
    ContextDeployer deployer = (ContextDeployer) context;
    String xpdlFiles[] = deployer.findDeployedPackages();
    for (int i = 0; i < xpdlFiles.length; i++)
    {
      String xpdlFileName = xpdlFiles[i];
      File xpdlBase = new File(contextBase, "WEB-INF/xpdl");
      File xpdlFile = new File(xpdlBase, xpdlFileName);
      long newLastModified = xpdlFile.lastModified();
      Long lastModified = (Long) xpdlXmlLastModified.get(xpdlFileName);
      if (lastModified == null)
      {
        xpdlXmlLastModified.put(xpdlFileName, new Long(newLastModified));
      }
      else
      {
        if (lastModified.longValue() != newLastModified)
        {
          if (newLastModified > (lastModified.longValue() + 5000))
          {
            xpdlXmlLastModified.remove(xpdlFileName);
            try
            {
              URL url = new URL("file", null, xpdlFile.getCanonicalPath());
              deployer.remove(xpdlFileName);
              deployer.install(xpdlFileName, url);
            }
            catch (Throwable t)
            {
              log.error(sm.getString("contextConfig.deployXPDL.error", xpdlFile.getName()), t);
            }
View Full Code Here

TOP

Related Classes of org.huihoo.willow.ContextDeployer

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.