org.codehaus.enunciate.modules.cxf
Class CXFDeploymentModule

java.lang.Object
  extended by org.codehaus.enunciate.modules.BasicDeploymentModule
      extended by org.codehaus.enunciate.modules.FreemarkerDeploymentModule
          extended by org.codehaus.enunciate.modules.cxf.CXFDeploymentModule
All Implemented Interfaces:
EnunciateClasspathListener, EnunciateModelAware, DeploymentModule, SpecProviderModule

public class CXFDeploymentModule
extends FreemarkerDeploymentModule
implements EnunciateClasspathListener, SpecProviderModule

CXF Module

The CXF module assembles a CXF-based server-side application for hosting the SOAP endpoints.

Note that the CXF module is disabled by default, so you must enable it in the enunciate configuration file, e.g.:

<enunciate>   <modules>     <jaxws-ri disabled="true"/>     <cxf disabled="false">     ...     </cxf>   </modules> </enunciate>

You should also be aware that the CXF module is not, by default, on the classpath when invoking Enunciate. For more information, see using CXF or XFire.

Steps

generate

The "generate" step generates the spring configuration file.

Configuration

The CXF module supports the following configuration attributes:

The CXF module also supports a list of jaxws-property child elements that each support a 'name' and 'value' attribute. This can be used to configure the CXF JAX-WS mechanism, and the properties will be passed along to the cxf configuration.

Artifacts

The CXF deployment module exports no artifacts.

Author:
Ryan Heaton

Field Summary
 
Fields inherited from class org.codehaus.enunciate.modules.BasicDeploymentModule
enunciate
 
Constructor Summary
CXFDeploymentModule()
           
 
Method Summary
 void addJaxwsProperty(java.lang.String name, java.lang.String value)
           
protected  void doBuild()
          Default implementation is a no-op.
 void doFreemarkerGenerate()
          Generate using Freemarker.
protected  java.net.URL getCXFServletTemplateURL()
           
 java.lang.String getJaxrsServletTransform()
           
 java.lang.String getJaxwsServletTransform()
           
 java.lang.String getName()
          The name of the deployment module.
protected  java.lang.String getRestSubcontext()
           
 Validator getValidator()
          Get the validator for this module, or null if none.
 void init(Enunciate enunciate)
          Sets the enunciate mechanism.
 void initModel(EnunciateFreemarkerModel model)
          Initialize the model.
 boolean isDisabled()
          Whether this deployment module has been disabled, e.g.
 boolean isJaxrsProvider()
          Whether this module is a JAX-RS provider module.
 boolean isJaxwsProvider()
          Whether this module is a JAX-WS provider module.
protected  boolean isLoggingFeatureEnabled()
          Whether the logging features is enabled via annotations.
protected  boolean isUpToDate()
          Whether the generated sources are up-to-date.
 boolean isUseExtensionMappings()
           
 boolean isUseWsdlRedirectFilter()
           
 void onClassesFound(java.util.Set<java.lang.String> classes)
          Logic for handling a set of classes that were found on the Enunciate classpath.
 void setEnableJaxrs(boolean enableJaxrs)
          Whether to enable the JAX-RS capabilities of CXF.
 void setEnableJaxws(boolean enableJaxws)
          Whether to enable the JAX-WS capabilities of CXF.
 void setJaxrsServletTransform(java.lang.String jaxrsServletTransform)
           
 void setJaxwsServletTransform(java.lang.String jaxwsServletTransform)
           
 void setUseExtensionMappings(boolean useExtensionMappings)
           
 void setUseSubcontext(boolean useSubcontext)
          Whether to use the REST subcontext.
 void setUseWsdlRedirectFilter(boolean useWsdlRedirectFilter)
           
 void setValidate(boolean validate)
          Whether or not to apply the CXF validation rules.
protected  void transformAndCopy(java.io.File src, java.io.File dest, java.io.File transform)
           
 
Methods inherited from class org.codehaus.enunciate.modules.FreemarkerDeploymentModule
close, doGenerate, getConfiguration, getModel, getModelInternal, getObjectWrapper, getTemplateExceptionHandler, getTemplateLoader, processTemplate, processTemplate, processTemplate, processTemplate
 
Methods inherited from class org.codehaus.enunciate.modules.BasicDeploymentModule
debug, doCompile, doPackage, getAliases, getBuildDir, getCompileDir, getConfigurationRules, getEnunciate, getGenerateDir, getOrder, getPackageDir, info, setBuildDir, setCompileDir, setDisabled, setGenerateDir, setPackageDir, step, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CXFDeploymentModule

public CXFDeploymentModule()
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
Overrides:
getName in class BasicDeploymentModule
Returns:
"cxf"

