/** * @param unit * @param endpointMap * @param trace */ protected void mapPersistenceUnits(DeploymentUnit unit, Map<String, ContainerDependencyMetaData> endpointMap, boolean trace) { // TODO Auto-generated method stub String vfsPath = unit.getRelativePath(); //PersistenceUnitsMetaData ejbMetaData = unit.getAttachment(PersistenceUnitsMetaData.class); }
public String getRelativePath() { return delegate.getRelativePath(); }
public String buildPath() { String prefix = unit.getRelativePath(); String suffix = lp.buildPath(); return prefix + (prefix.endsWith("/") == false && suffix.startsWith("/") == false ? "/" : "") + suffix; } };
public boolean ignorePath(DeploymentUnit unit, String path) { DeploymentUnit top = adjustDeploymentUnit(unit); if (top != unit) { String prefix = unit.getRelativePath(); path = prefix + (prefix.endsWith("/") == false && path.startsWith("/") == false ? "/" : "") + path; } return super.ignorePath(unit, path); }
private static DeploymentUnit findLinkPath(DeploymentUnit top, String path) { List<DeploymentUnit> children = top.getChildren(); DeploymentUnit targetUnit = null; if(children != null) { for(DeploymentUnit child : children) { String childPath = child.getRelativePath(); if(childPath.endsWith(path)) { targetUnit = child; } } } if (targetUnit == null) { return null; } if (log.isTraceEnabled()) { log.trace("Found appropriate DeploymentUnit: " + targetUnit); } return targetUnit; }
protected ContainerDependencyMetaData resolveEjbInterface(String iface, DeploymentUnit unit, Map<String, ContainerDependencyMetaData> endpointMap, DeploymentEndpointResolver resolver) throws Exception { ClassLoader loader = unit.getClassLoader(); Class<?> ifaceClass = loader.loadClass(iface); String vfsContext = unit.getRelativePath(); EndpointInfo info = resolver.getEndpointInfo(ifaceClass, EndpointType.EJB, vfsContext); if(info == null) throw new IllegalStateException("Failed to find ContainerDependencyMetaData for interface: "+ iface); ContainerDependencyMetaData cdmd = endpointMap.get(info.getComponentKey()); return cdmd; }
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 getModuleName(DeploymentUnit deploymentUnit) { // FIXME this is a hack to give the CURRENT users of this class, // ComponentNamingDeployer and ModuleNamingDeployer, the info they actually // want, rather than what they ask for. :) Tear this out once they // use the NamedModule DU attachment directly. String moduleName = identifier.getModuleName(deploymentUnit); if (moduleName != null) return moduleName; /* * JavaEE 6 FR 8.1.1: * The name can be explicitly set in the deployment descriptor for the module. If not set, the name * of the module is the pathname of the module in the ear file with any filename extension (.jar, .war, .rar) * removed, but with any directory names included. */ // TODO: get the module name from the deployment descriptor // FIXME: AS can't handle unique module names yet because we deploy a.jar and a.war at the same time, to counter don't strip the extension. String path = deploymentUnit.getRelativePath(); if(path == null || path.length() == 0) path = deploymentUnit.getSimpleName(); return stripSuffix(path); }
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(); }
protected void resolve(DeploymentUnit unit, Map<String, ContainerDependencyMetaData> endpointMap, JBossEnterpriseBeansMetaData beans, DeploymentEndpointResolver resolver, List<String> unresolvedPaths) throws Exception { if(beans == null || beans.size() == 0) return; String vfsPath = unit.getRelativePath(); for(JBossEnterpriseBeanMetaData bean : beans) { // Find the container dependency metadata String ejbCompID = "ejb/" + vfsPath + "#" + bean.getEjbName(); ContainerDependencyMetaData cdmd = endpointMap.get(ejbCompID); if(cdmd == null) throw new IllegalStateException("Failed to find ContainerDependencyMetaData for: "+ejbCompID); Environment env = bean.getJndiEnvironmentRefsGroup(); resolve(cdmd, unit, endpointMap, env, resolver, unresolvedPaths); } }
private String establishUniqueModuleName(DeploymentUnit unit, String configuredName, JBossAppMetaData appMetaData) throws DeploymentException String name = configuredName == null ? trimExtension(unit.getRelativePath()): configuredName; String modulePath = unit.getRelativePath(); ModulesMetaData modules = appMetaData.getModules(); if (modules == null) uniqueName = trimExtension(unit.getRelativePath()); if (uniqueName.equals(name) || !isNameUnique(uniqueName, ourModule, modules)) uniqueName = unit.getRelativePath(); if (!isNameUnique(uniqueName, ourModule, modules))
tmp.append(unit.getRelativePath()); JBossMetaData metaData = unit.getAttachment(JBossMetaData.class); if(metaData != null)
this.mapEjbs(unit.getRelativePath(), beans);
tmp.append(unit.getSimpleName()); else tmp.append(unit.getRelativePath()); tmp.append('\n'); JBossMetaData metaData = unit.getAttachment(JBossMetaData.class);
top.addAttachment(ENDPOINT_MAP_KEY, endpointMap, Map.class); top.addAttachment(ALTERNATE_MAP_KEY, endpointAlternateMap); DeploymentEndpointResolver resolver = new MappedDeploymentEndpointResolver(endpointMap, endpointAlternateMap, unit.getRelativePath()); top.addAttachment(DeploymentEndpointResolver.class, resolver); endpointMap, endpointAlternateMap, unit.getRelativePath()); ContainerDependencyMetaData webAppCDMD = new ContainerDependencyMetaData(unit.getSimpleName(), "web-app", unit.getRelativePath()); try ContainerDependencyMetaData clientCDMD = new ContainerDependencyMetaData(unit.getSimpleName(), "client", unit.getRelativePath()); try
String vfsContext = unit.getRelativePath(); for(MessageDestinationReferenceMetaData ref : msgRefs)
if(endpoints != null) String ejbKey = "ejb/" + jbossUnit.getRelativePath() + "#" + container.getEjbName(); cdmd = endpoints.get(ejbKey);
return; String vfsContext = unit.getRelativePath(); for(AnnotatedEJBReferenceMetaData ref : annotatedRefs)
return; String vfsContext = unit.getRelativePath(); ClassLoader loader = unit.getClassLoader(); for(EJBReferenceMetaData ref : ejbRefs)
boolean trace) String vfsPath = unit.getRelativePath(); JBossMetaData ejbMetaData = unit.getAttachment(JBossMetaData.class); MessageDestinationsMetaData msgDestinations = null;