org.jboss.deployers.plugins.annotations
Class GenericAnnotationDeployer

java.lang.Object
  extended by org.jboss.deployers.spi.deployer.helpers.AbstractDeployer
      extended by org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer
          extended by org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer<org.jboss.classloading.spi.dependency.Module>
              extended by org.jboss.deployers.plugins.annotations.GenericAnnotationDeployer
All Implemented Interfaces:
Deployer, Ordered
Direct Known Subclasses:
ScopedGenericAnnotationDeployer

public class GenericAnnotationDeployer
extends AbstractSimpleRealDeployer<org.jboss.classloading.spi.dependency.Module>

Generic annotation scanner deployer.

Author:
Ales Justin

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
GenericAnnotationDeployer()
           
 
Method Summary
protected  javassist.ClassPool createClassPool(ClassLoader classLoader)
          Create class pool.
protected  GenericAnnotationResourceVisitor createGenericAnnotationResourceVisitor(DeploymentUnit unit, javassist.ClassPool pool, ClassLoader classLoader)
          Create GenericAnnotationResourceVisitor.
 void deploy(DeploymentUnit unit, org.jboss.classloading.spi.dependency.Module module)
           
protected  URL[] getUrls(DeploymentUnit unit)
          Get the new root urls.
 void setCheckInterfaces(boolean checkInterfaces)
          Should we check interfaces for annotations as well.
 void setForceAnnotations(boolean forceAnnotations)
          Should we force all annotations to be available.
 void setKeepAnnotations(boolean keepAnnotations)
          Set the keep annotations flag.
protected  void visitModule(DeploymentUnit unit, org.jboss.classloading.spi.dependency.Module module, GenericAnnotationResourceVisitor visitor)
          Visit module.
 
Methods inherited from class org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer
getInput, internalDeploy, internalUndeploy, undeploy
 
Methods inherited from class org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer
addControllerContextName, deploy, isControllerContextNameCandidate, isUseUnitName, removeControllerContextName, setUseUnitName, undeploy
 
Methods inherited from class org.jboss.deployers.spi.deployer.helpers.AbstractDeployer
addInput, addInput, addOutput, addOutput, getInputs, getOutput, getOutputs, getRelativeOrder, getStage, isAllInputs, isComponentsOnly, isParentFirst, isTopLevelOnly, isWantComponents, setAllInputs, setComponentsOnly, setInput, setInputs, setInputs, setInputs, setOutput, setOutputs, setOutputs, setOutputs, setParentFirst, setRelativeOrder, setStage, setTopLevelOnly, setWantComponents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericAnnotationDeployer

public GenericAnnotationDeployer()
Method Detail

setForceAnnotations

public void setForceAnnotations(boolean forceAnnotations)
Should we force all annotations to be available.

Parameters:
forceAnnotations - the force annotations flag

setKeepAnnotations

public void setKeepAnnotations(boolean keepAnnotations)
Set the keep annotations flag.

Parameters:
keepAnnotations - the keep annotations flag

setCheckInterfaces

public void setCheckInterfaces(boolean checkInterfaces)
Should we check interfaces for annotations as well.

Parameters:
checkInterfaces - the check interfaces flag

createGenericAnnotationResourceVisitor

protected GenericAnnotationResourceVisitor createGenericAnnotationResourceVisitor(DeploymentUnit unit,
                                                                                  javassist.ClassPool pool,
                                                                                  ClassLoader classLoader)
Create GenericAnnotationResourceVisitor. Can be used change existing GARV's filter. Or determin if we need to force/keep annotations.

Parameters:
unit - the deployment unit
pool - the class pool
classLoader - the classloader
Returns:
new generic annotation visitor

createClassPool

protected javassist.ClassPool createClassPool(ClassLoader classLoader)
Create class pool.

Parameters:
classLoader - the class loader
Returns:
javassist class pool

visitModule

protected void visitModule(DeploymentUnit unit,
                           org.jboss.classloading.spi.dependency.Module module,
                           GenericAnnotationResourceVisitor visitor)
Visit module. Util method to add some behavior to Module before we visit it.

Parameters:
unit - the deployment unit
module - the module
visitor - the resource visitor

getUrls

protected URL[] getUrls(DeploymentUnit unit)
Get the new root urls.

Parameters:
unit - the deployment unit
Returns:
the new root urls

deploy

public void deploy(DeploymentUnit unit,
                   org.jboss.classloading.spi.dependency.Module module)
            throws DeploymentException
Specified by:
deploy in class AbstractSimpleRealDeployer<org.jboss.classloading.spi.dependency.Module>
Throws:
DeploymentException


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