HHH-12133 - Create ManagedBeanRegistry and ManagedBean

- reapplied backwards compatibility wrt ExtendedBeanManager for WildFly
This commit is contained in:
Steve Ebersole 2018-01-16 14:30:09 -06:00
parent 3fbe7ff5b7
commit 2e541f3b15
3 changed files with 18 additions and 2 deletions

View File

@ -11,4 +11,17 @@ package org.hibernate.jpa.event.spi.jpa;
*/ */
@Deprecated @Deprecated
public interface ExtendedBeanManager extends org.hibernate.resource.beans.container.spi.ExtendedBeanManager { public interface ExtendedBeanManager extends org.hibernate.resource.beans.container.spi.ExtendedBeanManager {
void registerLifecycleListener(LifecycleListener lifecycleListener);
@Override
default void registerLifecycleListener(org.hibernate.resource.beans.container.spi.ExtendedBeanManager.LifecycleListener lifecycleListener) {
registerLifecycleListener( (LifecycleListener) lifecycleListener );
}
/**
* @deprecated Use {@link org.hibernate.resource.beans.container.spi.ExtendedBeanManager.LifecycleListener} instead
*/
@Deprecated
interface LifecycleListener extends org.hibernate.resource.beans.container.spi.ExtendedBeanManager.LifecycleListener {
}
} }

View File

@ -35,7 +35,7 @@ public class CdiBeanContainerBuilder {
private static final String CONTAINER_FQN_DELAYED = "org.hibernate.resource.beans.container.internal.CdiBeanContainerDelayedAccessImpl"; private static final String CONTAINER_FQN_DELAYED = "org.hibernate.resource.beans.container.internal.CdiBeanContainerDelayedAccessImpl";
private static final String CONTAINER_FQN_EXTENDED = "org.hibernate.resource.beans.container.internal.CdiBeanContainerExtendedAccessImpl"; private static final String CONTAINER_FQN_EXTENDED = "org.hibernate.resource.beans.container.internal.CdiBeanContainerExtendedAccessImpl";
private static final String BEAN_MANAGER_EXTENSION_FQN = "org.hibernate.resource.beans.container.spi.ExtendedBeanManager"; private static final String BEAN_MANAGER_EXTENSION_FQN = "org.hibernate.jpa.event.spi.jpa.ExtendedBeanManager";
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static BeanContainerImplementor fromBeanManagerReference( public static BeanContainerImplementor fromBeanManagerReference(

View File

@ -8,11 +8,11 @@ package org.hibernate.resource.beans.container.internal;
import javax.enterprise.inject.spi.BeanManager; import javax.enterprise.inject.spi.BeanManager;
import org.hibernate.jpa.event.spi.jpa.ExtendedBeanManager;
import org.hibernate.resource.beans.container.spi.AbstractBeanContainer; import org.hibernate.resource.beans.container.spi.AbstractBeanContainer;
import org.hibernate.resource.beans.container.spi.BeanLifecycleStrategy; import org.hibernate.resource.beans.container.spi.BeanLifecycleStrategy;
import org.hibernate.resource.beans.container.spi.ContainedBean; import org.hibernate.resource.beans.container.spi.ContainedBean;
import org.hibernate.resource.beans.container.spi.ContainedBeanImplementor; import org.hibernate.resource.beans.container.spi.ContainedBeanImplementor;
import org.hibernate.resource.beans.container.spi.ExtendedBeanManager;
import org.hibernate.resource.beans.internal.Helper; import org.hibernate.resource.beans.internal.Helper;
import org.hibernate.resource.beans.spi.BeanInstanceProducer; import org.hibernate.resource.beans.spi.BeanInstanceProducer;
@ -25,6 +25,9 @@ import org.jboss.logging.Logger;
public class CdiBeanContainerExtendedAccessImpl public class CdiBeanContainerExtendedAccessImpl
extends AbstractBeanContainer extends AbstractBeanContainer
implements ExtendedBeanManager.LifecycleListener { implements ExtendedBeanManager.LifecycleListener {
// NOTE : we continue to use the deprecated form for now since that is what WildFly needs for the time being still
private static final Logger log = Logger.getLogger( CdiBeanContainerExtendedAccessImpl.class ); private static final Logger log = Logger.getLogger( CdiBeanContainerExtendedAccessImpl.class );
private BeanManager usableBeanManager; private BeanManager usableBeanManager;