use of org.jboss.as.server.deployment.DeploymentUnitProcessingException in project wildfly by wildfly.
the class XTSHandlerDeploymentProcessor method deploy.
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit unit = phaseContext.getDeploymentUnit();
final List<WebserviceDescriptionMetaData> webserviceDescriptions = new ArrayList<WebserviceDescriptionMetaData>();
boolean modifiedWSMeta = false;
for (String endpoint : getDeploymentClasses(unit)) {
try {
final EndpointMetaData endpointMetaData = EndpointMetaData.build(unit, endpoint);
if (endpointMetaData.isXTSEnabled()) {
XTSDeploymentMarker.mark(unit);
final boolean result = updateXTSEndpoint(endpoint, endpointMetaData, webserviceDescriptions, unit);
modifiedWSMeta = modifiedWSMeta || result;
}
} catch (XTSException e) {
throw new DeploymentUnitProcessingException("Error processing endpoint '" + endpoint + "'", e);
}
}
if (modifiedWSMeta) {
unit.putAttachment(WSAttachmentKeys.WEBSERVICES_METADATA_KEY, new WebservicesMetaData(null, webserviceDescriptions));
}
}
use of org.jboss.as.server.deployment.DeploymentUnitProcessingException in project wildfly by wildfly.
the class EarMetaDataParsingProcessor method handleJbossMetadata.
private JBossAppMetaData handleJbossMetadata(VirtualFile deploymentFile, final PropertyReplacer propertyReplacer, final DeploymentUnit deploymentUnit) throws DeploymentUnitProcessingException {
final VirtualFile applicationXmlFile = deploymentFile.getChild(JBOSS_APP_XML);
if (!applicationXmlFile.exists()) {
//may have been in jboss-all.xml
return deploymentUnit.getAttachment(AppJBossAllParser.ATTACHMENT_KEY);
}
InputStream inputStream = null;
try {
inputStream = applicationXmlFile.openStream();
final XMLInputFactory inputFactory = XMLInputFactory.newInstance();
inputFactory.setXMLResolver(NoopXMLResolver.create());
XMLStreamReader xmlReader = inputFactory.createXMLStreamReader(inputStream);
return JBossAppMetaDataParser.INSTANCE.parse(xmlReader, propertyReplacer);
} catch (Exception e) {
throw EeLogger.ROOT_LOGGER.failedToParse(e, applicationXmlFile);
} finally {
VFSUtils.safeClose(inputStream);
}
}
use of org.jboss.as.server.deployment.DeploymentUnitProcessingException in project wildfly by wildfly.
the class EarMetaDataParsingProcessor method handleSpecMetadata.
private EarMetaData handleSpecMetadata(VirtualFile deploymentFile, final PropertyReplacer propertyReplacer) throws DeploymentUnitProcessingException {
final VirtualFile applicationXmlFile = deploymentFile.getChild(APPLICATION_XML);
if (!applicationXmlFile.exists()) {
return null;
}
InputStream inputStream = null;
try {
inputStream = applicationXmlFile.openStream();
final XMLInputFactory inputFactory = XMLInputFactory.newInstance();
inputFactory.setXMLResolver(NoopXMLResolver.create());
XMLStreamReader xmlReader = inputFactory.createXMLStreamReader(inputStream);
return EarMetaDataParser.INSTANCE.parse(xmlReader, propertyReplacer);
} catch (Exception e) {
throw EeLogger.ROOT_LOGGER.failedToParse(e, applicationXmlFile);
} finally {
VFSUtils.safeClose(inputStream);
}
}
use of org.jboss.as.server.deployment.DeploymentUnitProcessingException in project wildfly by wildfly.
the class JMSConnectionFactoryDefinitionInjectionSource method getResourceValue.
@Override
public void getResourceValue(ResolutionContext context, ServiceBuilder<?> serviceBuilder, DeploymentPhaseContext phaseContext, Injector<ManagedReferenceFactory> injector) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
if (targetsPooledConnectionFactory(getActiveMQServerName(properties), resourceAdapter, phaseContext.getServiceRegistry())) {
try {
startedPooledConnectionFactory(context, jndiName, serviceBuilder, phaseContext.getServiceTarget(), deploymentUnit, injector);
} catch (OperationFailedException e) {
throw new DeploymentUnitProcessingException(e);
}
} else {
// delegate to the resource-adapter subsystem to create a generic JCA connection factory.
ConnectionFactoryDefinitionInjectionSource cfdis = new ConnectionFactoryDefinitionInjectionSource(jndiName, interfaceName, resourceAdapter);
cfdis.setMaxPoolSize(maxPoolSize);
cfdis.setMinPoolSize(minPoolSize);
cfdis.setTransactionSupportLevel(transactional ? TransactionSupport.TransactionSupportLevel.XATransaction : TransactionSupport.TransactionSupportLevel.NoTransaction);
// transfer all the generic properties + the additional properties specific to the JMSConnectionFactoryDefinition
for (Map.Entry<String, String> property : properties.entrySet()) {
cfdis.addProperty(property.getKey(), property.getValue());
}
if (!user.isEmpty()) {
cfdis.addProperty("user", user);
}
if (!password.isEmpty()) {
cfdis.addProperty("password", password);
}
if (!clientId.isEmpty()) {
cfdis.addProperty("clientId", clientId);
}
cfdis.getResourceValue(context, serviceBuilder, phaseContext, injector);
}
}
use of org.jboss.as.server.deployment.DeploymentUnitProcessingException in project wildfly by wildfly.
the class JMSDestinationDefinitionInjectionSource method startActiveMQDestination.
private void startActiveMQDestination(ResolutionContext context, ServiceBuilder<?> serviceBuilder, DeploymentPhaseContext phaseContext, Injector<ManagedReferenceFactory> injector) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final String uniqueName = uniqueName(context);
try {
ServiceName serviceName = MessagingServices.getActiveMQServiceName(getActiveMQServerName(properties));
if (interfaceName.equals(Queue.class.getName())) {
startQueue(uniqueName, phaseContext.getServiceTarget(), serviceName, serviceBuilder, deploymentUnit, injector);
} else {
startTopic(uniqueName, phaseContext.getServiceTarget(), serviceName, serviceBuilder, deploymentUnit, injector);
}
} catch (Exception e) {
throw new DeploymentUnitProcessingException(e);
}
}
Aggregations