org.codehaus.mojo.was6
Class AbstractWas6Mojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.was6.AbstractWas6Mojo
All Implemented Interfaces:
ContextEnabled, Mojo
Direct Known Subclasses:
AbstractAppMojo, AbstractEjbMojo, AbstractServerMojo, EndpointEnabler, ServiceDeployMojo, WsAdminMojo, WsDefaultBindingsMojo, WsListAppsMojo

public abstract class AbstractWas6Mojo
extends AbstractMojo

Abstract base class for running ws_ant.

Author:
David J. M. Karlsen

Field Summary
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractWas6Mojo()
           
 
Method Summary
protected abstract  void configureBuildScript(org.dom4j.Document document)
          Method to be implemented by subclasses for configuring their task.
protected  void configureTaskAttribute(org.dom4j.Document document, String attributeName, Object value)
          Configures task attributes.
 void execute()
          
protected  MavenProject getMavenProject()
          The enclosing project.
protected  Settings getSettings()
          Maven Settings
protected  org.dom4j.Element getTaskElement(org.dom4j.Document document)
          Fetches the element describing the IBM task.
protected abstract  String getTaskName()
          Defines the task name in the build script.
protected  File getWasHome()
          Returns the location of the was root install point.
protected  File getWorkingDirectory()
          Plugin working directory.
protected  File getWsAntExecutable()
          Locates the ws_ant.sh|bat executable.
protected  boolean isVerbose()
          Specifies if execution should be verbose.
 
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
 

Constructor Detail

AbstractWas6Mojo

public AbstractWas6Mojo()
Method Detail

getWorkingDirectory

protected File getWorkingDirectory()
Plugin working directory.


isVerbose

protected boolean isVerbose()
Specifies if execution should be verbose.

Returns:
true if verbose, else false.

getSettings

protected Settings getSettings()
Maven Settings

Returns:
the settings.

getMavenProject

protected MavenProject getMavenProject()
The enclosing project.

Returns:
enclosing project.

getWasHome

protected File getWasHome()
Returns the location of the was root install point.

Returns:
the root location.

getWsAntExecutable

protected File getWsAntExecutable()
                           throws MojoExecutionException
Locates the ws_ant.sh|bat executable.

Returns:
a File pointing on the executable
Throws:
MojoExecutionException

getTaskElement

protected org.dom4j.Element getTaskElement(org.dom4j.Document document)
                                    throws MojoExecutionException
Fetches the element describing the IBM task.

Parameters:
document - build document.
Returns:
element for this mojo's task.
Throws:
MojoExecutionException - should normally never happen.

configureTaskAttribute

protected void configureTaskAttribute(org.dom4j.Document document,
                                      String attributeName,
                                      Object value)
                               throws MojoExecutionException
Configures task attributes.

Parameters:
document - document containing buildscript.
attributeName - attribute to (un)define
value - to set, if null attribute with name attributeName will be removed, else defined with this value
Throws:
MojoExecutionException - if attribute wasn't defined in build script.

configureBuildScript

protected abstract void configureBuildScript(org.dom4j.Document document)
                                      throws MojoExecutionException
Method to be implemented by subclasses for configuring their task.

Parameters:
document - the build document.
Throws:
MojoExecutionException - if any failure occurs.

getTaskName

protected abstract String getTaskName()
Defines the task name in the build script.

Returns:
name of the task

execute

public void execute()
             throws MojoExecutionException,
                    MojoFailureException

Throws:
MojoExecutionException
MojoFailureException


Copyright © 2007-2012 Codehaus. All Rights Reserved.