use of org.jboss.as.connector.deployers.ra.ConnectionFactoryDefinitionInjectionSource 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);
}
}
Aggregations