org.jboss.deployers.spi.deployer.helpers
Class AbstractParsingDeployerWithOutput<T>

java.lang.Object
  extended by org.jboss.deployers.spi.deployer.helpers.AbstractDeployer
      extended by org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployer
          extended by org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput<T>
Type Parameters:
T - the type of output
All Implemented Interfaces:
Deployer, JarExtensionProvider, Ordered
Direct Known Subclasses:
AbstractVFSParsingDeployer

public abstract class AbstractParsingDeployerWithOutput<T>
extends AbstractParsingDeployer
implements JarExtensionProvider

AbstractParsingDeployerWithOutput.

Version:
$Revision: 1.1 $
Author:
Adrian Brock, Ales Justin, Scott.Stark@jboss.org

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.deployers.spi.Ordered
Ordered.OrderedComparator
 
Field Summary
 
Fields inherited from class org.jboss.deployers.spi.deployer.helpers.AbstractDeployer
log
 
Fields inherited from interface org.jboss.deployers.spi.Ordered
COMPARATOR
 
Constructor Summary
AbstractParsingDeployerWithOutput(Class<T> output)
          Create a new AbstractParsingDeployerWithOutput.
 
Method Summary
protected  boolean accepts(DeploymentUnit unit)
          Callback to do prechecking on the deployment
protected  boolean allowsReparse()
          A flag indicating whether createMetaData should execute a parse even if a non-null metadata value exists.
protected  void createMetaData(DeploymentUnit unit, Set<String> names, String suffix)
          Create some meta data.
protected  void createMetaData(DeploymentUnit unit, Set<String> names, String suffix, String key)
          Create some meta data.
protected  void createMetaData(DeploymentUnit unit, String name, String suffix)
          Create some meta data.
protected  void createMetaData(DeploymentUnit unit, String name, String suffix, String key)
          Create some meta data.
 void deploy(DeploymentUnit unit)
          Deploy a deployment
protected  String getAttachmentKey()
          Get attachment key.
 String getJarExtension()
          Get the jar extension.
protected  T getMetaData(DeploymentUnit unit, String key)
          Get some meta data
 String getName()
          Get the name.
 Set<String> getNames()
          Get the names.
 Class<T> getOutput()
          Get the otput for this deployer
 String getSuffix()
          Get the suffix.
 boolean isBuildManagedObject()
           
 boolean isIncludeDeploymentFile()
          Get the includeDeploymentFile.
protected abstract  T parse(DeploymentUnit unit, Set<String> names, String suffix, T root)
          Parse exact file names or look for a suffix
protected abstract  T parse(DeploymentUnit unit, Set<String> names, T root)
          Parse an multiple exact file names
protected abstract  T parse(DeploymentUnit unit, String name, String suffix, T root)
          Parse an exact file name or look for a suffix
protected abstract  T parse(DeploymentUnit unit, String name, T root)
          Parse an exact file name
 void setAttachmentKey(String attachmentKey)
          Set attachment key.
 void setBuildManagedObject(boolean buildManagedObject)
           
 void setIncludeDeploymentFile(boolean includeDeploymentFile)
          Set the includeDeploymentFile.
 void setJarExtension(String jarExtension)
          Set the jar extension.
 void setName(String name)
          Set the name.
 void setNames(Set<String> names)
          Set the names.
 void setSuffix(String suffix)
          Set the suffix.
 
Methods inherited from class org.jboss.deployers.spi.deployer.helpers.AbstractDeployer
addInput, addInput, addOutput, addOutput, getInput, getInputs, getOutputs, getRelativeOrder, getStage, isAllInputs, isComponentsOnly, isParentFirst, isTopLevelOnly, isWantComponents, setAllInputs, setComponentsOnly, setInput, setInputs, setInputs, setInputs, setOutput, setOutputs, setOutputs, setOutputs, setParentFirst, setRelativeOrder, setStage, setTopLevelOnly, setWantComponents, undeploy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractParsingDeployerWithOutput

public AbstractParsingDeployerWithOutput(Class<T> output)
Create a new AbstractParsingDeployerWithOutput.

Parameters:
output - the type of output
Throws:
IllegalArgumentException - for null output
Method Detail

getOutput

public Class<T> getOutput()
Description copied from interface: Deployer
Get the otput for this deployer

Specified by:
getOutput in interface Deployer
Overrides:
getOutput in class AbstractDeployer
Returns:
the output type

getName

public String getName()
Get the name.

Returns:
the name.

setName

public void setName(String name)
Set the name.

Parameters:
name - the name.

getNames

public Set<String> getNames()
Get the names.

Returns:
the names.

setNames

public void setNames(Set<String> names)
Set the names.

Parameters:
names - the names.

getSuffix

public String getSuffix()
Get the suffix.

Returns:
the suffix.

setSuffix

public void setSuffix(String suffix)
Set the suffix.

Parameters:
suffix - the suffix.

