From 86cde1296bc6a40fd06a006d997c79de9621764d Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Mon, 18 Dec 2017 09:45:21 -0600 Subject: [PATCH] HHH-12133 - Create ManagedBeanRegistry and ManagedBean - mostly just backporting this work from 6.0 --- .../resource/beans/internal/CompositeManagedBeanRegistry.java | 4 ++++ .../org/hibernate/resource/beans/spi/ManagedBeanRegistry.java | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/hibernate-core/src/main/java/org/hibernate/resource/beans/internal/CompositeManagedBeanRegistry.java b/hibernate-core/src/main/java/org/hibernate/resource/beans/internal/CompositeManagedBeanRegistry.java index 02793165bb..be44d26b70 100644 --- a/hibernate-core/src/main/java/org/hibernate/resource/beans/internal/CompositeManagedBeanRegistry.java +++ b/hibernate-core/src/main/java/org/hibernate/resource/beans/internal/CompositeManagedBeanRegistry.java @@ -86,6 +86,10 @@ public class CompositeManagedBeanRegistry return fallback.getBean( beanName, beanContract,shouldRegistryManageLifecycle ); } + @Override + public ManagedBeanRegistry getPrimaryBeanRegistry() { + return primaryRegistry; + } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Optional delegation diff --git a/hibernate-core/src/main/java/org/hibernate/resource/beans/spi/ManagedBeanRegistry.java b/hibernate-core/src/main/java/org/hibernate/resource/beans/spi/ManagedBeanRegistry.java index 1846383014..3e9cd05753 100644 --- a/hibernate-core/src/main/java/org/hibernate/resource/beans/spi/ManagedBeanRegistry.java +++ b/hibernate-core/src/main/java/org/hibernate/resource/beans/spi/ManagedBeanRegistry.java @@ -46,4 +46,8 @@ public interface ManagedBeanRegistry extends Service { * the release calls itself. */ ManagedBean getBean(String beanName, Class beanContract, boolean shouldRegistryManageLifecycle); + + default ManagedBeanRegistry getPrimaryBeanRegistry() { + return this; + } }