Class JDOPersistenceManagerProxy

java.lang.Object
org.datanucleus.api.jdo.JDOPersistenceManagerProxy
All Implemented Interfaces:
AutoCloseable, javax.jdo.PersistenceManager

public class JDOPersistenceManagerProxy extends Object implements javax.jdo.PersistenceManager
Implementation of a JDO persistence manager proxy. JDO spec $11.3.1. Returning a thread-safe PM.

In JTA this delegates to an underlying PM, with the exception of close() which has no effect. If there is a PM associated with the (JTA) transaction the proxy just delegates to whichever PM is still associated. If there is no PM associated to the (JTA) transaction then a PM is created and associated to the (JTA) txn. If there is no (JTA) txn currently associated then a new PM is created

In RESOURCE_LOCAL, this delegates to the PM associated with an implementation defined thread-local variable. The close() on the proxy clears the thread-local, so subsequent calls to getPersistenceManagerProxy() will create a new PM.

  • Field Details

  • Constructor Details

  • Method Details

    • getPM

      protected javax.jdo.PersistenceManager getPM()
      Accessor for the delegate PM that we hand off to.
      Returns:
      The delegate PM (from the PMF thread-local store)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface javax.jdo.PersistenceManager
    • addInstanceLifecycleListener

      public void addInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener, Class... classes)
      Specified by:
      addInstanceLifecycleListener in interface javax.jdo.PersistenceManager
    • checkConsistency

      public void checkConsistency()
      Specified by:
      checkConsistency in interface javax.jdo.PersistenceManager
    • currentTransaction

      public javax.jdo.Transaction currentTransaction()
      Specified by:
      currentTransaction in interface javax.jdo.PersistenceManager
    • deletePersistent

      public void deletePersistent(Object obj)
      Specified by:
      deletePersistent in interface javax.jdo.PersistenceManager
    • deletePersistentAll

      public void deletePersistentAll(Object... pcs)
      Specified by:
      deletePersistentAll in interface javax.jdo.PersistenceManager
    • deletePersistentAll

      public void deletePersistentAll(Collection pcs)
      Specified by:
      deletePersistentAll in interface javax.jdo.PersistenceManager
    • detachCopy

      public <T> T detachCopy(T pc)
      Specified by:
      detachCopy in interface javax.jdo.PersistenceManager
    • detachCopyAll

      public <T> Collection<T> detachCopyAll(Collection<T> pcs)
      Specified by:
      detachCopyAll in interface javax.jdo.PersistenceManager
    • detachCopyAll

      public <T> T[] detachCopyAll(T... pcs)
      Specified by:
      detachCopyAll in interface javax.jdo.PersistenceManager
    • evict

      public void evict(Object obj)
      Specified by:
      evict in interface javax.jdo.PersistenceManager
    • evictAll

      public void evictAll()
      Specified by:
      evictAll in interface javax.jdo.PersistenceManager
    • evictAll

      public void evictAll(Object... pcs)
      Specified by:
      evictAll in interface javax.jdo.PersistenceManager
    • evictAll

      public void evictAll(Collection pcs)
      Specified by:
      evictAll in interface javax.jdo.PersistenceManager
    • evictAll

      public void evictAll(boolean subclasses, Class cls)
      Specified by:
      evictAll in interface javax.jdo.PersistenceManager
    • flush

      public void flush()
      Specified by:
      flush in interface javax.jdo.PersistenceManager
    • getCopyOnAttach

      public boolean getCopyOnAttach()
      Specified by:
      getCopyOnAttach in interface javax.jdo.PersistenceManager
    • getDataStoreConnection

      public javax.jdo.datastore.JDOConnection getDataStoreConnection()
      Specified by:
      getDataStoreConnection in interface javax.jdo.PersistenceManager
    • getDetachAllOnCommit

      public boolean getDetachAllOnCommit()
      Specified by:
      getDetachAllOnCommit in interface javax.jdo.PersistenceManager
    • getExtent

      public <T> javax.jdo.Extent<T> getExtent(Class<T> pcClass)
      Specified by:
      getExtent in interface javax.jdo.PersistenceManager
    • getExtent

      public <T> javax.jdo.Extent<T> getExtent(Class<T> pcClass, boolean subclasses)
      Specified by:
      getExtent in interface javax.jdo.PersistenceManager
    • getFetchGroup

      public javax.jdo.FetchGroup getFetchGroup(Class arg0, String arg1)
      Specified by:
      getFetchGroup in interface javax.jdo.PersistenceManager
    • getFetchPlan

      public javax.jdo.FetchPlan getFetchPlan()
      Specified by:
      getFetchPlan in interface javax.jdo.PersistenceManager
    • getIgnoreCache

      public boolean getIgnoreCache()
      Specified by:
      getIgnoreCache in interface javax.jdo.PersistenceManager
    • getManagedObjects

      public Set getManagedObjects()
      Specified by:
      getManagedObjects in interface javax.jdo.PersistenceManager
    • getManagedObjects

      public Set getManagedObjects(EnumSet<javax.jdo.ObjectState> states)
      Specified by:
      getManagedObjects in interface javax.jdo.PersistenceManager
    • getManagedObjects

      public Set getManagedObjects(Class... classes)
      Specified by:
      getManagedObjects in interface javax.jdo.PersistenceManager
    • getManagedObjects

      public Set getManagedObjects(EnumSet<javax.jdo.ObjectState> states, Class... classes)
      Specified by:
      getManagedObjects in interface javax.jdo.PersistenceManager
    • getMultithreaded

      public boolean getMultithreaded()
      Specified by:
      getMultithreaded in interface javax.jdo.PersistenceManager
    • getObjectById

      public Object getObjectById(Object id)
      Specified by:
      getObjectById in interface javax.jdo.PersistenceManager
    • getObjectById

      public Object getObjectById(Object id, boolean validate)
      Specified by:
      getObjectById in interface javax.jdo.PersistenceManager
    • getObjectById

      public <T> T getObjectById(Class<T> cls, Object key)
      Specified by:
      getObjectById in interface javax.jdo.PersistenceManager
    • getObjectId

      public Object getObjectId(Object pc)
      Specified by:
      getObjectId in interface javax.jdo.PersistenceManager
    • getObjectIdClass

      public Class getObjectIdClass(Class cls)
      Specified by:
      getObjectIdClass in interface javax.jdo.PersistenceManager
    • getObjectsById

      public Collection getObjectsById(Collection oids)
      Specified by:
      getObjectsById in interface javax.jdo.PersistenceManager
    • getObjectsById

      public Object[] getObjectsById(Object... oids)
      Specified by:
      getObjectsById in interface javax.jdo.PersistenceManager
    • getObjectsById

      public Collection getObjectsById(Collection oids, boolean validate)
      Specified by:
      getObjectsById in interface javax.jdo.PersistenceManager
    • getObjectsById

      public Object[] getObjectsById(Object[] oids, boolean validate)
    • getObjectsById

      public Object[] getObjectsById(boolean validate, Object... oids)
      Specified by:
      getObjectsById in interface javax.jdo.PersistenceManager
    • getPersistenceManagerFactory

      public javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory()
      Specified by:
      getPersistenceManagerFactory in interface javax.jdo.PersistenceManager
    • getSequence

      public javax.jdo.datastore.Sequence getSequence(String sequenceName)
      Specified by:
      getSequence in interface javax.jdo.PersistenceManager
    • getServerDate

      public Date getServerDate()
      Specified by:
      getServerDate in interface javax.jdo.PersistenceManager
    • getTransactionalObjectId

      public Object getTransactionalObjectId(Object pc)
      Specified by:
      getTransactionalObjectId in interface javax.jdo.PersistenceManager
    • getUserObject

      public Object getUserObject()
      Specified by:
      getUserObject in interface javax.jdo.PersistenceManager
    • getUserObject

      public Object getUserObject(Object key)
      Specified by:
      getUserObject in interface javax.jdo.PersistenceManager
    • isClosed

      public boolean isClosed()
      Specified by:
      isClosed in interface javax.jdo.PersistenceManager
    • makeNontransactional

      public void makeNontransactional(Object pc)
      Specified by:
      makeNontransactional in interface javax.jdo.PersistenceManager
    • makeNontransactionalAll

      public void makeNontransactionalAll(Object... pcs)
      Specified by:
      makeNontransactionalAll in interface javax.jdo.PersistenceManager
    • makeNontransactionalAll

      public void makeNontransactionalAll(Collection arg0)
      Specified by:
      makeNontransactionalAll in interface javax.jdo.PersistenceManager
    • makePersistent

      public <T> T makePersistent(T obj)
      Specified by:
      makePersistent in interface javax.jdo.PersistenceManager
    • makePersistentAll

      public <T> T[] makePersistentAll(T... arg0)
      Specified by:
      makePersistentAll in interface javax.jdo.PersistenceManager
    • makePersistentAll

      public <T> Collection<T> makePersistentAll(Collection<T> arg0)
      Specified by:
      makePersistentAll in interface javax.jdo.PersistenceManager
    • makeTransactional

      public void makeTransactional(Object arg0)
      Specified by:
      makeTransactional in interface javax.jdo.PersistenceManager
    • makeTransactionalAll

      public void makeTransactionalAll(Object... arg0)
      Specified by:
      makeTransactionalAll in interface javax.jdo.PersistenceManager
    • makeTransactionalAll

      public void makeTransactionalAll(Collection arg0)
      Specified by:
      makeTransactionalAll in interface javax.jdo.PersistenceManager
    • makeTransient

      public void makeTransient(Object pc)
      Specified by:
      makeTransient in interface javax.jdo.PersistenceManager
    • makeTransient

      public void makeTransient(Object pc, boolean useFetchPlan)
      Specified by:
      makeTransient in interface javax.jdo.PersistenceManager
    • makeTransientAll

      public void makeTransientAll(Object... pcs)
      Specified by:
      makeTransientAll in interface javax.jdo.PersistenceManager
    • makeTransientAll

      public void makeTransientAll(Collection pcs)
      Specified by:
      makeTransientAll in interface javax.jdo.PersistenceManager
    • makeTransientAll

      public void makeTransientAll(Object[] pcs, boolean includeFetchPlan)
    • makeTransientAll

      public void makeTransientAll(boolean includeFetchPlan, Object... pcs)
      Specified by:
      makeTransientAll in interface javax.jdo.PersistenceManager
    • makeTransientAll

      public void makeTransientAll(Collection pcs, boolean useFetchPlan)
      Specified by:
      makeTransientAll in interface javax.jdo.PersistenceManager
    • newInstance

      public <T> T newInstance(Class<T> pc)
      Specified by:
      newInstance in interface javax.jdo.PersistenceManager
    • newNamedQuery

      public javax.jdo.Query newNamedQuery(Class cls, String filter)
      Specified by:
      newNamedQuery in interface javax.jdo.PersistenceManager
    • newObjectIdInstance

      public Object newObjectIdInstance(Class pcClass, Object key)
      Specified by:
      newObjectIdInstance in interface javax.jdo.PersistenceManager
    • newQuery

      public javax.jdo.Query newQuery()
      Specified by:
      newQuery in interface javax.jdo.PersistenceManager
    • newQuery

      public javax.jdo.Query newQuery(Object obj)
      Specified by:
      newQuery in interface javax.jdo.PersistenceManager
    • newQuery

      public javax.jdo.Query newQuery(String query)
      Specified by:
      newQuery in interface javax.jdo.PersistenceManager
    • newQuery

      public <T> javax.jdo.Query<T> newQuery(Class<T> cls)
      Specified by:
      newQuery in interface javax.jdo.PersistenceManager
    • newQuery

      public <T> javax.jdo.Query<T> newQuery(javax.jdo.Extent<T> cln)
      Specified by:
      newQuery in interface javax.jdo.PersistenceManager
    • newQuery

      public javax.jdo.Query newQuery(String language, Object query)
      Specified by:
      newQuery in interface javax.jdo.PersistenceManager
    • newQuery

      public <T> javax.jdo.Query<T> newQuery(Class<T> cls, Collection<T> cln)
      Specified by:
      newQuery in interface javax.jdo.PersistenceManager
    • newQuery

      public <T> javax.jdo.Query<T> newQuery(Class<T> cls, String filter)
      Specified by:
      newQuery in interface javax.jdo.PersistenceManager
    • newQuery

      public <T> javax.jdo.Query<T> newQuery(javax.jdo.Extent<T> cln, String filter)
      Specified by:
      newQuery in interface javax.jdo.PersistenceManager
    • newQuery

      public <T> javax.jdo.Query<T> newQuery(Class<T> cls, Collection<T> cln, String filter)
      Specified by:
      newQuery in interface javax.jdo.PersistenceManager
    • newJDOQLTypedQuery

      public <T> javax.jdo.JDOQLTypedQuery<T> newJDOQLTypedQuery(Class<T> cls)
      Specified by:
      newJDOQLTypedQuery in interface javax.jdo.PersistenceManager
    • putUserObject

      public Object putUserObject(Object key, Object value)
      Specified by:
      putUserObject in interface javax.jdo.PersistenceManager
    • refresh

      public void refresh(Object obj)
      Specified by:
      refresh in interface javax.jdo.PersistenceManager
    • refreshAll

      public void refreshAll()
      Specified by:
      refreshAll in interface javax.jdo.PersistenceManager
    • refreshAll

      public void refreshAll(Object... pcs)
      Specified by:
      refreshAll in interface javax.jdo.PersistenceManager
    • refreshAll

      public void refreshAll(Collection pcs)
      Specified by:
      refreshAll in interface javax.jdo.PersistenceManager
    • refreshAll

      public void refreshAll(javax.jdo.JDOException exc)
      Specified by:
      refreshAll in interface javax.jdo.PersistenceManager
    • removeInstanceLifecycleListener

      public void removeInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener)
      Specified by:
      removeInstanceLifecycleListener in interface javax.jdo.PersistenceManager
    • removeUserObject

      public Object removeUserObject(Object key)
      Specified by:
      removeUserObject in interface javax.jdo.PersistenceManager
    • retrieve

      public void retrieve(Object pc)
      Specified by:
      retrieve in interface javax.jdo.PersistenceManager
    • retrieve

      public void retrieve(Object pc, boolean fgOnly)
      Specified by:
      retrieve in interface javax.jdo.PersistenceManager
    • retrieveAll

      public void retrieveAll(Collection pcs)
      Specified by:
      retrieveAll in interface javax.jdo.PersistenceManager
    • retrieveAll

      public void retrieveAll(Object... pcs)
      Specified by:
      retrieveAll in interface javax.jdo.PersistenceManager
    • retrieveAll

      public void retrieveAll(Collection pcs, boolean fgOnly)
      Specified by:
      retrieveAll in interface javax.jdo.PersistenceManager
    • retrieveAll

      public void retrieveAll(Object[] pcs, boolean fgOnly)
    • retrieveAll

      public void retrieveAll(boolean fgOnly, Object... pcs)
      Specified by:
      retrieveAll in interface javax.jdo.PersistenceManager
    • setCopyOnAttach

      public void setCopyOnAttach(boolean flag)
      Specified by:
      setCopyOnAttach in interface javax.jdo.PersistenceManager
    • setDetachAllOnCommit

      public void setDetachAllOnCommit(boolean flag)
      Specified by:
      setDetachAllOnCommit in interface javax.jdo.PersistenceManager
    • setIgnoreCache

      public void setIgnoreCache(boolean flag)
      Specified by:
      setIgnoreCache in interface javax.jdo.PersistenceManager
    • setMultithreaded

      public void setMultithreaded(boolean flag)
      Specified by:
      setMultithreaded in interface javax.jdo.PersistenceManager
    • setUserObject

      public void setUserObject(Object userObject)
      Specified by:
      setUserObject in interface javax.jdo.PersistenceManager
    • getDatastoreReadTimeoutMillis

      public Integer getDatastoreReadTimeoutMillis()
      Specified by:
      getDatastoreReadTimeoutMillis in interface javax.jdo.PersistenceManager
    • setDatastoreReadTimeoutMillis

      public void setDatastoreReadTimeoutMillis(Integer intvl)
      Specified by:
      setDatastoreReadTimeoutMillis in interface javax.jdo.PersistenceManager
    • getDatastoreWriteTimeoutMillis

      public Integer getDatastoreWriteTimeoutMillis()
      Specified by:
      getDatastoreWriteTimeoutMillis in interface javax.jdo.PersistenceManager
    • setDatastoreWriteTimeoutMillis

      public void setDatastoreWriteTimeoutMillis(Integer intvl)
      Specified by:
      setDatastoreWriteTimeoutMillis in interface javax.jdo.PersistenceManager
    • getProperties

      public Map<String,Object> getProperties()
      Specified by:
      getProperties in interface javax.jdo.PersistenceManager
    • getSupportedProperties

      public Set<String> getSupportedProperties()
      Specified by:
      getSupportedProperties in interface javax.jdo.PersistenceManager
    • setProperty

      public void setProperty(String arg0, Object arg1)
      Specified by:
      setProperty in interface javax.jdo.PersistenceManager