getJarExtension

public String getJarExtension()
Get the jar extension.

Specified by:
getJarExtension in interface JarExtensionProvider
Returns:
the jar extension

setJarExtension

public void setJarExtension(String jarExtension)
Set the jar extension.

Parameters:
jarExtension - the jar extension

isIncludeDeploymentFile

public boolean isIncludeDeploymentFile()
Get the includeDeploymentFile.

Returns:
the includeDeploymentFile.

setIncludeDeploymentFile

public void setIncludeDeploymentFile(boolean includeDeploymentFile)
Set the includeDeploymentFile.

Parameters:
includeDeploymentFile - the includeDeploymentFile.

isBuildManagedObject

public boolean isBuildManagedObject()

setBuildManagedObject

public void setBuildManagedObject(boolean buildManagedObject)

allowsReparse

protected boolean allowsReparse()
A flag indicating whether createMetaData should execute a parse even if a non-null metadata value exists.

Returns:
false if a parse should be performed only if there is no existing metadata value. True indicates that parse should be done regardless of an existing metadata value.

deploy

public void deploy(DeploymentUnit unit)
            throws DeploymentException
Description copied from interface: Deployer
Deploy a deployment

Specified by:
deploy in interface Deployer
Parameters:
unit - the unit
Throws:
DeploymentException - for any error

accepts

protected boolean accepts(DeploymentUnit unit)
                   throws DeploymentException
Callback to do prechecking on the deployment

Parameters:
unit - the unit
Returns:
true by default
Throws:
DeploymentException - for any error

getMetaData

protected T getMetaData(DeploymentUnit unit,
                        String key)
Get some meta data

Parameters:
unit - the deployment unit
key - the key into the managed objects
Returns:
the metadata or null if it doesn't exist

getAttachmentKey

protected String getAttachmentKey()
Get attachment key. By default it's output's fqn classname.

Returns:
the attachment key.

setAttachmentKey

public void setAttachmentKey(String attachmentKey)
Set attachment key.

Parameters:
attachmentKey - the attachment key

createMetaData

protected void createMetaData(DeploymentUnit unit,
                              String name,
                              String suffix)
                       throws DeploymentException
Create some meta data. Calls createMetaData(unit, name, suffix, getDeploymentType().getName()).

Parameters:
unit - the deployment unit
name - the name
suffix - the suffix
Throws:
DeploymentException - for any error

createMetaData

protected void createMetaData(DeploymentUnit unit,
                              Set<String> names,
                              String suffix)
                       throws DeploymentException
Create some meta data. Calls createMetaData(unit, name, suffix, getDeploymentType().getName()).

Parameters:
unit - the deployment unit
names - the names
suffix - the suffix
Throws:
DeploymentException - for any error

createMetaData

protected void createMetaData(DeploymentUnit unit,
                              String name,
                              String suffix,
                              String key)
                       throws DeploymentException
Create some meta data. Invokes parse(unit, name, suffix) if there is not already a metadata

Parameters:
unit - the deployment unit
name - the name
suffix - the suffix
key - the key into the managed objects
Throws:
DeploymentException - for any error

createMetaData

protected void createMetaData(DeploymentUnit unit,
                              Set<String> names,
                              String suffix,
                              String key)
                       throws DeploymentException
Create some meta data. Invokes parse(unit, name, suffix) if there is not already a metadata

Parameters:
unit - the deployment unit
names - the names
suffix - the suffix
key - the key into the managed objects
Throws:
DeploymentException - for any error

parse

protected abstract T parse(DeploymentUnit unit,
                           String name,
                           T root)
                    throws Exception
Parse an exact file name

Parameters:
unit - the unit
name - the exact name to match
root - - possibly null pre-existing root
Returns:
the metadata or null if it doesn't exist
Throws:
Exception - for any error

parse

protected abstract T parse(DeploymentUnit unit,
                           Set<String> names,
                           T root)
                    throws Exception
Parse an multiple exact file names

Parameters:
unit - the unit
names - the exact names to match
root - - possibly null pre-existing root
Returns:
the metadata or null if it doesn't exist
Throws:
Exception - for any error

parse

protected abstract T parse(DeploymentUnit unit,
                           String name,
                           String suffix,
                           T root)
                    throws Exception
Parse an exact file name or look for a suffix

Parameters:
unit - the unit
name - the exact name to match
suffix - the suffix to match
root - - possibly null pre-existing root
Returns:
the metadata or null if it doesn't exist
Throws:
Exception - for any error

parse

protected abstract T parse(DeploymentUnit unit,
                           Set<String> names,
                           String suffix,
                           T root)
                    throws Exception
Parse exact file names or look for a suffix

Parameters:
unit - the unit
names - the exact names to match
suffix - the suffix to match
root - - possibly null pre-existing root
Returns:
the metadata or null if it doesn't exist
Throws:
Exception - for any error


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.