/** * Returns a named {@link PersistenceManagerFactory} or persistence * unit. * * @since 2.1 * @see #getPersistenceManagerFactory(Map,String,ClassLoader,ClassLoader) */ public static PersistenceManagerFactory getPersistenceManagerFactory (Map<?, ?> overrides, String name) { ClassLoader cl = getContextClassLoader(); return getPersistenceManagerFactory(overrides, name, cl, cl); }
/** * Get a <code>JDOEnhancer</code> using the available enhancer(s) specified in * "META-INF/services/JDOEnhancer" using the context class loader. * @return the <code>JDOEnhancer</code>. * @throws JDOFatalUserException if no available enhancer * @since 3.0 */ public static JDOEnhancer getEnhancer() { return getEnhancer(getContextClassLoader()); }
/** Get the anonymous <code>PersistenceManagerFactory</code> configured via * the standard configuration file resource "META-INF/jdoconfig.xml", using * the current thread's context class loader * to locate the configuration file resource(s). * @return the anonymous <code>PersistenceManagerFactory</code>. * @since 2.1 * @see #getPersistenceManagerFactory(Map,String,ClassLoader,ClassLoader) */ public static PersistenceManagerFactory getPersistenceManagerFactory() { ClassLoader cl = getContextClassLoader(); return getPersistenceManagerFactory( null, ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME, cl, cl); }
/** * Returns a named {@link PersistenceManagerFactory} or persistence * unit. * * @since 2.1 * @see #getPersistenceManagerFactory(Map,String,ClassLoader,ClassLoader) */ public static PersistenceManagerFactory getPersistenceManagerFactory (String name) { ClassLoader cl = getContextClassLoader(); return getPersistenceManagerFactory(null, name, cl, cl); }
/** * Returns a named {@link PersistenceManagerFactory} or persistence unit. * @since 2.1 * @see #getPersistenceManagerFactory(Map,String,ClassLoader,ClassLoader) * @param name Name of the PMF * @return PersistenceManagerFactory */ public static PersistenceManagerFactory getPersistenceManagerFactory (String name) { ClassLoader cl = getContextClassLoader(); return getPersistenceManagerFactory(null, name, cl, cl); }
/** * Get a <code>JDOEnhancer</code> using the available enhancer(s) specified in * "META-INF/services/JDOEnhancer" using the context class loader. * @return the <code>JDOEnhancer</code>. * @throws JDOFatalUserException if no available enhancer * @since 3.0 */ public static JDOEnhancer getEnhancer() { return getEnhancer(getContextClassLoader()); }
/** Get a <code>PersistenceManagerFactory</code> based on a <code>Properties</code> * instance, using the current thread's context class loader to locate the * <code>PersistenceManagerFactory</code> class. * @return the <code>PersistenceManagerFactory</code>. * @param props a <code>Properties</code> instance with properties of the * <code>PersistenceManagerFactory</code>. * @see #getPersistenceManagerFactory(java.util.Map,ClassLoader) */ public static PersistenceManagerFactory getPersistenceManagerFactory (Map<?, ?> props) { return getPersistenceManagerFactory( null, props, getContextClassLoader()); }
/** * Returns a named {@link PersistenceManagerFactory} or persistence unit. * @since 2.1 * @see #getPersistenceManagerFactory(Map,String,ClassLoader,ClassLoader) * @param name Name of the PMF * @param overrides Property overrides * @return PersistenceManagerFactory */ public static PersistenceManagerFactory getPersistenceManagerFactory (Map<?, ?> overrides, String name) { ClassLoader cl = getContextClassLoader(); return getPersistenceManagerFactory(overrides, name, cl, cl); }
/** Get the anonymous <code>PersistenceManagerFactory</code> configured via * the standard configuration file resource "META-INF/jdoconfig.xml", using * the current thread's context class loader * to locate the configuration file resource(s). * @return the anonymous <code>PersistenceManagerFactory</code>. * @since 2.1 * @see #getPersistenceManagerFactory(Map,String,ClassLoader,ClassLoader) */ public static PersistenceManagerFactory getPersistenceManagerFactory() { ClassLoader cl = getContextClassLoader(); return getPersistenceManagerFactory( null, ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME, cl, cl); }
/** Get a <code>PersistenceManagerFactory</code> based on a <code>Properties</code> * instance, using the current thread's context class loader to locate the * <code>PersistenceManagerFactory</code> class. * @return the <code>PersistenceManagerFactory</code>. * @param props a <code>Properties</code> instance with properties of the * <code>PersistenceManagerFactory</code>. * @see #getPersistenceManagerFactory(java.util.Map,ClassLoader) */ public static PersistenceManagerFactory getPersistenceManagerFactory (Map<?, ?> props) { return getPersistenceManagerFactory( null, props, getContextClassLoader()); }
/** * Returns a {@link PersistenceManagerFactory} configured based * on the properties stored in the file at * <code>propsFile</code>. This method is equivalent to * invoking {@link * #getPersistenceManagerFactory(File,ClassLoader)} with * <code>Thread.currentThread().getContextClassLoader()</code> as * the <code>loader</code> argument. * @since 2.0 * @param propsFile the file containing the Properties * @return the PersistenceManagerFactory */ public static PersistenceManagerFactory getPersistenceManagerFactory (File propsFile) { return getPersistenceManagerFactory( propsFile, getContextClassLoader()); }
/** * Returns a {@link PersistenceManagerFactory} configured based * on the Properties stored in the input stream at * <code>stream</code>. This method is equivalent to * invoking {@link * #getPersistenceManagerFactory(InputStream,ClassLoader)} with * <code>Thread.currentThread().getContextClassLoader()</code> as * the <code>loader</code> argument. * @since 2.0 * @param stream the stream containing the Properties * @return the PersistenceManagerFactory */ public static PersistenceManagerFactory getPersistenceManagerFactory (InputStream stream) { return getPersistenceManagerFactory( stream, getContextClassLoader()); }
/** * Returns a {@link PersistenceManagerFactory} configured based * on the Properties stored in the input stream at * <code>stream</code>. This method is equivalent to * invoking {@link * #getPersistenceManagerFactory(InputStream,ClassLoader)} with * <code>Thread.currentThread().getContextClassLoader()</code> as * the <code>loader</code> argument. * @since 2.0 * @param stream the stream containing the Properties * @return the PersistenceManagerFactory */ public static PersistenceManagerFactory getPersistenceManagerFactory (InputStream stream) { return getPersistenceManagerFactory( stream, getContextClassLoader()); }
/** * Returns a {@link PersistenceManagerFactory} configured based * on the properties stored in the file at * <code>propsFile</code>. This method is equivalent to * invoking {@link * #getPersistenceManagerFactory(File,ClassLoader)} with * <code>Thread.currentThread().getContextClassLoader()</code> as * the <code>loader</code> argument. * @since 2.0 * @param propsFile the file containing the Properties * @return the PersistenceManagerFactory */ public static PersistenceManagerFactory getPersistenceManagerFactory (File propsFile) { return getPersistenceManagerFactory( propsFile, getContextClassLoader()); }
/** * Returns a {@link PersistenceManagerFactory} at the JNDI * location specified by <code>jndiLocation</code> in the context * <code>context</code>. If <code>context</code> is * <code>null</code>, <code>new InitialContext()</code> will be * used. This method is equivalent to invoking {@link * #getPersistenceManagerFactory(String,Context,ClassLoader)} * with <code>Thread.currentThread().getContextClassLoader()</code> as * the <code>loader</code> argument. * @since 2.0 * @param jndiLocation the JNDI location containing the * PersistenceManagerFactory * @param context the context in which to find the named * PersistenceManagerFactory * @return the PersistenceManagerFactory */ public static PersistenceManagerFactory getPersistenceManagerFactory (String jndiLocation, Context context) { return getPersistenceManagerFactory (jndiLocation, context, getContextClassLoader()); }
/** * Returns a {@link PersistenceManagerFactory} at the JNDI * location specified by <code>jndiLocation</code> in the context * <code>context</code>. If <code>context</code> is * <code>null</code>, <code>new InitialContext()</code> will be * used. This method is equivalent to invoking {@link * #getPersistenceManagerFactory(String,Context,ClassLoader)} * with <code>Thread.currentThread().getContextClassLoader()</code> as * the <code>loader</code> argument. * @since 2.0 * @param jndiLocation the JNDI location containing the * PersistenceManagerFactory * @param context the context in which to find the named * PersistenceManagerFactory * @return the PersistenceManagerFactory */ public static PersistenceManagerFactory getPersistenceManagerFactory (String jndiLocation, Context context) { return getPersistenceManagerFactory (jndiLocation, context, getContextClassLoader()); }