org.jboss.deployers.spi.deployer.helpers
Class AbstractDeploymentVisitor<C,T>

java.lang.Object
  extended by org.jboss.deployers.spi.deployer.helpers.ComponentAdapter<C>
      extended by org.jboss.deployers.spi.deployer.helpers.AbstractDeploymentVisitor<C,T>
Type Parameters:
C - exact component type
T - exact deployment type
All Implemented Interfaces:
DeploymentVisitor<T>

public abstract class AbstractDeploymentVisitor<C,T>
extends ComponentAdapter<C>
implements DeploymentVisitor<T>

Simple deployment visitor.

Author:
Ales Justin

Constructor Summary
AbstractDeploymentVisitor()
           
 
Method Summary
 void deploy(DeploymentUnit unit, T deployment)
          Deploy the deployment
protected  String getAttachmentName(C attachment)
          Get attachment name.
protected abstract  List<? extends C> getComponents(T deployment)
          Get components from deployment.
protected abstract  Class<C> getComponentType()
          Get the component type.
protected  void safeRemoveComponent(DeploymentUnit unit, C attachment)
          Ignore all error during component removal.
 void undeploy(DeploymentUnit unit, T deployment)
          Undeploy the deployment
 
Methods inherited from class org.jboss.deployers.spi.deployer.helpers.ComponentAdapter
addComponent, getComponentName, removeComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.deployers.spi.deployer.helpers.DeploymentVisitor
getVisitorType
 

Constructor Detail

AbstractDeploymentVisitor

public AbstractDeploymentVisitor()
Method Detail

getAttachmentName

protected String getAttachmentName(C attachment)
Description copied from class: ComponentAdapter
Get attachment name. By default we return visitor type's name.

Specified by:
getAttachmentName in class ComponentAdapter<C>
Parameters:
attachment - the attachment
Returns:
the attachment name

getComponents

protected abstract List<? extends C> getComponents(T deployment)
Get components from deployment.

Parameters:
deployment - the deployment
Returns:
list of components

getComponentType

protected abstract Class<C> getComponentType()
Get the component type.

Returns:
the component type

deploy

public void deploy(DeploymentUnit unit,
                   T deployment)
            throws DeploymentException
Description copied from interface: DeploymentVisitor
Deploy the deployment

Specified by:
deploy in interface DeploymentVisitor<T>
Parameters:
unit - the deployment unit
deployment - the deployment
Throws:
DeploymentException - the deployment exception

undeploy

public void undeploy(DeploymentUnit unit,
                     T deployment)
Description copied from interface: DeploymentVisitor
Undeploy the deployment

Specified by:
undeploy in interface DeploymentVisitor<T>
Parameters:
unit - the deployment unit
deployment - the deployment

safeRemoveComponent

protected void safeRemoveComponent(DeploymentUnit unit,
                                   C attachment)
Ignore all error during component removal.

Parameters:
unit - the deployment unit
attachment - the attachment


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