@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { List<ResourceRoot> potentialSubDeployments = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS); for (ResourceRoot resourceRoot : potentialSubDeployments) { if (ModuleRootMarker.isModuleRoot(resourceRoot)) { } else if (deploymentUnit.getName().toLowerCase(Locale.ENGLISH).endsWith(".jar")) { final ResourceRoot root = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); final ModuleMetaData md = root.getAttachment(org.jboss.as.ee.structure.Attachments.MODULE_META_DATA); if (md != null) { if (md.getType() == ModuleMetaData.ModuleType.Client) { DeploymentTypeMarker.setType(DeploymentType.APPLICATION_CLIENT, deploymentUnit); VirtualFile appclientClientXml = root.getRoot().getChild(META_INF_APPLICATION_CLIENT_XML); if (appclientClientXml.exists()) { DeploymentTypeMarker.setType(DeploymentType.APPLICATION_CLIENT, deploymentUnit); } else { final Manifest manifest = root.getAttachment(Attachments.MANIFEST); String mainClass = main.getValue("Main-Class"); if (mainClass != null && !mainClass.isEmpty()) { DeploymentTypeMarker.setType(DeploymentType.APPLICATION_CLIENT, deploymentUnit);
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit)) { return; // Skip non web deployments WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); assert warMetaData != null; Map<String, WebFragmentMetaData> webFragments = warMetaData.getWebFragmentsMetaData(); warMetaData.setWebFragmentsMetaData(webFragments); List<ResourceRoot> resourceRoots = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS); for (ResourceRoot resourceRoot : resourceRoots) { if (resourceRoot.getRoot().getName().toLowerCase(Locale.ENGLISH).endsWith(".jar")) { VirtualFile webFragment = resourceRoot.getRoot().getChild(WEB_FRAGMENT_XML); if (webFragment.exists() && webFragment.isFile()) { InputStream is = null; try { webFragments.put(resourceRoot.getRootName(), webFragmentMetaData); UndertowLogger.ROOT_LOGGER.distributableDisabledInFragmentXml(deploymentUnit.getName(),resourceRoot.getRootName()); } catch (XMLStreamException e) { throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.failToParseXMLDescriptor(webFragment.toString(), e.getLocation().getLineNumber(), e.getLocation().getColumnNumber()));
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); if(moduleDescription == null) { return; } final ServiceTarget serviceTarget = phaseContext.getServiceTarget(); //if this is a war we need to bind to the modules comp namespace if(DeploymentTypeMarker.isType(DeploymentType.WAR,deploymentUnit) || DeploymentTypeMarker.isType(DeploymentType.APPLICATION_CLIENT, deploymentUnit)) { final ServiceName moduleContextServiceName = ContextNames.contextServiceNameOfModule(moduleDescription.getApplicationName(),moduleDescription.getModuleName()); bindServices(deploymentUnit, serviceTarget, moduleContextServiceName); } for(ComponentDescription component : moduleDescription.getComponentDescriptions()) { if(component.getNamingMode() == ComponentNamingMode.CREATE) { final ServiceName compContextServiceName = ContextNames.contextServiceNameOfComponent(moduleDescription.getApplicationName(),moduleDescription.getModuleName(),component.getComponentName()); bindServices(deploymentUnit, serviceTarget, compContextServiceName); } } }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit)) { return; // Skip non web deployments final VirtualFile deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot(); final VirtualFile jbossWebXml = deploymentRoot.getChild(JBOSS_WEB_XML); WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); assert warMetaData != null; if (jbossWebXml.exists()) { InputStream is = null; try { is = jbossWebXml.openStream(); final XMLInputFactory inputFactory = XMLInputFactory.newInstance(); inputFactory.setXMLResolver(NoopXMLResolver.create()); deploymentUnit.putAttachment(org.jboss.as.ee.structure.Attachments.DISTINCT_NAME, jBossWebMetaData.getDistinctName());
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { return; final ResourceRoot deploymentRoot = phaseContext.getDeploymentUnit().getAttachment(Attachments.DEPLOYMENT_ROOT); final VirtualFile virtualFile = deploymentRoot.getRoot(); deploymentRoot.putAttachment(Attachments.INDEX_RESOURCE_ROOT, false); ModuleRootMarker.mark(deploymentRoot, false); final boolean appXmlPresent = deploymentRoot.getRoot().getChild("META-INF/application.xml").exists(); final EarMetaData earMetaData = deploymentUnit.getAttachment(org.jboss.as.ee.structure.Attachments.EAR_METADATA); if (earMetaData != null) { final String xmlLibDirName = earMetaData.getLibraryDirectory(); Map<String, MountedDeploymentOverlay> overlays = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_OVERLAY_LOCATIONS); try { final VirtualFile libDir; libDir = virtualFile.getChild(libDirName); if (libDir.exists()) { List<VirtualFile> libArchives = libDir.getChildren(CHILD_ARCHIVE_FILTER);
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit)) { return; // Skip non web deployments final WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); if (warMetaData == null || warMetaData.getMergedJBossWebMetaData() == null) { return; TldsMetaData tldsMetaData = deploymentUnit.getAttachment(TldsMetaData.ATTACHMENT_KEY); if (tldsMetaData == null) { tldsMetaData = new TldsMetaData(); deploymentUnit.putAttachment(TldsMetaData.ATTACHMENT_KEY, tldsMetaData); final List<TldMetaData> uniqueTlds = new ArrayList<>(); final VirtualFile deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot(); final List<VirtualFile> testRoots = new ArrayList<VirtualFile>(); testRoots.add(deploymentRoot); testRoots.add(deploymentRoot.getChild(WEB_INF)); testRoots.add(deploymentRoot.getChild(META_INF)); for (ResourceRoot root : deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS)) { testRoots.add(root.getRoot()); testRoots.add(root.getRoot().getChild(META_INF)); testRoots.add(root.getRoot().getChild(META_INF).getChild(RESOURCES));
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); final VirtualFile switchyardXml; if (DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit)) { // switchyard.xml file located in /WEB-INF final VirtualFile warSwitchYardXml = deploymentRoot.getRoot().getChild(SWITCHYARD_XML_WAR); if (warSwitchYardXml.exists()) { switchyardXml = warSwitchYardXml; } else { // fall back to original location switchyardXml = deploymentRoot.getRoot().getChild(SWITCHYARD_XML); } } else { switchyardXml = deploymentRoot.getRoot().getChild(SWITCHYARD_XML); } if (!switchyardXml.exists()) { return; } final String archiveName = deploymentUnit.getName(); final String deploymentName = archiveName.substring(0, archiveName.lastIndexOf('.')); final SwitchYardMetaData switchYardMetaData = new SwitchYardMetaData(archiveName, deploymentName); switchYardMetaData.setSwitchYardFile(switchyardXml); deploymentUnit.putAttachment(SwitchYardMetaData.ATTACHMENT_KEY, switchYardMetaData); SwitchYardDeploymentMarker.mark(deploymentUnit); }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit)) { return; // Skip non web deployments WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); assert warMetaData != null; boolean fragmentFound = false; Map<String, WebFragmentMetaData> webFragments = warMetaData.getWebFragmentsMetaData(); List<ResourceRoot> resourceRoots = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS); for (ResourceRoot resourceRoot : resourceRoots) { if (resourceRoot.getRoot().getName().toLowerCase(Locale.ENGLISH).endsWith(".jar")) { jarsSet.add(resourceRoot.getRootName()); VirtualFile overlay = resourceRoot.getRoot().getChild("META-INF/resources"); if (overlay.exists()) { overlays.add(overlay); deploymentUnit.putAttachment(org.jboss.as.ee.component.Attachments.MODULE_DEPLOYMENT_DESCRIPTOR_ENVIRONMENT, bindings); final EEModuleDescription description = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION); description.setModuleName(mergedMetaData.getModuleName()); final EEModuleDescription description = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION); description.setDefaultSecurityDomain(mergedMetaData.getSecurityDomain());
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); ResourceRoot deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); if (deploymentRoot == null) { return; List<ResourceRoot> structure = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS); for (ResourceRoot resourceRoot : structure) { if (ModuleRootMarker.isModuleRoot(resourceRoot) && !SubDeploymentMarker.isSubDeployment(resourceRoot)) { if (resourceRoot.getRootName().equals("classes")) { deploymentUnit.putAttachment(WeldAttachments.CLASSES_RESOURCE_ROOT, resourceRoot); } else { VirtualFile beansXml = resourceRoot.getRoot().getChild(META_INF_BEANS_XML); if (beansXml.exists() && beansXml.isFile()) { WeldLogger.DEPLOYMENT_LOGGER.debugf("Found beans.xml: %s", beansXml.toString()); beanArchiveMetadata.put(resourceRoot, new ExplicitBeanArchiveMetadata(beansXml, resourceRoot, parseBeansXml(beansXml, parser, deploymentUnit), false)); if (DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit)) { final VirtualFile rootBeansXml = deploymentRoot.getRoot().getChild(WEB_INF_BEANS_XML); final boolean rootBeansXmlPresent = rootBeansXml.exists() && rootBeansXml.isFile(); beanArchiveMetadata.put(deploymentRoot, new ExplicitBeanArchiveMetadata(beansXml, classesRoot, parseBeansXml(beansXml, parser, deploymentUnit), true)); } else if (!DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { final VirtualFile rootBeansXml = deploymentRoot.getRoot().getChild(META_INF_BEANS_XML); if (rootBeansXml.exists() && rootBeansXml.isFile()) {
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final DeploymentUnit topLevelDeployment = Utils.getRootDeploymentUnit(deploymentUnit); final ServiceTarget serviceTarget = phaseContext.getServiceTarget(); if (!WeldDeploymentMarker.isPartOfWeldDeployment(topLevelDeployment)) { return; final Collection<ServiceName> dependencies = deploymentUnit.getAttachment(Attachments.JNDI_DEPENDENCIES); .getAttachment(WeldAttachments.DEPLOYMENT_ROOT_BEAN_DEPLOYMENT_ARCHIVE); if (rootBda == null) { rootBda = topLevelDeployment.getAttachment(WeldAttachments.DEPLOYMENT_ROOT_BEAN_DEPLOYMENT_ARCHIVE); if (DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit) || deploymentUnit.getName().endsWith(".jar")) { final ServiceName moduleContextServiceName = ContextNames.contextServiceNameOfModule(moduleDescription.getApplicationName(), moduleDescription.getModuleName()); bindBeanManager(serviceTarget, beanManagerServiceName, moduleContextServiceName, dependencies, phaseContext.getServiceRegistry()); for (ComponentDescription component : moduleDescription.getComponentDescriptions()) { if (component.getNamingMode() == ComponentNamingMode.CREATE) { final ServiceName compContextServiceName = ContextNames.contextServiceNameOfComponent(moduleDescription.getApplicationName(), moduleDescription.getModuleName(), component.getComponentName());
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (deploymentUnit.getName().toLowerCase(Locale.ENGLISH).endsWith(".ear")) { final Map<VirtualFile, ResourceRoot> existing = new HashMap<VirtualFile, ResourceRoot>(); for (final ResourceRoot additional : deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS)) { existing.put(additional.getRoot(), additional); final ResourceRoot root = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); final VirtualFile appClientRoot = root.getRoot().getChild(deployment); if (appClientRoot.exists()) { if (existing.containsKey(appClientRoot)) { final ResourceRoot existingRoot = existing.get(appClientRoot); ModuleRootMarker.mark(existingRoot); } else { final Closeable closable = appClientRoot.isFile() ? mount(appClientRoot, false) : null; final MountHandle mountHandle = new MountHandle(closable); final ResourceRoot childResource = new ResourceRoot(appClientRoot, mountHandle); ModuleRootMarker.mark(childResource); SubDeploymentMarker.mark(childResource); final ResourceRoot root = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); if (appClientRoot.equals(root.getRoot())) { DeploymentTypeMarker.setType(DeploymentType.APPLICATION_CLIENT, deploymentUnit);
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { return; EEModuleDescription moduleDescription = deploymentUnit.getAttachment(EE_MODULE_DESCRIPTION); final ServiceTarget serviceTarget = phaseContext.getServiceTarget(); final ServiceName appContextServiceName = ContextNames.contextServiceNameOfApplication(moduleDescription.getApplicationName()); final ServiceName moduleContextServiceName = ContextNames.contextServiceNameOfModule(moduleDescription.getApplicationName(), moduleDescription.getModuleName()); final NamingStoreService contextService = new NamingStoreService(true); serviceTarget.addService(moduleContextServiceName, contextService).install(); .addDependency(moduleContextServiceName, ServiceBasedNamingStore.class, moduleNameBinder.getNamingStoreInjector()) .install(); deploymentUnit.addToAttachmentList(org.jboss.as.server.deployment.Attachments.JNDI_DEPENDENCIES, moduleNameServiceName); deploymentUnit.putAttachment(MODULE_CONTEXT_CONFIG, moduleContextServiceName); phaseContext.addDependency(appContextServiceName, NamingStore.class, selector.getAppContextInjector()); phaseContext.addDependency(moduleContextServiceName, NamingStore.class, selector.getModuleContextInjector()); phaseContext.addDependency(moduleContextServiceName, NamingStore.class, selector.getCompContextInjector());
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit)) { return; // Skip non web deployments final ResourceRoot deploymentResourceRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); final VirtualFile deploymentRoot = deploymentResourceRoot.getRoot(); if (deploymentRoot == null) { return; final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); if (moduleSpecification == null) { return; deploymentResourceRoot.putAttachment(Attachments.INDEX_RESOURCE_ROOT, false); deploymentResourceRoot.getExportFilters().add(new FilterSpecification(PathFilters.getMetaInfFilter(), true)); deploymentResourceRoot.getExportFilters().add(new FilterSpecification(PathFilters.getMetaInfSubdirectoriesFilter(), true)); deploymentResourceRoot.getExportFilters().add(new FilterSpecification(PathFilters.acceptAll(), false)); deploymentUnit.addToAttachmentList(Attachments.RESOURCE_ROOTS, root);
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); // we only process .ear if (!DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { return; } final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); // set the default ear subdeployment isolation value moduleSpecification.setSubDeploymentModulesIsolated(earSubDeploymentsIsolated); }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); ResourceRoot deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); if (deploymentRoot == null) { return; final VirtualFile root = deploymentRoot.getRoot(); VirtualFile jobsDir = null; if (DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit)) { jobsDir = root.getChild(BatchXmlProcessor.WEB_INF_BATCH_XML); } else if (!DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { jobsDir = root.getChild(BatchXmlProcessor.META_INF_BATCH_XML); if (jobsDir != null && jobsDir.exists() && !jobsDir.getChildren().isEmpty()) { deploymentUnit.putAttachment(ExplicitBatchArchiveMetadataContainer.ATTACHMENT_KEY, deploymentMetadata);
private void handleJarDeployment(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!isEarDeployment(deploymentUnit) && !isWarDeployment(deploymentUnit) && (!appClientContainerMode || DeploymentTypeMarker.isType(DeploymentType.APPLICATION_CLIENT, deploymentUnit)) ) { // handle META-INF/persistence.xml // ordered list of PUs List<PersistenceUnitMetadataHolder> listPUHolders = new ArrayList<PersistenceUnitMetadataHolder>(1); // handle META-INF/persistence.xml final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); VirtualFile persistence_xml = deploymentRoot.getRoot().getChild(META_INF_PERSISTENCE_XML); parse(persistence_xml, listPUHolders, deploymentUnit); PersistenceUnitMetadataHolder holder = normalize(listPUHolders); // save the persistent unit definitions // deploymentUnit.putAttachment(PersistenceUnitMetadataHolder.PERSISTENCE_UNITS, holder); deploymentRoot.putAttachment(PersistenceUnitMetadataHolder.PERSISTENCE_UNITS, holder); markDU(holder, deploymentUnit); ROOT_LOGGER.tracef("parsed persistence unit definitions for jar %s", deploymentRoot.getRootName()); incrementPersistenceUnitCount(deploymentUnit, holder.getPersistenceUnits().size()); addApplicationDependenciesOnProvider( deploymentUnit, holder); } }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit depUnit = phaseContext.getDeploymentUnit(); if (!DeploymentTypeMarker.isType(DeploymentType.EAR, depUnit)) { return; } ResourceRoot deploymentRoot = depUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); List<ResourceRoot> potentialSubDeployments = depUnit.getAttachmentList(Attachments.RESOURCE_ROOTS); for (ResourceRoot resourceRoot : potentialSubDeployments) { if (IgnoreMetaInfMarker.isIgnoreMetaInf(resourceRoot)) continue; // Don't accept archives in the 'lib' directory String pathName = resourceRoot.getRoot().getPathNameRelativeTo(deploymentRoot.getRoot()); if (pathName.startsWith("lib/")) continue; // Check if this sub deployment has a valid OSGi manifest - if so mark it Manifest manifest = ManifestAttachmentProcessor.getManifest(resourceRoot); if (OSGiManifestBuilder.isValidBundleManifest(manifest)) { SubDeploymentMarker.mark(resourceRoot); } } }
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); final Module module = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.MODULE); if (eeModuleDescription == null) { return; if(DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { String applicationName = eeModuleDescription.getEarApplicationName(); final DeploymentModuleIdentifier identifier = new DeploymentModuleIdentifier(applicationName, eeModuleDescription.getModuleName(), eeModuleDescription.getDistinctName()); final Collection<ComponentDescription> componentDescriptions = eeModuleDescription.getComponentDescriptions(); final StartupCountdown countdown = deploymentUnit.getAttachment(Attachments.STARTUP_COUNTDOWN); final ModuleDeployment deployment = new ModuleDeployment(identifier, deploymentInformationMap); ServiceName moduleDeploymentService = deploymentUnit.getServiceName().append(ModuleDeployment.SERVICE_NAME); final ServiceBuilder<ModuleDeployment> builder = phaseContext.getServiceTarget().addService(moduleDeploymentService, deployment); for (Map.Entry<ServiceName, InjectedValue<?>> entry : injectedValues.entrySet()) { builder.addDependency(entry.getKey(), Object.class, (InjectedValue<Object>) entry.getValue()); final ServiceBuilder<Void> startBuilder = phaseContext.getServiceTarget().addService(deploymentUnit.getServiceName().append(ModuleDeployment.START_SERVICE_NAME), deploymentStart); for (final ServiceName componentStartService : componentStartServices) { startBuilder.requires(componentStartService);
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit unit = phaseContext.getDeploymentUnit(); if (DeploymentTypeMarker.isType(DeploymentType.EAR, unit)) { return; final ResourceRoot resourceRoot = getWsdlResourceRoot(unit, wsdlLocation); if (resourceRoot == null) continue; final VirtualFile wsdlLocationFile = resourceRoot.getRoot().getChild(wsdlLocation); final URL url = wsdlLocationFile.toURL(); SOAPAddressWSDLParser parser = new SOAPAddressWSDLParser(url); for (AnnotationInstance ai : map.get(wsdlLocation)) { unit.putAttachment(JMS_ENDPOINT_METADATA_KEY, new JMSEndpointsMetaData(list));
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (DeploymentTypeMarker.isType(EAR, deploymentUnit)) { return; } final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); if(moduleDescription == null) { return; } final String defaultDataSource = moduleDescription.getDefaultResourceJndiNames().getDataSource(); if(defaultDataSource == null) { return; } final LookupInjectionSource injectionSource = new LookupInjectionSource(defaultDataSource); if (DeploymentTypeMarker.isType(WAR, deploymentUnit)) { moduleDescription.getBindingConfigurations().add(new BindingConfiguration(MODULE_DEFAULT_DATASOURCE_JNDI_NAME, injectionSource)); } else { if (DeploymentTypeMarker.isType(APPLICATION_CLIENT, deploymentUnit)) { moduleDescription.getBindingConfigurations().add(new BindingConfiguration(COMP_DEFAULT_DATASOURCE_JNDI_NAME, injectionSource)); } for(ComponentDescription componentDescription : moduleDescription.getComponentDescriptions()) { if(componentDescription.getNamingMode() == ComponentNamingMode.CREATE) { componentDescription.getBindingConfigurations().add(new BindingConfiguration(COMP_DEFAULT_DATASOURCE_JNDI_NAME, injectionSource)); } } } }