![JAR search and dependency download from the Maven repository](/logo.png)
com.netflix.eureka2.interests.InstanceInfoInitStateHolder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of eureka-core Show documentation
Show all versions of eureka-core Show documentation
eureka-core developed by Netflix
The newest version!
package com.netflix.eureka2.interests;
import com.netflix.eureka2.registry.InstanceInfo;
import java.util.Iterator;
import java.util.concurrent.ConcurrentLinkedQueue;
/**
* An {@link Index.InitStateHolder} implementation for {@link InstanceInfo}
*
* @author Nitesh Kant
*/
public class InstanceInfoInitStateHolder extends Index.InitStateHolder {
// TODO: Implement compaction
private final ConcurrentLinkedQueue> notifications;
public InstanceInfoInitStateHolder(Iterator> initialRegistry) {
super(NotificationsSubject.create());
notifications = new ConcurrentLinkedQueue>();
while (initialRegistry.hasNext()) {
notifications.add(initialRegistry.next());
}
}
@Override
protected void addNotification(ChangeNotification notification) {
notifications.add(notification);
}
@Override
protected void clearAllNotifications() {
notifications.clear();
}
@Override
protected Iterator> _newIterator() {
return notifications.iterator();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy