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, InstallLibraryMojo, InstallPluginMojo, ListModulesMojo, StartStopUndeployMojoSupport

public abstract class ModuleMojoSupport
extends ReportingMojoSupport

Support for mojos that operate on modules.

Version:
$Rev: 1041990 $ $Date: 2010-12-04 04:53:06 +0800 (Sat, 04 Dec 2010) $

Field Summary
protected  ModuleConfig[] modules
          List of module artifact configurations.
 
Fields inherited from class org.apache.geronimo.mavenplugins.geronimo.reporting.ReportingMojoSupport
logFile, logOutput, logOutputDirectory, reporters, stopOnFailure
 
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  javax.enterprise.deploy.spi.TargetModuleID[] findModules(java.lang.String moduleId, javax.enterprise.deploy.spi.TargetModuleID[] targetIds)
           
protected  javax.enterprise.deploy.spi.DeploymentManager getDeploymentManager()
          Get a deployment manager; if the manager was previosuly initialized then that cached instance is used.
protected  java.lang.String getModuleId(org.codehaus.mojo.pluginsupport.util.ArtifactItem item)
          Returns the Geronimo moduleId for the given artifact.
protected  javax.enterprise.deploy.spi.TargetModuleID[] getNonRunningModules(javax.enterprise.deploy.spi.TargetModuleID[] moduleIds)
          Given a list of modules, return a list of non-running ones.
protected  boolean isModuleStarted(java.lang.String moduleId)
          Check if the given module is started.
protected  void logModules(javax.enterprise.deploy.spi.TargetModuleID[] targetIds)
           
protected  void logModules(javax.enterprise.deploy.spi.TargetModuleID[] targetIds, java.lang.String pad)
           
protected  void startModule()
           
protected  void stopModule()
           
protected  void undeployModule()
           
protected  javax.enterprise.deploy.spi.status.DeploymentStatus waitFor(javax.enterprise.deploy.spi.status.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.

Constructor Detail

ModuleMojoSupport

public ModuleMojoSupport()
Method Detail

getDeploymentManager

protected javax.enterprise.deploy.spi.DeploymentManager getDeploymentManager()
                                                                      throws java.io.IOException,
                                                                             javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException
Get a deployment manager; if the manager was previosuly initialized then that cached instance is used.

Returns:
Deployment manager instance; never null
Throws:
java.io.IOException
javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException

waitFor

protected javax.enterprise.deploy.spi.status.DeploymentStatus waitFor(javax.enterprise.deploy.spi.status.ProgressObject progress)
                                                               throws java.lang.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:
java.lang.InterruptedException

getModuleId

protected java.lang.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 javax.enterprise.deploy.spi.TargetModuleID[] getNonRunningModules(javax.enterprise.deploy.spi.TargetModuleID[] moduleIds)
                                                                     throws java.lang.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:
java.lang.Exception

isModuleStarted

protected boolean isModuleStarted(java.lang.String moduleId)
                           throws java.lang.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:
java.lang.Exception

findModules

protected javax.enterprise.deploy.spi.TargetModuleID[] findModules(java.lang.String moduleId,
                                                                   javax.enterprise.deploy.spi.TargetModuleID[] targetIds)

startModule

protected void startModule()
                    throws java.lang.Exception
Throws:
java.lang.Exception

stopModule

protected void stopModule()
                   throws java.lang.Exception
Throws:
java.lang.Exception

undeployModule

protected void undeployModule()
                       throws java.lang.Exception
Throws:
java.lang.Exception

logModules

protected void logModules(javax.enterprise.deploy.spi.TargetModuleID[] targetIds)

logModules

protected void logModules(javax.enterprise.deploy.spi.TargetModuleID[] targetIds,
                          java.lang.String pad)


Copyright © 2003-2012 The Apache Geronimo development community. All Rights Reserved.