move ClassmateContext to SPI package, since it occurs in BootstrapContext

it was previously in an internal package, and leaked onto the SPI
This commit is contained in:
Gavin King 2024-11-14 13:42:36 +01:00
parent df974fd1fb
commit abcdd60b76
16 changed files with 21 additions and 19 deletions

View File

@ -24,6 +24,7 @@ import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
import org.hibernate.boot.registry.selector.spi.StrategySelector; import org.hibernate.boot.registry.selector.spi.StrategySelector;
import org.hibernate.boot.spi.BootstrapContext; import org.hibernate.boot.spi.BootstrapContext;
import org.hibernate.boot.spi.ClassLoaderAccess; import org.hibernate.boot.spi.ClassLoaderAccess;
import org.hibernate.boot.spi.ClassmateContext;
import org.hibernate.boot.spi.MetadataBuildingOptions; import org.hibernate.boot.spi.MetadataBuildingOptions;
import org.hibernate.cfg.AvailableSettings; import org.hibernate.cfg.AvailableSettings;
import org.hibernate.engine.config.spi.ConfigurationService; import org.hibernate.engine.config.spi.ConfigurationService;

View File

@ -6,7 +6,7 @@ package org.hibernate.boot.model.convert.internal;
import java.util.List; import java.util.List;
import org.hibernate.boot.internal.ClassmateContext; import org.hibernate.boot.spi.ClassmateContext;
import org.hibernate.boot.model.convert.spi.AutoApplicableConverterDescriptor; import org.hibernate.boot.model.convert.spi.AutoApplicableConverterDescriptor;
import org.hibernate.boot.model.convert.spi.ConverterDescriptor; import org.hibernate.boot.model.convert.spi.ConverterDescriptor;
import org.hibernate.boot.model.convert.spi.JpaAttributeConverterCreationContext; import org.hibernate.boot.model.convert.spi.JpaAttributeConverterCreationContext;

View File

@ -4,7 +4,7 @@
*/ */
package org.hibernate.boot.model.convert.internal; package org.hibernate.boot.model.convert.internal;
import org.hibernate.boot.internal.ClassmateContext; import org.hibernate.boot.spi.ClassmateContext;
import org.hibernate.boot.model.convert.spi.JpaAttributeConverterCreationContext; import org.hibernate.boot.model.convert.spi.JpaAttributeConverterCreationContext;
import org.hibernate.resource.beans.spi.ManagedBean; import org.hibernate.resource.beans.spi.ManagedBean;

View File

@ -12,7 +12,7 @@ import java.util.List;
import org.hibernate.AnnotationException; import org.hibernate.AnnotationException;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.boot.internal.ClassmateContext; import org.hibernate.boot.spi.ClassmateContext;
import org.hibernate.boot.spi.MetadataBuildingContext; import org.hibernate.boot.spi.MetadataBuildingContext;
import org.hibernate.internal.util.GenericsHelper; import org.hibernate.internal.util.GenericsHelper;
import org.hibernate.internal.util.type.PrimitiveWrapperHelper; import org.hibernate.internal.util.type.PrimitiveWrapperHelper;

View File

@ -4,7 +4,7 @@
*/ */
package org.hibernate.boot.model.convert.internal; package org.hibernate.boot.model.convert.internal;
import org.hibernate.boot.internal.ClassmateContext; import org.hibernate.boot.spi.ClassmateContext;
import org.hibernate.boot.model.convert.spi.JpaAttributeConverterCreationContext; import org.hibernate.boot.model.convert.spi.JpaAttributeConverterCreationContext;
import org.hibernate.resource.beans.spi.ManagedBean; import org.hibernate.resource.beans.spi.ManagedBean;
import org.hibernate.resource.beans.spi.ProvidedInstanceManagedBeanImpl; import org.hibernate.resource.beans.spi.ProvidedInstanceManagedBeanImpl;

View File

@ -11,7 +11,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.hibernate.AnnotationException; import org.hibernate.AnnotationException;
import org.hibernate.boot.internal.ClassmateContext; import org.hibernate.boot.spi.ClassmateContext;
import org.hibernate.boot.jaxb.mapping.spi.JaxbConverterImpl; import org.hibernate.boot.jaxb.mapping.spi.JaxbConverterImpl;
import org.hibernate.boot.jaxb.mapping.spi.JaxbEntityImpl; import org.hibernate.boot.jaxb.mapping.spi.JaxbEntityImpl;
import org.hibernate.boot.jaxb.mapping.spi.JaxbEntityListenerContainerImpl; import org.hibernate.boot.jaxb.mapping.spi.JaxbEntityListenerContainerImpl;

View File

@ -8,7 +8,7 @@ import java.lang.annotation.Annotation;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import org.hibernate.boot.internal.ClassmateContext; import org.hibernate.boot.spi.ClassmateContext;
import org.hibernate.boot.model.convert.internal.AutoApplicableConverterDescriptorBypassedImpl; import org.hibernate.boot.model.convert.internal.AutoApplicableConverterDescriptorBypassedImpl;
import org.hibernate.boot.model.convert.internal.AutoApplicableConverterDescriptorStandardImpl; import org.hibernate.boot.model.convert.internal.AutoApplicableConverterDescriptorStandardImpl;
import org.hibernate.boot.model.convert.internal.ConverterHelper; import org.hibernate.boot.model.convert.internal.ConverterHelper;

View File

