public boolean isJavaEEComponent(DeploymentUnit unit) { return unit.isAttachmentPresent(JBossEnterpriseBeanMetaData.class) || unit.isAttachmentPresent(JBossServletMetaData.class); }
public boolean isAttachmentPresent(String name) { return delegate.isAttachmentPresent(name); }
@Override protected boolean isRelevant(DeploymentUnit unit) { return unit.isAttachmentPresent(WeldDiscoveryEnvironment.class); }
@Override public boolean belongsToWebModule(DeploymentUnit deploymentUnit) { return deploymentUnit.isAttachmentPresent(JBossWebMetaData.class); } }
@Override protected boolean isRelevant(DeploymentUnit unit) { return unit.isAttachmentPresent(ArchiveInfo.class); }
public boolean isAttachmentPresent(Class<?> type) { return delegate.isAttachmentPresent(type); }
public boolean isAttachmentPresent(String name, Class<?> expectedType) { return delegate.isAttachmentPresent(name, expectedType); }
public JavaEEModuleInformer.ModuleType getModuleType(DeploymentUnit unit) { if(unit.isAttachmentPresent(JBossClientMetaData.class)) return JavaEEModuleInformer.ModuleType.APP_CLIENT; if(unit.isAttachmentPresent(JBossMetaData.class) && isReallyAnEjbDeployment(unit)) return JavaEEModuleInformer.ModuleType.EJB; if(unit.isAttachmentPresent(JBossWebMetaData.class)) return JavaEEModuleInformer.ModuleType.WEB; return JavaEEModuleInformer.ModuleType.JAVA; }
public boolean accepts(DeploymentUnit unit) { if (attachmentNames != null && attachmentNames.isEmpty() == false) { for (String name : attachmentNames) { if (unit.isAttachmentPresent(name)) return true; } } return false; }
public boolean isEnterpriseApplicationArchive(DeploymentUnit deploymentUnit) { return deploymentUnit.isAttachmentPresent(JBossAppMetaData.class) || isTopLevelServiceArchive(deploymentUnit); }
private Set<U> findHandles(ScanningPlugin<T, U> plugin) { DeploymentUnit top = unit; while(top != null && top.isAttachmentPresent(Module.class) == false) top = top.getParent(); if (top == null) throw new IllegalArgumentException("No CL module: " + unit); Set<U> handles = new HashSet<U>(); recurse(top, plugin, handles, true); return handles; }
/** * Get module unit. * * @param unit the current unit * @return unit containing Module, or exception if no such unit exists */ public static DeploymentUnit getModuleUnit(DeploymentUnit unit) { if (unit == null) throw new IllegalArgumentException("Null unit"); // group util per module DeploymentUnit moduleUnit = unit; while(moduleUnit != null && moduleUnit.isAttachmentPresent(Module.class) == false) moduleUnit = moduleUnit.getParent(); if (moduleUnit == null) throw new IllegalArgumentException("No module in unit: " + unit); return moduleUnit; }
/** * In a deployment consisting of x.sar/ejbs.jar, the x.sar substitutes an EAR. */ protected boolean isTopLevelServiceArchive(DeploymentUnit deploymentUnit) { // Added additional check for file extension to prevent a .jar with jboss-service.xml // from being considered as an enterprise archive (https://issues.jboss.org/browse/JBAS-8770) return deploymentUnit.isTopLevel() && deploymentUnit.isAttachmentPresent(ServiceDeployment.class) && deploymentUnit.getSimpleName().endsWith(".sar"); }
/** * Do we have all required inputs. * * @param unit the deployment unit * @return true if all inputs exist */ protected boolean hasAllRequiredInputs(DeploymentUnit unit) { Set<String> inputs = getInputs(); if (inputs != null && inputs.isEmpty() == false) { for (String input : inputs) { if ((optionalInputs == null || optionalInputs.contains(input) == false) && unit.isAttachmentPresent(input) == false) { return false; } } } return true; }
public String getApplicationName(DeploymentUnit unit) { DeploymentUnit topLevel = unit.getTopLevel(); if(topLevel.isAttachmentPresent(JBossAppMetaData.class)) return topLevel.getSimpleName(); return null; }
/** * Is the bootstrap bean present. * * @param unit the deployment unit * @return true if there is bootstrap bean in attachments, false otherwise */ public static boolean isBootstrapBeanPresent(DeploymentUnit unit) { String attachmentName = getBootstrapBeanAttachmentName(unit); DeploymentUnit top = unit.getTopLevel(); return top.isAttachmentPresent(attachmentName); }
private void getEjbDeploymentPaths(DeploymentUnit unit, ArrayList<String> paths) { if(unit.isAttachmentPresent(JBossMetaData.class)) paths.add(unit.getRelativePath()); // Process children List<DeploymentUnit> children = unit.getChildren(); if(children != null) { for(DeploymentUnit child : children) getEjbDeploymentPaths(child, paths); } }
public String getModulePath(DeploymentUnit unit) { // first check if this a JavaEE Application (i.e. if it's a .ear). // If yes, then return the relative path (i.e. module name) of the unit // relative to the .ear DeploymentUnit topLevel = unit.getTopLevel(); if(topLevel.isAttachmentPresent(JBossAppMetaData.class)) { return unit.getRelativePath(); } // if it's not a JavaEE application (i.e. not a .ear), then // return the simple name of the unit return unit.getSimpleName(); }
private void recurse(DeploymentUnit current, ScanningPlugin<T, U> plugin, Set<U> handles, boolean allowModule) { // do not recurse into sub-deployments that have their own Module if (allowModule == false && current.isAttachmentPresent(Module.class)) return; U handle = current.getAttachment(plugin.getAttachmentKey(), plugin.getHandleInterface()); if (handle != null) handles.add(handle); for (DeploymentUnit child : current.getChildren()) { recurse(child, plugin, handles, false); } } }
public void deploy(DeploymentUnit unit) throws DeploymentException { /* If there is a META-INF/application.xml we don't process this. */ if (unit.isAttachmentPresent(EarMetaData.class)) { log.tracef("Ignoring ear with META-INF/application.xml: %1s", unit.getSimpleName()); return; } // Ignore non-vfs deployments if (unit instanceof VFSDeploymentUnit == false) { log.tracef("Not a vfs deployment: %1s", unit.getName()); return; } // See if the suffix matches the .ear requirement if (requiresEarSuffix && unit.getSimpleName().endsWith(".ear") == false) { log.tracef("Unit name does not end in .ear: %1s", unit.getSimpleName()); return; } VFSDeploymentUnit vfsunit = VFSDeploymentUnit.class.cast(unit); deploy(vfsunit); }