*
* @throws Exception If an exception occurred during feature negotiation.
*/
public void negotiateNextFeature() throws Exception {
if (featuresToNegotiate.size() > 0) {
StreamFeature advertisedFeature = featuresToNegotiate.remove(0);
if (!negotiatedFeatures.contains(advertisedFeature.getClass())) {
// See if there's a feature negotiator associated with the feature.
for (StreamFeatureNegotiator streamFeatureNegotiator : streamFeatureNegotiators) {
if (streamFeatureNegotiator.getFeatureClass() == advertisedFeature.getClass()) {
// If feature negotiation is incomplete, return and wait until it is completed.
if (streamFeatureNegotiator.processNegotiation(advertisedFeature) == StreamFeatureNegotiator.Status.INCOMPLETE) {
return;
}
}