@ -13,8 +13,6 @@ import org.hibernate.boot.Metadata;
import org.hibernate.boot.archive.scan.spi.ScanEnvironment; import org.hibernate.boot.archive.scan.spi.ScanEnvironment;
import org.hibernate.boot.archive.scan.spi.ScanOptions; import org.hibernate.boot.archive.scan.spi.ScanOptions;
import org.hibernate.boot.archive.spi.ArchiveDescriptorFactory; import org.hibernate.boot.archive.spi.ArchiveDescriptorFactory;
import org.hibernate.boot.internal.ClassmateContext;
import org.hibernate.boot.internal.TypeBeanInstanceProducer;
import org.hibernate.boot.model.convert.spi.ConverterDescriptor; import org.hibernate.boot.model.convert.spi.ConverterDescriptor;
import org.hibernate.boot.model.relational.AuxiliaryDatabaseObject; import org.hibernate.boot.model.relational.AuxiliaryDatabaseObject;
import org.hibernate.boot.registry.StandardServiceRegistry; import org.hibernate.boot.registry.StandardServiceRegistry;
@ -62,7 +60,7 @@ public interface BootstrapContext {
/** /**
* The {@link BeanInstanceProducer} to use when creating custom type references. * The {@link BeanInstanceProducer} to use when creating custom type references.
* *
* @implNote Usually a {@link TypeBeanInstanceProducer}. * @implNote Usually a {@link org.hibernate.boot.internal.TypeBeanInstanceProducer}.
*/ */
BeanInstanceProducer getCustomTypeProducer(); BeanInstanceProducer getCustomTypeProducer();
@ -105,9 +103,8 @@ public interface BootstrapContext {
/** /**
* Access to the shared {@link ClassmateContext} object used * Access to the shared {@link ClassmateContext} object used
* throughout the bootstrap process. * throughout the bootstrap process.
*
* @return Access to the shared {@link ClassmateContext} delegates.
*/ */
@Incubating
ClassmateContext getClassmateContext(); ClassmateContext getClassmateContext();
/** /**

View File

@ -2,14 +2,18 @@
* SPDX-License-Identifier: LGPL-2.1-or-later * SPDX-License-Identifier: LGPL-2.1-or-later
* Copyright Red Hat Inc. and Hibernate Authors * Copyright Red Hat Inc. and Hibernate Authors
*/ */
package org.hibernate.boot.internal; package org.hibernate.boot.spi;
import com.fasterxml.classmate.MemberResolver; import com.fasterxml.classmate.MemberResolver;
import com.fasterxml.classmate.TypeResolver; import com.fasterxml.classmate.TypeResolver;
import org.hibernate.Incubating;
/** /**
* Exposes the Classmate {@link TypeResolver} and {@link MemberResolver}.
*
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@Incubating
public class ClassmateContext { public class ClassmateContext {
private TypeResolver typeResolver = new TypeResolver(); private TypeResolver typeResolver = new TypeResolver();
private MemberResolver memberResolver = new MemberResolver( typeResolver ); private MemberResolver memberResolver = new MemberResolver( typeResolver );

View File

@ -26,7 +26,7 @@ import org.hibernate.boot.Metadata;
import org.hibernate.boot.MetadataBuilder; import org.hibernate.boot.MetadataBuilder;
import org.hibernate.boot.MetadataSources; import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.SessionFactoryBuilder; import org.hibernate.boot.SessionFactoryBuilder;
import org.hibernate.boot.internal.ClassmateContext; import org.hibernate.boot.spi.ClassmateContext;
import org.hibernate.boot.jaxb.spi.Binding; import org.hibernate.boot.jaxb.spi.Binding;
import org.hibernate.boot.model.FunctionContributor; import org.hibernate.boot.model.FunctionContributor;
import org.hibernate.boot.model.NamedEntityGraphDefinition; import org.hibernate.boot.model.NamedEntityGraphDefinition;

View File

@ -26,7 +26,7 @@ import org.hibernate.boot.beanvalidation.BeanValidationIntegrator;
import org.hibernate.boot.cfgxml.spi.CfgXmlAccessService; import org.hibernate.boot.cfgxml.spi.CfgXmlAccessService;
import org.hibernate.boot.cfgxml.spi.LoadedConfig; import org.hibernate.boot.cfgxml.spi.LoadedConfig;
import org.hibernate.boot.cfgxml.spi.MappingReference; import org.hibernate.boot.cfgxml.spi.MappingReference;
import org.hibernate.boot.internal.ClassmateContext; import org.hibernate.boot.spi.ClassmateContext;
import org.hibernate.boot.jaxb.hbm.spi.JaxbHbmHibernateMapping; import org.hibernate.boot.jaxb.hbm.spi.JaxbHbmHibernateMapping;
import org.hibernate.boot.jaxb.hbm.spi.JaxbHbmRootEntityType; import org.hibernate.boot.jaxb.hbm.spi.JaxbHbmRootEntityType;
import org.hibernate.boot.jaxb.spi.Binding; import org.hibernate.boot.jaxb.spi.Binding;

View File

@ -17,7 +17,7 @@ import org.hibernate.TimeZoneStorageStrategy;
import org.hibernate.annotations.SoftDelete; import org.hibernate.annotations.SoftDelete;
import org.hibernate.annotations.SoftDeleteType; import org.hibernate.annotations.SoftDeleteType;
import org.hibernate.annotations.TimeZoneStorageType; import org.hibernate.annotations.TimeZoneStorageType;
import org.hibernate.boot.internal.ClassmateContext; import org.hibernate.boot.spi.ClassmateContext;
import org.hibernate.boot.model.TypeDefinition; import org.hibernate.boot.model.TypeDefinition;
import org.hibernate.boot.model.convert.internal.AutoApplicableConverterDescriptorBypassedImpl; import org.hibernate.boot.model.convert.internal.AutoApplicableConverterDescriptorBypassedImpl;
import org.hibernate.boot.model.convert.internal.InstanceBasedConverterDescriptor; import org.hibernate.boot.model.convert.internal.InstanceBasedConverterDescriptor;

View File

@ -16,7 +16,7 @@ import org.hibernate.boot.archive.scan.spi.ScanEnvironment;
import org.hibernate.boot.archive.scan.spi.ScanOptions; import org.hibernate.boot.archive.scan.spi.ScanOptions;
import org.hibernate.boot.archive.spi.ArchiveDescriptorFactory; import org.hibernate.boot.archive.spi.ArchiveDescriptorFactory;
import org.hibernate.boot.internal.ClassLoaderAccessImpl; import org.hibernate.boot.internal.ClassLoaderAccessImpl;
import org.hibernate.boot.internal.ClassmateContext; import org.hibernate.boot.spi.ClassmateContext;
import org.hibernate.boot.internal.TypeBeanInstanceProducer; import org.hibernate.boot.internal.TypeBeanInstanceProducer;
import org.hibernate.boot.model.convert.spi.ConverterDescriptor; import org.hibernate.boot.model.convert.spi.ConverterDescriptor;
import org.hibernate.boot.model.relational.AuxiliaryDatabaseObject; import org.hibernate.boot.model.relational.AuxiliaryDatabaseObject;

View File

@ -25,7 +25,7 @@ import org.hibernate.boot.archive.scan.spi.ScanParameters;
import org.hibernate.boot.archive.scan.spi.ScanResult; import org.hibernate.boot.archive.scan.spi.ScanResult;
import org.hibernate.boot.archive.scan.spi.Scanner; import org.hibernate.boot.archive.scan.spi.Scanner;
import org.hibernate.boot.archive.spi.InputStreamAccess; import org.hibernate.boot.archive.spi.InputStreamAccess;
import org.hibernate.boot.internal.ClassmateContext; import org.hibernate.boot.spi.ClassmateContext;
import org.hibernate.boot.model.convert.spi.ConverterDescriptor; import org.hibernate.boot.model.convert.spi.ConverterDescriptor;
import org.hibernate.boot.model.process.internal.ManagedResourcesImpl; import org.hibernate.boot.model.process.internal.ManagedResourcesImpl;
import org.hibernate.boot.model.process.internal.ScanningCoordinator; import org.hibernate.boot.model.process.internal.ScanningCoordinator;

View File

@ -13,7 +13,7 @@ import org.hibernate.IrrelevantEntity;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.SessionFactory; import org.hibernate.SessionFactory;
import org.hibernate.boot.MetadataSources; import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.internal.ClassmateContext; import org.hibernate.boot.spi.ClassmateContext;
import org.hibernate.boot.model.convert.internal.InstanceBasedConverterDescriptor; import org.hibernate.boot.model.convert.internal.InstanceBasedConverterDescriptor;
import org.hibernate.boot.registry.StandardServiceRegistry; import org.hibernate.boot.registry.StandardServiceRegistry;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.boot.registry.StandardServiceRegistryBuilder;

View File

@ -11,7 +11,7 @@ import org.hibernate.boot.CacheRegionDefinition;
import org.hibernate.boot.archive.scan.spi.ScanEnvironment; import org.hibernate.boot.archive.scan.spi.ScanEnvironment;
import org.hibernate.boot.archive.scan.spi.ScanOptions; import org.hibernate.boot.archive.scan.spi.ScanOptions;
import org.hibernate.boot.archive.spi.ArchiveDescriptorFactory; import org.hibernate.boot.archive.spi.ArchiveDescriptorFactory;
import org.hibernate.boot.internal.ClassmateContext; import org.hibernate.boot.spi.ClassmateContext;
import org.hibernate.boot.internal.MetadataBuilderImpl; import org.hibernate.boot.internal.MetadataBuilderImpl;
import org.hibernate.boot.model.convert.spi.ConverterDescriptor; import org.hibernate.boot.model.convert.spi.ConverterDescriptor;
import org.hibernate.boot.model.relational.AuxiliaryDatabaseObject; import org.hibernate.boot.model.relational.AuxiliaryDatabaseObject;