HHH-6191 - repackage org.hibernate.cache per api/spi/internal split

This commit is contained in:
Steve Ebersole 2011-05-04 14:43:03 -05:00
parent b9d002778b
commit c930ebcd7d
182 changed files with 2509 additions and 2421 deletions

View File

@ -283,7 +283,7 @@ http://opensource.atlassian.com/projects/hibernate/browse/HHH/fixforversion/1114
* [HHH-5512] - JndiInfinispanRegionFactory shouldn't try to stop CacheManager
* [HHH-5517] - Switch uuid generation in SessionFactory to org.hibernate.id.UUIDGenerator instead
* [HHH-5519] - VersionedItem should not extend Item, otherwise query cache results are confusing
* [HHH-5520] - Per org.hibernate.cache.RegionFactory javadocs, implementors should be allowed to use no-arg constructor
* [HHH-5520] - Per org.hibernate.cache.spi.RegionFactory javadocs, implementors should be allowed to use no-arg constructor
** Deprecation
* [HHH-5489] - Deprecate jbosscache as a second level cache provider, in favor of infinispan

View File

@ -29,12 +29,12 @@
<itemizedlist>
<listitem>
<para>
<code>org.hibernate.cache.StandardQueryCache</code> holds the cached query results.
<code>org.hibernate.cache.internal.StandardQueryCache</code> holds the cached query results.
</para>
</listitem>
<listitem>
<para>
<code>org.hibernate.cache.UpdateTimestampsCache</code> holds timestamps of the most recent updates to
<code>org.hibernate.cache.spi.UpdateTimestampsCache</code> holds timestamps of the most recent updates to
queryable tables. These timestamps validate results served from the query cache.
</para>
</listitem>

View File

@ -21,7 +21,7 @@
<property name="current_session_context_class">thread</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="cache.provider_class">org.hibernate.cache.internal.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>

View File

@ -712,7 +712,7 @@ Customer customer = (Customer) session.get( Customer.class, customerId );
<para revision="1">You have the option to tell Hibernate which caching
implementation to use by specifying the name of a class that implements
<literal>org.hibernate.cache.CacheProvider</literal> using the property
<literal>org.hibernate.cache.spi.CacheProvider</literal> using the property
<literal>hibernate.cache.provider_class</literal>. Hibernate is bundled
with a number of built-in integrations with the open-source cache
providers that are listed in <xref linkend="cacheproviders" />. You can
@ -752,7 +752,7 @@ Customer customer = (Customer) session.get( Customer.class, customerId );
<row>
<entry>Hashtable (not intended for production use)</entry>
<entry><literal>org.hibernate.cache.HashtableCacheProvider</literal></entry>
<entry><literal>org.hibernate.cache.internal.HashtableCacheProvider</literal></entry>
<entry>memory</entry>
@ -1316,12 +1316,12 @@ hibernate.cache.use_structured_entries true</programlisting>
<para>This setting creates two new cache regions: <itemizedlist>
<listitem>
<para><classname>org.hibernate.cache.StandardQueryCache</classname>,
<para><classname>org.hibernate.cache.internal.StandardQueryCache</classname>,
holding the cached query results</para>
</listitem>
<listitem>
<para><classname>org.hibernate.cache.UpdateTimestampsCache</classname>,
<para><classname>org.hibernate.cache.spi.UpdateTimestampsCache</classname>,
holding timestamps of the most recent updates to queryable tables.
These are used to validate the results as they are served from the
query cache.</para>

View File

