Class EntityManagerFactoryProxy
- java.lang.Object
-
- org.hotswap.agent.plugin.hibernate.proxy.EntityManagerFactoryProxy
-
public class EntityManagerFactoryProxy extends java.lang.ObjectCreate a proxy for EntityManagerFactory and register all created proxies. Provide static method to reload a proxied factory. This class must run in App classloader.- Author:
- Jiri Bubnik
-
-
Constructor Summary
Constructors Constructor Description EntityManagerFactoryProxy()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EntityManagerFactoryProxygetWrapper(java.lang.String persistenceUnitName)Create new wrapper for persistenceUnitName and hold it's instance for future use.javax.persistence.EntityManagerFactoryproxy(java.lang.Object builder, javax.persistence.EntityManagerFactory factory, java.lang.String persistenceUnitName, javax.persistence.spi.PersistenceUnitInfo info, java.util.Map properties)Create a proxy for EntityManagerFactory.static voidrefreshProxiedFactories()Refresh all known wrapped factories.voidrefreshProxiedFactory()Refresh a single persistence unit - replace the wrapped EntityManagerFactory with fresh instance.voidrefreshProxiedFactoryVersion43OrGreater()
-
-
-
Method Detail
-
getWrapper
public static EntityManagerFactoryProxy getWrapper(java.lang.String persistenceUnitName)
Create new wrapper for persistenceUnitName and hold it's instance for future use.- Parameters:
persistenceUnitName- key to the wrapper- Returns:
- existing wrapper or new instance (never null)
-
refreshProxiedFactories
public static void refreshProxiedFactories()
Refresh all known wrapped factories.
-
refreshProxiedFactoryVersion43OrGreater
public void refreshProxiedFactoryVersion43OrGreater()
-
refreshProxiedFactory
public void refreshProxiedFactory() throws java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException, java.lang.NoSuchFieldExceptionRefresh a single persistence unit - replace the wrapped EntityManagerFactory with fresh instance.- Throws:
java.lang.NoSuchMethodExceptionjava.lang.reflect.InvocationTargetExceptionjava.lang.IllegalAccessExceptionjava.lang.NoSuchFieldException
-
proxy
public javax.persistence.EntityManagerFactory proxy(java.lang.Object builder, javax.persistence.EntityManagerFactory factory, java.lang.String persistenceUnitName, javax.persistence.spi.PersistenceUnitInfo info, java.util.Map properties)Create a proxy for EntityManagerFactory.- Parameters:
factory- initial factory to delegate method calls to.info- definition to cache for factory reloadproperties- properties to cache for factory reload- Returns:
- the proxy
-
-