/** * Returns the environment property object searching on the supplied key. * throws an illegal argument exception if no such environment property * exists. */ @Override public final EnvironmentProperty getEnvironmentPropertyByName(String name) { if (env != null) return env.getEnvironmentPropertyByName(name); for (Iterator itr = this.getEnvironmentProperties().iterator(); itr.hasNext();) { EnvironmentProperty ev = (EnvironmentProperty) itr.next(); if (ev.getName().equals(name)) { return ev; } } throw new IllegalArgumentException(localStrings.getLocalString( "enterprise.deployment.exceptionbeanhasnoenvpropertybyname", "This bean {0} has no environment property by the name of {1}", new Object[]{getName(), name})); }
/** * Returns the environment property object searching on the supplied key. * throws an illegal argument exception if no such environment property * exists. */ @Override public EnvironmentProperty getEnvironmentPropertyByName(String name) { if (env != null) return env.getEnvironmentPropertyByName(name); for (Iterator itr = this.getEnvironmentProperties().iterator(); itr.hasNext();) { EnvironmentProperty ev = (EnvironmentProperty) itr.next(); if (ev.getName().equals(name)) { return ev; } } throw new IllegalArgumentException(localStrings.getLocalString( "enterprise.deployment.exceptionbeanhasnoenvpropertybyname", "This bean {0} has no environment property by the name of {1}", new Object[]{getName(), name})); }
public EnvironmentProperty getEnvEntry(String name) { EnvironmentProperty envEntry = null; try { envEntry = getEnvEntryContainer(). getEnvironmentPropertyByName(name); // annotation has a corresponding env-entry // in xml. Just add annotation info and continue. // This logic might change depending on overriding rules // and order in which annotations are read w.r.t. to xml. // E.g. sparse overriding in xml or loading annotations // first. } catch(IllegalArgumentException e) { // DOL API is (unfortunately) defined to return // IllegalStateException if name doesn't exist. Application app = getAppFromDescriptor(); if( app != null ) { try { // Check for java:app/java:global dependencies at app-level envEntry = app.getEnvironmentPropertyByName(name); // Make sure it's added to the container context. addEnvEntryDescriptor(envEntry); } catch(IllegalArgumentException ee) {} } } return envEntry; }
public EnvironmentProperty getEnvEntry(String name) { EnvironmentProperty envEntry = null; try { envEntry = getEnvEntryContainer(). getEnvironmentPropertyByName(name); // annotation has a corresponding env-entry // in xml. Just add annotation info and continue. // This logic might change depending on overriding rules // and order in which annotations are read w.r.t. to xml. // E.g. sparse overriding in xml or loading annotations // first. } catch(IllegalArgumentException e) { // DOL API is (unfortunately) defined to return // IllegalStateException if name doesn't exist. Application app = getAppFromDescriptor(); if( app != null ) { try { // Check for java:app/java:global dependencies at app-level envEntry = app.getEnvironmentPropertyByName(name); // Make sure it's added to the container context. addEnvEntryDescriptor(envEntry); } catch(IllegalArgumentException ee) {} } } return envEntry; }