GigaSpaces XAP 9.7.2 API

org.openspaces.jpa
Class StoreManager

java.lang.Object
  extended by org.apache.openjpa.abstractstore.AbstractStoreManager
      extended by org.openspaces.jpa.StoreManager
All Implemented Interfaces:
org.apache.openjpa.kernel.StoreManager, org.apache.openjpa.lib.util.Closeable

public class StoreManager
extends org.apache.openjpa.abstractstore.AbstractStoreManager

A GigaSpaces back-end implementation for OpenJPA. Responsible for storing and fetching data from GigaSpaces using space API.

Since:
8.0
Author:
idan

Field Summary
 
Fields inherited from class org.apache.openjpa.abstractstore.AbstractStoreManager
ctx
 
Fields inherited from interface org.apache.openjpa.kernel.StoreManager
FORCE_LOAD_ALL, FORCE_LOAD_DFG, FORCE_LOAD_NONE, FORCE_LOAD_REFRESH, VERSION_DIFFERENT, VERSION_EARLIER, VERSION_LATER, VERSION_SAME
 
Constructor Summary
StoreManager()
           
 
Method Summary
 void begin()
           
 void beginOptimistic()
           
 void commit()
           
 org.apache.openjpa.lib.rop.ResultObjectProvider executeExtent(org.apache.openjpa.meta.ClassMetaData classmetadata, boolean flag, org.apache.openjpa.kernel.FetchConfiguration fetchconfiguration)
           
 boolean exists(org.apache.openjpa.kernel.OpenJPAStateManager sm, Object edata)
          Returns whether the state manager's managed object exists in space.
protected  Collection flush(Collection pNew, Collection pNewUpdated, Collection pNewFlushedDeleted, Collection pDirty, Collection pDeleted)
          Flushes changes to GigaSpaces.
 int getClassRelationStatus(Class<?> type)
          Gets the class relation status (one-to-one etc..) for the provided type.
 SpaceConfiguration getConfiguration()
           
 Transaction getCurrentTransaction()
          Gets the current active transaction.
 com.j_spaces.jdbc.driver.GConnection getJdbcConnection()
          Gets a JDBC connection using the configuration's space instance.
protected  Collection<String> getUnsupportedOptions()
           
 boolean initialize(org.apache.openjpa.kernel.OpenJPAStateManager sm, org.apache.openjpa.kernel.PCState state, org.apache.openjpa.kernel.FetchConfiguration fetchConfiguration, Object edata)
           
 boolean isCached(List<Object> oids, BitSet edata)
           
 boolean load(org.apache.openjpa.kernel.OpenJPAStateManager sm, BitSet fields, org.apache.openjpa.kernel.FetchConfiguration fetch, int lockLevel, Object context)
          This method loads specific fields from the data store for updating them.
 Collection loadAll(Collection sms, org.apache.openjpa.kernel.PCState state, int load, org.apache.openjpa.kernel.FetchConfiguration fetch, Object edata)
           
 Object loadObject(org.apache.openjpa.meta.ClassMetaData classMetaData, com.gigaspaces.internal.transport.IEntryPacket entry)
          Initializes an ExternalEntry result as a state managed Pojo.
protected  org.apache.openjpa.conf.OpenJPAConfiguration newConfiguration()
           
 org.apache.openjpa.kernel.StoreQuery newQuery(String language)
           
protected  void open()
           
 void rollback()
           
 void rollbackOptimistic()
           
 boolean syncVersion(org.apache.openjpa.kernel.OpenJPAStateManager sm, Object edata)
           
 
Methods inherited from class org.apache.openjpa.abstractstore.AbstractStoreManager
assignDataStoreId, assignField, assignObjectId, beforeStateChange, cancelAll, close, compareVersion, copyDataStoreId, flush, getClientConnection, getContext, getDataStoreIdSequence, getDataStoreIdType, getManagedType, getPlatform, getValueSequence, newDataStoreId, newFetchConfiguration, releaseConnection, retainConnection, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StoreManager

public StoreManager()
Method Detail

open

protected void open()
Overrides:
open in class org.apache.openjpa.abstractstore.AbstractStoreManager

getUnsupportedOptions

protected Collection<String> getUnsupportedOptions()
Overrides:
getUnsupportedOptions in class org.apache.openjpa.abstractstore.AbstractStoreManager

syncVersion

public boolean syncVersion(org.apache.openjpa.kernel.OpenJPAStateManager sm,
                           Object edata)
Specified by:
syncVersion in interface org.apache.openjpa.kernel.StoreManager
Overrides:
syncVersion in class org.apache.openjpa.abstractstore.AbstractStoreManager

begin

