Skip to content

Commit

Permalink
Harden NamedCacheProxyProtocolIT
Browse files Browse the repository at this point in the history
(merge 14.1.2.0 -> ce/14.1.2.0 114830)

[git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v14.1.2.0/": change = 114831]
  • Loading branch information
thegridman committed Mar 7, 2025
1 parent 34dd0ea commit 8cfb81c
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;

import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Stream;
Expand Down Expand Up @@ -445,6 +446,18 @@ protected ConfigurableCacheFactory ensureCCF(String sScopeOrNull)
return s_mapCCF.computeIfAbsent(sScope, BaseGrpcIT::createCCF);
}

protected String ensureUniqueName()
{
return ensureScopeName(null);
}

protected String ensureUniqueName(String sName)
{
return sName == null || sName.isBlank()
? "test-" + s_id.incrementAndGet()
: sName + "-" + s_id.incrementAndGet();
}

protected static ConfigurableCacheFactory createCCF(String sScope)
{
ClassLoader loader = Classes.getContextClassLoader();
Expand Down Expand Up @@ -554,6 +567,8 @@ protected MapEvent<K, V> toSimpleEvent(MapEvent<K, V> event)

// ----- data members ---------------------------------------------------

protected static final AtomicLong s_id = new AtomicLong(0L);

protected static ConfigurableCacheFactory s_ccfDefault;

protected final static Map<String, ConfigurableCacheFactory> s_mapCCF = new ConcurrentHashMap<>();
Expand Down
Loading

0 comments on commit 8cfb81c

Please sign in to comment.