public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); Module module = deploymentUnit.getAttachment(Attachments.MODULE); if (module == null) { throw ServerLogger.ROOT_LOGGER.nullModuleAttachment(deploymentUnit); } if(deploymentUnit.getParent() == null) { final DeploymentReflectionIndex index = DeploymentReflectionIndex.create(); deploymentUnit.putAttachment(Attachments.REFLECTION_INDEX, index); deploymentUnit.putAttachment(Attachments.PROXY_REFLECTION_INDEX, new ProxyMetadataSource(index)); } else { final DeploymentReflectionIndex index = deploymentUnit.getParent().getAttachment(Attachments.REFLECTION_INDEX); deploymentUnit.putAttachment(Attachments.REFLECTION_INDEX, index); deploymentUnit.putAttachment(Attachments.PROXY_REFLECTION_INDEX, deploymentUnit.getParent().getAttachment(Attachments.PROXY_REFLECTION_INDEX)); } }
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); Module module = deploymentUnit.getAttachment(Attachments.MODULE); if (module == null) { throw ServerLogger.ROOT_LOGGER.nullModuleAttachment(deploymentUnit); } if(deploymentUnit.getParent() == null) { final DeploymentReflectionIndex index = DeploymentReflectionIndex.create(); deploymentUnit.putAttachment(Attachments.REFLECTION_INDEX, index); deploymentUnit.putAttachment(Attachments.PROXY_REFLECTION_INDEX, new ProxyMetadataSource(index)); } else { final DeploymentReflectionIndex index = deploymentUnit.getParent().getAttachment(Attachments.REFLECTION_INDEX); deploymentUnit.putAttachment(Attachments.REFLECTION_INDEX, index); deploymentUnit.putAttachment(Attachments.PROXY_REFLECTION_INDEX, deploymentUnit.getParent().getAttachment(Attachments.PROXY_REFLECTION_INDEX)); } }
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); // OSGi fragments do not have a module Manifest manifest = deploymentUnit.getAttachment(Attachments.OSGI_MANIFEST); if (ManifestHelper.hasMainAttributeValue(manifest, "Fragment-Host")) { return; } Module module = deploymentUnit.getAttachment(Attachments.MODULE); if (module == null) { throw MESSAGES.nullModuleAttachment(deploymentUnit); } if(deploymentUnit.getParent() == null) { final DeploymentReflectionIndex index = DeploymentReflectionIndex.create(); deploymentUnit.putAttachment(Attachments.REFLECTION_INDEX, index); deploymentUnit.putAttachment(Attachments.PROXY_REFLECTION_INDEX, new ProxyMetadataSource(index)); deploymentUnit.putAttachment(Attachments.CLASS_INDEX, new DeploymentClassIndex(index, module)); } else { final DeploymentReflectionIndex index = deploymentUnit.getParent().getAttachment(Attachments.REFLECTION_INDEX); deploymentUnit.putAttachment(Attachments.REFLECTION_INDEX, index); deploymentUnit.putAttachment(Attachments.PROXY_REFLECTION_INDEX, deploymentUnit.getParent().getAttachment(Attachments.PROXY_REFLECTION_INDEX)); deploymentUnit.putAttachment(Attachments.CLASS_INDEX, new DeploymentClassIndex(index, module)); } }
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); // OSGi fragments do not have a module Manifest manifest = deploymentUnit.getAttachment(Attachments.OSGI_MANIFEST); if (ManifestHelper.hasMainAttributeValue(manifest, "Fragment-Host")) { return; } Module module = deploymentUnit.getAttachment(Attachments.MODULE); if (module == null) { throw MESSAGES.nullModuleAttachment(deploymentUnit); } if(deploymentUnit.getParent() == null) { final DeploymentReflectionIndex index = DeploymentReflectionIndex.create(); deploymentUnit.putAttachment(Attachments.REFLECTION_INDEX, index); deploymentUnit.putAttachment(Attachments.PROXY_REFLECTION_INDEX, new ProxyMetadataSource(index)); deploymentUnit.putAttachment(Attachments.CLASS_INDEX, new DeploymentClassIndex(index, module)); } else { final DeploymentReflectionIndex index = deploymentUnit.getParent().getAttachment(Attachments.REFLECTION_INDEX); deploymentUnit.putAttachment(Attachments.REFLECTION_INDEX, index); deploymentUnit.putAttachment(Attachments.PROXY_REFLECTION_INDEX, deploymentUnit.getParent().getAttachment(Attachments.PROXY_REFLECTION_INDEX)); deploymentUnit.putAttachment(Attachments.CLASS_INDEX, new DeploymentClassIndex(index, module)); } }