use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.
the class EJBClientDescriptorParsingProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final XMLMapper mapper = createMapper(deploymentUnit);
final ResourceRoot resourceRoot = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.DEPLOYMENT_ROOT);
final ServiceModuleLoader moduleLoader = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.SERVICE_MODULE_LOADER);
VirtualFile descriptorFile = null;
for (final String loc : EJB_CLIENT_DESCRIPTOR_LOCATIONS) {
final VirtualFile file = resourceRoot.getRoot().getChild(loc);
if (file.exists()) {
descriptorFile = file;
break;
}
}
if (descriptorFile == null) {
return;
}
if (deploymentUnit.getParent() != null) {
EeLogger.ROOT_LOGGER.subdeploymentIgnored(descriptorFile.getPathName());
return;
}
final File ejbClientDeploymentDescriptorFile;
try {
ejbClientDeploymentDescriptorFile = descriptorFile.getPhysicalFile();
} catch (IOException e) {
throw EeLogger.ROOT_LOGGER.failedToProcessEJBClientDescriptor(e);
}
final EJBClientDescriptorMetaData ejbClientDescriptorMetaData = parse(ejbClientDeploymentDescriptorFile, mapper);
EeLogger.ROOT_LOGGER.debugf("Successfully parsed jboss-ejb-client.xml for deployment unit %s", deploymentUnit);
// attach the metadata
deploymentUnit.putAttachment(Attachments.EJB_CLIENT_METADATA, ejbClientDescriptorMetaData);
}
use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.
the class EarInitializationProcessor method deploy.
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
// Make sure this is an EAR deployment
String deploymentName = deploymentUnit.getName().toLowerCase(Locale.ENGLISH);
if (deploymentName.endsWith(EAR_EXTENSION)) {
// Let other processors know this is an EAR deployment
DeploymentTypeMarker.setType(DeploymentType.EAR, deploymentUnit);
}
}
use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.
the class AnnotationPropertyReplacementProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
deploymentUnit.putAttachment(attachmentKey, annotationPropertyReplacement);
}
use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.
the class ComponentAggregationProcessor method deploy.
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final ComponentRegistry componentRegistry = new ComponentRegistry(phaseContext.getServiceRegistry());
final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(EE_MODULE_DESCRIPTION);
if (moduleDescription == null) {
return;
}
phaseContext.getServiceTarget().addService(ComponentRegistry.serviceName(deploymentUnit), new ValueService<>(new ImmediateValue<Object>(componentRegistry))).addDependency(moduleDescription.getDefaultClassIntrospectorServiceName(), EEClassIntrospector.class, componentRegistry.getClassIntrospectorInjectedValue()).install();
deploymentUnit.putAttachment(COMPONENT_REGISTRY, componentRegistry);
if (deploymentUnit.getAttachment(Attachments.DEPLOYMENT_TYPE) == DeploymentType.EAR) {
final EEApplicationDescription applicationDescription = new EEApplicationDescription();
deploymentUnit.putAttachment(org.jboss.as.ee.component.Attachments.EE_APPLICATION_DESCRIPTION, applicationDescription);
for (final Map.Entry<String, String> messageDestination : moduleDescription.getMessageDestinations().entrySet()) {
applicationDescription.addMessageDestination(messageDestination.getKey(), messageDestination.getValue(), deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.DEPLOYMENT_ROOT).getRoot());
}
/*
* We are an EAR, so we must inspect all of our subdeployments and aggregate all their component views
* into a single index, so that inter-module resolution will work.
*/
// Add the application description
final List<DeploymentUnit> subdeployments = deploymentUnit.getAttachmentList(SUB_DEPLOYMENTS);
for (final DeploymentUnit subdeployment : subdeployments) {
final EEModuleDescription subDeploymentModuleDescription = subdeployment.getAttachment(EE_MODULE_DESCRIPTION);
final ResourceRoot deploymentRoot = subdeployment.getAttachment(org.jboss.as.server.deployment.Attachments.DEPLOYMENT_ROOT);
if (subDeploymentModuleDescription == null) {
// Not an EE deployment.
continue;
}
for (final ComponentDescription componentDescription : subDeploymentModuleDescription.getComponentDescriptions()) {
applicationDescription.addComponent(componentDescription, deploymentRoot.getRoot());
}
for (final Map.Entry<String, String> messageDestination : subDeploymentModuleDescription.getMessageDestinations().entrySet()) {
applicationDescription.addMessageDestination(messageDestination.getKey(), messageDestination.getValue(), deploymentRoot.getRoot());
}
for (final ComponentDescription componentDescription : subdeployment.getAttachmentList(org.jboss.as.ee.component.Attachments.ADDITIONAL_RESOLVABLE_COMPONENTS)) {
applicationDescription.addComponent(componentDescription, deploymentRoot.getRoot());
}
subdeployment.putAttachment(EE_APPLICATION_DESCRIPTION, applicationDescription);
}
} else if (deploymentUnit.getParent() == null) {
final EEApplicationDescription applicationDescription = new EEApplicationDescription();
deploymentUnit.putAttachment(org.jboss.as.ee.component.Attachments.EE_APPLICATION_DESCRIPTION, applicationDescription);
/*
* We are a top-level EE deployment, or a non-EE deployment. Our "aggregate" index is just a copy of
* our local EE module index.
*/
final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.DEPLOYMENT_ROOT);
for (final ComponentDescription componentDescription : moduleDescription.getComponentDescriptions()) {
applicationDescription.addComponent(componentDescription, deploymentRoot.getRoot());
}
for (final Map.Entry<String, String> messageDestination : moduleDescription.getMessageDestinations().entrySet()) {
applicationDescription.addMessageDestination(messageDestination.getKey(), messageDestination.getValue(), deploymentRoot.getRoot());
}
for (final ComponentDescription componentDescription : deploymentUnit.getAttachmentList(org.jboss.as.ee.component.Attachments.ADDITIONAL_RESOLVABLE_COMPONENTS)) {
applicationDescription.addComponent(componentDescription, deploymentRoot.getRoot());
}
}
}
use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.
the class IIOPMarkerProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
// for now we mark all subsystems as using IIOP if the IIOP subsystem is installed
IIOPDeploymentMarker.mark(deploymentUnit);
}
Aggregations