static ConnectionFactoryConfiguration createConfiguration(final OperationContext context, final String name, final ModelNode model) throws OperationFailedException {
final ModelNode entries = ENTRIES.resolveModelAttribute(context, model);
final String[] jndiBindings = JndiEntriesAttribute.getJndiBindings(entries);
final ConnectionFactoryConfiguration config = new ConnectionFactoryConfigurationImpl(name, HornetQClient.DEFAULT_HA, jndiBindings);
config.setHA(HA.resolveModelAttribute(context, model).asBoolean());
config.setAutoGroup(AUTO_GROUP.resolveModelAttribute(context, model).asBoolean());
config.setBlockOnAcknowledge(BLOCK_ON_ACK.resolveModelAttribute(context, model).asBoolean());
config.setBlockOnDurableSend(BLOCK_ON_DURABLE_SEND.resolveModelAttribute(context, model).asBoolean());
config.setBlockOnNonDurableSend(BLOCK_ON_NON_DURABLE_SEND.resolveModelAttribute(context, model).asBoolean());
config.setCacheLargeMessagesClient(CACHE_LARGE_MESSAGE_CLIENT.resolveModelAttribute(context, model).asBoolean());
config.setCallTimeout(CALL_TIMEOUT.resolveModelAttribute(context, model).asLong());
config.setClientFailureCheckPeriod(CLIENT_FAILURE_CHECK_PERIOD.resolveModelAttribute(context, model).asInt());
final ModelNode clientId = CLIENT_ID.resolveModelAttribute(context, model);
if (clientId.isDefined()) {
config.setClientID(clientId.asString());
}
config.setCompressLargeMessages(COMPRESS_LARGE_MESSAGES.resolveModelAttribute(context, model).asBoolean());
config.setConfirmationWindowSize(CONFIRMATION_WINDOW_SIZE.resolveModelAttribute(context, model).asInt());
config.setConnectionTTL(CONNECTION_TTL.resolveModelAttribute(context, model).asLong());
if (model.hasDefined(CONNECTOR)) {
ModelNode connectorRefs = model.get(CONNECTOR);
List<String> connectorNames = new ArrayList<String>();
for (String connectorName : model.get(CONNECTOR).keys()) {
ModelNode connectorRef = connectorRefs.get(connectorName);
connectorNames.add(connectorName);
}
config.setConnectorNames(connectorNames);
}
//config.setConnectorConfigs(connectorConfigs)
// config.setConnectorNames(connectors);
config.setConsumerMaxRate(CONSUMER_MAX_RATE.resolveModelAttribute(context, model).asInt());
config.setConsumerWindowSize(CONSUMER_WINDOW_SIZE.resolveModelAttribute(context, model).asInt());
final ModelNode discoveryGroupName = DISCOVERY_GROUP_NAME.resolveModelAttribute(context, model);
if (discoveryGroupName.isDefined()) {
config.setDiscoveryGroupName(discoveryGroupName.asString());
}
config.setDupsOKBatchSize(DUPS_OK_BATCH_SIZE.resolveModelAttribute(context, model).asInt());
config.setFailoverOnInitialConnection(FAILOVER_ON_INITIAL_CONNECTION.resolveModelAttribute(context, model).asBoolean());
final ModelNode groupId = GROUP_ID.resolveModelAttribute(context, model);
if(groupId.isDefined()) {
config.setGroupID(groupId.asString());
}
final ModelNode lbcn = LOAD_BALANCING_CLASS_NAME.resolveModelAttribute(context, model);
if(lbcn.isDefined()) {
config.setLoadBalancingPolicyClassName(lbcn.asString());
}
config.setMaxRetryInterval(MAX_RETRY_INTERVAL.resolveModelAttribute(context, model).asLong());
config.setMinLargeMessageSize(MIN_LARGE_MESSAGE_SIZE.resolveModelAttribute(context, model).asInt());
config.setPreAcknowledge(PRE_ACK.resolveModelAttribute(context, model).asBoolean());
config.setProducerMaxRate(PRODUCER_MAX_RATE.resolveModelAttribute(context, model).asInt());
config.setProducerWindowSize(PRODUCER_WINDOW_SIZE.resolveModelAttribute(context, model).asInt());
config.setReconnectAttempts(CONNECTION_FACTORY_RECONNECT_ATTEMPTS.resolveModelAttribute(context, model).asInt());
config.setRetryInterval(RETRY_INTERVAL.resolveModelAttribute(context, model).asLong());
config.setRetryIntervalMultiplier(RETRY_INTERVAL_MULTIPLIER.resolveModelAttribute(context, model).asDouble());
config.setScheduledThreadPoolMaxSize(CONNECTION_SCHEDULED_THREAD_POOL_MAX_SIZE.resolveModelAttribute(context, model).asInt());
config.setThreadPoolMaxSize(CONNECTION_THREAD_POOL_MAX_SIZE.resolveModelAttribute(context, model).asInt());
config.setTransactionBatchSize(TRANSACTION_BATCH_SIZE.resolveModelAttribute(context, model).asInt());
config.setUseGlobalPools(USE_GLOBAL_POOLS.resolveModelAttribute(context, model).asBoolean());
config.setLoadBalancingPolicyClassName(LOAD_BALANCING_CLASS_NAME.resolveModelAttribute(context, model).asString());
JMSFactoryType jmsFactoryType = getFactoryType(CONNECTION_FACTORY_TYPE.resolveModelAttribute(context, model).asString());
config.setFactoryType(jmsFactoryType);
return config;
}