org.apache.continuum.buildagent.build.execution
Class AbstractBuildExecutor

java.lang.Object
  extended by org.apache.continuum.buildagent.build.execution.AbstractBuildExecutor
All Implemented Interfaces:
ContinuumAgentBuildExecutor, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
Direct Known Subclasses:
AntBuildExecutor, MavenOneBuildExecutor, MavenTwoBuildExecutor, ShellBuildExecutor

public abstract class AbstractBuildExecutor
extends Object
implements ContinuumAgentBuildExecutor, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable


Field Summary
protected static org.slf4j.Logger log
           
 
Fields inherited from interface org.apache.continuum.buildagent.build.execution.ContinuumAgentBuildExecutor
ROLE
 
Constructor Summary
protected AbstractBuildExecutor(String id, boolean resolveExecutable)
           
 
Method Summary
protected  ContinuumAgentBuildExecutionResult executeShellCommand(Project project, String executable, String arguments, File output, Map<String,String> environments)
           
protected  String findExecutable(String executable, String defaultExecutable, boolean resolveExecutable, File workingDirectory)
          Find the actual executable path to be used
 BuildAgentConfigurationService getBuildAgentConfigurationService()
           
 BuildAgentInstallationService getBuildAgentInstallationService()
           
 BuildAgentManager getBuildAgentManager()
           
protected  String getBuildFileForProject(BuildDefinition buildDefinition)
           
protected  Properties getContinuumSystemProperties(Project project)
           
 String getDefaultExecutable()
           
 List<org.apache.maven.artifact.Artifact> getDeployableArtifacts(Project project, File workingDirectory, BuildDefinition buildDefinition)
           
 org.codehaus.plexus.commandline.ExecutableResolver getExecutableResolver()
           
 org.apache.maven.project.MavenProject getMavenProject(File workingDirectory, BuildDefinition buildDefinition)
           
protected  List<Map<String,Object>> getProjectDependencies(List<ProjectDependency> dependencies)
           
protected  List<Map<String,String>> getProjectDevelopers(List<ProjectDeveloper> developers)
           
protected  List<Map<String,Object>> getProjectNotifiers(List<ProjectNotifier> notifiers)
           
protected  Map<String,Object> getProjectParent(ProjectDependency parent)
           
 ShellCommandHelper getShellCommandHelper()
           
 File getWorkingDirectory(int projectId)
           
 void initialize()
           
 boolean isBuilding(Project project)
           
 boolean isResolveExecutable()
           
 void killProcess(Project project)
           
 void setBuildAgentConfigurationService(BuildAgentConfigurationService buildAgentConfigurationService)
           
 void setBuildAgentInstallationService(BuildAgentInstallationService buildAgentInstallationService)
           
 void setBuildAgentManager(BuildAgentManager buildAgentManager)
           
 void setDefaultExecutable(String defaultExecutable)
           
 void setExecutableResolver(org.codehaus.plexus.commandline.ExecutableResolver executableResolver)
           
 void setResolveExecutable(boolean resolveExecutable)
           
 void setShellCommandHelper(ShellCommandHelper shellCommandHelper)
           
protected  void updateProject(Project project)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.continuum.buildagent.build.execution.ContinuumAgentBuildExecutor
build, updateProjectFromWorkingDirectory
 

Field Detail

log

protected static final org.slf4j.Logger log
Constructor Detail

AbstractBuildExecutor

protected AbstractBuildExecutor(String id,
                                boolean resolveExecutable)
Method Detail

setShellCommandHelper

public void setShellCommandHelper(ShellCommandHelper shellCommandHelper)

getShellCommandHelper

public ShellCommandHelper getShellCommandHelper()

setDefaultExecutable

public void setDefaultExecutable(String defaultExecutable)

getBuildAgentConfigurationService

public BuildAgentConfigurationService getBuildAgentConfigurationService()

setBuildAgentConfigurationService

public void setBuildAgentConfigurationService(BuildAgentConfigurationService buildAgentConfigurationService)

getBuildAgentInstallationService

public BuildAgentInstallationService getBuildAgentInstallationService()

setBuildAgentInstallationService

public void setBuildAgentInstallationService(BuildAgentInstallationService buildAgentInstallationService)

getBuildAgentManager

public BuildAgentManager getBuildAgentManager()

setBuildAgentManager

public void setBuildAgentManager(BuildAgentManager buildAgentManager)

getDefaultExecutable

public String getDefaultExecutable()

initialize

public void initialize()
                throws org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
Specified by:
initialize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
Throws:
org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException

findExecutable

protected String findExecutable(String executable,
                                String defaultExecutable,
                                boolean resolveExecutable,
                                File workingDirectory)
Find the actual executable path to be used

Parameters:
defaultExecutable -
Returns:
The executable path

executeShellCommand

protected ContinuumAgentBuildExecutionResult executeShellCommand(Project project,
                                                                 String executable,
                                                                 String arguments,
                                                                 File output,
                                                                 Map<String,String> environments)
                                                          throws ContinuumAgentBuildExecutorException,
                                                                 ContinuumAgentBuildCancelledException
Throws:
ContinuumAgentBuildExecutorException
ContinuumAgentBuildCancelledException

getContinuumSystemProperties

protected Properties getContinuumSystemProperties(Project project)

getBuildFileForProject

protected String getBuildFileForProject(BuildDefinition buildDefinition)

updateProject

protected void updateProject(Project project)
                      throws ContinuumAgentBuildExecutorException
Throws:
ContinuumAgentBuildExecutorException

getProjectDevelopers

protected List<Map<String,String>> getProjectDevelopers(List<ProjectDeveloper> developers)

getProjectParent

protected Map<String,Object> getProjectParent(ProjectDependency parent)

getProjectDependencies

protected List<Map<String,Object>> getProjectDependencies(List<ProjectDependency> dependencies)

getProjectNotifiers

protected List<Map<String,Object>> getProjectNotifiers(List<ProjectNotifier> notifiers)

isBuilding

public boolean isBuilding(Project project)
Specified by:
isBuilding in interface ContinuumAgentBuildExecutor

killProcess

public void killProcess(Project project)
Specified by:
killProcess in interface ContinuumAgentBuildExecutor

getDeployableArtifacts

public List<org.apache.maven.artifact.Artifact> getDeployableArtifacts(Project project,
                                                                       File workingDirectory,
                                                                       BuildDefinition buildDefinition)
                                                                throws ContinuumAgentBuildExecutorException
Specified by:
getDeployableArtifacts in interface ContinuumAgentBuildExecutor
Throws:
ContinuumAgentBuildExecutorException

getMavenProject

public org.apache.maven.project.MavenProject getMavenProject(File workingDirectory,
                                                             BuildDefinition buildDefinition)
                                                      throws ContinuumAgentBuildExecutorException
Specified by:
getMavenProject in interface ContinuumAgentBuildExecutor
Throws:
ContinuumAgentBuildExecutorException

getWorkingDirectory

public File getWorkingDirectory(int projectId)

isResolveExecutable

public boolean isResolveExecutable()

setResolveExecutable

public void setResolveExecutable(boolean resolveExecutable)

setExecutableResolver

public void setExecutableResolver(org.codehaus.plexus.commandline.ExecutableResolver executableResolver)

getExecutableResolver

public org.codehaus.plexus.commandline.ExecutableResolver getExecutableResolver()


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.