org.apache.geronimo.mavenplugins.geronimo.module
Class ModuleMojoSupport

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.pluginsupport.MojoSupport
          extended by org.codehaus.mojo.pluginsupport.ant.AntMojoSupport
              extended by org.apache.geronimo.mavenplugins.geronimo.GeronimoMojoSupport
                  extended by org.apache.geronimo.mavenplugins.geronimo.reporting.ReportingMojoSupport
                      extended by org.apache.geronimo.mavenplugins.geronimo.module.ModuleMojoSupport
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
Direct Known Subclasses:
DeployModuleMojo, ListModulesMojo, StartStopUndeployMojoSupport

public abstract class ModuleMojoSupport
extends ReportingMojoSupport

Support for mojos that operate on modules.


Field Summary
protected  ModuleConfig[] modules
          List of module artifact configurations.
protected  boolean stopOnFailure
          Whether to stop or proceed when errors and failures are encountered
 
Fields inherited from class org.apache.geronimo.mavenplugins.geronimo.reporting.ReportingMojoSupport
logFile, logOutput, logOutputDirectory, reporters
 
Fields inherited from class org.apache.geronimo.mavenplugins.geronimo.GeronimoMojoSupport
artifactRepository, hostname, password, port, project, username
 
Fields inherited from class org.codehaus.mojo.pluginsupport.ant.AntMojoSupport
ant
 
Fields inherited from class org.codehaus.mojo.pluginsupport.MojoSupport
container, log
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
ModuleMojoSupport()
           
 
Method Summary
protected  TargetModuleID[] findModules(String moduleId, TargetModuleID[] targetIds)
           
protected  DeploymentManager getDeploymentManager()
          Get a deployment manager; if the manager was previosuly initialized then that cached instance is used.
protected  String getModuleId(org.codehaus.mojo.pluginsupport.util.ArtifactItem item)
          Returns the Geronimo moduleId for the given artifact.
protected  TargetModuleID[] getNonRunningModules(TargetModuleID[] moduleIds)
          Given a list of modules, return a list of non-running ones.
protected  boolean isModuleStarted(String moduleId)
          Check if the given module is started.
protected  void logModules(TargetModuleID[] targetIds)
           
protected  void logModules(TargetModuleID[] targetIds, String pad)
           
protected  void startModule()
           
protected  void stopModule()
           
protected  void undeployModule()
           
protected  DeploymentStatus waitFor(ProgressObject progress)
          Waits for the given progress to stop running.
 
Methods inherited from class org.apache.geronimo.mavenplugins.geronimo.reporting.ReportingMojoSupport
execute, getFullClassName, getLogFile
 
Methods inherited from class org.apache.geronimo.mavenplugins.geronimo.GeronimoMojoSupport
getArtifactRepository, getProject
 
Methods inherited from class org.codehaus.mojo.pluginsupport.ant.AntMojoSupport
createFileSet, createTask, inheritProperties, init, initAntLogger, mkdir, setProperty, setSystemProperty, setSystemProperty
 
Methods inherited from class org.codehaus.mojo.pluginsupport.MojoSupport
contextualize, createArtifact, doExecute, getArtifact, getArtifactFactory, getArtifactResolver, getProjectArtifacts, getProjectArtifacts, getProjectArtifacts, resolveArtifact, resolveArtifact
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modules

protected ModuleConfig[] modules
List of module artifact configurations. Artifacts need to point to jar | war | ear | rar archive. Module artifact's configurations should match the moduleId specified in the plan, if plan exists.


stopOnFailure

protected boolean stopOnFailure
Whether to stop or proceed when errors and failures are encountered

Constructor Detail

ModuleMojoSupport

public ModuleMojoSupport()
Method Detail

getDeploymentManager

protected DeploymentManager getDeploymentManager()
                                          throws IOException,
                                                 DeploymentManagerCreationException
Get a deployment manager; if the manager was previosuly initialized then that cached instance is used.

Returns:
Deployment manager instance; never null
Throws:
IOException
DeploymentManagerCreationException

waitFor

protected DeploymentStatus waitFor(ProgressObject progress)
                            throws InterruptedException
Waits for the given progress to stop running.

Parameters:
progress - The progress object to wait for.
Returns:
The status of the deployment; never null
Throws:
InterruptedException

getModuleId

protected String getModuleId(org.codehaus.mojo.pluginsupport.util.ArtifactItem item)
Returns the Geronimo moduleId for the given artifact.

Parameters:
item - The artifact item to get the moduleId for.
Returns:
The moduleId of the given artifact item.

getNonRunningModules

protected TargetModuleID[] getNonRunningModules(TargetModuleID[] moduleIds)
                                         throws Exception
Given a list of modules, return a list of non-running ones.

Parameters:
moduleIds - The list of modules to check
Returns:
The list of modules that are not running
Throws:
Exception

isModuleStarted

protected boolean isModuleStarted(String moduleId)
                           throws Exception
Check if the given module is started.

Parameters:
moduleId - The module ID to check
Returns:
True if the module for this ID is started.
Throws:
Exception

findModules

protected TargetModuleID[] findModules(String moduleId,
                                       TargetModuleID[] targetIds)

startModule

protected void startModule()
                    throws Exception
Throws:
Exception

stopModule

protected void stopModule()
                   throws Exception
Throws:
Exception

undeployModule

protected void undeployModule()
                       throws Exception
Throws:
Exception

logModules

protected void logModules(TargetModuleID[] targetIds)

logModules

protected void logModules(TargetModuleID[] targetIds,
                          String pad)


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.