All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netflix.eventbus.bridge.ImmutableEventBusBridgeStats Maven / Gradle / Ivy

There is a newer version: 0.3.0
Show newest version
package com.netflix.eventbus.bridge;

/**
 * Decorator for {@link EventBusBridgeStats} that makes it unmodifiable.
 * An instance of this is returned by {@link EventBusSuroBridgeStats.getStats()}
 * 
 * @author elandau
 *
 */
public class ImmutableEventBusBridgeStats implements EventBusBridgeStats {

    private EventBusBridgeStats delegate;
    
    public ImmutableEventBusBridgeStats(EventBusBridgeStats delegate) {
        this.delegate = delegate;
    }
    
    @Override
    public long getConsumeCount() {
        return this.delegate.getConsumeCount();
    }

    @Override
    public long getConsumeErrorCount() {
        return this.delegate.getConsumeErrorCount();
    }

    @Override
    public long incConsumeCount() {
        throw new UnsupportedOperationException();
    }

    @Override
    public long incConsumeErrorCount(Exception e) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Exception getLastConsumeException() {
        return this.delegate.getLastConsumeException();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy