/*
* Copyright (c) 2022, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* https://oss.oracle.com/licenses/upl.
*/
package com.tangosol.net.internal;
import com.oracle.coherence.common.base.Blocking;
import com.oracle.coherence.common.base.IdentityHolder;
import com.tangosol.io.ClassLoaderAware;
import com.tangosol.net.security.Security;
import com.tangosol.net.topic.NamedTopic;
import com.tangosol.util.ConcurrentMap;
import com.tangosol.util.SegmentedConcurrentMap;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentHashMap;
/**
* {@link ScopedTopicReferenceStore} holds scoped {@link NamedTopic} references.
*
* {@link NamedTopic} references are scoped by ClassLoader and, optionally, Subject.
* ScopedTopicReferenceStore requires no explicit input about Subjects from its clients.
* Subject scoping is configured in the operational configuration and applies only to
* remote topics.
*
* Thread safety documented in {@link AbstractScopedReferenceStore}.
*
* @author vp 2022.05.17.
* @since 22.06
*/
@SuppressWarnings("rawtypes")
public class ScopedTopicReferenceStore
extends ScopedReferenceStore
{
// ----- constructor ----------------------------------------------------
/**
* Create a {@link ScopedTopicReferenceStore} to hold references to the topics.
*/
public ScopedTopicReferenceStore()
{
super(NamedTopic.class, NamedTopic::isActive, NamedTopic::getName, NamedTopic::getService);
}
/**
* Remove topic references from this store for all destroyed and released topics.
*/
public void clearInactiveTopicRefs()
{
for (Iterator