Class RemoteSessionController


  • public class RemoteSessionController
    extends Object
    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 Detail

      • isInTransaction

        protected boolean isInTransaction
        Used to resolve transaction treading for client-side nested transaction where server uses many worker threads.
      • isInEarlyTransaction

        protected boolean isInEarlyTransaction
        Used to isolate queries to a unit of work in an early transaction.
      • session

        protected AbstractSession session
        This is a either a database session or a client session depending upon the setup.
      • unitOfWork

        protected UnitOfWorkImpl unitOfWork
        Use the temporary unit of work to isolate queries after an early transaction.
      • remoteValueHolders

        protected Map<ObjID,​ValueHolderInterface> remoteValueHolders
        The original remote value holders, before they were serialized; keyed by ID
      • remoteCursors

        protected Map<ObjID,​Cursor> remoteCursors
        The original cursor (either CursoredStream or ScrollableCursor, before they were serialized; keyed by ID
      • commandManager

        protected CommandManager commandManager
        This is the Synchronization policy used to synchronize remote caches
    • Constructor Detail

      • RemoteSessionController

        public RemoteSessionController​(AbstractSession session)
    • Method Detail

      • processCommand

        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 - RemoteCommand The command to be executed on the remote session
      • beginTransaction

        public Transporter beginTransaction()
        Begin a transaction on the database.
      • beginEarlyTransaction

        public Transporter beginEarlyTransaction()
        Begin an early unit of work transaction.
      • buildObjectDescriptor

        protected ObjectDescriptor buildObjectDescriptor​(Object object)
        build and return an object descriptor to be sent to the client
      • closeScrollableCursor

        public Transporter closeScrollableCursor​(ObjID id)
        Used for closing scrolable cursor across RMI.
      • commitRootUnitOfWork

        public Transporter commitRootUnitOfWork​(Transporter remoteTransporter)
        Remote unit of work after serialization is commited locally.
      • commitTransaction

        public Transporter commitTransaction()
        Commit a transaction on the database.
      • cursoredStreamClose

        public Transporter cursoredStreamClose​(Transporter remoteCursoredStreamOid)
        Used for closing cursored streams across RMI.
      • cursoredStreamNextpage

        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
      • cursoredStreamSize

        public Transporter cursoredStreamSize​(Transporter remoteCursoredStreamOid)
        Return the wrapped cursored stream from the server
      • cursorSelectObjects

        public Transporter cursorSelectObjects​(Transporter remoteTransporter)
        Returns a remote cursor stub in a transporter
      • executeQuery

        public Transporter executeQuery​(Transporter remoteTransporter)
        A remote query after serialization is executed locally.
      • getCommandManager

        public CommandManager getCommandManager()
        INTERNAL: This method returns the command manager policy for this remote connection
      • getDefaultReadOnlyClasses

        public Transporter getDefaultReadOnlyClasses()
        return the read-only classes
      • getDescriptor

        public Transporter getDescriptor​(Transporter remoteTransporter)
        Extract descriptor from the session
      • getDescriptorForAlias

        public Transporter getDescriptorForAlias​(Transporter remoteTransporter)
        Extract descriptor from the session
      • getLogin

        public Transporter getLogin()
        Get the associated session login.
      • getRemoteCursors

        protected Map<ObjID,​Cursor> getRemoteCursors()
        return the pre-remoted cursors
      • getRemoteValueHolders

        public Map<ObjID,​ValueHolderInterface> getRemoteValueHolders()
        INTERNAL: return the pre-serialized remote value holders
      • getSequenceNumberNamed

        public Transporter getSequenceNumberNamed​(Transporter remoteFunctionCall)
        INTERNAL: Get the value returned by remote function call
      • getSession

        public AbstractSession getSession()
        Get the associated server side session.
      • initialize

        protected void initialize​(AbstractSession session)
        Initialize this RemoteSessionController with a session. Clear the cached valueholders and cursors.
      • initializeIdentityMapsOnServerSession

        public Transporter initializeIdentityMapsOnServerSession()
        Initalize all the server side identity maps.
      • instantiateRemoteValueHolderOnServer

        public Transporter instantiateRemoteValueHolderOnServer​(Transporter remoteTransporter)
        The corresponding original value holder is instantiated.
      • isInTransaction

        protected boolean isInTransaction()
      • replaceValueHoldersIn

        public Map replaceValueHoldersIn​(Object object)
        Traverse the specified object, replacing the standard value holders with remote value holders. And build up a collection of object descriptors.
      • replaceValueHoldersIn

        public void replaceValueHoldersIn​(Object object,
                                          Map objectDescriptors)
        Traverse the specified object, replacing the standard value holders with remote value holders. Add the resulting object descriptors to the "collecting parm".
      • replaceValueHoldersInAll

        public Map 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.
      • rollbackTransaction

        public Transporter rollbackTransaction()
        Rollback a transaction on the database.
      • saveRemoteValueHolder

        public 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

        public Transporter scrollableCursorAbsolute​(Transporter remoteScrollableCursorOid,
                                                    int rows)
        Moves the cursor to the given row number in the result set
      • scrollableCursorAfterLast

        public Transporter scrollableCursorAfterLast​(Transporter remoteScrollableCursorOid)
        Moves the cursor to the end of the result set, just after the last row.
      • scrollableCursorBeforeFirst

        public Transporter scrollableCursorBeforeFirst​(Transporter remoteScrollableCursorOid)
        Moves the cursor to the front of the result set, just before the first row
      • scrollableCursorClose

        public Transporter scrollableCursorClose​(Transporter remoteScrollableCursorOid)
        Used for closing cursored streams across RMI.
      • scrollableCursorCurrentIndex

        public Transporter scrollableCursorCurrentIndex​(Transporter remoteScrollableCursorOid)
        Retrieves the current row index number
      • scrollableCursorFirst

        public Transporter scrollableCursorFirst​(Transporter remoteScrollableCursorOid)
        Moves the cursor to the first row in the result set
      • scrollableCursorIsAfterLast

        public Transporter scrollableCursorIsAfterLast​(Transporter remoteScrollableCursorOid)
        Indicates whether the cursor is after the last row in the result set.
      • scrollableCursorIsBeforeFirst

        public Transporter scrollableCursorIsBeforeFirst​(Transporter remoteScrollableCursorOid)
        Indicates whether the cursor is before the first row in the result set.
      • scrollableCursorIsFirst

        public Transporter scrollableCursorIsFirst​(Transporter remoteScrollableCursorOid)
        Indicates whether the cursor is on the first row of the result set.
      • scrollableCursorIsLast

        public Transporter scrollableCursorIsLast​(Transporter remoteScrollableCursorOid)
        Indicates whether the cursor is on the last row of the result set.
      • scrollableCursorLast

        public Transporter scrollableCursorLast​(Transporter remoteScrollableCursorOid)
        Moves the cursor to the last row in the result set
      • scrollableCursorNextObject

        public Transporter scrollableCursorNextObject​(Transporter remoteScrollableCursorOid)
        Retrieve next object from the scrollable cursor
      • scrollableCursorPreviousObject

        public Transporter scrollableCursorPreviousObject​(Transporter remoteScrollableCursorOid)
        Retrieve previous object from the scrollable cursor
      • scrollableCursorRelative

        public Transporter scrollableCursorRelative​(Transporter remoteScrollableCursorOid,
                                                    int rows)
        Moves the cursor to the given row number in the result set
      • scrollableCursorSize

        public Transporter scrollableCursorSize​(Transporter remoteCursorOid)
        Return the scrollable cursor size from the server
      • setIsInTransaction

        protected void setIsInTransaction​(boolean isInTransaction)
      • setRemoteCursors

        protected void setRemoteCursors​(Map<ObjID,​Cursor> remoteCursors)
        set the pre-remoted cursors
      • setRemoteValueHolders

        protected void setRemoteValueHolders​(Map<ObjID,​ValueHolderInterface> remoteValueHolders)
        set the pre-serialized remote value holders
      • setSession

        protected void setSession​(AbstractSession session)
        Set the associated server side session.
      • getExecutionSession

        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.