org.codehaus.enunciate.modules.jboss
Class JBossDeploymentModule

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

public class JBossDeploymentModule
extends FreemarkerDeploymentModule
implements EnunciateClasspathListener, SpecProviderModule

JBoss Module

The JBoss module assembles a JBoss-based server-side application for hosting the WS endpoints.

Steps

generate

The "generate" step generates the configuration files.

Configuration

Content Negotiation

Enuncite provides content type negotiation (conneg) to Jersey that conforms to the content type negotiation of the Enunciate REST module. This means that each resource is mounted from the REST subcontext (see above) but ALSO from a subcontext that conforms to the id of each content type that the resource supports. So, if the content type id of the "application/xml" content type is "xml" then the resource at path "mypath" will be mounted at both "/rest/mypath" and "/xml/mypath".

The content types for each JAX-RS resource are declared by the @Produces annotation. The content type ids are customized with the "enunciate/services/rest/content-types" element in the Enunciate configuration. Enunciate supplies providers for the "application/xml" and "application/json" content types by default.

The JBoss module supports the following configuration attributes:

The JBoss module also supports a list of option child elements that each support a 'name' and 'value' attribute. This can be used to configure the RESTEasy mechanism, and the properties will be passed along as context parameters. See the RESTEasy docs for details.

Artifacts

The JBoss deployment module exports no artifacts.

Author:
Ryan Heaton

Field Summary
 
Fields inherited from class org.codehaus.enunciate.modules.BasicDeploymentModule
enunciate
 
Constructor Summary
JBossDeploymentModule()
           
 
Method Summary
 void addOption(java.lang.String name, java.lang.String value)
           
protected  void doBuild()
          Default implementation is a no-op.
 void doFreemarkerGenerate()
          Generate using Freemarker.
 org.apache.commons.digester.RuleSet getConfigurationRules()
          Default implementation returns null.
 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.
 boolean isUsePathBasedConneg()
          Whether to use path-based conneg.
 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)
           
 void setEnableJaxws(boolean enableJaxws)
           
 void setUsePathBasedConneg(boolean usePathBasedConneg)
          Whether to use path-based conneg.
 void setUseSubcontext(boolean useSubcontext)
          Whether to use the REST subcontext.
 
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, 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

JBossDeploymentModule

public JBossDeploymentModule()
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:
"jboss"

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.

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.

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

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

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

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

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.

setEnableJaxrs

public void setEnableJaxrs(boolean enableJaxrs)

setEnableJaxws

public void setEnableJaxws(boolean enableJaxws)

isUsePathBasedConneg

public boolean isUsePathBasedConneg()
Whether to use path-based conneg.

Returns:
Whether to use path-based conneg.

setUsePathBasedConneg

public void setUsePathBasedConneg(boolean usePathBasedConneg)
Whether to use path-based conneg.

Parameters:
usePathBasedConneg - Whether to use path-based conneg.

setUseSubcontext

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

Parameters:
useSubcontext - Whether to use the REST subcontext.

getRestSubcontext

protected java.lang.String getRestSubcontext()

addOption

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

getConfigurationRules

public org.apache.commons.digester.RuleSet getConfigurationRules()
Description copied from class: BasicDeploymentModule
Default implementation returns null.

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