HHH-2645 : Synchronization bottleneck in EntityModeToTuplizerMapping
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@14271 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
c053aefa0d
commit
2d7b7a38bc
|
@ -1,13 +1,12 @@
|
||||||
package org.hibernate.tuple;
|
package org.hibernate.tuple;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.hibernate.EntityMode;
|
import org.hibernate.EntityMode;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
|
import org.hibernate.util.FastHashMap;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Centralizes handling of {@link EntityMode} to {@link Tuplizer} mappings.
|
* Centralizes handling of {@link EntityMode} to {@link Tuplizer} mappings.
|
||||||
|
@ -17,7 +16,15 @@ import java.io.Serializable;
|
||||||
public abstract class EntityModeToTuplizerMapping implements Serializable {
|
public abstract class EntityModeToTuplizerMapping implements Serializable {
|
||||||
|
|
||||||
// map of EntityMode -> Tuplizer
|
// map of EntityMode -> Tuplizer
|
||||||
private final Map tuplizers = Collections.synchronizedMap( new LinkedHashMap() );
|
private final Map tuplizers;
|
||||||
|
|
||||||
|
public EntityModeToTuplizerMapping() {
|
||||||
|
tuplizers = new FastHashMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityModeToTuplizerMapping(Map tuplizers) {
|
||||||
|
this.tuplizers = tuplizers;
|
||||||
|
}
|
||||||
|
|
||||||
protected void addTuplizer(EntityMode entityMode, Tuplizer tuplizer) {
|
protected void addTuplizer(EntityMode entityMode, Tuplizer tuplizer) {
|
||||||
tuplizers.put( entityMode, tuplizer );
|
tuplizers.put( entityMode, tuplizer );
|
||||||
|
|
Loading…
Reference in New Issue