/** * Creates a new instance which wraps the specified {@code map}. */ public ConcurrentSet() { map = PlatformDependent.newConcurrentHashMap(); }
/** * Creates a new instance which wraps the specified {@code map}. */ public ConcurrentSet() { map = PlatformDependent.newConcurrentHashMap(); }
@Override public <K, V> Map<K, V> createMap(String name) { return PlatformDependent.newConcurrentHashMap(); }
public Http2ClientChannelHandler() { // Use a concurrent map because we add and iterate from the main thread (just for the purposes of the example), // but Netty also does a get on the map when messages are received in a EventLoop thread. streamIdPromiseMap = PlatformDependent.newConcurrentHashMap(); }
public Http2ClientChannelHandler() { // Use a concurrent map because we add and iterate from the main thread (just for the purposes of the example), // but Netty also does a get on the map when messages are received in a EventLoop thread. streamIdPromiseMap = PlatformDependent.newConcurrentHashMap(); }
/** * Creates a new instance which wraps the specified {@code map}. */ public ConcurrentSet() { map = PlatformDependent.newConcurrentHashMap(); }
private <K, V> void join(ConcurrentMap<K, Set<V>> map, K key, V value) { Set<V> clients = map.get(key); if (clients == null) { clients = Collections.newSetFromMap(PlatformDependent.<V, Boolean>newConcurrentHashMap()); Set<V> oldClients = map.putIfAbsent(key, clients); if (oldClients != null) { clients = oldClients; } } clients.add(value); // object may be changed due to other concurrent call if (clients != map.get(key)) { // re-join if queue has been replaced join(map, key, value); } }
private final ConcurrentMap<ChannelHandlerContext, Boolean> initMap = PlatformDependent.newConcurrentHashMap();
/** * non-aggressive concurrent cache * good for shared cache, when we're worried about class unloading * * @param classLoader - specific classLoader to use, or null if you want to revert to default * @return new instance of class resolver */ public static ClassResolver weakCachingConcurrentResolver(ClassLoader classLoader) { return new CachingClassResolver( new ClassLoaderClassResolver(defaultClassLoader(classLoader)), new WeakReferenceMap<String, Class<?>>( PlatformDependent.<String, Reference<Class<?>>>newConcurrentHashMap())); }
/** * aggressive concurrent cache * good for shared cache, when we're not worried about class unloading * * @param classLoader - specific classLoader to use, or null if you want to revert to default * @return new instance of class resolver */ public static ClassResolver softCachingConcurrentResolver(ClassLoader classLoader) { return new CachingClassResolver( new ClassLoaderClassResolver(defaultClassLoader(classLoader)), new SoftReferenceMap<String, Class<?>>( PlatformDependent.<String, Reference<Class<?>>>newConcurrentHashMap())); }
/** * non-aggressive concurrent cache * good for shared cache, when we're worried about class unloading * * @param classLoader - specific classLoader to use, or null if you want to revert to default * @return new instance of class resolver */ public static ClassResolver weakCachingConcurrentResolver(ClassLoader classLoader) { return new CachingClassResolver( new ClassLoaderClassResolver(defaultClassLoader(classLoader)), new WeakReferenceMap<String, Class<?>>( PlatformDependent.<String, Reference<Class<?>>>newConcurrentHashMap())); }
/** * aggressive concurrent cache * good for shared cache, when we're not worried about class unloading * * @param classLoader - specific classLoader to use, or null if you want to revert to default * @return new instance of class resolver */ public static ClassResolver softCachingConcurrentResolver(ClassLoader classLoader) { return new CachingClassResolver( new ClassLoaderClassResolver(defaultClassLoader(classLoader)), new SoftReferenceMap<String, Class<?>>( PlatformDependent.<String, Reference<Class<?>>>newConcurrentHashMap())); }
/** * non-agressive concurrent cache * good for shared cache, when we're worried about class unloading * * @param classLoader - specific classLoader to use, or null if you want to revert to default * @return new instance of class resolver */ public static ClassResolver weakCachingConcurrentResolver(ClassLoader classLoader) { return new CachingClassResolver( new ClassLoaderClassResolver(defaultClassLoader(classLoader)), new WeakReferenceMap<String, Class<?>>( PlatformDependent.<String, Reference<Class<?>>>newConcurrentHashMap())); }
/** * agressive concurrent cache * good for shared cache, when we're not worried about class unloading * * @param classLoader - specific classLoader to use, or null if you want to revert to default * @return new instance of class resolver */ public static ClassResolver softCachingConcurrentResolver(ClassLoader classLoader) { return new CachingClassResolver( new ClassLoaderClassResolver(defaultClassLoader(classLoader)), new SoftReferenceMap<String, Class<?>>( PlatformDependent.<String, Reference<Class<?>>>newConcurrentHashMap())); }
/** * Creates a new instance which wraps the specified {@code map}. */ public ConcurrentSet() { map = PlatformDependent.newConcurrentHashMap(); }
PooledConnectionProvider(String name, PoolFactory poolFactory) { this.name = name; this.poolFactory = poolFactory; this.channelPools = PlatformDependent.newConcurrentHashMap(); }
/** * Creates a new instance which wraps the specified {@code map}. */ public ConcurrentSet() { map = PlatformDependent.newConcurrentHashMap(); }
PooledConnectionProvider(String name, PoolFactory poolFactory) { this.name = name; this.poolFactory = poolFactory; this.channelPools = PlatformDependent.newConcurrentHashMap(); }
DefaultPoolResources(String name, PoolFactory provider) { this.name = name; this.provider = provider; this.channelPools = PlatformDependent.newConcurrentHashMap(); }
public Http2ResponseHandler() { // Use a concurrent map because we add and iterate from the main thread (just for the purposes of the example), // but Netty also does a get on the map when messages are received in a EventLoop thread. streamidPromiseMap = PlatformDependent.newConcurrentHashMap(); }