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, ManagedObjectCreator, org.jboss.deployers.spi.Ordered

public abstract class AbstractParsingDeployerWithOutput<T>
extends AbstractParsingDeployer
implements ManagedObjectCreator

AbstractParsingDeployerWithOutput.

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

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.deployers.spi.Ordered
org.jboss.deployers.spi.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(org.jboss.deployers.structure.spi.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.
 void build(org.jboss.deployers.structure.spi.DeploymentUnit unit, Map<String,org.jboss.managed.api.ManagedObject> managedObjects)
          Build managed object.
protected  void createMetaData(org.jboss.deployers.structure.spi.DeploymentUnit unit, String name, String suffix)
          Create some meta data.
protected  void createMetaData(org.jboss.deployers.structure.spi.DeploymentUnit unit, String name, String suffix, String key)
          Create some meta data.
 void deploy(org.jboss.deployers.structure.spi.DeploymentUnit unit)
          Deploy a deployment
protected  T getMetaData(org.jboss.deployers.structure.spi.DeploymentUnit unit, String key)
          Get some meta data
 String getName()
          Get the name.
 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(org.jboss.deployers.structure.spi.DeploymentUnit unit, String name, String suffix, T root)
          Parse an exact file name or look for a suffix
protected abstract  T parse(org.jboss.deployers.structure.spi.DeploymentUnit unit, String name, T root)
          Parse an exact file name
 void setBuildManagedObject(boolean buildManagedObject)
           
 void setIncludeDeploymentFile(boolean includeDeploymentFile)
          Set the includeDeploymentFile.
 void setName(String name)
          Set the name.
 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, getType, isAllInputs, isComponentsOnly, isParentFirst, isTopLevelOnly, isWantComponents, setAllInputs, setComponentsOnly, setInput, setInputs, setInputs, setInputs, setOutput, setOutputs, setOutputs, setOutputs, setParentFirst, setRelativeOrder, setStage, setTopLevelOnly, setType, 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.

getSuffix

public String getSuffix()
Get the suffix.

Returns:
the suffix.

setSuffix

public void setSuffix(String suffix)
Set the suffix.

Parameters:
suffix - the suffix.

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(org.jboss.deployers.structure.spi.DeploymentUnit unit)
            throws org.jboss.deployers.spi.DeploymentException
Description copied from interface: Deployer
Deploy a deployment

Specified by:
deploy in interface Deployer
Parameters:
unit - the unit
Throws:
org.jboss.deployers.spi.DeploymentException - for any error

accepts

protected boolean accepts(org.jboss.deployers.structure.spi.DeploymentUnit unit)
                   throws org.jboss.deployers.spi.DeploymentException
Callback to do prechecking on the deployment

Parameters:
unit - the unit
Returns:
true by default
Throws:
org.jboss.deployers.spi.DeploymentException - for any error

getMetaData

protected T getMetaData(org.jboss.deployers.structure.spi.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

createMetaData

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

Parameters:
unit - the deployment unit
name - the name
suffix - the suffix
Throws:
org.jboss.deployers.spi.DeploymentException - for any error

createMetaData

protected void createMetaData(org.jboss.deployers.structure.spi.DeploymentUnit unit,
                              String name,
                              String suffix,
                              String key)
                       throws org.jboss.deployers.spi.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:
org.jboss.deployers.spi.DeploymentException - for any error

parse

protected abstract T parse(org.jboss.deployers.structure.spi.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(org.jboss.deployers.structure.spi.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

build

public void build(org.jboss.deployers.structure.spi.DeploymentUnit unit,
                  Map<String,org.jboss.managed.api.ManagedObject> managedObjects)
           throws org.jboss.deployers.spi.DeploymentException
Build managed object.

Specified by:
build in interface ManagedObjectCreator
Parameters:
unit - the deployment unit
managedObjects - map of managed objects
Throws:
org.jboss.deployers.spi.DeploymentException - for any deployment exception


Copyright © 2008 JBoss Inc.. All Rights Reserved.