org.apache.jdo.impl.fostore
Class CommitRequest

java.lang.Object
  extended byorg.apache.jdo.impl.fostore.AbstractRequest
      extended byorg.apache.jdo.impl.fostore.CommitRequest
All Implemented Interfaces:
Request

class CommitRequest
extends AbstractRequest

Represents a request to cause previous insert, update, and so on operations since the previous Commit or Rollback request to commit to the datastore.

Author:
Dave Bristor

Field Summary
protected  FOStoreSchemaUID fsuid
          uid corresponding to the same java.lang.Class that initializes jdoClass.
protected  JDOClass jdoClass
          Class meta data of the object represented by the constructor's given state manager
protected static int LENGTH_COOKIE
           
(package private) static org.apache.commons.logging.Log logger
          Logger
private  Message message
          Message in which this request is written
protected static I18NHelper msg
           
private  boolean okToReleaseDatabase
          If true, then after committing the database should be released.
protected  FOStoreOutput out
          Stream to which request writes itself.
protected  FOStorePMF pmf
          PersistenceManagerFactory via which request is being done.
protected  StateManagerInternal sm
          The state manager which is the subject of this request.
 
Constructor Summary
(package private) CommitRequest(Message m, FOStorePMF pmf)
           
 
Method Summary
 void doRequest()
          Does whatever it is that the kind of request does in actually making a request of the store.
protected  void doRequestBody()
          Provides the information required to fulfill a CommitRequest.
protected  RequestId getId()
           
 StateManagerInternal getStateManager()
          Get the StateManager associated with this request, null if none.
 void handleReply(Status status, java.io.DataInput in, int length)
          Handles reply data from a CommitReply.
(package private)  void setOkToReleaseDatabase(boolean ok)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

message

private final Message message
Message in which this request is written


okToReleaseDatabase

private boolean okToReleaseDatabase
If true, then after committing the database should be released.


sm

protected StateManagerInternal sm
The state manager which is the subject of this request.


pmf

protected final FOStorePMF pmf
PersistenceManagerFactory via which request is being done.


out

protected final FOStoreOutput out
Stream to which request writes itself.


jdoClass

protected JDOClass jdoClass
Class meta data of the object represented by the constructor's given state manager


fsuid

protected FOStoreSchemaUID fsuid
uid corresponding to the same java.lang.Class that initializes jdoClass.


msg

protected static final I18NHelper msg

logger

static final org.apache.commons.logging.Log logger
Logger


LENGTH_COOKIE

protected static final int LENGTH_COOKIE
See Also:
Constant Field Values
Constructor Detail

CommitRequest

CommitRequest(Message m,
              FOStorePMF pmf)
Method Detail

setOkToReleaseDatabase

void setOkToReleaseDatabase(boolean ok)

doRequestBody

protected void doRequestBody()
                      throws java.io.IOException
Provides the information required to fulfill a CommitRequest. The format of this request is (aside from the request header): boolean: okToReleaseDatabase

Specified by:
doRequestBody in class AbstractRequest
Throws:
java.io.IOException

handleReply

public void handleReply(Status status,
                        java.io.DataInput in,
                        int length)
                 throws java.io.IOException
Handles reply data from a CommitReply.

Parameters:
in - the input stream.
length - the length of data in the stream.
status - Indication as to the success, failure, etc. of the request as handled by the store.
Throws:
java.io.IOException - if any problems reading the stream.

getId

protected RequestId getId()

doRequest

public final void doRequest()
                     throws java.io.IOException
Description copied from interface: Request
Does whatever it is that the kind of request does in actually making a request of the store.

Specified by:
doRequest in interface Request
Throws:
java.io.IOException - in case of errors with the stream.
See Also:
Request.doRequest()

getStateManager

public StateManagerInternal getStateManager()
Get the StateManager associated with this request, null if none.

Specified by:
getStateManager in interface Request
Returns:
the StateManager.