Top Description Fields Constructors Methods
org.eclipse.persistence.internal.sessions.remote

public Class RemoteSessionController

extends Object
Class Inheritance
Imports
java.rmi.server.ObjID, java.util.Enumeration, .Hashtable, .IdentityHashMap, .Map, .Vector, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.indirection.ValueHolderInterface, org.eclipse.persistence.internal.descriptors.DescriptorIterator, org.eclipse.persistence.internal.helper.ClassConstants, org.eclipse.persistence.internal.identitymaps.CacheKey, org.eclipse.persistence.internal.queries.CollectionContainerPolicy, .ContainerPolicy, org.eclipse.persistence.internal.sessions.AbstractRecord, .AbstractSession, .UnitOfWorkImpl, org.eclipse.persistence.queries.Cursor, .CursorPolicy, .CursoredStream, .DatabaseQuery, .ScrollableCursor, org.eclipse.persistence.sessions.coordination.CommandManager

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 TypeField and Description
protected CommandManager
commandManager

This is the Synchronization policy used to synchronize remote caches

protected boolean
isInEarlyTransaction

Used to isolate queries to a unit of work in an early transaction.

protected boolean
isInTransaction

Used to resolve transaction treading for client-side nested transaction where server uses many worker threads.

protected Map<ObjID, Cursor>
remoteCursors

