db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r509809 - in /db/jdo/trunk: api20/src/java/javax/jdo/PersistenceManager.java api20/src/java/javax/jdo/PersistenceManagerFactory.java tck20/src/conf/jdo-2_0-signatures.txt
Date Tue, 20 Feb 2007 23:34:47 GMT
Author: clr
Date: Tue Feb 20 15:34:41 2007
New Revision: 509809

URL: http://svn.apache.org/viewvc?view=rev&rev=509809
Log:
JDO-445 JDO-449 JDO-462 Updated PersistenceManager and PersistenceManagerFactory with new
methods

Modified:
    db/jdo/trunk/api20/src/java/javax/jdo/PersistenceManager.java
    db/jdo/trunk/api20/src/java/javax/jdo/PersistenceManagerFactory.java
    db/jdo/trunk/tck20/src/conf/jdo-2_0-signatures.txt

Modified: db/jdo/trunk/api20/src/java/javax/jdo/PersistenceManager.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api20/src/java/javax/jdo/PersistenceManager.java?view=diff&rev=509809&r1=509808&r2=509809
==============================================================================
--- db/jdo/trunk/api20/src/java/javax/jdo/PersistenceManager.java (original)
+++ db/jdo/trunk/api20/src/java/javax/jdo/PersistenceManager.java Tue Feb 20 15:34:41 2007
@@ -23,6 +23,7 @@
 package javax.jdo;
 
 import java.util.Collection;
+import java.util.Date;
 
 import javax.jdo.datastore.JDOConnection;
 import javax.jdo.datastore.Sequence;
@@ -37,7 +38,7 @@
  * <P>A <code>PersistenceManager</code> is obtained from the
  * {@link PersistenceManagerFactory}
  * (recommended) or by construction.
- * @version 2.0
+ * @version 2.1
  */
 
 public interface PersistenceManager {
@@ -1084,4 +1085,16 @@
      * @since 2.0
      */
     void removeInstanceLifecycleListener (InstanceLifecycleListener listener);
+
+    /**
+     * Get the Date as seen by the server. 
+     * Clients using this method can order their operations according to 
+     * a single time source. Implementations use the setting of the 
+     * server time zone to prepare a Date instance that represents 
+     * UTC time on the server. 
+     * @return a Date instance corresponding to the UTC Date 
+     * as seen by the server
+     * @since 2.1
+     */
+    Date getServerDate();
 }

Modified: db/jdo/trunk/api20/src/java/javax/jdo/PersistenceManagerFactory.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api20/src/java/javax/jdo/PersistenceManagerFactory.java?view=diff&rev=509809&r1=509808&r2=509809
==============================================================================
--- db/jdo/trunk/api20/src/java/javax/jdo/PersistenceManagerFactory.java (original)
+++ db/jdo/trunk/api20/src/java/javax/jdo/PersistenceManagerFactory.java Tue Feb 20 15:34:41
2007
@@ -51,10 +51,24 @@
  * <P>Operational state (<code>PersistenceManager</code> pooling, connection

  * pooling, operational parameters) must not be serialized.
  *
