Examples of War


Examples of com.palmergames.bukkit.towny.war.War

      }
  }

  private void monarchDeath(Player attackerPlayer, Player defenderPlayer, Resident attackerResident, Resident defenderResident) {
    if (plugin.getTownyUniverse().isWarTime()) {
      War warEvent = plugin.getTownyUniverse().getWarEvent();
      try {
        Nation defenderNation = defenderResident.getTown().getNation();
        if (warEvent.isWarringNation(defenderNation))
          if (defenderResident.isMayor())
            if (defenderResident.isKing()) {
              if (attackerResident != null && attackerResident.hasTown())
                warEvent.remove(attackerResident.getTown(), defenderNation);
              else
                warEvent.remove(defenderNation);
              TownyMessaging.sendGlobalMessage(defenderNation.getName() + "'s king was killed. Nation removed from war.");
            } else {
              if (attackerResident != null && attackerResident.hasTown())
                warEvent.remove(attackerResident.getTown(), defenderResident.getTown());
              else
                warEvent.remove(defenderResident.getTown());
              TownyMessaging.sendGlobalMessage(defenderResident.getTown() + "'s mayor was killed. Town removed from war.");
            }
      } catch (NotRegisteredException e) {
      }
    }
View Full Code Here

Examples of com.palmergames.bukkit.towny.war.War

  public boolean isWarTime() {
    return warEvent != null ? warEvent.isWarTime() : false;
  }

  public void startWarEvent() {
    this.warEvent = new War(plugin, TownySettings.getWarTimeWarningDelay());
    setChangedNotify(WAR_START);
  }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.War

        File userWebXML = getWebXML(userWebFilesDir);
        IClasspathEntry[] jarEntries = getJarEntries();
        File userClassFilesDir = getAbsoluteOutputLocation(this.javaProject);
       
        outputWar.delete();
        War warTask = new War();
        progressMonitor.worked(1);
        Project antProject = new Project();
        antProject.init();
        warTask.setProject(antProject);
        warTask.setDestFile(outputWar);
        ZipFileSet classes = new ZipFileSet();
        classes.setDir(userClassFilesDir);
        warTask.addClasses(classes);
        classes = new ZipFileSet();
        classes.setDir(userClassFilesDir);
        classes.setIncludes("log4j.properties");
        warTask.addClasses(classes);
        if (userWebFilesDir != null && userWebFilesDir.exists())
        {
            FileSet webFiles = new FileSet();
            webFiles.setDir(userWebFilesDir);
            webFiles.setExcludes(WEBINF);
            warTask.addFileset(webFiles);
        }
        if (userWebXML != null && userWebXML.exists())
        {
            warTask.setWebxml(userWebXML);
        }
        else
        {
            // Without a webxml attribute the Ant war task
            // requires the update attribute set to true
            // That's why we actually need an existing war file.
            try
            {
                // A file is needed for war creation
                File voidFile = File.createTempFile("void", null);
                createZipFile(outputWar, voidFile);
                voidFile.delete();
            }
            catch (IOException e)
            {
                throw new CoreException(
                    new Status(
                        IStatus.ERROR,
                        WebappPlugin.getPluginId(),
                        IStatus.OK,
                        WebappMessages.getString(
                            "WarBuilder.message.createwar.temp"),
                        e));
            }

            warTask.setUpdate(true);
        }

        ZipFileSet[] jarFS = getZipFileSets(jarEntries);
        for (int i = 0; i < jarFS.length; i++)
        {
            warTask.addLib(jarFS[i]);
        }
        warTask.execute();
        progressMonitor.worked(2);
        return outputWar;
    }
View Full Code Here

Examples of org.apache.tools.ant.taskdefs.War

        createWar();
    }

    private void createWar() {
        War war = new War();
        war.setDestFile(destDir.resolve(processName + ".war").toFile());
        war.setNeedxmlfile(false);

        FileSet set = new FileSet();
        set.setDir(destDir.toFile());
        war.add(set);

        war.setTaskName("war");
        war.setProject(AntUtil.builder().getProject());

        war.execute();
    }
View Full Code Here

Examples of org.codehaus.cargo.container.deployable.WAR

        // (6) Stop the container
        container.stop();
    }

    private WAR getWAR(String context) {
        return new WAR(localRepository + "/org/apache/struts/"
                + context + "/" + version + "/"
                + context + "-" + version + ".war");
    }
View Full Code Here

Examples of org.codehaus.cargo.container.deployable.WAR

        deployer.setLogger(new LoggerImpl(listener.getLogger()));


        String extension = FilenameUtils.getExtension(f.getAbsolutePath());
        if ("WAR".equalsIgnoreCase(extension)) {
            WAR war = createWAR(f);
            if (!StringUtils.isEmpty(contextPath)) {
                war.setContext(contextPath);
            }
            deployer.redeploy(war);
        } else if ("EAR".equalsIgnoreCase(extension)) {
            EAR ear = createEAR(f);
            deployer.redeploy(ear);
View Full Code Here

Examples of org.codehaus.cargo.container.deployable.WAR

     *
     * @param deployableFile The deployable file to create the Deployable from.
     * @return A Deployable object.
     */
    protected WAR createWAR(File deployableFile) {
        return new WAR(deployableFile.getAbsolutePath());
    }
View Full Code Here

Examples of org.codehaus.cargo.container.deployable.WAR

      }
    }
    container.setExtraClasspath(extraClassPath.toArray(new String[extraClassPath.size()]));

    // Finally deploy Sqoop server war file
    configuration.addDeployable(new WAR("../server/target/sqoop.war"));

    // Start Sqoop server
    container.start();
  }
View Full Code Here

Examples of org.codehaus.cargo.container.deployable.WAR

     *
     * @param warLocation the war location
     * @return a container ready to start
     */
    protected InstalledLocalContainer getContainer(final String warLocation) {
        Deployable war = new WAR(warLocation);
        LocalConfiguration configuration = new Tomcat6xStandaloneLocalConfiguration(
                "target/tomcat6x");
        configuration.addDeployable(war);
        InstalledLocalContainer webapp = new Tomcat6xInstalledLocalContainer(
                configuration);
View Full Code Here

Examples of org.codehaus.cargo.container.deployable.WAR

        // (6) Stop the container
        container.stop();
    }

    private WAR getWAR(String context) {
        return new WAR(localRepository + "/org/apache/struts/"
                + context + "/" + version + "/"
                + context + "-" + version + ".war");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.