Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 7453 invoked from network); 14 Mar 2007 20:50:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Mar 2007 20:50:46 -0000 Received: (qmail 5696 invoked by uid 500); 14 Mar 2007 20:50:54 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 5672 invoked by uid 99); 14 Mar 2007 20:50:54 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Mar 2007 13:50:54 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Mar 2007 13:50:45 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 352D171407D for ; Wed, 14 Mar 2007 13:50:10 -0700 (PDT) Message-ID: <5417262.1173905410215.JavaMail.jira@brutus> Date: Wed, 14 Mar 2007 13:50:10 -0700 (PDT) From: "Craig Russell (JIRA)" To: jdo-dev@db.apache.org Subject: [jira] Assigned: (JDO-467) Named PMF proposal / JDOHelper enhancements In-Reply-To: <25999101.1172283185837.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JDO-467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Craig Russell reassigned JDO-467: --------------------------------- Assignee: Matthew T. Adams > Named PMF proposal / JDOHelper enhancements > ------------------------------------------- > > Key: JDO-467 > URL: https://issues.apache.org/jira/browse/JDO-467 > Project: JDO > Issue Type: New Feature > Components: api2, api2-legacy > Affects Versions: JDO 2 final > Reporter: Matthew T. Adams > Assigned To: Matthew T. Adams > Fix For: JDO 2 maintenance release 1 > > Attachments: JDO-467.patch.txt, jdo-config.xsd.version-01.txt, jdoconfig.xsd > > > From the email on the expert group & jdo-dev alias: > This is a proposal we discussed on the Fri Feb 23 JDO conf call. Please > review and discuss. > Overview: > Currently, there is no way to bootstrap a JDO implementation completely > externally to the source code. The developer is required to provide at > least a resource name that identifies a java.util.Properties file on the > classpath that can configure a single PMF. This makes deployment in > different environments more challenging than necessary. > Motivation: > * Source code is required to be aware of external configuration: > * In all current JDOHelper.getPersistenceManagerFactory APIs and > * in order to configure listeners. > * Aligns JDO bootstrapping with JPA bootstrapping concepts. > Proposed Solution: > * Introduce new API methods and JDO equivalent of the JPA persistence > unit concepts, including a jdo.xml file that provides for the > configuration of one or more named PMFs. > Details: > * PersistenceManagerFactory additions > /** Returns the persistence unit name of this PMF. It's the JPA > persistence unit name if configured via persistence.xml or the JDO > persistence unit name if configured via javax.jdo.xml. */ > public String getName(); > * JDOHelper API additions > /** The default name of the JDO configuration file. */ > public static final String DEFAULT_JDO_CONFIG_RESOURCE_NAME = > "javax.jdo.xml"; > /** The name of the default persistence unit. */ > public static final String DEFAULT_PMF_NAME = "default"; > /** Gets the PMF named "default" in the resource "javax.jdo.xml" found > via the current ClassLoader. */ > public static PersistenceManagerFactory getPersistenceFactoryManager() { > return getPersistenceFactoryManagerByName(DEFAULT_PMF_NAME); > } > /** Gets the PMF named pmfName in the resource "javax.jdo.xml" found via > the current ClassLoader. */ > public static PersistenceManagerFactory > getPersistenceManagerFactoryByName(String pmfName) { > return getPersistenceFactoryManagerByName(DEFAULT_PMF_NAME, > DEFAULT_JDO_CONFIG_RESOURCE_NAME); > } > /** Gets the PMF named pmfName in the resource named resourceName found > via the current ClassLoader. */ > public static PersistenceManagerFactory > getPersistenceManagerFactoryByName(String pmfName, String resourceName) > { > return getPersistenceFactoryManagerByName(DEFAULT_PMF_NAME, > DEFAULT_JDO_CONFIG_RESOURCE_NAME, getClass().getClassLoader()); > } > /** Gets the PMF named pmfName in the resource named resourceName found > via the current ClassLoader. */ > public static PersistenceManagerFactory > getPersistenceManagerFactoryByName(String pmfName, String resourceName, > ClassLoader loader) { > // reads resource resourceName via given loader > // configures & returns PMF with the given name > } > * Possibilities for DEFAULT_JDO_CONFIG_RESOURCE_NAME value: > need to determine file name (similar to persistence.xml) > javax.jdo.xml > jdo.xml > ... > * Proposal for JDO persistence unit configuration XML file > * Could be more like Spring beans.xml (supporting references, etc.) > * Note: Square brackets indicate optional elements/attributes > > [ elements wherever appropriate] > > > > [name="default"] > [resource="..."] > > [class="xcalia.ic.jdo.PersistenceManagerFactory"] > [connection-driver="..."] > [connection-url="..."] > [connection-user-name="..."] > [connection-password="..."] > [...] > > > > [] > [] > [] > [...] > > > > javax.jdo....=... > javax.jdo....=... > xcalia.ic....=... > ... > ]]> > > > > > [ listener-class="my.jdo.InstanceListener" > classes-observed="my.domain.Foo,my.domain.Bar,.." > [static-factory-method="..."] > [pre-attach="preAttach"] > [post-attach="postAttach"] > [pre-store="preStore"] > [...] > />] > > > [ class="..." > [factory-method="..."] > [pre-attach="preAttach"] > [post-attach="postAttach"] > />] > [...] > > > resources="META-INF/production-1;META-INF/production-2;..."/> > > > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.