org.apache.tomcat.maven.plugin.tomcat7
Class AbstractCatalinaMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.tomcat.maven.plugin.tomcat7.AbstractTomcat7Mojo
          extended by org.apache.tomcat.maven.plugin.tomcat7.AbstractCatalinaMojo
All Implemented Interfaces:
ContextEnabled, Mojo
Direct Known Subclasses:
AbstractWarCatalinaMojo

public abstract class AbstractCatalinaMojo
extends AbstractTomcat7Mojo

Abstract goal that provides common configuration for Catalina-based goals.

Version:
$Id: AbstractCatalinaMojo.html 1305321 2012-03-26 12:01:12Z olamy $
Author:
Mark Hobson

Field Summary
 
Fields inherited from class org.apache.tomcat.maven.plugin.tomcat7.AbstractTomcat7Mojo
messagesProvider, path
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractCatalinaMojo()
           
 
Method Summary
 void execute()
          
protected  URL getDeployedURL()
          Gets the URL of the deployed webapp.
protected  TomcatManager getManager()
          Gets the Tomcat manager wrapper object configured for this goal.
protected  String getPath()
          Gets the webapp context path to use when communicating with Tomcat manager.
protected  URL getURL()
          Gets the full URL of the Tomcat manager instance.
protected abstract  void invokeManager()
          Invokes Tomcat manager when this Mojo is executed.
protected  void log(String string)
          Splits the given string into lines and writes each one separately to the log at info level.
 
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

AbstractCatalinaMojo

public AbstractCatalinaMojo()
Method Detail

execute

public void execute()
             throws MojoExecutionException

Throws:
MojoExecutionException

invokeManager

protected abstract void invokeManager()
                               throws MojoExecutionException,
                                      TomcatManagerException,
                                      IOException
Invokes Tomcat manager when this Mojo is executed.

Throws:
MojoExecutionException - if there was a problem executing this goal
TomcatManagerException - if the Tomcat manager request fails
IOException - if an i/o error occurs

getManager

protected TomcatManager getManager()
                            throws MojoExecutionException
Gets the Tomcat manager wrapper object configured for this goal.

Returns:
the Tomcat manager wrapper object
Throws:
MojoExecutionException - if there was a problem obtaining the authentication details

getURL

protected URL getURL()
Gets the full URL of the Tomcat manager instance.

Returns:
the full URL of the Tomcat manager instance to use

getPath

protected String getPath()
Gets the webapp context path to use when communicating with Tomcat manager.

Overrides:
getPath in class AbstractTomcat7Mojo
Returns:
the webapp context path to use

getDeployedURL

protected URL getDeployedURL()
                      throws MalformedURLException
Gets the URL of the deployed webapp.

Returns:
the URL of the deployed webapp
Throws:
MalformedURLException - if the deployed webapp URL is invalid

log

protected void log(String string)
Splits the given string into lines and writes each one separately to the log at info level.

Parameters:
string - the string to write


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.