Search in sources :

Example 1 with PropertiesPropertyResolver

use of org.jboss.metadata.property.PropertiesPropertyResolver in project wildfly by wildfly.

the class DeploymentPropertyResolverProcessor method deploy.

public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    DeploymentUnit current = deploymentUnit;
    final List<PropertyResolver> propertyResolvers = new ArrayList<PropertyResolver>();
    do {
        final Properties deploymentProperties = current.getAttachment(Attachments.DEPLOYMENT_PROPERTIES);
        if (deploymentProperties != null) {
            propertyResolvers.add(new PropertiesPropertyResolver(deploymentProperties));
        }
        current = current.getParent();
    } while (current != null);
    if (!propertyResolvers.isEmpty()) {
        deploymentUnit.addToAttachmentList(Attachments.DEPLOYMENT_PROPERTY_RESOLVERS, new CompositePropertyResolver(propertyResolvers));
    }
}
Also used : PropertiesPropertyResolver(org.jboss.metadata.property.PropertiesPropertyResolver) ArrayList(java.util.ArrayList) PropertyResolver(org.jboss.metadata.property.PropertyResolver) PropertiesPropertyResolver(org.jboss.metadata.property.PropertiesPropertyResolver) CompositePropertyResolver(org.jboss.metadata.property.CompositePropertyResolver) Properties(java.util.Properties) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit) CompositePropertyResolver(org.jboss.metadata.property.CompositePropertyResolver)

Aggregations

ArrayList (java.util.ArrayList)1 Properties (java.util.Properties)1 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)1 CompositePropertyResolver (org.jboss.metadata.property.CompositePropertyResolver)1 PropertiesPropertyResolver (org.jboss.metadata.property.PropertiesPropertyResolver)1 PropertyResolver (org.jboss.metadata.property.PropertyResolver)1