/*
(non-Javadoc)

@see org.apache.maven.enforcer.rule.api.EnforcerRule#execute(org.apache.maven.enforcer.rule.api.EnforcerRuleHelper)
172259
public void execute( EnforcerRuleHelper helper )
        throws EnforcerRuleException
    {
        this.log = helper.getLog();

        // if the file is already defined, use that. Otherwise get the main artifact.
        if ( files.length == 0 )
        {
            try
            {
                MavenProject project = (MavenProject) helper.evaluate( "${project}" );
                files = new File[1];
                files[0] = project.getArtifact().getFile();

                super.execute( helper );
            }
            catch ( ExpressionEvaluationException e )
            {
                throw new EnforcerRuleException( "Unable to retrieve the project.", e );
            }
        }
        else
        {
            super.execute( helper );
        }

    }
546526
public void execute() throws MojoExecutionException, MojoFailureException {
		try {
			createBundles();
		} catch (Exception ex) {
			Logger logger = Logger.getLogger(JawrMojo.class.getName());
			if(ex instanceof ServletException){
				logger.log(Level.SEVERE, null, ((ServletException)ex).getRootCause());
			}else{
				logger.log(Level.SEVERE, null, ex);
			}
			throw new MojoFailureException("JAWR Maven plugin failed: " + ex.getLocalizedMessage());
		}
	}
915811
@Override
    public void execute() throws MojoExecutionException {
        
        if (StringUtils.isEmpty(moduleSource) && ignoreMissingSource) {
            getLog().info("No help module source specified.");
            return;
        }
        
        init("help", moduleBase);
        registerLoader(new SourceLoader("javahelp", "*.hs", ZipIterator.class));
        registerLoader(new SourceLoader("ohj", "*.hs", ZipIterator.class));
        registerLoader(new ChmSourceLoader());
        registerExternalLoaders();
        SourceLoader loader = sourceLoaders.get(moduleFormat);
        
        if (loader == null) {
            throw new MojoExecutionException("No source loader found for format " + moduleFormat);
        }
        
        try {
            String sourceFilename = FileUtils.normalize(baseDirectory + "/" + moduleSource);
            HelpProcessor processor = new HelpProcessor(this, sourceFilename, loader);
            processor.transform();
            addConfigEntry("help", moduleId, processor.getHelpSetFile(), moduleName, getModuleVersion(), moduleFormat,
                moduleLocale);
            assembleArchive();
        } catch (Exception e) {
            throw new MojoExecutionException("Unexpected error.", e);
        }
    }
1178511
@Override
    public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {

        nameValidator.validate(operation);
        final String newAlias = operation.require(NAME).asString();
        final ModelNode submodel = context.readResourceForUpdate(PathAddress.EMPTY_ADDRESS).getModel();
        final ModelNode currentValue = submodel.get(CacheContainerResource.ALIASES.getName()).clone();

        ModelNode newValue = addNewAliasToList(currentValue, newAlias) ;

        // now set the new ALIAS attribute
        final ModelNode syntheticOp = new ModelNode();
        syntheticOp.get(CacheContainerResource.ALIASES.getName()).set(newValue);
        CacheContainerResource.ALIASES.validateAndSet(syntheticOp, submodel);

        // since we modified the model, set reload required
        if (requiresRuntime(context)) {
            context.addStep((context1, operation1) -> {
                context1.reloadRequired();
                context1.completeStep(OperationContext.RollbackHandler.REVERT_RELOAD_REQUIRED_ROLLBACK_HANDLER);
            }, OperationContext.Stage.RUNTIME);
        }
    }
1315562
@Override
	public boolean execute(final ProcessInstance processInstance) {
		getBundleSelector().selectBundle(processInstance);
		List<Lock> locks = ContextUtils.getLocks(processInstance,getLockFactory(),"nz.co.senanque.workflow.Executor.execute(ProcessInstance)");
		LockTemplate lockTemplate = new LockTemplate(locks, new LockAction() {
			
			public void doAction() {
				log.debug("executing {}",processInstance.getId());
				getWorkflowManager().execute(processInstance.getId());
			}});
		return lockTemplate.doAction();
	}
702316
protected void execute(CommandLine cmdLine)
            throws MojoFailureException, MojoExecutionException
        {
        try
            {
            DefaultExecutor executor = new DefaultExecutor();
            executor.setWorkingDirectory(workingDir);
            executor.setStreamHandler(new PumpStreamHandler(System.out, System.err, System.in));

            executor.execute(cmdLine);
            }
        catch (ExecuteException e)
            {
            throw new MojoFailureException("npm failure", e);
            }
        catch (IOException e)
            {
            throw new MojoExecutionException("Error executing NPM", e);
            }
        }
1244798
public void execute() throws MojoExecutionException {
        super.execute();
        try {
            lambdaFunctions.forEach(context -> {
                try {
                    deleteTriggers.andThen(deleteFunction).apply(
                            context.withFunctionArn(lambdaClient.getFunction(new GetFunctionRequest()
                                .withFunctionName(context.getFunctionName())).getConfiguration().getFunctionArn()));                      
                } catch (Exception e) {
                    getLog().error(e.getMessage());
                }
            });
        } catch (Exception e) {
            getLog().error(e.getMessage(), e);
        }
    }
1079058
@Override
    public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {

        nameValidator.validate(operation);
        final String attributeName = operation.require(NAME).asString();

        final ModelNode submodel = context.readResource(PathAddress.EMPTY_ADDRESS).getModel();
        final ModelNode currentValue = submodel.get(attributeName).clone();

        context.getResult().set(currentValue);
    }
1331237
@Override
    public Object execute() throws Exception 
    {
        Object ret = executeChange();
        if (changesManager != null)
            changesManager.modelChanged();
        return ret;
    }
1086295
public <T> T execute(Callable<T> callable) throws ProcessApplicationExecutionException {
    try {
      return callable.call();
    }
    catch (Exception e) {
      throw LOG.processApplicationExecutionException(e);
    }
  }
1244932
@Override
    protected void doExecute() throws Exception {
        final CommandHandler commandHandler = new CommandHandlerImpl(this.getLog());

        checkStageDirectoryExistence();

        checkRuntimeExistence(commandHandler);

        runFunctions(commandHandler);
    }
1253450
public synchronized void execute() throws MojoExecutionException, MojoFailureException {
        try {
            doExecute();
        }
        catch (Exception e) {
            //
            // NOTE: Wrap to avoid truncating the stacktrace
            //

            if (e instanceof MojoExecutionException) {
                throw new MojoExecutionException(e.getMessage(), e);
            }
            else if (e instanceof MojoFailureException) {
                MojoFailureException x = new MojoFailureException(e.getMessage());
                x.initCause(e);
                throw x;
            }
            else {
                throw new MojoExecutionException(e.getMessage(), e);
            }
        }
    }
617787
@Override
   public void execute() throws BuildException 
   {
      ClassLoader oldCL = SecurityActions.getThreadContextClassLoader();
      try 
      {
         SecurityActions.setThreadContextClassLoader(SecurityActions.getClassLoader(ValidatorTask.class));

         Validation.validate(new File(getRarFile()).toURI().toURL(), 
            getOutputDir(), getCommandLine().getClasspath().list());
      }
      catch (Throwable t) 
      {
         throw new BuildException(t.getMessage(), t);
      }
      finally
      {
         SecurityActions.setThreadContextClassLoader(oldCL);
      }
   }
679977
public void execute( EnforcerRuleHelper theHelper )
        throws EnforcerRuleException
    {
        List<String> missingProfiles = new ArrayList<String>();
        try
        {
            MavenProject project = (MavenProject) theHelper.evaluate( "${project}" );
            if ( StringUtils.isNotEmpty( profiles ) )
            {
                String[] profs = profiles.split( "," );
                for ( String profile : profs )
                {
                    if ( !isProfileActive( project, profile ) )
                    {
                        missingProfiles.add( profile );
                    }
                }

                boolean fail = false;
                if ( !missingProfiles.isEmpty() )
                {
                    fail = true;
                    // if (all && missingProfiles.size() != profs.length)
                    // {
                    // fail = true;
                    // }
                    // else
                    // {
                    // if (!all && missingProfiles.size() >= (profs.length -1))
                    // {
                    // fail = true;
                    // }
                    // }
                }

                if ( fail )
                {
                    String message = getMessage();
                    StringBuilder buf = new StringBuilder();
                    if ( message != null )
                    {
                        buf.append( message + "\n" );
                    }

                    for ( String profile : missingProfiles )
                    {
                        buf.append( "Profile \"" + profile + "\" is not activated.\n" );
                    }

                    throw new EnforcerRuleException( buf.toString() );
                }

            }

        }
        catch ( ExpressionEvaluationException e )
        {
            throw new EnforcerRuleException( "Unable to retrieve the project.", e );
        }

    }
731306
public void execute( EnforcerRuleHelper helper )
        throws EnforcerRuleException
    {
        boolean callSuper;
        MavenProject project = null;
        if ( onlyWhenRelease )
        {
            // get the project
            project = getProject( helper );

            // only call super if this project is a release
            callSuper = !project.getArtifact().isSnapshot();
        }
        else
        {
            callSuper = true;
        }
        if ( callSuper )
        {
            super.execute( helper );
            if ( failWhenParentIsSnapshot )
            {
                if ( project == null )
                {
                    project = getProject( helper );
                }
                Artifact parentArtifact = project.getParentArtifact();
                if ( parentArtifact != null && parentArtifact.isSnapshot() )
                {
                    throw new EnforcerRuleException( "Parent Cannot be a snapshot: " + parentArtifact.getId() );
                }
            }
        }
    }
865479
@Override
	public void execute() {
		if (target instanceof WComponentGroup<?>) {
			for (WComponent component : ((WComponentGroup<WComponent>) target).getComponents()) {
				if (component instanceof SubordinateTarget) {
					applyAction((SubordinateTarget) component, value);
				}
			}
		} else {
			// Leaf.
			applyAction(target, value);
		}

	}
511738
public void execute()
			throws BuildException
	{
		try
		{
			verboseHeaderToLog();

			List<String> args = buildCommandLine();

			verboseCommandLineToLog(args);

			doRun(args);

		}
        catch (BuildException ex) {
            throw ex;
        }
		catch (Exception ex)
		{
			throw new BuildException("AntTaskRunner", ex);
		}
	}