diff options
Diffstat (limited to 'utils/src/main/java/org/onap/policy/common/utils/jpa/EntityMgrFactoryCloser.java')
-rw-r--r-- | utils/src/main/java/org/onap/policy/common/utils/jpa/EntityMgrFactoryCloser.java | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/utils/src/main/java/org/onap/policy/common/utils/jpa/EntityMgrFactoryCloser.java b/utils/src/main/java/org/onap/policy/common/utils/jpa/EntityMgrFactoryCloser.java index 8910c087..b046cc55 100644 --- a/utils/src/main/java/org/onap/policy/common/utils/jpa/EntityMgrFactoryCloser.java +++ b/utils/src/main/java/org/onap/policy/common/utils/jpa/EntityMgrFactoryCloser.java @@ -23,37 +23,37 @@ package org.onap.policy.common.utils.jpa; import javax.persistence.EntityManagerFactory; /** - * Wrapper for an <i>EntityManagerFactory</i>, providing auto-close - * functionality. This is useful in try-with-resources statements. + * Wrapper for an <i>EntityManagerFactory</i>, providing auto-close functionality. This is useful in + * try-with-resources statements. */ public class EntityMgrFactoryCloser implements AutoCloseable { - /** - * The wrapped factory. - */ - private final EntityManagerFactory emf; - - /** - * - * @param emf - * manager to be auto-closed - */ - public EntityMgrFactoryCloser(EntityManagerFactory emf) { - this.emf = emf; - } - - /** - * Gets the EntityManagerFactory wrapped within this object. - * - * @return the associated EntityManagerFactory - */ - public EntityManagerFactory getFactory() { - return emf; - } - - @Override - public void close() { - emf.close(); - } + /** + * The wrapped factory. + */ + private final EntityManagerFactory emf; + + /** + * Construct an instance with the given EntityManagerFactory. + * + * @param emf manager to be auto-closed + */ + public EntityMgrFactoryCloser(EntityManagerFactory emf) { + this.emf = emf; + } + + /** + * Gets the EntityManagerFactory wrapped within this object. + * + * @return the associated EntityManagerFactory + */ + public EntityManagerFactory getFactory() { + return emf; + } + + @Override + public void close() { + emf.close(); + } } |