summaryrefslogtreecommitdiffstats
path: root/jdisc_core/src/main/java/com/yahoo/jdisc/NoopSharedResource.java
blob: 7f4fe96d76922967afd6c4dbc746b80b798d2a26 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc;

/**
 * An implementation of {@link SharedResource} that does not do anything.
 * Useful base class for e.g. mocks of SharedResource sub-interfaces, where reference counting is not the focus.
 *
 * @author bakksjo
 */
public class NoopSharedResource implements SharedResource {
    @Override
    public final ResourceReference refer() {
        return References.NOOP_REFERENCE;
    }

    @Override
    public final void release() {
    }
}