@ -493,7 +493,7 @@ public class Event {
<property name="current_session_context_class">thread</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="cache.provider_class">org.hibernate.cache.internal.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>

View File

@ -43,7 +43,7 @@
<property name="dialect">org.hibernate.dialect.H2Dialect</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="cache.provider_class">org.hibernate.cache.internal.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>

View File

@ -43,7 +43,7 @@
<property name="dialect">org.hibernate.dialect.H2Dialect</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="cache.provider_class">org.hibernate.cache.internal.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>

View File

@ -494,7 +494,7 @@ hibernate.cache.region_prefix hibernate.test
#hibernate.cache.provider_class org.hibernate.cache.EhCacheProvider
#hibernate.cache.provider_class org.hibernate.cache.EmptyCacheProvider
hibernate.cache.provider_class org.hibernate.cache.HashtableCacheProvider
hibernate.cache.provider_class org.hibernate.cache.internal.HashtableCacheProvider
#hibernate.cache.provider_class org.hibernate.cache.TreeCacheProvider
#hibernate.cache.provider_class org.hibernate.cache.OSCacheProvider
#hibernate.cache.provider_class org.hibernate.cache.SwarmCacheProvider

View File

@ -34,9 +34,9 @@ import org.hibernate.HibernateException;
import org.hibernate.action.spi.AfterTransactionCompletionProcess;
import org.hibernate.action.spi.BeforeTransactionCompletionProcess;
import org.hibernate.action.spi.Executable;
import org.hibernate.cache.access.CollectionRegionAccessStrategy;
import org.hibernate.cache.access.EntityRegionAccessStrategy;
import org.hibernate.cache.access.SoftLock;
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy;
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy;
import org.hibernate.cache.spi.access.SoftLock;
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.persister.collection.CollectionPersister;

View File

@ -29,8 +29,8 @@ import org.hibernate.action.spi.AfterTransactionCompletionProcess;
import org.hibernate.action.spi.BeforeTransactionCompletionProcess;
import org.hibernate.action.spi.Executable;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.access.SoftLock;
import org.hibernate.cache.spi.CacheKey;
import org.hibernate.cache.spi.access.SoftLock;
import org.hibernate.collection.PersistentCollection;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.event.EventSource;

View File

@ -27,8 +27,8 @@ import java.io.Serializable;
import org.hibernate.AssertionFailure;
import org.hibernate.HibernateException;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.access.SoftLock;
import org.hibernate.cache.spi.CacheKey;
import org.hibernate.cache.spi.access.SoftLock;
import org.hibernate.engine.EntityEntry;
import org.hibernate.engine.PersistenceContext;
import org.hibernate.engine.SessionImplementor;

View File

@ -27,8 +27,8 @@ import java.io.Serializable;
import org.hibernate.AssertionFailure;
import org.hibernate.HibernateException;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.entry.CacheEntry;
import org.hibernate.cache.spi.CacheKey;
import org.hibernate.cache.spi.entry.CacheEntry;
import org.hibernate.engine.EntityEntry;
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.engine.SessionImplementor;

View File

@ -28,9 +28,9 @@ import java.io.Serializable;
import org.hibernate.AssertionFailure;
import org.hibernate.HibernateException;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.access.SoftLock;
import org.hibernate.cache.entry.CacheEntry;
import org.hibernate.cache.spi.CacheKey;
import org.hibernate.cache.spi.access.SoftLock;
import org.hibernate.cache.spi.entry.CacheEntry;
import org.hibernate.engine.EntityEntry;
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.engine.SessionImplementor;

View File

@ -22,7 +22,8 @@
* Boston, MA 02110-1301 USA
*/
package org.hibernate.annotations;
import org.hibernate.cache.access.AccessType;
import org.hibernate.cache.spi.access.AccessType;
/**
* Cache concurrency strategy
@ -43,35 +44,36 @@ public enum CacheConcurrencyStrategy {
}
public static CacheConcurrencyStrategy fromAccessType(AccessType accessType) {
final String name = accessType == null ? null : accessType.getName();
if ( AccessType.READ_ONLY.getName().equals( name ) ) {
switch ( accessType ) {
case READ_ONLY: {
return READ_ONLY;
}
else if ( AccessType.READ_WRITE.getName().equals( name ) ) {
case READ_WRITE: {
return READ_WRITE;
}
else if ( AccessType.NONSTRICT_READ_WRITE.getName().equals( name ) ) {
case NONSTRICT_READ_WRITE: {
return NONSTRICT_READ_WRITE;
}
else if ( AccessType.TRANSACTIONAL.getName().equals( name ) ) {
case TRANSACTIONAL: {
return TRANSACTIONAL;
}
else {
default: {
return NONE;
}
}
}
public static CacheConcurrencyStrategy parse(String name) {
if ( READ_ONLY.accessType.getName().equalsIgnoreCase( name ) ) {
if ( READ_ONLY.accessType.getExternalName().equalsIgnoreCase( name ) ) {
return READ_ONLY;
}
else if ( READ_WRITE.accessType.getName().equalsIgnoreCase( name ) ) {
else if ( READ_WRITE.accessType.getExternalName().equalsIgnoreCase( name ) ) {
return READ_WRITE;
}
else if ( NONSTRICT_READ_WRITE.accessType.getName().equalsIgnoreCase( name ) ) {
else if ( NONSTRICT_READ_WRITE.accessType.getExternalName().equalsIgnoreCase( name ) ) {
return NONSTRICT_READ_WRITE;
}
else if ( TRANSACTIONAL.accessType.getName().equalsIgnoreCase( name ) ) {
else if ( TRANSACTIONAL.accessType.getExternalName().equalsIgnoreCase( name ) ) {
return TRANSACTIONAL;
}
else if ( "none".equalsIgnoreCase( name ) ) {

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,118 +20,14 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
import java.util.Properties;
import org.hibernate.cache.access.AccessType;
import org.hibernate.cfg.Settings;
/**
* Contract for building second level cache regions.
* <p/>
* Implementors should define a constructor in one of two forms:<ul>
* <li>MyRegionFactoryImpl({@link java.util.Properties})</li>
* <li>MyRegionFactoryImpl()</li>
* </ul>
* Use the first when we need to read config properties prior to
* {@link #start} being called. For an example, have a look at
* {@link org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge}
* where we need the properties in order to determine which legacy
* {@link CacheProvider} to use so that we can answer the
* {@link #isMinimalPutsEnabledByDefault()} question for the
* {@link org.hibernate.cfg.SettingsFactory}.
*
* @author Steve Ebersole
*/
public interface RegionFactory {
/**
* Lifecycle callback to perform any necessary initialization of the
* underlying cache implementation(s). Called exactly once during the
* construction of a {@link org.hibernate.internal.SessionFactoryImpl}.
*
* @param settings The settings in effect.
* @param properties The defined cfg properties
* @throws CacheException Indicates problems starting the L2 cache impl;
* considered as a sign to stop {@link org.hibernate.SessionFactory}
* building.
* @deprecated Moved, but still need this definition for ehcache
*/
public void start(Settings settings, Properties properties) throws CacheException;
/**
* Lifecycle callback to perform any necessary cleanup of the underlying
* cache implementation(s). Called exactly once during
* {@link org.hibernate.SessionFactory#close}.
*/
public void stop();
/**
* By default should we perform "minimal puts" when using this second
* level cache implementation?
*
* @return True if "minimal puts" should be performed by default; false
* otherwise.
*/
public boolean isMinimalPutsEnabledByDefault();
/**
* Get the default access type for {@link EntityRegion entity} and
* {@link CollectionRegion collection} regions.
*
* @return This factory's default access type.
*/
public AccessType getDefaultAccessType();
/**
* Generate a timestamp.
* <p/>
* This is generally used for cache content locking/unlocking purposes
* depending upon the access-strategy being used.
*
* @return The generated timestamp.
*/
public long nextTimestamp();
/**
* Build a cache region specialized for storing entity data.
*
* @param regionName The name of the region.
* @param properties Configuration properties.
* @param metadata Information regarding the type of data to be cached
* @return The built region
* @throws CacheException Indicates problems building the region.
*/
public EntityRegion buildEntityRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException;
/**
* Build a cache region specialized for storing collection data.
*
* @param regionName The name of the region.
* @param properties Configuration properties.
* @param metadata Information regarding the type of data to be cached
* @return The built region
* @throws CacheException Indicates problems building the region.
*/
public CollectionRegion buildCollectionRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException;
/**
* Build a cache region specialized for storing query results
*
* @param regionName The name of the region.
* @param properties Configuration properties.
* @return The built region
* @throws CacheException Indicates problems building the region.
*/
public QueryResultsRegion buildQueryResultsRegion(String regionName, Properties properties) throws CacheException;
/**
* Build a cache region specialized for storing update-timestamps data.
*
* @param regionName The name of the region.
* @param properties Configuration properties.
* @return The built region
* @throws CacheException Indicates problems building the region.
*/
public TimestampsRegion buildTimestampsRegion(String regionName, Properties properties) throws CacheException;
@Deprecated
public interface RegionFactory extends org.hibernate.cache.spi.RegionFactory {
}

View File

@ -1,85 +0,0 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.access;
import java.io.Serializable;
/**
* The types of access strategies available.
*
* @author Steve Ebersole
*/
public class AccessType implements Serializable {
public static final AccessType READ_ONLY = new AccessType( "read-only" );
public static final AccessType READ_WRITE = new AccessType( "read-write" );
public static final AccessType NONSTRICT_READ_WRITE = new AccessType( "nonstrict-read-write" );
public static final AccessType TRANSACTIONAL = new AccessType( "transactional" );
private final String name;
private AccessType(String name) {
this.name = name;
}
public String getName() {
return name;
}
public String toString() {
return "AccessType[" + name + "]";
}
private static AccessType resolve(String name) {
if ( READ_ONLY.name.equals( name ) ) {
return READ_ONLY;
}
else if ( READ_WRITE.name.equals( name ) ) {
return READ_WRITE;
}
else if ( NONSTRICT_READ_WRITE.name.equals( name ) ) {
return NONSTRICT_READ_WRITE;
}
else if ( TRANSACTIONAL.name.equals( name ) ) {
return TRANSACTIONAL;
}
else {
return null;
}
}
public static AccessType parse(String name) {
return resolve( name );
}
private Object readResolve() {
return resolve( name );
}
public static String getValidUsageString() {
return "cache usage attribute should be " + READ_ONLY.name +
", " + READ_WRITE.name +
", " + NONSTRICT_READ_WRITE.name +
", or " + TRANSACTIONAL.name;
}
}

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,11 +20,12 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.impl;
package org.hibernate.cache.internal;
import java.util.Comparator;
import org.hibernate.cache.CacheDataDescription;
import org.hibernate.cache.spi.CacheDataDescription;
import org.hibernate.mapping.Collection;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.type.VersionType;

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,13 +20,16 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.internal;
import java.util.Collections;
import java.util.Hashtable;
import java.util.Map;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.spi.Cache;
/**
* A lightweight implementation of the <tt>Cache</tt> interface
* @author Gavin King

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,11 +20,15 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.internal;
import java.util.Properties;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.spi.Cache;
import org.hibernate.cache.spi.CacheProvider;
/**
* A simple in-memory Hashtable-based cache impl.
*

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,16 +20,22 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.internal;
import java.util.Properties;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.NoCachingEnabledException;
import org.hibernate.cache.spi.Cache;
import org.hibernate.cache.spi.CacheProvider;
/**
* Implementation of NoCacheProvider.
*
* @author Steve Ebersole
*/
@Deprecated
public class NoCacheProvider implements CacheProvider {
/**
* Configure the cache
@ -37,7 +43,7 @@ public class NoCacheProvider implements CacheProvider {
* @param regionName the name of the cache region
* @param properties configuration settings
*
* @throws CacheException
* @throws org.hibernate.cache.CacheException
*/
public Cache buildCache(String regionName, Properties properties) throws CacheException {
throw new NoCachingEnabledException();

View File

@ -21,17 +21,19 @@
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.cache.impl;
package org.hibernate.cache.internal;
import java.util.Properties;
import org.hibernate.cache.CacheDataDescription;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.CollectionRegion;
import org.hibernate.cache.EntityRegion;
import org.hibernate.cache.NoCachingEnabledException;
import org.hibernate.cache.QueryResultsRegion;
import org.hibernate.cache.RegionFactory;
import org.hibernate.cache.TimestampsRegion;
import org.hibernate.cache.access.AccessType;
import org.hibernate.cache.spi.CacheDataDescription;
import org.hibernate.cache.spi.CollectionRegion;
import org.hibernate.cache.spi.EntityRegion;
import org.hibernate.cache.spi.QueryResultsRegion;
import org.hibernate.cache.spi.RegionFactory;
import org.hibernate.cache.spi.TimestampsRegion;
import org.hibernate.cache.spi.access.AccessType;
import org.hibernate.cfg.Settings;
/**

View File

@ -21,21 +21,29 @@
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.cache;
package org.hibernate.cache.internal;
import javax.persistence.EntityNotFoundException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import javax.persistence.EntityNotFoundException;
import org.jboss.logging.Logger;
import org.hibernate.HibernateException;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.UnresolvableObjectException;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.spi.QueryCache;
import org.hibernate.cache.spi.QueryKey;
import org.hibernate.cache.spi.QueryResultsRegion;
import org.hibernate.cache.spi.UpdateTimestampsCache;
import org.hibernate.cfg.Settings;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.type.Type;
import org.hibernate.type.TypeHelper;
import org.jboss.logging.Logger;
/**
* The standard implementation of the Hibernate QueryCache interface. This

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,26 +20,28 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.internal;
import java.util.Properties;
import org.hibernate.HibernateException;
import org.hibernate.cache.spi.QueryCache;
import org.hibernate.cache.spi.QueryCacheFactory;
import org.hibernate.cache.spi.UpdateTimestampsCache;
import org.hibernate.cfg.Settings;
/**
* Standard Hibernate implementation of the QueryCacheFactory interface. Returns
* instances of {@link StandardQueryCache}.
* Standard Hibernate implementation of the QueryCacheFactory interface. Returns instances of
* {@link StandardQueryCache}.
*/
public class StandardQueryCacheFactory implements QueryCacheFactory {
@Override
public QueryCache getQueryCache(
final String regionName,
final UpdateTimestampsCache updateTimestampsCache,
final Settings settings,
final Properties props)
throws HibernateException {
final Properties props) throws HibernateException {
return new StandardQueryCache(settings, props, updateTimestampsCache, regionName);
}
}

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,15 +20,12 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.internal;
/**
* Generates increasing identifiers (in a single VM only).
* Not valid across multiple VMs. Identifiers are not necessarily
* strictly increasing, but usually are.
* Generates increasing identifiers (in a single VM only). Not valid across multiple VMs. Identifiers are not
* necessarily strictly increasing, but usually are.
*/
public final class Timestamper {
private static short counter = 0;
@ -51,7 +48,8 @@ public final class Timestamper {
}
}
private Timestamper() {}
private Timestamper() {
}
}

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,12 +20,12 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.impl.bridge;
import org.hibernate.cache.Cache;
package org.hibernate.cache.internal.bridge;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.GeneralDataRegion;
import org.hibernate.cache.spi.Cache;
import org.hibernate.cache.spi.GeneralDataRegion;
import org.hibernate.cfg.Settings;
/**

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,13 +20,14 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.impl.bridge;
package org.hibernate.cache.internal.bridge;
import java.util.Map;
import org.hibernate.cache.Cache;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.Region;
import org.hibernate.cache.spi.Cache;
import org.hibernate.cache.spi.Region;
import org.hibernate.cfg.Settings;
/**

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,12 +20,13 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.impl.bridge;
import org.hibernate.cache.Cache;
import org.hibernate.cache.CacheDataDescription;
import org.hibernate.cache.TransactionalDataRegion;
package org.hibernate.cache.internal.bridge;
import org.hibernate.cache.spi.Cache;
import org.hibernate.cache.spi.CacheDataDescription;
import org.hibernate.cache.spi.TransactionAwareCache;
import org.hibernate.cache.spi.TransactionalDataRegion;
import org.hibernate.cfg.Settings;
/**
@ -45,7 +46,7 @@ public abstract class BaseTransactionalDataRegionAdapter
}
public boolean isTransactionAware() {
return underlyingCache instanceof org.hibernate.cache.TransactionAwareCache;
return underlyingCache instanceof TransactionAwareCache;
}
public CacheDataDescription getCacheDataDescription() {

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,14 +20,14 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.impl.bridge;
import org.hibernate.cache.CacheConcurrencyStrategy;
package org.hibernate.cache.internal.bridge;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.CollectionRegion;
import org.hibernate.cache.access.CollectionRegionAccessStrategy;
import org.hibernate.cache.access.SoftLock;
import org.hibernate.cache.spi.CacheConcurrencyStrategy;
import org.hibernate.cache.spi.CollectionRegion;
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy;
import org.hibernate.cache.spi.access.SoftLock;
import org.hibernate.cfg.Settings;
/**

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,26 +20,26 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.impl.bridge;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.cache.Cache;
import org.hibernate.cache.CacheConcurrencyStrategy;
import org.hibernate.cache.CacheDataDescription;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.CollectionRegion;
import org.hibernate.cache.NonstrictReadWriteCache;
import org.hibernate.cache.OptimisticCache;
import org.hibernate.cache.ReadOnlyCache;
import org.hibernate.cache.ReadWriteCache;
import org.hibernate.cache.TransactionalCache;
import org.hibernate.cache.access.AccessType;
import org.hibernate.cache.access.CollectionRegionAccessStrategy;
import org.hibernate.cfg.Settings;
package org.hibernate.cache.internal.bridge;
import org.jboss.logging.Logger;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.spi.Cache;
import org.hibernate.cache.spi.CacheConcurrencyStrategy;
import org.hibernate.cache.spi.CacheDataDescription;
import org.hibernate.cache.spi.CollectionRegion;
import org.hibernate.cache.spi.NonstrictReadWriteCache;
import org.hibernate.cache.spi.OptimisticCache;
import org.hibernate.cache.spi.ReadOnlyCache;
import org.hibernate.cache.spi.ReadWriteCache;
import org.hibernate.cache.spi.TransactionalCache;
import org.hibernate.cache.spi.access.AccessType;
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy;
import org.hibernate.cfg.Settings;
import org.hibernate.internal.CoreMessageLogger;
/**
* Adapter specifically bridging {@link CollectionRegion} to {@link Cache}.
*

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,14 +20,14 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.impl.bridge;
import org.hibernate.cache.CacheConcurrencyStrategy;
package org.hibernate.cache.internal.bridge;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.EntityRegion;
import org.hibernate.cache.access.EntityRegionAccessStrategy;
import org.hibernate.cache.access.SoftLock;
import org.hibernate.cache.spi.CacheConcurrencyStrategy;
import org.hibernate.cache.spi.EntityRegion;
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy;
import org.hibernate.cache.spi.access.SoftLock;
import org.hibernate.cfg.Settings;
/**

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,28 +20,28 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.impl.bridge;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.cache.Cache;
import org.hibernate.cache.CacheConcurrencyStrategy;
import org.hibernate.cache.CacheDataDescription;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.EntityRegion;
import org.hibernate.cache.NonstrictReadWriteCache;
import org.hibernate.cache.OptimisticCache;
import org.hibernate.cache.ReadOnlyCache;
import org.hibernate.cache.ReadWriteCache;
import org.hibernate.cache.TransactionalCache;
import org.hibernate.cache.access.AccessType;
import org.hibernate.cache.access.EntityRegionAccessStrategy;
import org.hibernate.cfg.Settings;
package org.hibernate.cache.internal.bridge;
import org.jboss.logging.Logger;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.spi.Cache;
import org.hibernate.cache.spi.CacheConcurrencyStrategy;
import org.hibernate.cache.spi.CacheDataDescription;
import org.hibernate.cache.spi.EntityRegion;
import org.hibernate.cache.spi.NonstrictReadWriteCache;
import org.hibernate.cache.spi.OptimisticCache;
import org.hibernate.cache.spi.ReadOnlyCache;
import org.hibernate.cache.spi.ReadWriteCache;
import org.hibernate.cache.spi.TransactionalCache;
import org.hibernate.cache.spi.access.AccessType;
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy;
import org.hibernate.cfg.Settings;
import org.hibernate.internal.CoreMessageLogger;
/**
* Adapter specifically bridging {@link EntityRegion} to {@link Cache}.
* Adapter specifically bridging {@link EntityRegion} to {@link org.hibernate.cache.spi.Cache}.
*
* @author Steve Ebersole
*/

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,12 +20,13 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.impl.bridge;
package org.hibernate.cache.internal.bridge;
import java.util.Comparator;
import org.hibernate.cache.CacheDataDescription;
import org.hibernate.cache.OptimisticCacheSource;
import org.hibernate.cache.spi.CacheDataDescription;
import org.hibernate.cache.spi.OptimisticCacheSource;
/**
* {@inheritDoc}

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,15 +20,15 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.impl.bridge;
import org.hibernate.cache.Cache;
import org.hibernate.cache.QueryResultsRegion;
package org.hibernate.cache.internal.bridge;
import org.hibernate.cache.spi.Cache;
import org.hibernate.cache.spi.QueryResultsRegion;
import org.hibernate.cfg.Settings;
/**
* Adapter specifically briding {@link QueryResultsRegion} to {@link Cache}.
* Adapter specifically briding {@link org.hibernate.cache.spi.QueryResultsRegion} to {@link Cache}.
*
* @author Steve Ebersole
*/

View File

@ -21,26 +21,27 @@
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.cache.impl.bridge;
package org.hibernate.cache.internal.bridge;
import java.util.Properties;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.cache.CacheDataDescription;
import org.jboss.logging.Logger;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.CacheProvider;
import org.hibernate.cache.CollectionRegion;
import org.hibernate.cache.EntityRegion;
import org.hibernate.cache.NoCacheProvider;
import org.hibernate.cache.QueryResultsRegion;
import org.hibernate.cache.RegionFactory;
import org.hibernate.cache.TimestampsRegion;
import org.hibernate.cache.access.AccessType;
import org.hibernate.cache.internal.NoCacheProvider;
import org.hibernate.cache.spi.CacheDataDescription;
import org.hibernate.cache.spi.CacheProvider;
import org.hibernate.cache.spi.CollectionRegion;
import org.hibernate.cache.spi.EntityRegion;
import org.hibernate.cache.spi.QueryResultsRegion;
import org.hibernate.cache.spi.RegionFactory;
import org.hibernate.cache.spi.TimestampsRegion;
import org.hibernate.cache.spi.access.AccessType;
import org.hibernate.cfg.Environment;
import org.hibernate.cfg.Settings;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.internal.util.ReflectHelper;
import org.hibernate.internal.util.config.ConfigurationHelper;
import org.jboss.logging.Logger;
/**
* Acts as a bridge between the {@link RegionFactory} contract and the older

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,15 +20,15 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.impl.bridge;
import org.hibernate.cache.Cache;
import org.hibernate.cache.TimestampsRegion;
package org.hibernate.cache.internal.bridge;
import org.hibernate.cache.spi.Cache;
import org.hibernate.cache.spi.TimestampsRegion;
import org.hibernate.cfg.Settings;
/**
* Adapter specifically briding {@link TimestampsRegion} to {@link Cache}.
* Adapter specifically bridging {@link TimestampsRegion} to {@link org.hibernate.cache.spi.Cache}.
*
* @author Steve Ebersole
*/

View File

@ -29,7 +29,8 @@
<body>
<p>
This package defines APIs/SPIs and implementations for the Hibernate second-level cache.
This package defines Hibernate second level cache service. {@link org.hibernate.cache.spi} defines the
SPI used to integrate with Hibernate internals.
</p>
<p>
The legacy (and now deprecated) approach to caching is defined by the {@link org.hibernate.cache.CacheProvider} and

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,15 +20,15 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.hibernate.cache.CacheException;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.cfg.Environment;
import org.hibernate.internal.util.StringHelper;

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,11 +20,13 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
import java.util.Map;
import org.hibernate.cache.CacheException;
/**
* Implementors define a caching algorithm. All implementors
* <b>must</b> be threadsafe.
@ -36,7 +38,7 @@ public interface Cache {
* Get an item from the cache
* @param key
* @return the cached object or <tt>null</tt>
* @throws CacheException
* @throws org.hibernate.cache.CacheException
*/
public Object read(Object key) throws CacheException;
/**

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,11 +20,13 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
import java.util.Comparator;
import org.hibernate.cache.access.SoftLock;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.spi.access.SoftLock;
/**
* Implementors manage transactional access to cached data. Transactions
@ -71,7 +73,7 @@ public interface CacheConcurrencyStrategy {
* @param key
* @param txTimestamp a timestamp prior to the transaction start time
* @return the cached object or <tt>null</tt>
* @throws CacheException
* @throws org.hibernate.cache.CacheException
*/
public Object get(Object key, long txTimestamp) throws CacheException;

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,9 +20,9 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
import java.util.Comparator;
/**

View File

@ -21,7 +21,7 @@
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
import java.io.Serializable;

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,11 +20,13 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
import java.util.Properties;
import org.hibernate.cache.CacheException;
/**
* Support for pluggable caches.
*
@ -38,7 +40,7 @@ public interface CacheProvider {
*
* @param regionName the name of the cache region
* @param properties configuration settings
* @throws CacheException
* @throws org.hibernate.cache.CacheException
*/
public Cache buildCache(String regionName, Properties properties) throws CacheException;

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,11 +20,12 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
import org.hibernate.cache.access.AccessType;
import org.hibernate.cache.access.CollectionRegionAccessStrategy;
package org.hibernate.cache.spi;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.spi.access.AccessType;
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy;
/**
* Defines the contract for a cache region which will specifically be used to
@ -45,7 +46,7 @@ public interface CollectionRegion extends TransactionalDataRegion {
* @param accessType The type of access strategy to build; never null.
* @return The appropriate strategy contract for accessing this region
* for the requested type of access.
* @throws CacheException Usually indicates mis-configuration.
* @throws org.hibernate.cache.CacheException Usually indicates mis-configuration.
*/
public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException;
}

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,11 +20,12 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
import org.hibernate.cache.access.AccessType;
import org.hibernate.cache.access.EntityRegionAccessStrategy;
package org.hibernate.cache.spi;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.spi.access.AccessType;
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy;
/**
* Defines the contract for a cache region which will specifically be used to
@ -40,7 +41,7 @@ public interface EntityRegion extends TransactionalDataRegion {
* @param accessType The type of access strategy to build; never null.
* @return The appropriate strategy contract for accessing this region
* for the requested type of access.
* @throws CacheException Usually indicates mis-configuration.
* @throws org.hibernate.cache.CacheException Usually indicates mis-configuration.
*/
public EntityRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException;
}

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,15 +20,16 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
import java.io.Serializable;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.hibernate.EntityMode;
import org.hibernate.engine.TypedValue;
import org.hibernate.internal.FilterImpl;

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,10 +20,10 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
import org.hibernate.cache.CacheException;
/**
* Contract for general-purpose cache regions.
@ -37,7 +37,7 @@ public interface GeneralDataRegion extends Region {
*
* @param key The key of the item to be retrieved.
* @return the cached object or <tt>null</tt>
* @throws CacheException Indicates a problem accessing the item or region.
* @throws org.hibernate.cache.CacheException Indicates a problem accessing the item or region.
*/
public Object get(Object key) throws CacheException;

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,16 +20,17 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
import java.util.Comparator;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.cache.access.SoftLock;
import org.jboss.logging.Logger;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.spi.access.SoftLock;
import org.hibernate.internal.CoreMessageLogger;
/**
* Caches data that is sometimes updated without ever locking the cache.
* If concurrent access to an item is possible, this concurrency strategy
@ -40,6 +41,7 @@ import org.jboss.logging.Logger;
* @author Gavin King
* @see ReadWriteCache for a much stricter algorithm
*/
@Deprecated
public class NonstrictReadWriteCache implements CacheConcurrencyStrategy {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,21 +20,19 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
/**
* A contract for transactional cache implementations which support
* optimistic locking of items within the cache.
* <p/>
* The optimisitic locking capabilities are only utilized for
* The optimistic locking capabilities are only utilized for
* the entity cache regions.
* <p/>
* Unlike the methods on the {@link Cache} interface, all the methods
* here will only ever be called from access scenarios where versioned
* data is actually a possiblity (i.e., entity data). Be sure to consult
* data is actually a possibility (i.e., entity data). Be sure to consult
* with {@link OptimisticCacheSource#isVersioned()} to determine whether
* versioning is actually in effect.
*

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,9 +20,9 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
import java.util.Comparator;
/**

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,12 +20,14 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
import java.util.List;
import java.util.Set;
import org.hibernate.HibernateException;
import org.hibernate.cache.CacheException;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.type.Type;

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,10 +20,11 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
import java.util.Properties;
import org.hibernate.HibernateException;
import org.hibernate.cfg.Settings;
@ -34,12 +35,9 @@ import org.hibernate.cfg.Settings;
* @author Steve Ebersole
*/
public interface QueryCacheFactory {
public QueryCache getQueryCache(
String regionName,
UpdateTimestampsCache updateTimestampsCache,
Settings settings,
Properties props)
throws HibernateException;
Properties props) throws HibernateException;
}

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -21,13 +21,14 @@
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
import java.io.IOException;
import java.io.Serializable;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.hibernate.EntityMode;
import org.hibernate.engine.QueryParameters;
import org.hibernate.engine.RowSelection;

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,10 +20,8 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
/**
* Defines the contract for a cache region which will specifically be used to

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,19 +20,22 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
import java.util.Comparator;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.cache.access.SoftLock;
import org.jboss.logging.Logger;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.spi.access.SoftLock;
import org.hibernate.internal.CoreMessageLogger;
/**
* Caches data that is never updated.
* @see CacheConcurrencyStrategy
* @see org.hibernate.cache.spi.CacheConcurrencyStrategy
*/
@Deprecated
public class ReadOnlyCache implements CacheConcurrencyStrategy {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, ReadOnlyCache.class.getName());

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,17 +20,18 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
import java.io.Serializable;
import java.util.Comparator;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.cache.access.SoftLock;
import org.jboss.logging.Logger;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.spi.access.SoftLock;
import org.hibernate.internal.CoreMessageLogger;
/**
* Caches data that is sometimes updated while maintaining the semantics of
* "read committed" isolation level. If the database is set to "repeatable
@ -45,8 +46,9 @@ import org.jboss.logging.Logger;
* as the lock is released.
*
* @see NonstrictReadWriteCache for a faster algorithm
* @see CacheConcurrencyStrategy
* @see org.hibernate.cache.spi.CacheConcurrencyStrategy
*/
@Deprecated
public class ReadWriteCache implements CacheConcurrencyStrategy {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, ReadWriteCache.class.getName());

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,11 +20,13 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
import java.util.Map;
import org.hibernate.cache.CacheException;
/**
* Defines a contract for accessing a particular named region within the
* underlying cache implementation.
@ -44,7 +46,7 @@ public interface Region {
* during {@link org.hibernate.SessionFactory#close()} to give
* the region a chance to cleanup.
*
* @throws CacheException Indicates problem shutting down
* @throws org.hibernate.cache.CacheException Indicates problem shutting down
*/
public void destroy() throws CacheException;

View File

@ -0,0 +1,139 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.cache.spi;
import java.util.Properties;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.spi.access.AccessType;
import org.hibernate.cfg.Settings;
/**
* Contract for building second level cache regions.
* <p/>
* Implementors should define a constructor in one of two forms:<ul>
* <li>MyRegionFactoryImpl({@link java.util.Properties})</li>
* <li>MyRegionFactoryImpl()</li>
* </ul>
* Use the first when we need to read config properties prior to
* {@link #start} being called. For an example, have a look at
* {@link org.hibernate.cache.internal.bridge.RegionFactoryCacheProviderBridge}
* where we need the properties in order to determine which legacy
* {@link CacheProvider} to use so that we can answer the
* {@link #isMinimalPutsEnabledByDefault()} question for the
* {@link org.hibernate.cfg.SettingsFactory}.
*
* @author Steve Ebersole
*/
public interface RegionFactory {
/**
* Lifecycle callback to perform any necessary initialization of the
* underlying cache implementation(s). Called exactly once during the
* construction of a {@link org.hibernate.internal.SessionFactoryImpl}.
*
* @param settings The settings in effect.
* @param properties The defined cfg properties
* @throws org.hibernate.cache.CacheException Indicates problems starting the L2 cache impl;
* considered as a sign to stop {@link org.hibernate.SessionFactory}
* building.
*/
public void start(Settings settings, Properties properties) throws CacheException;
/**
* Lifecycle callback to perform any necessary cleanup of the underlying
* cache implementation(s). Called exactly once during
* {@link org.hibernate.SessionFactory#close}.
*/
public void stop();
/**
* By default should we perform "minimal puts" when using this second
* level cache implementation?
*
* @return True if "minimal puts" should be performed by default; false
* otherwise.
*/
public boolean isMinimalPutsEnabledByDefault();
/**
* Get the default access type for {@link EntityRegion entity} and
* {@link CollectionRegion collection} regions.
*
* @return This factory's default access type.
*/
public AccessType getDefaultAccessType();
/**
* Generate a timestamp.
* <p/>
* This is generally used for cache content locking/unlocking purposes
* depending upon the access-strategy being used.
*
* @return The generated timestamp.
*/
public long nextTimestamp();
/**
* Build a cache region specialized for storing entity data.
*
* @param regionName The name of the region.
* @param properties Configuration properties.
* @param metadata Information regarding the type of data to be cached
* @return The built region
* @throws CacheException Indicates problems building the region.
*/
public EntityRegion buildEntityRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException;
/**
* Build a cache region specialized for storing collection data.
*
* @param regionName The name of the region.
* @param properties Configuration properties.
* @param metadata Information regarding the type of data to be cached
* @return The built region
* @throws CacheException Indicates problems building the region.
*/
public CollectionRegion buildCollectionRegion(String regionName, Properties properties, CacheDataDescription metadata) throws CacheException;
/**
* Build a cache region specialized for storing query results
*
* @param regionName The name of the region.
* @param properties Configuration properties.
* @return The built region
* @throws CacheException Indicates problems building the region.
*/
public QueryResultsRegion buildQueryResultsRegion(String regionName, Properties properties) throws CacheException;
/**
* Build a cache region specialized for storing update-timestamps data.
*
* @param regionName The name of the region.
* @param properties Configuration properties.
* @return The built region
* @throws CacheException Indicates problems building the region.
*/
public TimestampsRegion buildTimestampsRegion(String regionName, Properties properties) throws CacheException;
}

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,10 +20,8 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
/**
* Defines the contract for a cache region which will specifically be used to

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,14 +20,11 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
/**
* Marker interface for identifying cache impls which are aware of
* JTA transactions
* Marker interface for identifying {@link Cache} implementations which are aware of JTA transactions
*
* @author Steve Ebersole
*/

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,16 +20,17 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
import java.util.Comparator;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.cache.access.SoftLock;
import org.jboss.logging.Logger;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.spi.access.SoftLock;
import org.hibernate.internal.CoreMessageLogger;
/**
* Support for fully transactional cache implementations like
* JBoss TreeCache. Note that this might be a less scalable
@ -38,6 +39,7 @@ import org.jboss.logging.Logger;
*
* @author Gavin King
*/
@Deprecated
public class TransactionalCache implements CacheConcurrencyStrategy {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, TransactionalCache.class.getName());

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,10 +20,8 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
/**
* Defines contract for regions which hold transactionally-managed data.

View File

@ -21,17 +21,20 @@
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.cache;
package org.hibernate.cache.spi;
import java.io.Serializable;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.hibernate.HibernateException;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.cfg.Settings;
import org.jboss.logging.Logger;
import org.hibernate.HibernateException;
import org.hibernate.cache.CacheException;
import org.hibernate.cfg.Settings;
import org.hibernate.internal.CoreMessageLogger;
/**
* Tracks the timestamps of the most recent updates to particular tables. It is
* important that the cache timeout of the underlying cache implementation be set

View File

@ -0,0 +1,62 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.cache.spi.access;
/**
* The types of access strategies available.
*
* @author Steve Ebersole
*/
public enum AccessType {
READ_ONLY( "read-only" ),
READ_WRITE( "read-write" ),
NONSTRICT_READ_WRITE( "nonstrict-read-write" ),
TRANSACTIONAL( "transactional" );
private final String externalName;
private AccessType(String externalName) {
this.externalName = externalName;
}
public String getExternalName() {
return externalName;
}
public String toString() {
return "AccessType[" + externalName + "]";
}
public static AccessType fromExternalName(String externalName) {
if ( externalName == null ) {
return null;
}
for ( AccessType accessType : AccessType.values() ) {
if ( accessType.getExternalName().equals( externalName ) ) {
return accessType;
}
}
throw new UnknownAccessTypeException( externalName );
}
}

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,11 +20,11 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.access;
package org.hibernate.cache.spi.access;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.CollectionRegion;
import org.hibernate.cache.spi.CollectionRegion;
/**
* Contract for managing transactional and concurrent access to cached collection
@ -55,7 +55,7 @@ public interface CollectionRegionAccessStrategy {
* @param key The key of the item to be retrieved.
* @param txTimestamp a timestamp prior to the transaction start time
* @return the cached object or <tt>null</tt>
* @throws org.hibernate.cache.CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws org.hibernate.cache.CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public Object get(Object key, long txTimestamp) throws CacheException;
@ -67,7 +67,7 @@ public interface CollectionRegionAccessStrategy {
* @param txTimestamp a timestamp prior to the transaction start time
* @param version the item version number
* @return <tt>true</tt> if the object was successfully cached
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public boolean putFromLoad(
Object key,
@ -85,7 +85,7 @@ public interface CollectionRegionAccessStrategy {
* @param version the item version number
* @param minimalPutOverride Explicit minimalPut flag
* @return <tt>true</tt> if the object was successfully cached
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public boolean putFromLoad(
Object key,
@ -105,7 +105,7 @@ public interface CollectionRegionAccessStrategy {
* @param key The key of the item to lock
* @param version The item's current version value
* @return A representation of our lock on the item; or null.
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public SoftLock lockItem(Object key, Object version) throws CacheException;
@ -113,7 +113,7 @@ public interface CollectionRegionAccessStrategy {
* Lock the entire region
*
* @return A representation of our lock on the item; or null.
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public SoftLock lockRegion() throws CacheException;
@ -124,7 +124,7 @@ public interface CollectionRegionAccessStrategy {
*
* @param key The item key
* @param lock The lock previously obtained from {@link #lockItem}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public void unlockItem(Object key, SoftLock lock) throws CacheException;
@ -133,7 +133,7 @@ public interface CollectionRegionAccessStrategy {
* region
*
* @param lock The lock previously obtained from {@link #lockRegion}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public void unlockRegion(SoftLock lock) throws CacheException;
@ -142,14 +142,14 @@ public interface CollectionRegionAccessStrategy {
* This method is used by "synchronous" concurrency strategies.
*
* @param key The key of the item to remove
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public void remove(Object key) throws CacheException;
/**
* Called to evict data from the entire region
*
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public void removeAll() throws CacheException;
@ -158,7 +158,7 @@ public interface CollectionRegionAccessStrategy {
* isolation.
*
* @param key The key of the item to remove
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public void evict(Object key) throws CacheException;
@ -166,7 +166,7 @@ public interface CollectionRegionAccessStrategy {
* Forcibly evict all items from the cache immediately without regard for transaction
* isolation.
*
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public void evictAll() throws CacheException;
}

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,11 +20,11 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.access;
package org.hibernate.cache.spi.access;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.EntityRegion;
import org.hibernate.cache.spi.EntityRegion;
/**
* Contract for managing transactional and concurrent access to cached entity
@ -57,7 +57,7 @@ public interface EntityRegionAccessStrategy {
* @param key The key of the item to be retrieved.
* @param txTimestamp a timestamp prior to the transaction start time
* @return the cached object or <tt>null</tt>
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public Object get(Object key, long txTimestamp) throws CacheException;
@ -69,7 +69,7 @@ public interface EntityRegionAccessStrategy {
* @param txTimestamp a timestamp prior to the transaction start time
* @param version the item version number
* @return <tt>true</tt> if the object was successfully cached
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public boolean putFromLoad(
Object key,
@ -87,7 +87,7 @@ public interface EntityRegionAccessStrategy {
* @param version the item version number
* @param minimalPutOverride Explicit minimalPut flag
* @return <tt>true</tt> if the object was successfully cached
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public boolean putFromLoad(
Object key,
@ -107,7 +107,7 @@ public interface EntityRegionAccessStrategy {
* @param key The key of the item to lock
* @param version The item's current version value
* @return A representation of our lock on the item; or null.
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public SoftLock lockItem(Object key, Object version) throws CacheException;
@ -115,7 +115,7 @@ public interface EntityRegionAccessStrategy {
* Lock the entire region
*
* @return A representation of our lock on the item; or null.
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public SoftLock lockRegion() throws CacheException;
@ -126,7 +126,7 @@ public interface EntityRegionAccessStrategy {
*
* @param key The item key
* @param lock The lock previously obtained from {@link #lockItem}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public void unlockItem(Object key, SoftLock lock) throws CacheException;
@ -135,7 +135,7 @@ public interface EntityRegionAccessStrategy {
* region
*
* @param lock The lock previously obtained from {@link #lockRegion}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public void unlockRegion(SoftLock lock) throws CacheException;
@ -148,7 +148,7 @@ public interface EntityRegionAccessStrategy {
* @param value The item
* @param version The item's version value
* @return Were the contents of the cache actual changed by this operation?
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public boolean insert(Object key, Object value, Object version) throws CacheException;
@ -161,7 +161,7 @@ public interface EntityRegionAccessStrategy {
* @param value The item
* @param version The item's version value
* @return Were the contents of the cache actual changed by this operation?
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public boolean afterInsert(Object key, Object value, Object version) throws CacheException;
@ -175,7 +175,7 @@ public interface EntityRegionAccessStrategy {
* @param currentVersion The item's current version value
* @param previousVersion The item's previous version value
* @return Were the contents of the cache actual changed by this operation?
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public boolean update(Object key, Object value, Object currentVersion, Object previousVersion) throws CacheException;
@ -190,7 +190,7 @@ public interface EntityRegionAccessStrategy {
* @param previousVersion The item's previous version value
* @param lock The lock previously obtained from {@link #lockItem}
* @return Were the contents of the cache actual changed by this operation?
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock) throws CacheException;
@ -199,14 +199,14 @@ public interface EntityRegionAccessStrategy {
* This method is used by "synchronous" concurrency strategies.
*
* @param key The key of the item to remove
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public void remove(Object key) throws CacheException;
/**
* Called to evict data from the entire region
*
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public void removeAll() throws CacheException;
@ -215,7 +215,7 @@ public interface EntityRegionAccessStrategy {
* isolation.
*
* @param key The key of the item to remove
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public void evict(Object key) throws CacheException;
@ -223,7 +223,7 @@ public interface EntityRegionAccessStrategy {
* Forcibly evict all items from the cache immediately without regard for transaction
* isolation.
*
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.Region}
* @throws CacheException Propogated from underlying {@link org.hibernate.cache.spi.Region}
*/
public void evictAll() throws CacheException;
}

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,14 +20,12 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.access;
package org.hibernate.cache.spi.access;
/**
* Moved up from inner definition on the now deprecated
* {@link org.hibernate.cache.CacheConcurrencyStrategy}.
* {@link org.hibernate.cache.spi.CacheConcurrencyStrategy}.
*
* @author Steve Ebersole
*/

