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.
/*
* JPPF.
* Copyright (C) 2005-2015 JPPF Team.
* http://www.jppf.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jppf.serialization;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import org.slf4j.*;
/**
* Instances of this class handle the caching and lookup of class descriptors and objects during serialization.
* @author Laurent Cohen
* @exclude
*/
class SerializationCaches {
/**
* Logger for this class.
*/
private static Logger log = LoggerFactory.getLogger(SerializationCaches.class);
/**
* Determines whether the debug level is enabled in the log configuration, without the cost of a method call.
*/
private static boolean traceEnabled = log.isTraceEnabled();
/**
* List of all primitive types.
*/
static final Class>[] PRIMITIVE_TYPES = { Byte.TYPE, Short.TYPE, Integer.TYPE, Long.TYPE, Float.TYPE, Double.TYPE, Character.TYPE, Boolean.TYPE/*, Void.TYPE*/ };
/**
* Mapping of primitive types to their descriptor.
*/
static Map, ClassDescriptor> globalTypesMap = initGlobalTypes();
/**
* Mapping of classes to their descriptor.
*/
Map, ClassDescriptor> classToDescMap = new HashMap<>();
//Map, ClassDescriptor> classToDescMap = new IdentityHashMap, ClassDescriptor>(256);
/**
* Mapping of objects to their handle.
*/
Map