@XmlTransient public String getName() { return getEnvEntryName(); }
@XmlTransient public String getName() { return getEnvEntryName(); }
@XmlTransient public String getName() { return getEnvEntryName(); }
public EnvEntry injectionTarget(final String className, final String property) { getInjectionTarget().add(new InjectionTarget(className, property)); if (this.getEnvEntryName() == null) { this.setEnvEntryName("java:comp/env/" + className + "/" + property); } return this; }
public EnvEntry injectionTarget(final String className, final String property) { getInjectionTarget().add(new InjectionTarget(className, property)); if (this.getEnvEntryName() == null) { this.setEnvEntryName("java:comp/env/" + className + "/" + property); } return this; }
@Override public String toString() { return "EnvEntry{" + "name='" + getEnvEntryName() + '\'' + ", type='" + getEnvEntryType() + '\'' + ", value='" + getEnvEntryValue() + '\'' + ", mappedName='" + getMappedName() + '\'' + ", lookupName='" + getLookupName() + '\'' + '}'; } }
@Override public String toString() { return "EnvEntry{" + "name='" + getEnvEntryName() + '\'' + ", type='" + getEnvEntryType() + '\'' + ", value='" + getEnvEntryValue() + '\'' + ", mappedName='" + getMappedName() + '\'' + ", lookupName='" + getLookupName() + '\'' + '}'; } }
private void buildEnvEntryInfos(final JndiConsumer item, final JndiEncInfo moduleJndiEnc, final JndiEncInfo compJndiEnc) { for (final EnvEntry env : item.getEnvEntry()) { // ignore env entries without a value and lookup name //If the the reference name of the environment entry is belong to those shareable JNDI name space, it somewhat is a valid one if (env.getEnvEntryValue() == null && env.getLookupName() == null && !isShareableJNDINamespace(env.getEnvEntryName()) && !CompManagedBean.class.isInstance(item) /* in this case we can desire to contextually lookup webapp value from an ear lib */) { continue; } final EnvEntryInfo info = new EnvEntryInfo(); info.referenceName = env.getEnvEntryName(); info.type = env.getEnvEntryType(); info.value = env.getEnvEntryValue(); info.location = buildLocationInfo(env); info.targets.addAll(buildInjectionInfos(env)); insert( info, appInfo.globalJndiEnc.envEntries, appInfo.appJndiEnc.envEntries, moduleJndiEnc.envEntries, compJndiEnc.envEntries ); } }
private List<EnvEntryInfo> buildEnvEntryInfos(JndiConsumer item) { List<EnvEntryInfo> infos = new ArrayList<EnvEntryInfo>(); for (EnvEntry env : item.getEnvEntry()) { // ignore env entries without a value if (env.getEnvEntryValue() == null) { continue; } if (env.getEnvEntryType() == null){ // TODO: Maybe Move this into the EnvEntry class env.setEnvEntryType("java.lang.String"); } EnvEntryInfo info = new EnvEntryInfo(); info.name = env.getEnvEntryName(); info.type = env.getEnvEntryType(); info.value = env.getEnvEntryValue(); info.location = buildLocationInfo(env); info.targets.addAll(buildInjectionInfos(env)); infos.add(info); } return infos; }
private void buildEnvEntryInfos(final JndiConsumer item, final JndiEncInfo moduleJndiEnc, final JndiEncInfo compJndiEnc) { for (final EnvEntry env : item.getEnvEntry()) { // ignore env entries without a value and lookup name //If the the reference name of the environment entry is belong to those shareable JNDI name space, it somewhat is a valid one if (env.getEnvEntryValue() == null && env.getLookupName() == null && !isShareableJNDINamespace(env.getEnvEntryName())) { continue; } final EnvEntryInfo info = new EnvEntryInfo(); info.referenceName = env.getEnvEntryName(); info.type = env.getEnvEntryType(); info.value = env.getEnvEntryValue(); info.location = buildLocationInfo(env); info.targets.addAll(buildInjectionInfos(env)); insert( info, appInfo.globalJndiEnc.envEntries, appInfo.appJndiEnc.envEntries, moduleJndiEnc.envEntries, compJndiEnc.envEntries ); } }
@Override public void preProcessWebXmlElement(WebApp webApp, MergeContext mergeContext) throws DeploymentException { for (EnvEntry envEntry : webApp.getEnvEntry()) { String envEntryName = envEntry.getEnvEntryName(); mergeContext.setAttribute(createEnvEntryKey(envEntryName), new MergeItem(envEntry, null, ElementSource.WEB_XML)); //Create an attribute tag to indicate whether injectTarget is configured in web.xml file if (envEntry.getInjectionTarget().size() > 0) { mergeContext.setAttribute(createEnvEntryInjectTargetConfiguredInWebXMLKey(envEntryName), Boolean.TRUE); } for (InjectionTarget injectionTarget : envEntry.getInjectionTarget()) { mergeContext.setAttribute(createEnvEntryInjectTargetKey(envEntryName, injectionTarget.getInjectionTargetClass(), injectionTarget.getInjectionTargetName() ), Boolean.TRUE); } } }
public void merge(WebFragment webFragment, WebApp webApp, MergeContext mergeContext) throws DeploymentException { for (EnvEntry srcEnvEntry : webFragment.getEnvEntry()) { String envEntryName = srcEnvEntry.getEnvEntryName(); String envEntryKey = createEnvEntryKey(envEntryName); MergeItem mergeItem = (MergeItem) mergeContext.getAttribute(envEntryKey);