View File

@ -0,0 +1,35 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program 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 distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.cache.spi.access;
import org.hibernate.HibernateException;
/**
* @author Steve Ebersole
*/
public class UnknownAccessTypeException extends HibernateException {
public UnknownAccessTypeException(String accessTypeName) {
super( "Unknown access type [" + accessTypeName + "]" );
}
}

View File

@ -21,7 +21,7 @@
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.cache.entry;
package org.hibernate.cache.spi.entry;
import java.io.Serializable;

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,11 +20,10 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.entry;
import org.hibernate.engine.SessionFactoryImplementor;
package org.hibernate.cache.spi.entry;
import org.hibernate.engine.SessionFactoryImplementor;
/**
* @author Gavin King

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,10 +20,11 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.entry;
package org.hibernate.cache.spi.entry;
import java.io.Serializable;
import org.hibernate.collection.PersistentCollection;
import org.hibernate.internal.util.collections.ArrayHelper;
import org.hibernate.persister.collection.CollectionPersister;

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,12 +20,13 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.entry;
package org.hibernate.cache.spi.entry;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.persister.entity.EntityPersister;

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,12 +20,13 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.entry;
package org.hibernate.cache.spi.entry;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import org.hibernate.engine.SessionFactoryImplementor;
/**

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,13 +20,14 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.entry;
package org.hibernate.cache.spi.entry;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.hibernate.engine.SessionFactoryImplementor;
/**

View File

@ -1,10 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* Copyright (c) 2008-2011, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
@ -20,11 +20,10 @@
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*
*/
package org.hibernate.cache.entry;
import org.hibernate.engine.SessionFactoryImplementor;
package org.hibernate.cache.spi.entry;
import org.hibernate.engine.SessionFactoryImplementor;
/**
* @author Gavin King

View File

@ -82,6 +82,7 @@ import org.hibernate.AnnotationException;
import org.hibernate.AssertionFailure;
import org.hibernate.EntityMode;
import org.hibernate.FetchMode;
import org.hibernate.cache.spi.RegionFactory;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.MappingException;
import org.hibernate.annotations.BatchSize;
@ -134,7 +135,6 @@ import org.hibernate.annotations.common.reflection.XClass;
import org.hibernate.annotations.common.reflection.XMethod;
import org.hibernate.annotations.common.reflection.XPackage;
import org.hibernate.annotations.common.reflection.XProperty;
import org.hibernate.cache.RegionFactory;
import org.hibernate.cfg.annotations.CollectionBinder;
import org.hibernate.cfg.annotations.EntityBinder;
import org.hibernate.cfg.annotations.MapKeyColumnDelegator;

View File

@ -296,7 +296,7 @@ public interface AvailableSettings {
public static final String CACHE_PROVIDER = "hibernate.cache.provider_class";
/**
* The {@link org.hibernate.cache.RegionFactory} implementation class
* The {@link org.hibernate.cache.spi.RegionFactory} implementation class
*/
public static final String CACHE_REGION_FACTORY = "hibernate.cache.region.factory_class";

