public void error(DeploymentContext context) { visitor.error(context.getDeploymentUnit()); } }
public void visit(DeploymentContext context) throws DeploymentException { visitor.visit(context.getDeploymentUnit()); }
@Override protected DeploymentUnit addComponent(DeploymentUnit unit, DependencyItem attachment) { unit.addIDependOn(attachment); return null; }
public <T> T search(DeploymentUnit unit, String name, Class<T> expectedType) { DeploymentUnit parent = unit.getParent(); return (parent != null) ? parent.getAttachment(name, expectedType) : null; } }
private boolean isSharedENC(org.jboss.deployers.structure.spi.DeploymentUnit deploymentUnit) { JBossMetaData jbossMetaData = deploymentUnit.getAttachment(JBossMetaData.class); JBossWebMetaData jbosswebMetaData = deploymentUnit.getAttachment(JBossWebMetaData.class); if (jbossMetaData != null && jbosswebMetaData != null) { return true; } return false; }
@Override protected void attachBarrier(DeploymentUnit deploymentUnit, Barrier switchBoard) { deploymentUnit.addAttachment(Barrier.class, switchBoard); }
/** * Remove controller context name. * * @param unit the deployment unit */ protected void removeControllerContextName(DeploymentUnit unit) { unit.removeControllerContextName(unit.getName()); }
/** * Get the name of the module * * @return the string */ public String getName() { return deploymentUnit.getName(); }
@Override protected DeploymentUnit adjustDeploymentUnit(DeploymentUnit unit) { return unit.getTopLevel(); }
public DeploymentUnit getTopLevel() { DeploymentContext context = deploymentContext.getTopLevel(); return context.getDeploymentUnit(); }
public boolean isJavaEEApplication(DeploymentUnit deploymentUnit) { // JavaEE 6.0 FR 5.2.2 // practically everything deployed standalone is considered a JavaEEApplication in terms of naming return deploymentUnit.isTopLevel(); }
@Override protected boolean doAccepts(DeploymentUnit unit) { for (DeploymentUnitFilter filter : filters) { if (filter.accepts(unit) == false) return false; } return true; }
@Override public void undeploy(DeploymentUnit unit, Module deployment) { if (handler != null) unit.removeAttachment(ErrorHandler.class); if (finder != null) unit.removeAttachment(ResourceOwnerFinder.class); unit.removeAttachment(ReflectProvider.class); }
@Override protected Enumeration<URL> findResources(String name) throws IOException { return loader.getResources(name); } }
public void changeRelativeOrder(int relativeOrder) { if (deploymentContext instanceof DeploymentContextExt) { DeploymentContextExt ext = (DeploymentContextExt) deploymentContext; ext.changeRelativeOrder(relativeOrder); } }
/** * Remove context to deployment mapping. * * @param context the context * @param unit the deployment * @return is previous mapping value same as unit param */ protected DeploymentUnit removeContext(ControllerContext context, DeploymentUnit unit) { return (registry != null) ? registry.removeContext(context, unit) : null; }
private ServiceMetaData getParentJaccPolicyBean(DeploymentUnit childDU) { DeploymentUnit parentDU = childDU.getParent(); while (parentDU != null) { ServiceMetaData parentJacc = (ServiceMetaData) parentDU.getAttachment(JACC_ATTACHMENT_NAME); if (parentJacc != null) return parentJacc; parentDU = parentDU.getParent(); } return null; }
protected boolean isSharedENC(DeploymentUnit deploymentUnit) { JBossMetaData jbossMetaData = deploymentUnit.getAttachment(JBossMetaData.class); JBossWebMetaData jbosswebMetaData = deploymentUnit.getAttachment(JBossWebMetaData.class); if (jbossMetaData != null && jbosswebMetaData != null) { return true; } return false; }
/** * Is deployer relevant. * * @param unit the deployment unit * @return true if deployer is relevant, false otherwise */ protected boolean isRelevant(DeploymentUnit unit) { return filter != null && filter.accepts(unit); }
@Override public void undeploy(DeploymentUnit unit, JBossAppMetaData deployment) { //Perform JACC cleanup for the EAR unit.removeAttachment(PolicyConfiguration.class); }