public void begin()
Specified by:
begin in interface org.apache.openjpa.kernel.StoreManager
Overrides:
begin in class org.apache.openjpa.abstractstore.AbstractStoreManager

commit

public void commit()
Specified by:
commit in interface org.apache.openjpa.kernel.StoreManager
Overrides:
commit in class org.apache.openjpa.abstractstore.AbstractStoreManager

rollback

public void rollback()
Specified by:
rollback in interface org.apache.openjpa.kernel.StoreManager
Overrides:
rollback in class org.apache.openjpa.abstractstore.AbstractStoreManager

beginOptimistic

public void beginOptimistic()
Specified by:
beginOptimistic in interface org.apache.openjpa.kernel.StoreManager
Overrides:
beginOptimistic in class org.apache.openjpa.abstractstore.AbstractStoreManager

rollbackOptimistic

public void rollbackOptimistic()
Specified by:
rollbackOptimistic in interface org.apache.openjpa.kernel.StoreManager
Overrides:
rollbackOptimistic in class org.apache.openjpa.abstractstore.AbstractStoreManager

newQuery

public org.apache.openjpa.kernel.StoreQuery newQuery(String language)
Specified by:
newQuery in interface org.apache.openjpa.kernel.StoreManager
Overrides:
newQuery in class org.apache.openjpa.abstractstore.AbstractStoreManager

newConfiguration

protected org.apache.openjpa.conf.OpenJPAConfiguration newConfiguration()
Overrides:
newConfiguration in class org.apache.openjpa.abstractstore.AbstractStoreManager

getConfiguration

public SpaceConfiguration getConfiguration()

exists

public boolean exists(org.apache.openjpa.kernel.OpenJPAStateManager sm,
                      Object edata)
Returns whether the state manager's managed object exists in space.


isCached

public boolean isCached(List<Object> oids,
                        BitSet edata)

loadAll

public Collection loadAll(Collection sms,
                          org.apache.openjpa.kernel.PCState state,
                          int load,
                          org.apache.openjpa.kernel.FetchConfiguration fetch,
                          Object edata)
Specified by:
loadAll in interface org.apache.openjpa.kernel.StoreManager
Overrides:
loadAll in class org.apache.openjpa.abstractstore.AbstractStoreManager

initialize

public boolean initialize(org.apache.openjpa.kernel.OpenJPAStateManager sm,
                          org.apache.openjpa.kernel.PCState state,
                          org.apache.openjpa.kernel.FetchConfiguration fetchConfiguration,
                          Object edata)
Specified by:
initialize in interface org.apache.openjpa.kernel.StoreManager
Specified by:
initialize in class org.apache.openjpa.abstractstore.AbstractStoreManager

load

public boolean load(org.apache.openjpa.kernel.OpenJPAStateManager sm,
                    BitSet fields,
                    org.apache.openjpa.kernel.FetchConfiguration fetch,
                    int lockLevel,
                    Object context)
This method loads specific fields from the data store for updating them. Note: The state manager's fields are cleared.

Specified by:
load in interface org.apache.openjpa.kernel.StoreManager
Specified by:
load in class org.apache.openjpa.abstractstore.AbstractStoreManager

executeExtent

public org.apache.openjpa.lib.rop.ResultObjectProvider executeExtent(org.apache.openjpa.meta.ClassMetaData classmetadata,
                                                                     boolean flag,
                                                                     org.apache.openjpa.kernel.FetchConfiguration fetchconfiguration)
Specified by:
executeExtent in interface org.apache.openjpa.kernel.StoreManager
Specified by:
executeExtent in class org.apache.openjpa.abstractstore.AbstractStoreManager

flush

protected Collection flush(Collection pNew,
                           Collection pNewUpdated,
                           Collection pNewFlushedDeleted,
                           Collection pDirty,
                           Collection pDeleted)
Flushes changes to GigaSpaces. Returns a list of exceptions that occurred.

Specified by:
flush in class org.apache.openjpa.abstractstore.AbstractStoreManager

loadObject

public Object loadObject(org.apache.openjpa.meta.ClassMetaData classMetaData,
                         com.gigaspaces.internal.transport.IEntryPacket entry)
Initializes an ExternalEntry result as a state managed Pojo. (used by JPQL's query executor)


getCurrentTransaction

public Transaction getCurrentTransaction()
Gets the current active transaction.


getJdbcConnection

public com.j_spaces.jdbc.driver.GConnection getJdbcConnection()
                                                       throws SQLException
Gets a JDBC connection using the configuration's space instance. Each store manager has its own Connection for Multithreaded reasons.

Throws:
SQLException

getClassRelationStatus

public int getClassRelationStatus(Class<?> type)
Gets the class relation status (one-to-one etc..) for the provided type.


GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.