private void addEnvironmentProperties(ScopeType scope, Iterator envItr, Collection<JNDIBinding> jndiBindings) { while( envItr.hasNext() ) { EnvironmentProperty next = (EnvironmentProperty) envItr.next(); if( !dependencyAppliesToScope(next, scope)) { continue; } // Only env-entries that have been assigned a value are // eligible for look up if (next.hasAValue()) { String name = descriptorToLogicalJndiName(next); Object value = next.hasLookupName() ? namingUtils.createLazyNamingObjectFactory(name, next.getLookupName(), true) : namingUtils.createSimpleNamingObjectFactory(name, next.getValueObject()); jndiBindings.add(new CompEnvBinding(name, value)); } } }
private void addEnvironmentProperties(ScopeType scope, Iterator envItr, Collection<JNDIBinding> jndiBindings) { while( envItr.hasNext() ) { EnvironmentProperty next = (EnvironmentProperty) envItr.next(); if( !dependencyAppliesToScope(next, scope)) { continue; } // Only env-entries that have been assigned a value are // eligible for look up if (next.hasAValue()) { String name = descriptorToLogicalJndiName(next); Object value; if(next.hasLookupName()) { value = namingUtils.createLazyNamingObjectFactory(name, next.getLookupName(), true); } else if(next.getMappedName().length() > 0) { value = namingUtils.createLazyNamingObjectFactory(name, next.getMappedName(), true); } else { value = namingUtils.createSimpleNamingObjectFactory(name, next.getValueObject()); } jndiBindings.add(new CompEnvBinding(name, value)); } } }