com.impetus.kundera.cache.ElementCollectionCacheManager Maven / Gradle / Ivy
/*******************************************************************************
* * Copyright 2012 Impetus Infotech.
* *
* * 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 com.impetus.kundera.cache;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.impetus.kundera.Constants;
import com.impetus.kundera.utils.DeepEquals;
/**
* Cache for holding element collection column names and corresponding objects
* This is a singleton class TODO: Improve singleton implementation code, think
* performance overhead due to synchronization TODO: Think of a better way to
* handle element collection object handling. better remove this cache
* altogether
*
* @author amresh.singh
*/
public class ElementCollectionCacheManager
{
/** log for this class. */
private static Logger log = LoggerFactory.getLogger(ElementCollectionCacheManager.class);
/* Single instance */
/** The instance. */
private static ElementCollectionCacheManager instance;
/**
* Instantiates a new element collection cache manager.
*/
private ElementCollectionCacheManager()
{
}
/**
* Gets the single instance of ElementCollectionCacheManager.
*
* @return single instance of ElementCollectionCacheManager
*/
public static synchronized ElementCollectionCacheManager getInstance()
{
if (instance == null)
{
instance = new ElementCollectionCacheManager();
}
return instance;
}
/**
* Mapping between Row Key and (Map of element collection objects and
* element collection object name).
*/
private static Map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy