org.apache.jdo.impl.fostore
Class BufferedRequestFactory

java.lang.Object
  extended byorg.apache.jdo.impl.fostore.BufferedRequestFactory
All Implemented Interfaces:
RequestFactory

class BufferedRequestFactory
extends java.lang.Object
implements RequestFactory

Creates different kinds of requests.

Author:
Dave Bristor

Field Summary
private static BufferedRequestFactory instance
           
 
Constructor Summary
private BufferedRequestFactory()
           
 
Method Summary
 ActivateClassRequest getActivateClassRequest(java.lang.Class cls, Message m, FOStorePMF pmf)
          Creates a request object to activate the class corresponding to the given oid.
 BeginTxRequest getBeginTxRequest(Message m, FOStorePMF pmf, boolean optimistic)
          Creates a request object which notifies the store of the kind of transaction that is starting.
 CommitRequest getCommitRequest(Message m, FOStorePMF pmf)
          Creates a request object which causes previous operations to commit.
 CreateOIDRequest getCreateOIDRequest(org.apache.jdo.state.StateManagerInternal sm, Message m, FOStorePMF pmf, OID oid, org.apache.jdo.pm.PersistenceManagerInternal pm)
          Creates a request object that will get a datastore OID for a provisional OID.
 DeleteRequest getDeleteRequest(org.apache.jdo.state.StateManagerInternal sm, Message m, FOStorePMF pmf)
          Creates a request object to cause a persistent object in the store to be deleted.
 DumpRequest getDumpRequest(DumpOption option, java.lang.String className, Message m, FOStorePMF pmf)
          Creates a request object to get information from the store.
 FetchRequest getFetchRequest(org.apache.jdo.state.StateManagerInternal sm, Message m, FOStorePMF pmf)
          Creates a request object to cause one or more fields of a persistent object to be read from the store.
 GetClassRequest getGetClassRequest(CLID clid, Message m, FOStorePMF pmf, org.apache.jdo.pm.PersistenceManagerInternal pm)
          Creates a request object to cause the java.lang.Class associated with the given CLID to be provided.
 GetExtentRequest getGetExtentRequest(FOStoreExtent extent, java.lang.Class pcClass, boolean subclasses, Message m, org.apache.jdo.pm.PersistenceManagerInternal pm)
          Creates a request object to cause a particular class's extent to be retrieved.
 GetInstancesRequest getGetInstancesRequest(java.util.ArrayList oids, int start, int numInstances, Message m, org.apache.jdo.pm.PersistenceManagerInternal pm, java.lang.Class cls)
          Creates a request to get instances for some oids.
 InsertRequest getInsertRequest(org.apache.jdo.state.StateManagerInternal sm, Message m, FOStorePMF pmf)
          Creates a request object to cause a persistent object to be inserted into the datastore.
(package private) static RequestFactory getInstance()
           
 RollbackRequest getRollbackRequest(Message m, FOStorePMF pmf)
          Creates a request object which causes previous operations to rollback.
 UpdateRequest getUpdateRequest(org.apache.jdo.state.StateManagerInternal sm, Message m, FOStorePMF pmf, java.util.BitSet loadedFields, java.util.BitSet dirtyFields, boolean optimistic)
          Creates a request object to cause one or more fields of a persistent object to be updated in the store.
 VerifyRequest getVerifyRequest(org.apache.jdo.state.StateManagerInternal sm, Message m, FOStorePMF pmf, boolean verifyFields, java.util.BitSet fieldsToVerify)
          Creates a request object to verify that in-memory data is the same as that in the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static BufferedRequestFactory instance
Constructor Detail

BufferedRequestFactory

private BufferedRequestFactory()
Method Detail

getInstance

static RequestFactory getInstance()

getCreateOIDRequest

public CreateOIDRequest getCreateOIDRequest(org.apache.jdo.state.StateManagerInternal sm,
                                            Message m,
                                            FOStorePMF pmf,
                                            OID oid,
                                            org.apache.jdo.pm.PersistenceManagerInternal pm)
Description copied from interface: RequestFactory
Creates a request object that will get a datastore OID for a provisional OID.

Specified by:
getCreateOIDRequest in interface RequestFactory
See Also:
RequestFactory.getCreateOIDRequest(org.apache.jdo.state.StateManagerInternal, org.apache.jdo.impl.fostore.Message, org.apache.jdo.impl.fostore.FOStorePMF, org.apache.jdo.impl.fostore.OID, org.apache.jdo.pm.PersistenceManagerInternal)

getActivateClassRequest

public ActivateClassRequest getActivateClassRequest(java.lang.Class cls,
                                                    Message m,
                                                    FOStorePMF pmf)
Description copied from interface: RequestFactory
Creates a request object to activate the class corresponding to the given oid.

Specified by:
getActivateClassRequest in interface RequestFactory
Parameters:
cls - Class to be activated.
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.
See Also:
RequestFactory.getActivateClassRequest(java.lang.Class, org.apache.jdo.impl.fostore.Message, org.apache.jdo.impl.fostore.FOStorePMF)

getInsertRequest

public InsertRequest getInsertRequest(org.apache.jdo.state.StateManagerInternal sm,
                                      Message m,
                                      FOStorePMF pmf)
Description copied from interface: RequestFactory
Creates a request object to cause a persistent object to be inserted into the datastore.

Specified by:
getInsertRequest in interface RequestFactory
Parameters:
sm - StateManagerInternal of the object to be stored in the datastore.
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.
See Also:
RequestFactory.getInsertRequest(org.apache.jdo.state.StateManagerInternal, org.apache.jdo.impl.fostore.Message, org.apache.jdo.impl.fostore.FOStorePMF)

getUpdateRequest

public UpdateRequest getUpdateRequest(org.apache.jdo.state.StateManagerInternal sm,
                                      Message m,
                                      FOStorePMF pmf,
                                      java.util.BitSet loadedFields,
                                      java.util.BitSet dirtyFields,
                                      boolean optimistic)
Description copied from interface: RequestFactory
Creates a request object to cause one or more fields of a persistent object to be updated in the store.

Specified by:
getUpdateRequest in interface RequestFactory
Parameters:
sm - StateManagerInternal of the object to be updated.
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.
loadedFields - Set of fields loaded from the database.
dirtyFields - Set of fields that are to be flushed and verified against the those in the database, if this update is within the context of an optimistic transaction.
optimistic - If true, then update is happening in context of optimistic transaction, otherwise datastore transaction.
See Also:
RequestFactory.getUpdateRequest(org.apache.jdo.state.StateManagerInternal, org.apache.jdo.impl.fostore.Message, org.apache.jdo.impl.fostore.FOStorePMF, java.util.BitSet, java.util.BitSet, boolean)

getVerifyRequest

public VerifyRequest getVerifyRequest(org.apache.jdo.state.StateManagerInternal sm,
                                      Message m,
                                      FOStorePMF pmf,
                                      boolean verifyFields,
                                      java.util.BitSet fieldsToVerify)
Description copied from interface: RequestFactory
Creates a request object to verify that in-memory data is the same as that in the database.

Specified by:
getVerifyRequest in interface RequestFactory
Parameters:
sm - StateManagerInternal of the object to be verified.
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.
verifyFields - If true, verify values of object, otherwise verify only existence (and ignore remaining parameters).
fieldsToVerify - Set of fields to be verified against those in the database.
See Also:
RequestFactory.getVerifyRequest(org.apache.jdo.state.StateManagerInternal, org.apache.jdo.impl.fostore.Message, org.apache.jdo.impl.fostore.FOStorePMF, boolean, java.util.BitSet)

getFetchRequest

public FetchRequest getFetchRequest(org.apache.jdo.state.StateManagerInternal sm,
                                    Message m,
                                    FOStorePMF pmf)
Description copied from interface: RequestFactory
Creates a request object to cause one or more fields of a persistent object to be read from the store.

Specified by:
getFetchRequest in interface RequestFactory
Parameters:
sm - StateManagerInternal of the object whose field(s) are to be read.
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.
See Also:
RequestFactory.getFetchRequest(org.apache.jdo.state.StateManagerInternal, org.apache.jdo.impl.fostore.Message, org.apache.jdo.impl.fostore.FOStorePMF)

getGetExtentRequest

public GetExtentRequest getGetExtentRequest(FOStoreExtent extent,
                                            java.lang.Class pcClass,
                                            boolean subclasses,
                                            Message m,
                                            org.apache.jdo.pm.PersistenceManagerInternal pm)
Description copied from interface: RequestFactory
Creates a request object to cause a particular class's extent to be retrieved.

Specified by:
getGetExtentRequest in interface RequestFactory
Parameters:
extent - FOStoreExtent for which the request is being created.
pcClass - Class of the objects whose extent is sought. It is required that the caller ensure that the given pcClass implement javax.jdo.PersistenceCapable.
subclasses - If false, retrieve instances of pcClass only; if true retrieve those plus all instances of subclasses of pcClass.
m - Message by which the request is to be sent to the store.
pm - PersistenceManager on whose behalf the request is taking place.
See Also:
RequestFactory.getGetExtentRequest(org.apache.jdo.impl.fostore.FOStoreExtent, java.lang.Class, boolean, org.apache.jdo.impl.fostore.Message, org.apache.jdo.pm.PersistenceManagerInternal)

getGetInstancesRequest

public GetInstancesRequest getGetInstancesRequest(java.util.ArrayList oids,
                                                  int start,
                                                  int numInstances,
                                                  Message m,
                                                  org.apache.jdo.pm.PersistenceManagerInternal pm,
                                                  java.lang.Class cls)
Description copied from interface: RequestFactory
Creates a request to get instances for some oids.

Specified by:
getGetInstancesRequest in interface RequestFactory
Parameters:
oids - List of oids for which instances are needed.
start - Starting index in oids for which instances are needed.
numInstances - Number of instances which are needed.
pm - PersistenceManager on whose behalf the request is taking place.
cls - Candidate Class for which instances are being obtained.
See Also:
RequestFactory.getGetInstancesRequest(java.util.ArrayList, int, int, org.apache.jdo.impl.fostore.Message, org.apache.jdo.pm.PersistenceManagerInternal, java.lang.Class)

getDeleteRequest

public DeleteRequest getDeleteRequest(org.apache.jdo.state.StateManagerInternal sm,
                                      Message m,
                                      FOStorePMF pmf)
Description copied from interface: RequestFactory
Creates a request object to cause a persistent object in the store to be deleted.

Specified by:
getDeleteRequest in interface RequestFactory
Parameters:
sm - StateManagerInternal of the object to delete in the store.
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.
See Also:
RequestFactory.getDeleteRequest(org.apache.jdo.state.StateManagerInternal, org.apache.jdo.impl.fostore.Message, org.apache.jdo.impl.fostore.FOStorePMF)

getGetClassRequest

public GetClassRequest getGetClassRequest(CLID clid,
                                          Message m,
                                          FOStorePMF pmf,
                                          org.apache.jdo.pm.PersistenceManagerInternal pm)
Description copied from interface: RequestFactory
Creates a request object to cause the java.lang.Class associated with the given CLID to be provided.

Specified by:
getGetClassRequest in interface RequestFactory
Parameters:
clid - CLID of the class that is needed.
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.
pm - PersistenceManager used to load the class. place.
See Also:
RequestFactory.getGetClassRequest(org.apache.jdo.impl.fostore.CLID, org.apache.jdo.impl.fostore.Message, org.apache.jdo.impl.fostore.FOStorePMF, org.apache.jdo.pm.PersistenceManagerInternal)

getBeginTxRequest

public BeginTxRequest getBeginTxRequest(Message m,
                                        FOStorePMF pmf,
                                        boolean optimistic)
Description copied from interface: RequestFactory
Creates a request object which notifies the store of the kind of transaction that is starting.

Specified by:
getBeginTxRequest in interface RequestFactory
Parameters:
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.
optimistic - Indicates whether an optimistic or datastore transaction is beginning.
See Also:
RequestFactory.getBeginTxRequest(org.apache.jdo.impl.fostore.Message, org.apache.jdo.impl.fostore.FOStorePMF, boolean)

getCommitRequest

public CommitRequest getCommitRequest(Message m,
                                      FOStorePMF pmf)
Description copied from interface: RequestFactory
Creates a request object which causes previous operations to commit.

Specified by:
getCommitRequest in interface RequestFactory
Parameters:
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.
See Also:
RequestFactory.getCommitRequest(org.apache.jdo.impl.fostore.Message, org.apache.jdo.impl.fostore.FOStorePMF)

getRollbackRequest

public RollbackRequest getRollbackRequest(Message m,
                                          FOStorePMF pmf)
Description copied from interface: RequestFactory
Creates a request object which causes previous operations to rollback.

Specified by:
getRollbackRequest in interface RequestFactory
Parameters:
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.
See Also:
RequestFactory.getRollbackRequest(org.apache.jdo.impl.fostore.Message, org.apache.jdo.impl.fostore.FOStorePMF)

getDumpRequest

public DumpRequest getDumpRequest(DumpOption option,
                                  java.lang.String className,
                                  Message m,
                                  FOStorePMF pmf)
Description copied from interface: RequestFactory
Creates a request object to get information from the store.

Specified by:
getDumpRequest in interface RequestFactory
Parameters:
option - Diagnostic parameter code.
className - Optional class name.
m - Message by which the request is to be sent to the store.
pmf - FOStorePMF in which the request is taking place.
See Also:
RequestFactory.getDumpRequest(org.apache.jdo.impl.fostore.DumpOption, java.lang.String, org.apache.jdo.impl.fostore.Message, org.apache.jdo.impl.fostore.FOStorePMF)