getCXFServletTemplateURL

protected java.net.URL getCXFServletTemplateURL()
Returns:
The URL to "cxf-servlet.xml.fmt"

onClassesFound

public void onClassesFound(java.util.Set<java.lang.String> classes)
Description copied from interface: EnunciateClasspathListener
Logic for handling a set of classes that were found on the Enunciate classpath.

Specified by:
onClassesFound in interface EnunciateClasspathListener
Parameters:
classes - The classes that were found.

init

public void init(Enunciate enunciate)
          throws EnunciateException
Description copied from class: BasicDeploymentModule
Sets the enunciate mechanism.

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

initModel

public void initModel(EnunciateFreemarkerModel model)
Description copied from interface: EnunciateModelAware
Initialize the model.

Specified by:
initModel in interface EnunciateModelAware
Overrides:
initModel in class FreemarkerDeploymentModule
Parameters:
model - The model to initialize.

doFreemarkerGenerate

public void doFreemarkerGenerate()
                          throws java.io.IOException,
                                 freemarker.template.TemplateException
Description copied from class: FreemarkerDeploymentModule
Generate using Freemarker. Same as FreemarkerDeploymentModule.doGenerate() but can throw a TemplateException.

Specified by:
doFreemarkerGenerate in class FreemarkerDeploymentModule
Throws:
java.io.IOException
freemarker.template.TemplateException

isLoggingFeatureEnabled

protected boolean isLoggingFeatureEnabled()
Whether the logging features is enabled via annotations.

Returns:
Whether the logging features is enabled via annotations.

doBuild

protected void doBuild()
                throws EnunciateException,
                       java.io.IOException
Description copied from class: BasicDeploymentModule
Default implementation is a no-op.

Overrides:
doBuild in class BasicDeploymentModule
Throws:
EnunciateException
java.io.IOException

transformAndCopy

protected void transformAndCopy(java.io.File src,
                                java.io.File dest,
                                java.io.File transform)
                         throws EnunciateException,
                                java.io.IOException
Throws:
EnunciateException
java.io.IOException

isUpToDate

protected boolean isUpToDate()
Whether the generated sources are up-to-date.

Returns:
Whether the generated sources are up-to-date.

isJaxwsProvider

public boolean isJaxwsProvider()
Description copied from interface: SpecProviderModule
Whether this module is a JAX-WS provider module.

Specified by:
isJaxwsProvider in interface SpecProviderModule
Returns:
Whether this module is a JAX-WS provider module.

isJaxrsProvider

public boolean isJaxrsProvider()
Description copied from interface: SpecProviderModule
Whether this module is a JAX-RS provider module.

Specified by:
isJaxrsProvider in interface SpecProviderModule
Returns:
Whether this module is a JAX-RS provider module.

setUseSubcontext

public void setUseSubcontext(boolean useSubcontext)
Whether to use the REST subcontext.

Parameters:
useSubcontext - Whether to use the REST subcontext.

setValidate

public void setValidate(boolean validate)
Whether or not to apply the CXF validation rules.

Parameters:
validate - Whether or not to apply the CXF validation rules.

setEnableJaxrs

public void setEnableJaxrs(boolean enableJaxrs)
Whether to enable the JAX-RS capabilities of CXF.

Parameters:
enableJaxrs - Whether to enable the JAX-RS capabilities of CXF.

setEnableJaxws

public void setEnableJaxws(boolean enableJaxws)
Whether to enable the JAX-WS capabilities of CXF.

Parameters:
enableJaxws - Whether to enable the JAX-WS capabilities of CXF.

isUseWsdlRedirectFilter

public boolean isUseWsdlRedirectFilter()

setUseWsdlRedirectFilter

public void setUseWsdlRedirectFilter(boolean useWsdlRedirectFilter)

isUseExtensionMappings

public boolean isUseExtensionMappings()

setUseExtensionMappings

public void setUseExtensionMappings(boolean useExtensionMappings)

getJaxwsServletTransform

public java.lang.String getJaxwsServletTransform()

setJaxwsServletTransform

public void setJaxwsServletTransform(java.lang.String jaxwsServletTransform)

getJaxrsServletTransform

public java.lang.String getJaxrsServletTransform()

setJaxrsServletTransform

public void setJaxrsServletTransform(java.lang.String jaxrsServletTransform)

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
Overrides:
getValidator in class BasicDeploymentModule
Returns:
null

getRestSubcontext

protected java.lang.String getRestSubcontext()

addJaxwsProperty

public void addJaxwsProperty(java.lang.String name,
                             java.lang.String value)

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
Overrides:
isDisabled in class BasicDeploymentModule
Returns:
Whether this deployment module has been disabled.