- * @version 2.0
+ * @version 2.1
  */
 
 public interface PersistenceManagerFactory extends java.io.Serializable {
+
+    /** 
+     * The value for TransactionType to specify that transactions
+     * are managed by the Java Transactions API, as documented in 
+     * JSR-220.
+     */
+    public static final String JTA = "JTA";
+
+    /** 
+     * The value for TransactionType to specify that transactions
+     * are managed by the javax.jdo.Transaction instance, similar
+     * to the usage as documented in JSR-220.
+     */
+    public static final String RESOURCE_LOCAL = "RESOURCE_LOCAL";
     
     /** Close this PersistenceManagerFactory. Check for 
      * JDOPermission("closePersistenceManagerFactory") and if not authorized, 
@@ -94,6 +108,29 @@
      */
     PersistenceManager getPersistenceManager();
 
+    /** Get a thread-safe instance of a proxy that dynamically binds 
+     * on each method call to an instance of <code>PersistenceManager</code>.
+     * <P>When used with a <code>PersistenceManagerFactory</code>
+     * that uses TransactionType JTA,
+     * the proxy can be used in a server to dynamically bind to an instance 
+     * from this factory associated with the thread's current transaction.
+     * In this case, the close method is ignored, as the 
+     * <code>PersistenceManager</code> is automatically closed when the
+     * transaction completes.
+     * <P>When used with a <code>PersistenceManagerFactory</code>
+     * that uses TransactionType RESOURCE_LOCAL, the proxy uses an inheritable
+     * ThreadLocal to bind to an instance of <code>PersistenceManager</code>
+     * associated with the thread. In this case, the close method executed
+     * on the proxy closes the <code>PersistenceManager</code> and then
+     * clears the ThreadLocal.
+     * Use of this method does not affect the configurability of the
+     * <code>PersistenceManagerFactory</code>.
+     *
+     * @since 2.1
+     * @return a <code>PersistenceManager</code> proxy.
+     */
+    PersistenceManager getPersistenceManagerProxy();
+
     /** Get an instance of <code>PersistenceManager</code> from this factory.
 
      * The instance has default values for options.  
      * The parameters <code>userid</code> and <code>password</code>
are used 
@@ -329,9 +366,81 @@
      * factory.
      * @see #getDetachAllOnCommit()
      * @since 2.0
+     * @param flag the default DetachAllOnCommit setting
      */
     void setDetachAllOnCommit(boolean flag);
-    
+
+
+    /**
+     * Sets the PersistenceUnitName for this PersistenceManagerFactory.
+     * This has the same semantics as the same-named property in
+     * JSR-220 PersistenceUnitInfo.
+     * @see #getPersistenceUnitName()
+     * @since 2.1
+     * @param name the PersistenceUnitName
+     */
+    void setPersistenceUnitName(String name);
+
+    /**
+     * Gets the PersistenceUnitName for this PersistenceManagerFactory.
+     * @see #setPersistenceUnitName(String)
+     * @since 2.1
+     * @return the PersistenceUnitName
+     */
+    String getPersistenceUnitName();
+
+    /**
+     * Sets the TimeZone ID of the server associated with this
+     * PersistenceManagerFactory. The parameter is a String
+     * suitable for use with TimeZone.getTimeZone(). The String
+     * must match an ID returned by TimeZone.getAvailableIDs().
+     * If the ServerTimeZoneID is not set, or set to the null String,
+     * assume that the server has the same TimeZone ID as the client.
+     * If incorrectly set, the result of PersistenceManager.getServerDate()
+     * might be incorrect.
+     * @see #getServerTimeZoneID()
+     * @see java.util.TimeZone#getTimeZone(String)
+     * @see java.util.TimeZone#getAvailableIDs()
+     * @see PersistenceManager#getServerDate()
+     * @since 2.1
+     * @param timezoneid the TimeZone ID of the server
+     * @throws JDOUserException if the parameter does not match
+     * an ID from TimeZone.getAvailableIDs()
+     */
+    void setServerTimeZoneID(String timezoneid);
+
+    /**
+     * Gets the TimeZone ID of the server associated with this
+     * PersistenceManagerFactory. If not set, assume that
+     * the server has the same TimeZone ID as the client.
+     * @see #setServerTimeZoneID(String)
+     * @since 2.1
+     * @return the TimeZone of the server
+     */
+    String getServerTimeZoneID();
+
+    /**
+     * Sets the TransactionType for this PersistenceManagerFactory.
+     * Permitted values are "JTA" and "RESOURCE_LOCAL".
+     * This has the same semantics as the same-named property in
+     * JSR-220 EntityManagerFactory.
+     * @see #getTransactionType()
+     * @see #JTA
+     * @see #RESOURCE_LOCAL
+     * @since 2.1
+     * @param name the TransactionType
+     * @throws JDOUserException if the parameter is not a permitted value
+     */
+    void setTransactionType(String name);
+
+    /**
+     * Gets the TransactionType for this PersistenceManagerFactory.
+     * @see #setTransactionType(String)
+     * @since 2.1
+     * @return the TransactionType
+     */
+    String getTransactionType();
+
     /** Return non-configurable properties of this 
      * <code>PersistenceManagerFactory</code>.
      * Properties with keys <code>VendorName</code> and 
@@ -388,6 +497,7 @@
      * a second-level cache, the returned instance does nothing. This
      * method never returns <code>null</code>.
      * @since 2.0
+     * @return the DataStoreCache
      */
     DataStoreCache getDataStoreCache ();
 

Modified: db/jdo/trunk/tck20/src/conf/jdo-2_0-signatures.txt
URL: http://svn.apache.org/viewvc/db/jdo/trunk/tck20/src/conf/jdo-2_0-signatures.txt?view=diff&rev=509809&r1=509808&r2=509809
==============================================================================
--- db/jdo/trunk/tck20/src/conf/jdo-2_0-signatures.txt (original)
+++ db/jdo/trunk/tck20/src/conf/jdo-2_0-signatures.txt Tue Feb 20 15:34:41 2007
@@ -241,6 +241,7 @@
 
 public class javax.jdo.JDOHelper {
     public JDOHelper();
+    public static javax.jdo.JDOHelper getInstance();
     public static javax.jdo.PersistenceManager getPersistenceManager(Object pc);
     public static void makeDirty(Object pc, String fieldName);
     public static Object getObjectId(Object pc);
@@ -478,6 +479,7 @@
     public void checkConsistency();
     public javax.jdo.FetchPlan getFetchPlan();
     public Object newInstance(Class pcClass);
+    public java.util.Date getServerDate();
     public javax.jdo.datastore.Sequence getSequence(String name);
     public javax.jdo.datastore.JDOConnection getDataStoreConnection();
     public void addInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener
listener, Class[] classes);
@@ -485,9 +487,12 @@
 }
 
 public interface javax.jdo.PersistenceManagerFactory extends java.io.Serializable {
+    public static final java.lang.String JTA;
+    public static final java.lang.String RESOURCE_LOCAL;
     public void close();
     public boolean isClosed();
     public javax.jdo.PersistenceManager getPersistenceManager();
+    public javax.jdo.PersistenceManager getPersistenceManagerProxy();
     public javax.jdo.PersistenceManager getPersistenceManager(String userid, String password);
     public void setConnectionUserName(String userName);
     public String getConnectionUserName();
@@ -522,6 +527,12 @@
     public boolean getIgnoreCache();
     public boolean getDetachAllOnCommit();
     public void setDetachAllOnCommit(boolean flag);
+    public java.lang.String getPersistenceUnitName();
+    public void setPersistenceUnitName(java.lang.String);
+    public java.lang.String getServerTimeZoneID();
+    public void setServerTimeZoneID(java.lang.String);
+    public java.lang.String getTransactionType();
+    public void setTransactionType(java.lang.String);
     public java.util.Properties getProperties();
     public java.util.Collection supportedOptions();
     public javax.jdo.datastore.DataStoreCache getDataStoreCache();
@@ -541,6 +552,7 @@
     public void declareVariables(String variables);
     public void setOrdering(String ordering);
     public void setIgnoreCache(boolean ignoreCache);
+    public void addSubquery(javax.jdo.Query, java.lang.String, java.lang.String);
     public boolean getIgnoreCache();
     public void compile();
     public Object execute();



Mime
View raw message