View File

@ -76,7 +76,7 @@ import org.hibernate.internal.util.config.ConfigurationHelper;
* </tr>
* <tr>
* <td><tt>hibernate.cache.provider_class</tt></td>
* <td>classname of <tt>org.hibernate.cache.CacheProvider</tt>
* <td>classname of <tt>org.hibernate.cache.spi.CacheProvider</tt>
* subclass (if not specified EHCache is used)</td>
* </tr>
* <tr>

View File

@ -27,8 +27,8 @@ import java.util.Map;
import org.hibernate.ConnectionReleaseMode;
import org.hibernate.EntityMode;
import org.hibernate.MultiTenancyStrategy;
import org.hibernate.cache.QueryCacheFactory;
import org.hibernate.cache.RegionFactory;
import org.hibernate.cache.spi.QueryCacheFactory;
import org.hibernate.cache.spi.RegionFactory;
import org.hibernate.hql.QueryTranslatorFactory;
import org.hibernate.service.jta.platform.spi.JtaPlatform;
import org.hibernate.tuple.entity.EntityTuplizerFactory;

View File

@ -33,10 +33,10 @@ import org.hibernate.ConnectionReleaseMode;
import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
import org.hibernate.MultiTenancyStrategy;
import org.hibernate.cache.QueryCacheFactory;
import org.hibernate.cache.RegionFactory;
import org.hibernate.cache.impl.NoCachingRegionFactory;
import org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge;
import org.hibernate.cache.internal.NoCachingRegionFactory;
import org.hibernate.cache.spi.QueryCacheFactory;
import org.hibernate.cache.spi.RegionFactory;
import org.hibernate.cache.internal.bridge.RegionFactoryCacheProviderBridge;
import org.hibernate.engine.jdbc.spi.ExtractedDatabaseMetaData;
import org.hibernate.engine.jdbc.spi.JdbcServices;
import org.hibernate.engine.transaction.spi.TransactionFactory;
@ -305,7 +305,7 @@ public class SettingsFactory implements Serializable {
protected QueryCacheFactory createQueryCacheFactory(Properties properties, ServiceRegistry serviceRegistry) {
String queryCacheFactoryClassName = ConfigurationHelper.getString(
Environment.QUERY_CACHE_FACTORY, properties, "org.hibernate.cache.StandardQueryCacheFactory"
Environment.QUERY_CACHE_FACTORY, properties, "org.hibernate.cache.internal.StandardQueryCacheFactory"
);
LOG.debugf( "Query cache factory: %s", queryCacheFactoryClassName );
try {

View File

@ -816,8 +816,8 @@ public class EntityBinder {
}
public static String getCacheConcurrencyStrategy(CacheConcurrencyStrategy strategy) {
org.hibernate.cache.access.AccessType accessType = strategy.toAccessType();
return accessType == null ? null : accessType.getName();
org.hibernate.cache.spi.access.AccessType accessType = strategy.toAccessType();
return accessType == null ? null : accessType.getExternalName();
}
public void addFilter(String name, String condition) {

View File

@ -30,7 +30,7 @@ import java.util.LinkedHashMap;
import java.util.Map;
import org.hibernate.EntityMode;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.spi.CacheKey;
import org.hibernate.collection.PersistentCollection;
import org.hibernate.internal.util.MarkerObject;
import org.hibernate.persister.collection.CollectionPersister;

View File

@ -34,9 +34,9 @@ import org.hibernate.MappingException;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.SessionFactoryObserver;
import org.hibernate.cache.QueryCache;
import org.hibernate.cache.Region;
import org.hibernate.cache.UpdateTimestampsCache;
import org.hibernate.cache.spi.QueryCache;
import org.hibernate.cache.spi.Region;
import org.hibernate.cache.spi.UpdateTimestampsCache;
import org.hibernate.cfg.Settings;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.function.SQLFunctionRegistry;

View File

@ -36,7 +36,7 @@ import org.hibernate.Interceptor;
import org.hibernate.Query;
import org.hibernate.ScrollMode;
import org.hibernate.ScrollableResults;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.spi.CacheKey;
import org.hibernate.collection.PersistentCollection;
import org.hibernate.engine.jdbc.LobCreationContext;
import org.hibernate.engine.jdbc.spi.JdbcConnectionAccess;

View File

@ -30,11 +30,11 @@ import org.jboss.logging.Logger;
import org.hibernate.AssertionFailure;
import org.hibernate.CacheMode;
import org.hibernate.HibernateException;
import org.hibernate.cache.spi.CacheKey;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.LockMode;
import org.hibernate.bytecode.instrumentation.spi.LazyPropertyInitializer;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.entry.CacheEntry;
import org.hibernate.cache.spi.entry.CacheEntry;
import org.hibernate.event.EventType;
import org.hibernate.event.PostLoadEvent;
import org.hibernate.event.PostLoadEventListener;

View File

@ -36,9 +36,9 @@ import org.jboss.logging.Logger;
import org.hibernate.CacheMode;
import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
import org.hibernate.cache.spi.CacheKey;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.entry.CollectionCacheEntry;
import org.hibernate.cache.spi.entry.CollectionCacheEntry;
import org.hibernate.collection.PersistentCollection;
import org.hibernate.engine.CollectionEntry;
import org.hibernate.engine.CollectionKey;

View File

@ -25,12 +25,12 @@ package org.hibernate.event.def;
import org.jboss.logging.Logger;
import org.hibernate.cache.spi.CacheKey;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.LockMode;
import org.hibernate.LockOptions;
import org.hibernate.ObjectDeletedException;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.access.SoftLock;
import org.hibernate.cache.spi.access.SoftLock;
import org.hibernate.engine.EntityEntry;
import org.hibernate.engine.Status;
import org.hibernate.event.EventSource;

View File

@ -28,9 +28,9 @@ import java.io.Serializable;
import org.jboss.logging.Logger;
import org.hibernate.HibernateException;
import org.hibernate.cache.spi.CacheKey;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.entry.CollectionCacheEntry;
import org.hibernate.cache.spi.entry.CollectionCacheEntry;
import org.hibernate.collection.PersistentCollection;
import org.hibernate.engine.CollectionEntry;
import org.hibernate.engine.PersistenceContext;

View File

@ -29,14 +29,14 @@ import org.jboss.logging.Logger;
import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
import org.hibernate.cache.spi.CacheKey;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.LockMode;
import org.hibernate.NonUniqueObjectException;
import org.hibernate.PersistentObjectException;
import org.hibernate.TypeMismatchException;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.access.SoftLock;
import org.hibernate.cache.entry.CacheEntry;
import org.hibernate.cache.spi.access.SoftLock;
import org.hibernate.cache.spi.entry.CacheEntry;
import org.hibernate.engine.EntityEntry;
import org.hibernate.engine.EntityKey;
import org.hibernate.engine.PersistenceContext;

View File

@ -32,7 +32,7 @@ import org.hibernate.HibernateException;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.PersistentObjectException;
import org.hibernate.UnresolvableObjectException;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.spi.CacheKey;
import org.hibernate.engine.Cascade;
import org.hibernate.engine.CascadingAction;
import org.hibernate.engine.EntityEntry;

View File

@ -36,7 +36,7 @@ import org.hibernate.SQLQuery;
import org.hibernate.ScrollableResults;
import org.hibernate.SessionException;
import org.hibernate.SharedSessionContract;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.spi.CacheKey;
import org.hibernate.engine.EntityKey;
import org.hibernate.engine.NamedQueryDefinition;
import org.hibernate.engine.NamedSQLQueryDefinition;

View File

@ -65,16 +65,16 @@ import org.hibernate.SessionFactoryObserver;
import org.hibernate.StatelessSession;
import org.hibernate.StatelessSessionBuilder;
import org.hibernate.TypeHelper;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.CollectionRegion;
import org.hibernate.cache.EntityRegion;
import org.hibernate.cache.QueryCache;
import org.hibernate.cache.Region;
import org.hibernate.cache.UpdateTimestampsCache;
import org.hibernate.cache.access.AccessType;
import org.hibernate.cache.access.CollectionRegionAccessStrategy;
import org.hibernate.cache.access.EntityRegionAccessStrategy;
import org.hibernate.cache.impl.CacheDataDescriptionImpl;
import org.hibernate.cache.internal.CacheDataDescriptionImpl;
import org.hibernate.cache.spi.CacheKey;
import org.hibernate.cache.spi.CollectionRegion;
import org.hibernate.cache.spi.EntityRegion;
import org.hibernate.cache.spi.QueryCache;
import org.hibernate.cache.spi.Region;
import org.hibernate.cache.spi.UpdateTimestampsCache;
import org.hibernate.cache.spi.access.AccessType;
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy;
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.cfg.Settings;
@ -299,7 +299,7 @@ public final class SessionFactoryImpl
// cache region is defined by the root-class in the hierarchy...
EntityRegionAccessStrategy accessStrategy = ( EntityRegionAccessStrategy ) entityAccessStrategies.get( cacheRegionName );
if ( accessStrategy == null && settings.isSecondLevelCacheEnabled() ) {
final AccessType accessType = AccessType.parse( model.getCacheConcurrencyStrategy() );
final AccessType accessType = AccessType.fromExternalName( model.getCacheConcurrencyStrategy() );
if ( accessType != null ) {
LOG.trace("Building cache for entity data [" + model.getEntityName() + "]");
EntityRegion entityRegion = settings.getRegionFactory().buildEntityRegion( cacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) );
@ -325,11 +325,12 @@ public final class SessionFactoryImpl
while ( collections.hasNext() ) {
Collection model = (Collection) collections.next();
final String cacheRegionName = cacheRegionPrefix + model.getCacheRegionName();
final AccessType accessType = AccessType.parse( model.getCacheConcurrencyStrategy() );
final AccessType accessType = AccessType.fromExternalName( model.getCacheConcurrencyStrategy() );
CollectionRegionAccessStrategy accessStrategy = null;
if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
LOG.trace("Building cache for collection data [" + model.getRole() + "]");
CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion( cacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) );
CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion( cacheRegionName, properties, CacheDataDescriptionImpl
.decode( model ) );
accessStrategy = collectionRegion.buildAccessStrategy( accessType );
entityAccessStrategies.put( cacheRegionName, accessStrategy );
allCacheRegions.put( cacheRegionName, collectionRegion );

View File

@ -49,7 +49,7 @@ import org.hibernate.SessionException;
import org.hibernate.StatelessSession;
import org.hibernate.Transaction;
import org.hibernate.UnresolvableObjectException;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.spi.CacheKey;
import org.hibernate.collection.PersistentCollection;
import org.hibernate.engine.EntityKey;
import org.hibernate.engine.LoadQueryInfluencers;

View File

@ -41,6 +41,8 @@ import org.jboss.logging.Logger;
import org.hibernate.AssertionFailure;
import org.hibernate.HibernateException;
import org.hibernate.cache.spi.QueryCache;
import org.hibernate.cache.spi.QueryKey;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.LockMode;
import org.hibernate.LockOptions;
@ -49,9 +51,7 @@ import org.hibernate.ScrollMode;
import org.hibernate.ScrollableResults;
import org.hibernate.StaleObjectStateException;
import org.hibernate.WrongClassException;
import org.hibernate.cache.FilterKey;
import org.hibernate.cache.QueryCache;
import org.hibernate.cache.QueryKey;
import org.hibernate.cache.spi.FilterKey;
import org.hibernate.collection.PersistentCollection;
import org.hibernate.dialect.Dialect;
import org.hibernate.engine.EntityKey;

View File

@ -42,11 +42,11 @@ import org.hibernate.MappingException;
import org.hibernate.QueryException;
import org.hibernate.TransientObjectException;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.access.CollectionRegionAccessStrategy;
import org.hibernate.cache.entry.CacheEntryStructure;
import org.hibernate.cache.entry.StructuredCollectionCacheEntry;
import org.hibernate.cache.entry.StructuredMapCacheEntry;
import org.hibernate.cache.entry.UnstructuredCacheEntry;
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy;
import org.hibernate.cache.spi.entry.CacheEntryStructure;
import org.hibernate.cache.spi.entry.StructuredCollectionCacheEntry;
import org.hibernate.cache.spi.entry.StructuredMapCacheEntry;
import org.hibernate.cache.spi.entry.UnstructuredCacheEntry;
import org.hibernate.cfg.Configuration;
import org.hibernate.collection.PersistentCollection;
import org.hibernate.dialect.Dialect;

View File

@ -30,7 +30,7 @@ import java.util.Iterator;
import org.hibernate.HibernateException;
import org.hibernate.MappingException;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.access.CollectionRegionAccessStrategy;
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy;
import org.hibernate.cfg.Configuration;
import org.hibernate.collection.PersistentCollection;
import org.hibernate.engine.LoadQueryInfluencers;

View File

@ -29,8 +29,8 @@ import java.sql.SQLException;
import java.util.Map;
import org.hibernate.HibernateException;
import org.hibernate.MappingException;
import org.hibernate.cache.access.CollectionRegionAccessStrategy;
import org.hibernate.cache.entry.CacheEntryStructure;
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy;
import org.hibernate.cache.spi.entry.CacheEntryStructure;
import org.hibernate.collection.PersistentCollection;
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.engine.SessionImplementor;

View File

@ -30,7 +30,7 @@ import java.sql.SQLException;
import java.util.Iterator;
import org.hibernate.MappingException;
import org.hibernate.cache.CacheException;
import org.hibernate.cache.access.CollectionRegionAccessStrategy;
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy;
import org.hibernate.cfg.Configuration;
import org.hibernate.collection.PersistentCollection;
import org.hibernate.engine.LoadQueryInfluencers;

View File

@ -52,12 +52,12 @@ import org.hibernate.StaleStateException;
import org.hibernate.bytecode.instrumentation.internal.FieldInterceptionHelper;
import org.hibernate.bytecode.instrumentation.spi.FieldInterceptor;
import org.hibernate.bytecode.instrumentation.spi.LazyPropertyInitializer;
import org.hibernate.cache.CacheKey;
import org.hibernate.cache.access.EntityRegionAccessStrategy;
import org.hibernate.cache.entry.CacheEntry;
import org.hibernate.cache.entry.CacheEntryStructure;
import org.hibernate.cache.entry.StructuredCacheEntry;
import org.hibernate.cache.entry.UnstructuredCacheEntry;
import org.hibernate.cache.spi.CacheKey;
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy;
import org.hibernate.cache.spi.entry.CacheEntry;
import org.hibernate.cache.spi.entry.CacheEntryStructure;
import org.hibernate.cache.spi.entry.StructuredCacheEntry;
import org.hibernate.cache.spi.entry.UnstructuredCacheEntry;
import org.hibernate.dialect.lock.LockingStrategy;
import org.hibernate.engine.CascadeStyle;
import org.hibernate.engine.CascadingAction;

Some files were not shown because too many files have changed in this diff Show More