org.codehaus.enunciate.modules
Class BasicDeploymentModule

java.lang.Object
  extended by org.codehaus.enunciate.modules.BasicDeploymentModule
All Implemented Interfaces:
DeploymentModule
Direct Known Subclasses:
FreemarkerDeploymentModule

public class BasicDeploymentModule
extends java.lang.Object
implements DeploymentModule

Basic stub for a deployment module. Provides methods for each step.

Author:
Ryan Heaton

Field Summary
protected  Enunciate enunciate
           
 
Constructor Summary
BasicDeploymentModule()
           
 
Method Summary
 void close()
          Default implementation is a no-op.
 void debug(java.lang.String message, java.lang.Object... formatArgs)
          Handle a debug-level message.
protected  void doBuild()
          Default implementation is a no-op.
protected  void doCompile()
          Default implementation is a no-op.
protected  void doGenerate()
          Default implementation is a no-op.
protected  void doPackage()
          Default implementation is a no-op.
 java.util.Set<java.lang.String> getAliases()
          The aliases (modifiable).
 java.io.File getBuildDir()
          The build directory for this module.
 java.io.File getCompileDir()
          The compile directory for this module.
 org.apache.commons.digester.RuleSet getConfigurationRules()
          Default implementation returns null.
 Enunciate getEnunciate()
          The enunciate mechanism.
 java.io.File getGenerateDir()
          The generate directory for this module.
 java.lang.String getName()
          The name of the deployment module.
 int getOrder()
          The order of execution for the deployment module.
 java.io.File getPackageDir()
          The package directory for this module.
 Validator getValidator()
          Get the validator for this module, or null if none.
 void info(java.lang.String message, java.lang.Object... formatArgs)
          Handle an info-level message.
 void init(Enunciate enunciate)
          Sets the enunciate mechanism.
 boolean isDisabled()
          Whether this deployment module has been disabled, e.g.
 void setBuildDir(java.io.File buildDir)
          Set the build dir for this module.
 void setCompileDir(java.io.File compileDir)
          Set the compile dir for this module.
 void setDisabled(boolean disabled)
          Disable (or enable) this deployment module.
 void setGenerateDir(java.io.File generateDir)
          Set the generate dir for this module.
 void setPackageDir(java.io.File packageDir)
          Set the package dir for this module.
 void step(Enunciate.Target target)
          Calls the step methods as necessary.
 void warn(java.lang.String message, java.lang.Object... formatArgs)
          Handle a warn-level message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enunciate

protected Enunciate enunciate
Constructor Detail

BasicDeploymentModule

public BasicDeploymentModule()
Method Detail

getName

public java.lang.String getName()
Description copied from interface: DeploymentModule
The name of the deployment module. Identifies its section in the enunciate configuration.

Specified by:
getName in interface DeploymentModule
Returns:
"basic"

getAliases

public java.util.Set<java.lang.String> getAliases()
The aliases (modifiable).

Specified by:
getAliases in interface DeploymentModule
Returns:
The aliases (modifiable).

getValidator

public Validator getValidator()
Description copied from interface: DeploymentModule
Get the validator for this module, or null if none.

Specified by:
getValidator in interface DeploymentModule
Returns:
null

isDisabled

public boolean isDisabled()
Description copied from interface: DeploymentModule
Whether this deployment module has been disabled, e.g. in the config file. Since the discovery mechanism is used to discover the modules on the classpath, it may be necessary to be able to disable a module.

Specified by:
isDisabled in interface DeploymentModule
Returns:
Whether this deployment module has been disabled.

setDisabled

public void setDisabled(boolean disabled)
Disable (or enable) this deployment module.

Parameters:
disabled - true to disable, false to enable.

init

public void init(Enunciate enunciate)
          throws EnunciateException
Sets the enunciate mechanism.

Specified by:
init in interface DeploymentModule
Parameters:
enunciate - The enunciate mechanism.
Throws:
EnunciateException

getEnunciate

public Enunciate getEnunciate()
The enunciate mechanism.

Returns:
The enunciate mechanism.

step

public void step(Enunciate.Target target)
          throws EnunciateException,
                 java.io.IOException
Calls the step methods as necessary.

Specified by:
step in interface DeploymentModule
Parameters:
target - The step.
Throws:
EnunciateException
java.io.IOException

doGenerate

protected void doGenerate()
                   throws EnunciateException,
                          java.io.IOException
Default implementation is a no-op.

Throws:
EnunciateException
java.io.IOException

doBuild

protected void doBuild()
                throws EnunciateException,
                       java.io.IOException
Default implementation is a no-op.

Throws:
EnunciateException
java.io.IOException

doCompile

protected void doCompile()
                  throws EnunciateException,
                         java.io.IOException
Default implementation is a no-op.

Throws:
EnunciateException
java.io.IOException

doPackage

protected void doPackage()
                  throws EnunciateException,
                         java.io.IOException
Default implementation is a no-op.

Throws:
EnunciateException
java.io.IOException

close

public void close()
           throws EnunciateException
Default implementation is a no-op.

Specified by:
close in interface DeploymentModule
Throws:
EnunciateException

getConfigurationRules

public org.apache.commons.digester.RuleSet getConfigurationRules()
Default implementation returns null.

Specified by:
getConfigurationRules in interface DeploymentModule
Returns:
null.

getOrder

public int getOrder()
Description copied from interface: DeploymentModule
The order of execution for the deployment module.

Specified by:
getOrder in interface DeploymentModule
Returns:
0

getGenerateDir

public java.io.File getGenerateDir()
The generate directory for this module. Defaults to <enunciate generate dir>/<module name>

Returns:
The generate directory for this module.

setGenerateDir

public void setGenerateDir(java.io.File generateDir)
Set the generate dir for this module.

Parameters:
generateDir - The generate dir for this module.

getCompileDir

public java.io.File getCompileDir()
The compile directory for this module. Defaults to <enunciate compile dir>/<module name>

Returns:
The compile directory for this module.

setCompileDir

public void setCompileDir(java.io.File compileDir)
Set the compile dir for this module.

Parameters:
compileDir - The compile dir for this module.

getBuildDir

public java.io.File getBuildDir()
The build directory for this module. Defaults to <enunciate build dir>/<module name>

Returns:
The build directory for this module.

setBuildDir

public void setBuildDir(java.io.File buildDir)
Set the build dir for this module.

Parameters:
buildDir - The build dir for this module.

getPackageDir

public java.io.File getPackageDir()
The package directory for this module. Defaults to <enunciate package dir>/<module name>

Returns:
The package directory for this module.

setPackageDir

public void setPackageDir(java.io.File packageDir)
Set the package dir for this module.

Parameters:
packageDir - The package dir for this module.

info

public void info(java.lang.String message,
                 java.lang.Object... formatArgs)
Handle an info-level message.

Parameters:
message - The info message.
formatArgs - The format args of the message.

debug

public void debug(java.lang.String message,
                  java.lang.Object... formatArgs)
Handle a debug-level message.

Parameters:
message - The debug message.
formatArgs - The format args of the message.

warn

public void warn(java.lang.String message,
                 java.lang.Object... formatArgs)
Handle a warn-level message.

Parameters:
message - The warn message.
formatArgs - The format args of the message.