Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* JBoss, Home of Professional Open Source
* Copyright 2009 Red Hat Inc. and/or its affiliates and other
* contributors as indicated by the @author tags. All rights reserved.
* See the copyright.txt in the distribution for a full listing of
* individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.infinispan.atomic;
import net.jcip.annotations.NotThreadSafe;
import org.infinispan.AdvancedCache;
import org.infinispan.Cache;
import org.infinispan.context.FlagContainer;
import org.infinispan.marshall.AbstractExternalizer;
import org.infinispan.marshall.Ids;
import org.infinispan.util.FastCopyHashMap;
import org.infinispan.util.Util;
import org.infinispan.util.logging.Log;
import org.infinispan.util.logging.LogFactory;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
/**
* The default implementation of {@link AtomicMap}. Note that this map cannot be constructed directly, and callers
* should obtain references to AtomicHashMaps via the {@link AtomicMapLookup} helper. This helper will ensure proper
* concurrent construction and registration of AtomicMaps in Infinispan's data container. E.g.:
*
* Note that for replication to work properly, AtomicHashMap updates must always take place within the
* scope of an ongoing JTA transaction or batch (see {@link Cache#startBatch()}).
*
*
* @author (various)
* @param the type of keys maintained by this map
* @param the type of mapped values
* @see AtomicMap
* @see AtomicMapLookup
* @since 4.0
*/
@NotThreadSafe
public final class AtomicHashMap implements AtomicMap, CopyableDeltaAware, Cloneable {
private static final Log log = LogFactory.getLog(AtomicHashMap.class);
private static final boolean trace = log.isTraceEnabled();
protected final FastCopyHashMap delegate;
private AtomicHashMapDelta delta = null;
private volatile AtomicHashMapProxy proxy;
volatile boolean copied = false;
volatile boolean removed = false;
/**
* Construction only allowed through this factory method. This factory is intended for use internally by the
* CacheDelegate. User code should use {@link AtomicMapLookup#getAtomicMap(Cache, Object)}.
*/
public static AtomicHashMap newInstance(Cache