|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.impl.fostore.Message
Represents a set of one or more requests that will be sent to the store.
Request
Field Summary | |
private java.util.HashSet |
clids
Set of CLIDs associated with ActivateClass requests that are in this Message. |
private org.apache.jdo.store.Connector |
connector
Connector for which this message acts as a transport. |
(package private) static org.apache.commons.logging.Log |
logger
Logger |
private static org.apache.jdo.util.I18NHelper |
msg
I18N support. |
private int |
numRequests
Indicates the number of requests that have been written into this Message. |
private int |
numRequestStash
Contains the position in the output of the numRequest stashed by initOutput. |
private FOStoreOutput |
out
This contains the Message's actual data for the store. |
private java.util.HashMap |
requests
Set of request objects that are in the process of carrying out their function; maps from a RequestId to Request. |
private static int |
VERSION_NUMBER
The version number of the current protocol. |
Constructor Summary | |
(package private) |
Message()
|
(package private) |
Message(org.apache.jdo.store.Connector connector)
Constructor for Message. |
Method Summary | |
(package private) void |
addCLID(CLID clid)
Add the given CLID to the set of CLIDs maintained by this Message. |
private void |
closeConnection(FOStoreClientConnection con)
Close the connection to the store. |
(package private) boolean |
containsCLID(CLID clid)
Returns true if the given CLID is in this Message's set of CLIDs. |
void |
dump()
Dump the complete current contents of the message buffer. |
private void |
finishOutput()
Finish the output buffer by updating the stash with number of requests. |
(package private) org.apache.jdo.store.Connector |
getConnector()
|
FOStoreOutput |
getOutput()
Return the FOStoreOutput stream for requests to be inserted. |
(package private) Request |
getRequest(RequestId requestId)
Provides the Request corresponding to the give requestId, removing it from the internal map of requests (i.e., subsequent getRequest invocations for the same requestId will return null). |
(package private) boolean |
hasRequests()
Returns true if this message has requests for the store. |
private void |
initOutput()
Initialize the output buffer with version number and a stash for number of requests. |
(package private) void |
processInStore(FOStoreClientConnection con,
boolean okToReleaseConnection)
Write this message to the given connection, and read replies from that connection, processing replies as they are read. |
(package private) void |
putRequest(RequestId requestId,
Request request)
Maps the given request to the given requestId. |
private void |
receiveFromStore(FOStoreClientConnection con,
boolean okToReleaseConnection)
Receive the replies from the store and process them. |
private void |
sendToStore(FOStoreClientConnection con)
Send the current Message buffer to the store. |
(package private) static void |
verifyVersionNumber(java.io.DataInput in)
Verify a Message's version number. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private final org.apache.jdo.store.Connector connector
private final java.util.HashMap requests
private final java.util.HashSet clids
private final FOStoreOutput out
private int numRequests
private int numRequestStash
private static final int VERSION_NUMBER
private static final org.apache.jdo.util.I18NHelper msg
static final org.apache.commons.logging.Log logger
Constructor Detail |
Message(org.apache.jdo.store.Connector connector)
connector
- The Connector on whose behalf this Message is serving
as a transport. May be null.Message()
Method Detail |
org.apache.jdo.store.Connector getConnector()
public FOStoreOutput getOutput()
void processInStore(FOStoreClientConnection con, boolean okToReleaseConnection)
con
- the FOStoreClientConnection for this messagefor stream header reader.
private void sendToStore(FOStoreClientConnection con)
con
- the FOStoreClientConnectionprivate void receiveFromStore(FOStoreClientConnection con, boolean okToReleaseConnection)
con
- the FOStoreConnection with the replies.void putRequest(RequestId requestId, Request request)
requestId
- Identifies a request within a JVM.request
- A request for some operation on the store for which a
reply is expected.Request getRequest(RequestId requestId)
requestId
- Identifier for a particular request in this JVM.
boolean hasRequests()
private void initOutput()
private void finishOutput()
private void closeConnection(FOStoreClientConnection con)
con
- the connection to close.static void verifyVersionNumber(java.io.DataInput in) throws java.io.IOException
javax.jdo.JDOFatalUserException
- if the version number does not match
that in the caller's JVM.
java.io.IOException
void addCLID(CLID clid)
boolean containsCLID(CLID clid)
public void dump()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |