}
private JMSConnectionFactoryDefinitionDescriptor createDescriptor(JMSConnectionFactoryDefinition defn) {
JMSConnectionFactoryDefinitionDescriptor desc = new JMSConnectionFactoryDefinitionDescriptor();
desc.setMetadataSource(MetadataSource.ANNOTATION);
desc.setName(defn.name());
desc.setClassName(defn.className());
if (defn.description() != null && !defn.description().equals("")) {
desc.setDescription(defn.description());
}
if (defn.resourceAdapterName() != null && !defn.resourceAdapterName().equals("")) {
desc.setResourceAdapterName(defn.resourceAdapterName());
}
if (defn.user() != null && !defn.user().equals("")) {
desc.setUser(defn.user());
}
if (defn.password() != null /*ALLOW EMPTY PASSWORDS && !defn.password().equals("")*/) {
desc.setPassword(defn.password());
}
if (defn.clientId() != null && !defn.clientId().equals("")) {
desc.setClientId(defn.clientId());
}
if (defn.connectionTimeout() >= 0) {
desc.setConnectionTimeout(defn.connectionTimeout());
}
desc.setTransactional(defn.transactional());
if (defn.initialPoolSize() >= 0) {
desc.setInitialPoolSize(defn.initialPoolSize());
}
if (defn.maxPoolSize() >= 0) {
desc.setMaxPoolSize(defn.maxPoolSize());
}
if (defn.minPoolSize() >= 0) {
desc.setMinPoolSize(defn.minPoolSize());
}
if (defn.maxIdleTime() >= 0) {
desc.setMaxIdleTime(defn.maxIdleTime());
}
if (defn.properties() != null) {
Properties properties = desc.getProperties();
String[] defnProperties = defn.properties();
if (defnProperties.length > 0) {
for (String property : defnProperties) {
int index = property.indexOf("=");