public boolean hasAValue() { return ( setValueCalled || hasLookupName() ); }
public boolean hasAValue() { return ( setValueCalled || hasLookupName() || getMappedName().length() > 0); }
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)); } } }
/** * Store references to environment entries. * Also validate custom resources of primitive data types. */ private void parseResources(EnvironmentProperty envProp, JndiNameEnvironment env, AppResources appResources) { String name = getLogicalJNDIName(envProp.getName(), env); String jndiName = ""; if (envProp.hasLookupName()) jndiName = envProp.getLookupName(); // error handling for mapped name null case done in getMappedName else if (envProp.getMappedName().length() > 0) jndiName = envProp.getMappedName(); AppResource envPropResource = new AppResource(name, jndiName, envProp.getType(), env, true); // If lookup/mapped name is not present, then we do not need to validate. if (jndiName.length() == 0) envPropResource.noValidation(); appResources.store(envPropResource); // Store EnvProps even if they do not have a valid lookup element appResources.storeInNamespace(name, env); }
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)); } } }
for (EnvironmentProperty environmentProperty : environmentProperties) { String jndiName = environmentProperty.getName(); if (environmentProperty.hasLookupName()) { jndiName = environmentProperty.getLookupName(); } else if (environmentProperty.getMappedName().length() > 0) {
if (!desc.hasLookupName() && ok(getResourceLookupValue(resourceAn, ainfo))) desc.setLookupName(getResourceLookupValue(resourceAn, ainfo));
if (!desc.hasLookupName() && !desc.isSetValueCalled() && ok(getResourceLookupValue(resourceAn, ainfo))) desc.setLookupName(getResourceLookupValue(resourceAn, ainfo));