The original cursor (either CursoredStream or ScrollableCursor, before they were serialized; keyed by ID

protected Map<ObjID, ValueHolderInterface<T>>
remoteValueHolders

The original remote value holders, before they were serialized; keyed by ID

protected AbstractSession
session

This is a either a database session or a client session depending upon the setup.

protected UnitOfWorkImpl
unitOfWork

Use the temporary unit of work to isolate queries after an early transaction.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Transporter
beginEarlyTransaction()

Begin an early unit of work transaction.

public Transporter
beginTransaction()

Begin a transaction on the database.

protected ObjectDescriptor
buildObjectDescriptor(Object object)

build and return an object descriptor to be sent to the client

public Transporter
closeScrollableCursor(ObjID id)

Used for closing scrolable cursor across RMI.

public Transporter
commitRootUnitOfWork(Transporter remoteTransporter)

Remote unit of work after serialization is commited locally.

public Transporter
commitTransaction()

Commit a transaction on the database.

public Transporter
cursoredStreamClose(Transporter remoteCursoredStreamOid)

Used for closing cursored streams across RMI.

public Transporter
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 client

public Transporter
cursoredStreamSize(Transporter remoteCursoredStreamOid)

Return the wrapped cursored stream from the server

public Transporter
cursorSelectObjects(Transporter remoteTransporter)

Returns a remote cursor stub in a transporter

public Transporter
executeNamedQuery(Transporter nameTransporter, Transporter classTransporter, Transporter argumentsTransporter)

A named query after serialization is executed locally.

public Transporter
executeQuery(Transporter remoteTransporter)

A remote query after serialization is executed locally.

public CommandManager
getCommandManager()

INTERNAL: This method returns the command manager policy for this remote connection

public Transporter
getDefaultReadOnlyClasses()

return the read-only classes

public Transporter
getDescriptor(Transporter remoteTransporter)

Extract descriptor from the session

public Transporter
getDescriptorForAlias(Transporter remoteTransporter)

Extract descriptor from the session

protected AbstractSession
getExecutionSession()

Return the correct session for the transaction context.

public Transporter
getLogin()

Get the associated session login.

protected Map<ObjID, Cursor>
getRemoteCursors()

return the pre-remoted cursors

public Map<ObjID, ValueHolderInterface<T>>
getRemoteValueHolders()

INTERNAL: return the pre-serialized remote value holders

public Transporter
getSequenceNumberNamed(Transporter remoteFunctionCall)

INTERNAL: Get the value returned by remote function call

public AbstractSession
getSession()

Get the associated server side session.

protected void
initialize(AbstractSession session)

Initialize this RemoteSessionController with a session.

public Transporter
initializeIdentityMapsOnServerSession()

Initalize all the server side identity maps.

public Transporter
instantiateRemoteValueHolderOnServer(Transporter remoteTransporter)

The corresponding original value holder is instantiated.

protected boolean
public Transporter
processCommand(Transporter
RemoteCommand The command to be executed on the remote session
remoteCommand
)

INTERNAL: This method is intended to be used by by sessions that wish to execute a command on a remote session

public Map<K, V>
replaceValueHoldersIn(Object object)

Traverse the specified object, replacing the standard value holders with remote value holders.

public void
replaceValueHoldersIn(Object object, Map<K, V> objectDescriptors)

Traverse the specified object, replacing the standard value holders with remote value holders.

public Map<K, V>
replaceValueHoldersInAll(Object container, ContainerPolicy policy)

Traverse the specified objects, replacing the standard value holders with remote value holders.

public Transporter
rollbackTransaction()

Rollback a transaction on the database.

public void
saveRemoteValueHolder(RemoteValueHolder<T> 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".

public Transporter
scrollableCursorAbsolute(Transporter remoteScrollableCursorOid, int rows)

Moves the cursor to the given row number in the result set

public Transporter
scrollableCursorAfterLast(Transporter remoteScrollableCursorOid)

Moves the cursor to the end of the result set, just after the last row.

public Transporter
scrollableCursorBeforeFirst(Transporter remoteScrollableCursorOid)

Moves the cursor to the front of the result set, just before the first row

public Transporter
scrollableCursorClose(Transporter remoteScrollableCursorOid)

Used for closing cursored streams across RMI.

public Transporter
scrollableCursorCurrentIndex(Transporter remoteScrollableCursorOid)

Retrieves the current row index number

public Transporter
scrollableCursorFirst(Transporter remoteScrollableCursorOid)

Moves the cursor to the first row in the result set

public Transporter
scrollableCursorIsAfterLast(Transporter remoteScrollableCursorOid)

Indicates whether the cursor is after the last row in the result set.

public Transporter
scrollableCursorIsBeforeFirst(Transporter remoteScrollableCursorOid)

Indicates whether the cursor is before the first row in the result set.

public Transporter
scrollableCursorIsFirst(Transporter remoteScrollableCursorOid)

Indicates whether the cursor is on the first row of the result set.

public Transporter
scrollableCursorIsLast(Transporter remoteScrollableCursorOid)

Indicates whether the cursor is on the last row of the result set.

public Transporter
scrollableCursorLast(Transporter remoteScrollableCursorOid)

Moves the cursor to the last row in the result set

public Transporter
scrollableCursorNextObject(Transporter remoteScrollableCursorOid)

Retrieve next object from the scrollable cursor

public Transporter
scrollableCursorPreviousObject(Transporter remoteScrollableCursorOid)

Retrieve previous object from the scrollable cursor

public Transporter
scrollableCursorRelative(Transporter remoteScrollableCursorOid, int rows)

Moves the cursor to the given row number in the result set

public Transporter
scrollableCursorSize(Transporter remoteCursorOid)

Return the scrollable cursor size from the server

protected void
setIsInTransaction(boolean isInTransaction)

protected void
setRemoteCursors(Map<ObjID, Cursor> remoteCursors)

set the pre-remoted cursors

protected void
setRemoteValueHolders(Map<ObjID, ValueHolderInterface<T>> remoteValueHolders)

set the pre-serialized remote value holders

protected void
setSession(AbstractSession session)

Set the associated server side session.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

commandManagerback to summary
protected CommandManager commandManager

This is the Synchronization policy used to synchronize remote caches

isInEarlyTransactionback to summary
protected boolean isInEarlyTransaction

Used to isolate queries to a unit of work in an early transaction.

isInTransactionback to summary
protected boolean isInTransaction

Used to resolve transaction treading for client-side nested transaction where server uses many worker threads.

remoteCursorsback to summary
protected Map<ObjID, Cursor> remoteCursors

The original cursor (either CursoredStream or ScrollableCursor, before they were serialized; keyed by ID

remoteValueHoldersback to summary
protected Map<ObjID, ValueHolderInterface<T>> remoteValueHolders

The original remote value holders, before they were serialized; keyed by ID

sessionback to summary
protected AbstractSession session

This is a either a database session or a client session depending upon the setup.

unitOfWorkback to summary
protected UnitOfWorkImpl unitOfWork

Use the temporary unit of work to isolate queries after an early transaction.

Constructor Detail

RemoteSessionControllerback to summary
public RemoteSessionController(AbstractSession session)

Method Detail

beginEarlyTransactionback to summary
public Transporter beginEarlyTransaction()

Begin an early unit of work transaction.

beginTransactionback to summary
public Transporter beginTransaction()

Begin a transaction on the database.

buildObjectDescriptorback to summary
protected ObjectDescriptor buildObjectDescriptor(Object object)

build and return an object descriptor to be sent to the client

closeScrollableCursorback to summary
public Transporter closeScrollableCursor(ObjID id)

Used for closing scrolable cursor across RMI.

commitRootUnitOfWorkback to summary
public Transporter commitRootUnitOfWork(Transporter remoteTransporter)

Remote unit of work after serialization is commited locally.

commitTransactionback to summary
public Transporter commitTransaction()

Commit a transaction on the database.

cursoredStreamCloseback to summary
public Transporter cursoredStreamClose(Transporter remoteCursoredStreamOid)

Used for closing cursored streams across RMI.

cursoredStreamNextpageback to summary
public Transporter 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 client

cursoredStreamSizeback to summary
public Transporter cursoredStreamSize(Transporter remoteCursoredStreamOid)

Return the wrapped cursored stream from the server

cursorSelectObjectsback to summary
public Transporter cursorSelectObjects(Transporter remoteTransporter)

Returns a remote cursor stub in a transporter

executeNamedQueryback to summary
public Transporter executeNamedQuery(Transporter nameTransporter, Transporter classTransporter, Transporter argumentsTransporter)

A named query after serialization is executed locally.

executeQueryback to summary
public Transporter executeQuery(Transporter remoteTransporter)

A remote query after serialization is executed locally.

getCommandManagerback to summary
public CommandManager getCommandManager()

INTERNAL: This method returns the command manager policy for this remote connection

getDefaultReadOnlyClassesback to summary
public Transporter getDefaultReadOnlyClasses()

return the read-only classes

getDescriptorback to summary
public Transporter getDescriptor(Transporter remoteTransporter)

Extract descriptor from the session

getDescriptorForAliasback to summary
public Transporter getDescriptorForAlias(Transporter remoteTransporter)

Extract descriptor from the session

getExecutionSessionback to summary
protected AbstractSession 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.

getLoginback to summary
public Transporter getLogin()

Get the associated session login.

getRemoteCursorsback to summary
protected Map<ObjID, Cursor> getRemoteCursors()

return the pre-remoted cursors

getRemoteValueHoldersback to summary
public Map<ObjID, ValueHolderInterface<T>> getRemoteValueHolders()

INTERNAL: return the pre-serialized remote value holders

getSequenceNumberNamedback to summary
public Transporter getSequenceNumberNamed(Transporter remoteFunctionCall)

INTERNAL: Get the value returned by remote function call

getSessionback to summary
public AbstractSession getSession()

Get the associated server side session.

initializeback to summary
protected void initialize(AbstractSession session)

Initialize this RemoteSessionController with a session. Clear the cached valueholders and cursors.

initializeIdentityMapsOnServerSessionback to summary
public Transporter initializeIdentityMapsOnServerSession()

Initalize all the server side identity maps.

instantiateRemoteValueHolderOnServerback to summary
public Transporter instantiateRemoteValueHolderOnServer(Transporter remoteTransporter)

The corresponding original value holder is instantiated.

isInTransactionback to summary
protected boolean isInTransaction()
processCommandback to summary
public Transporter processCommand(Transporter remoteCommand)

INTERNAL: This method is intended to be used by by sessions that wish to execute a command on a remote session

Parameters
remoteCommand:Transporter

RemoteCommand The command to be executed on the remote session

replaceValueHoldersInback to summary
public Map<K, V> replaceValueHoldersIn(Object object)

Traverse the specified object, replacing the standard value holders with remote value holders. And build up a collection of object descriptors.

replaceValueHoldersInback to summary
public void replaceValueHoldersIn(Object object, Map<K, V> objectDescriptors)

Traverse the specified object, replacing the standard value holders with remote value holders. Add the resulting object descriptors to the "collecting parm".

replaceValueHoldersInAllback to summary
public Map<K, V> replaceValueHoldersInAll(Object container, ContainerPolicy policy)

Traverse the specified objects, replacing the standard value holders with remote value holders. And build up a collection of object descriptors.

rollbackTransactionback to summary
public Transporter rollbackTransaction()

Rollback a transaction on the database.

saveRemoteValueHolderback to summary
public void saveRemoteValueHolder(RemoteValueHolder<T> 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".

scrollableCursorAbsoluteback to summary
public Transporter scrollableCursorAbsolute(Transporter remoteScrollableCursorOid, int rows)

Moves the cursor to the given row number in the result set

scrollableCursorAfterLastback to summary
public Transporter scrollableCursorAfterLast(Transporter remoteScrollableCursorOid)

Moves the cursor to the end of the result set, just after the last row.

scrollableCursorBeforeFirstback to summary
public Transporter scrollableCursorBeforeFirst(Transporter remoteScrollableCursorOid)

Moves the cursor to the front of the result set, just before the first row

scrollableCursorCloseback to summary
public Transporter scrollableCursorClose(Transporter remoteScrollableCursorOid)

Used for closing cursored streams across RMI.

scrollableCursorCurrentIndexback to summary
public Transporter scrollableCursorCurrentIndex(Transporter remoteScrollableCursorOid)

Retrieves the current row index number

scrollableCursorFirstback to summary
public Transporter scrollableCursorFirst(Transporter remoteScrollableCursorOid)

Moves the cursor to the first row in the result set

scrollableCursorIsAfterLastback to summary
public Transporter scrollableCursorIsAfterLast(Transporter remoteScrollableCursorOid)

Indicates whether the cursor is after the last row in the result set.

scrollableCursorIsBeforeFirstback to summary
public Transporter scrollableCursorIsBeforeFirst(Transporter remoteScrollableCursorOid)

Indicates whether the cursor is before the first row in the result set.

scrollableCursorIsFirstback to summary
public Transporter scrollableCursorIsFirst(Transporter remoteScrollableCursorOid)

Indicates whether the cursor is on the first row of the result set.

scrollableCursorIsLastback to summary
public Transporter scrollableCursorIsLast(Transporter remoteScrollableCursorOid)

Indicates whether the cursor is on the last row of the result set.

scrollableCursorLastback to summary
public Transporter scrollableCursorLast(Transporter remoteScrollableCursorOid)

Moves the cursor to the last row in the result set

scrollableCursorNextObjectback to summary
public Transporter scrollableCursorNextObject(Transporter remoteScrollableCursorOid)

Retrieve next object from the scrollable cursor

scrollableCursorPreviousObjectback to summary
public Transporter scrollableCursorPreviousObject(Transporter remoteScrollableCursorOid)

Retrieve previous object from the scrollable cursor

scrollableCursorRelativeback to summary
public Transporter scrollableCursorRelative(Transporter remoteScrollableCursorOid, int rows)

Moves the cursor to the given row number in the result set

scrollableCursorSizeback to summary
public Transporter scrollableCursorSize(Transporter remoteCursorOid)

Return the scrollable cursor size from the server

setIsInTransactionback to summary
protected void setIsInTransaction(boolean isInTransaction)
setRemoteCursorsback to summary
protected void setRemoteCursors(Map<ObjID, Cursor> remoteCursors)

set the pre-remoted cursors

setRemoteValueHoldersback to summary
protected void setRemoteValueHolders(Map<ObjID, ValueHolderInterface<T>> remoteValueHolders)

set the pre-serialized remote value holders

setSessionback to summary
protected void setSession(AbstractSession session)

Set the associated server side session.