Module org.eclipse.persistence.core
Class RemoteSessionController
java.lang.Object
org.eclipse.persistence.internal.sessions.remote.RemoteSessionController
RemoteSessionController sits between the remote session (on the client)
and whatever session is running on the server. Any interaction between these
two classes takes place through this object.
-
Field Summary
Modifier and TypeFieldDescriptionprotected CommandManager
This is the Synchronization policy used to synchronize remote cachesprotected boolean
Used to isolate queries to a unit of work in an early transaction.protected boolean
Used to resolve transaction treading for client-side nested transaction where server uses many worker threads.The original cursor (either CursoredStream or ScrollableCursor, before they were serialized; keyed by IDprotected Map
<ObjID, ValueHolderInterface> The original remote value holders, before they were serialized; keyed by IDprotected AbstractSession
This is a either a database session or a client session depending upon the setup.protected UnitOfWorkImpl
Use the temporary unit of work to isolate queries after an early transaction. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionBegin an early unit of work transaction.Begin a transaction on the database.protected ObjectDescriptor
buildObjectDescriptor
(Object object) build and return an object descriptor to be sent to the clientUsed for closing scrolable cursor across RMI.commitRootUnitOfWork
(Transporter remoteTransporter) Remote unit of work after serialization is commited locally.Commit a transaction on the database.cursoredStreamClose
(Transporter remoteCursoredStreamOid) Used for closing cursored streams across RMI.cursoredStreamNextpage
(Transporter remoteCursoredId, int pageSize) Retrieve next page of objects from the remote cursored stream once, avoid page size round trips from the server to the clientcursoredStreamSize
(Transporter remoteCursoredStreamOid) Return the wrapped cursored stream from the servercursorSelectObjects
(Transporter remoteTransporter) Returns a remote cursor stub in a transporterexecuteNamedQuery
(Transporter nameTransporter, Transporter classTransporter, Transporter argumentsTransporter) A named query after serialization is executed locally.executeQuery
(Transporter remoteTransporter) A remote query after serialization is executed locally.INTERNAL: This method returns the command manager policy for this remote connectionreturn the read-only classesgetDescriptor
(Transporter remoteTransporter) Extract descriptor from the sessiongetDescriptorForAlias
(Transporter remoteTransporter) Extract descriptor from the sessionprotected AbstractSession
Return the correct session for the transaction context.getLogin()
Get the associated session login.return the pre-remoted cursorsINTERNAL: return the pre-serialized remote value holdersgetSequenceNumberNamed
(Transporter remoteFunctionCall) INTERNAL: Get the value returned by remote function callGet the associated server side session.protected void
initialize
(AbstractSession session) Initialize this RemoteSessionController with a session.Initalize all the server side identity maps.instantiateRemoteValueHolderOnServer
(Transporter remoteTransporter) The corresponding original value holder is instantiated.protected boolean
processCommand
(Transporter remoteCommand) INTERNAL: This method is intended to be used by by sessions that wish to execute a command on a remote sessionreplaceValueHoldersIn
(Object object) Traverse the specified object, replacing the standard value holders with remote value holders.void
replaceValueHoldersIn
(Object object, Map objectDescriptors) Traverse the specified object, replacing the standard value holders with remote value holders.replaceValueHoldersInAll
(Object container, ContainerPolicy policy) Traverse the specified objects, replacing the standard value holders with remote value holders.Rollback a transaction on the database.void
saveRemoteValueHolder
(RemoteValueHolder remoteValueHolder) Save the pre-serialized version of the remote value holder so that it can be used when the serialized version (on the client) is instantiated and needs to come back to the server to get its "value".scrollableCursorAbsolute
(Transporter remoteScrollableCursorOid, int rows) Moves the cursor to the given row number in the result setscrollableCursorAfterLast
(Transporter remoteScrollableCursorOid) Moves the cursor to the end of the result set, just after the last row.scrollableCursorBeforeFirst
(Transporter remoteScrollableCursorOid) Moves the cursor to the front of the result set, just before the first rowscrollableCursorClose
(Transporter remoteScrollableCursorOid) Used for closing cursored streams across RMI.scrollableCursorCurrentIndex
(Transporter remoteScrollableCursorOid) Retrieves the current row index numberscrollableCursorFirst
(Transporter remoteScrollableCursorOid) Moves the cursor to the first row in the result setscrollableCursorIsAfterLast
(Transporter remoteScrollableCursorOid) Indicates whether the cursor is after the last row in the result set.scrollableCursorIsBeforeFirst
(Transporter remoteScrollableCursorOid) Indicates whether the cursor is before the first row in the result set.scrollableCursorIsFirst
(Transporter remoteScrollableCursorOid) Indicates whether the cursor is on the first row of the result set.scrollableCursorIsLast
(Transporter remoteScrollableCursorOid) Indicates whether the cursor is on the last row of the result set.scrollableCursorLast
(Transporter remoteScrollableCursorOid) Moves the cursor to the last row in the result setscrollableCursorNextObject
(Transporter remoteScrollableCursorOid) Retrieve next object from the scrollable cursorscrollableCursorPreviousObject
(Transporter remoteScrollableCursorOid) Retrieve previous object from the scrollable cursorscrollableCursorRelative
(Transporter remoteScrollableCursorOid, int rows) Moves the cursor to the given row number in the result setscrollableCursorSize
(Transporter remoteCursorOid) Return the scrollable cursor size from the serverprotected void
setIsInTransaction
(boolean isInTransaction) protected void
setRemoteCursors
(Map<ObjID, Cursor> remoteCursors) set the pre-remoted cursorsprotected void
setRemoteValueHolders
(Map<ObjID, ValueHolderInterface> remoteValueHolders) set the pre-serialized remote value holdersprotected void
setSession
(AbstractSession session) Set the associated server side session.
-
Field Details
-
isInTransaction
protected boolean isInTransactionUsed to resolve transaction treading for client-side nested transaction where server uses many worker threads. -
isInEarlyTransaction
protected boolean isInEarlyTransactionUsed to isolate queries to a unit of work in an early transaction. -
session
This is a either a database session or a client session depending upon the setup. -
unitOfWork
Use the temporary unit of work to isolate queries after an early transaction. -
remoteValueHolders
The original remote value holders, before they were serialized; keyed by ID -
remoteCursors
The original cursor (either CursoredStream or ScrollableCursor, before they were serialized; keyed by ID -
commandManager
This is the Synchronization policy used to synchronize remote caches
-
-
Constructor Details
-
RemoteSessionController
-
-
Method Details
-
processCommand
INTERNAL: This method is intended to be used by by sessions that wish to execute a command on a remote session- Parameters:
remoteCommand
- RemoteCommand The command to be executed on the remote session
-
beginTransaction
Begin a transaction on the database. -
beginEarlyTransaction
Begin an early unit of work transaction. -
buildObjectDescriptor
build and return an object descriptor to be sent to the client -
closeScrollableCursor
Used for closing scrolable cursor across RMI. -
commitRootUnitOfWork
Remote unit of work after serialization is commited locally. -
commitTransaction
Commit a transaction on the database. -
cursoredStreamClose
Used for closing cursored streams across RMI. -
cursoredStreamNextpage
Retrieve next page of objects from the remote cursored stream once, avoid page size round trips from the server to the client -
cursoredStreamSize
Return the wrapped cursored stream from the server -
cursorSelectObjects
Returns a remote cursor stub in a transporter -
executeNamedQuery
public Transporter executeNamedQuery(Transporter nameTransporter, Transporter classTransporter, Transporter argumentsTransporter) A named query after serialization is executed locally. -
executeQuery
A remote query after serialization is executed locally. -
getCommandManager
INTERNAL: This method returns the command manager policy for this remote connection -
getDefaultReadOnlyClasses
return the read-only classes -
getDescriptor
Extract descriptor from the session -
getDescriptorForAlias
Extract descriptor from the session -
getLogin
Get the associated session login. -
getRemoteCursors
return the pre-remoted cursors -
getRemoteValueHolders
INTERNAL: return the pre-serialized remote value holders -
getSequenceNumberNamed
INTERNAL: Get the value returned by remote function call -
getSession
Get the associated server side session. -
initialize
Initialize this RemoteSessionController with a session. Clear the cached valueholders and cursors. -
initializeIdentityMapsOnServerSession
Initalize all the server side identity maps. -
instantiateRemoteValueHolderOnServer
The corresponding original value holder is instantiated. -
isInTransaction
protected boolean isInTransaction() -
replaceValueHoldersIn
Traverse the specified object, replacing the standard value holders with remote value holders. And build up a collection of object descriptors. -
replaceValueHoldersIn
Traverse the specified object, replacing the standard value holders with remote value holders. Add the resulting object descriptors to the "collecting parm". -
replaceValueHoldersInAll
Traverse the specified objects, replacing the standard value holders with remote value holders. And build up a collection of object descriptors. -
rollbackTransaction
Rollback a transaction on the database. -
saveRemoteValueHolder
Save the pre-serialized version of the remote value holder so that it can be used when the serialized version (on the client) is instantiated and needs to come back to the server to get its "value". -
scrollableCursorAbsolute
Moves the cursor to the given row number in the result set -
scrollableCursorAfterLast
Moves the cursor to the end of the result set, just after the last row. -
scrollableCursorBeforeFirst
Moves the cursor to the front of the result set, just before the first row -
scrollableCursorClose
Used for closing cursored streams across RMI. -
scrollableCursorCurrentIndex
Retrieves the current row index number -
scrollableCursorFirst
Moves the cursor to the first row in the result set -
scrollableCursorIsAfterLast
Indicates whether the cursor is after the last row in the result set. -
scrollableCursorIsBeforeFirst
Indicates whether the cursor is before the first row in the result set. -
scrollableCursorIsFirst
Indicates whether the cursor is on the first row of the result set. -
scrollableCursorIsLast
Indicates whether the cursor is on the last row of the result set. -
scrollableCursorLast
Moves the cursor to the last row in the result set -
scrollableCursorNextObject
Retrieve next object from the scrollable cursor -
scrollableCursorPreviousObject
Retrieve previous object from the scrollable cursor -
scrollableCursorRelative
Moves the cursor to the given row number in the result set -
scrollableCursorSize
Return the scrollable cursor size from the server -
setIsInTransaction
protected void setIsInTransaction(boolean isInTransaction) -
setRemoteCursors
set the pre-remoted cursors -
setRemoteValueHolders
set the pre-serialized remote value holders -
setSession
Set the associated server side session. -
getExecutionSession
Return the correct session for the transaction context. If in an active transaction, a unit of work must be used to avoid putting uncommitted data into the cache, and to use the correct accessor for the queries.
-