Interface BytecodeProvider

All Superinterfaces:
Serializable, Service

@JavaServiceLoadable public interface BytecodeProvider extends Service
Contract for providers of bytecode services to Hibernate.

Bytecode requirements break down into the following areas

  1. proxy generation (both for runtime-lazy-loading and basic proxy generation) getProxyFactoryFactory()
  • Method Details

    • getProxyFactoryFactory

      @Nonnull ProxyFactoryFactory getProxyFactoryFactory()
      Retrieve the specific factory for this provider capable of generating run-time proxies for lazy-loading purposes.
      Returns:
      The provider specific factory.
    • createEnhancementSession

      @Nonnull EnhancementSession createEnhancementSession(EnhancementModel model, EnhancementEnvironment environment)
      Creates a privately owned session for a stable model and bytecode environment.
    • resetCaches

      default void resetCaches()
      Some BytecodeProvider implementations will have classloader specific caching. These caches are useful at runtime but need to be reset at least on SessionFactory shutdown to prevent leaking the deployment classloader. Since the BytecodeProvider is static these caches are potentially shared across multiple deployments; in this case we'll clear all caches which might show as a small, temporary performance degradation on the SessionFactory instances which haven't been closed. This limitation will be removed in the future, when these providers will no longer be static.