/** * Sets the desired version for the current thread to the provided values. * This method will update any existing request version information set by * defaults or a previous call to this method. The specified version (and * any related implied versions} will be set for the current thread until the * {@link #resetThreadVersion()} method is called to reset to the version * information back to the default state. * * @param version the new active version for this request. */ public void setThreadVersion(Version version) { // Set the thread local to the list of versions implied by the requested // version. threadVersions.set( Collections.unmodifiableList(version.getImpliedVersions())); }
/** * Sets the desired version for the current thread to the provided values. * This method will update any existing request version information set by * defaults or a previous call to this method. The specified version (and * any related implied versions} will be set for the current thread until the * {@link #resetThreadVersion()} method is called to reset to the version * information back to the default state. * * @param version the new active version for this request. */ public void setThreadVersion(Version version) { // Set the thread local to the list of versions implied by the requested // version. threadVersions.set( Collections.unmodifiableList(version.getImpliedVersions())); }
/** * Sets the desired version for the current thread to the provided values. * This method will update any existing request version information set by * defaults or a previous call to this method. The specified version (and * any related implied versions} will be set for the current thread until the * {@link #resetThreadVersion()} method is called to reset to the version * information back to the default state. * * @param version the new active version for this request. */ public void setThreadVersion(Version version) { // Set the thread local to the list of versions implied by the requested // version. threadVersions.set( Collections.unmodifiableList(version.getImpliedVersions())); }
/** * Adds an implied version (plus any of its nested dependencies) to the * implied versions list for this version. * @param v the implied version. */ private void addImpliedVersion(Version v) { if (!impliedVersions.contains(v)) { impliedVersions.add(v); for (Version impliedVersion : v.getImpliedVersions()) { addImpliedVersion(impliedVersion); } } }
/** * Adds an implied version (plus any of its nested dependencies) to the * implied versions list for this version. * @param v the implied version. */ private void addImpliedVersion(Version v) { if (!impliedVersions.contains(v)) { impliedVersions.add(v); for (Version impliedVersion : v.getImpliedVersions()) { addImpliedVersion(impliedVersion); } } }
/** * Adds an implied version (plus any of its nested dependencies) to the * implied versions list for this version. * @param v the implied version. */ private void addImpliedVersion(Version v) { if (!impliedVersions.contains(v)) { impliedVersions.add(v); for (Version impliedVersion : v.getImpliedVersions()) { addImpliedVersion(impliedVersion); } } }
/** * Adds a default version to the version registry. This will overwrite any * existing default version for the same service. * * @param newDefault default version to add to the registry * (not <code>null</code>) * @param includeImplied if {@code true}, indicates that all implied versions * associated with the new default should be set as defaults too. */ public void addDefaultVersion(Version newDefault, boolean includeImplied) { // Implement the addition using a copy into a new array. This is done to // avoid requiring full synchronization of access to defaultVersions, where // additions will be infrequent and often happen at initialization time. ArrayList<Version> newDefaults = new ArrayList<Version>(defaultVersions); if (includeImplied) { mergeVersions(newDefaults, newDefault.getImpliedVersions()); } else { mergeVersions(newDefaults, newDefault); } // Replace the current defaults with the updated list. defaultVersions = Collections.unmodifiableList(newDefaults); }
/** * Adds a default version to the version registry. This will overwrite any * existing default version for the same service. * * @param newDefault default version to add to the registry * (not <code>null</code>) * @param includeImplied if {@code true}, indicates that all implied versions * associated with the new default should be set as defaults too. */ public void addDefaultVersion(Version newDefault, boolean includeImplied) { // Implement the addition using a copy into a new array. This is done to // avoid requiring full synchronization of access to defaultVersions, where // additions will be infrequent and often happen at initialization time. ArrayList<Version> newDefaults = new ArrayList<Version>(defaultVersions); if (includeImplied) { mergeVersions(newDefaults, newDefault.getImpliedVersions()); } else { mergeVersions(newDefaults, newDefault); } // Replace the current defaults with the updated list. defaultVersions = Collections.unmodifiableList(newDefaults); }
/** * Adds a default version to the version registry. This will overwrite any * existing default version for the same service. * * @param newDefault default version to add to the registry * (not <code>null</code>) * @param includeImplied if {@code true}, indicates that all implied versions * associated with the new default should be set as defaults too. */ public void addDefaultVersion(Version newDefault, boolean includeImplied) { // Implement the addition using a copy into a new array. This is done to // avoid requiring full synchronization of access to defaultVersions, where // additions will be infrequent and often happen at initialization time. ArrayList<Version> newDefaults = new ArrayList<Version>(defaultVersions); if (includeImplied) { mergeVersions(newDefaults, newDefault.getImpliedVersions()); } else { mergeVersions(newDefaults, newDefault); } // Replace the current defaults with the updated list. defaultVersions = Collections.unmodifiableList(newDefaults); }