Class RemoteConnection
- java.lang.Object
-
- org.eclipse.persistence.internal.sessions.remote.RemoteConnection
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
CORBAConnection,RMIConnection,RMIConnection
public abstract class RemoteConnection extends java.lang.Object implements java.io.SerializableDefines set of abstract methods which one must overwrite for any kind to implement a communication mechanism.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringserviceNameThis attribute is used to provide a globally unique identifier for this connection.protected DistributedSessionsessionBack reference to owning session.
-
Constructor Summary
Constructors Constructor Description RemoteConnection()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidbeginEarlyTransaction()Begin an early unit of work transaction.abstract voidbeginTransaction()Begin a transaction on the database.abstract RemoteUnitOfWorkcommitRootUnitOfWork(RemoteUnitOfWork remoteUnitOfWork)Commit remote unit of workabstract voidcommitTransaction()Commit a transaction on the database.abstract SessioncreateRemoteSession()Returns remote client session.abstract voidcursoredStreamClose(java.rmi.server.ObjID id)Used for closing cursored streams across RMI.abstract java.util.VectorcursoredStreamNextPage(RemoteCursoredStream remoteCursoredStream, ReadQuery query, DistributedSession session, int pageSize)Retrieve next page size of objects from the remote cursored streamabstract intcursoredStreamSize(java.rmi.server.ObjID remoteCursoredStreamID)Return the cursored stream sizeabstract RemoteCursoredStreamcursorSelectObjects(CursoredStreamPolicy policy, DistributedSession session)Get remote cursor stream.abstract RemoteScrollableCursorcursorSelectObjects(ScrollableCursorPolicy policy, DistributedSession session)Get remote cursor stream.voidfixObjectReferences(Transporter remoteCursoredStream, ObjectLevelReadQuery query, DistributedSession session)INTERNAL: An object has been serialized from the server to the remote client.abstract java.util.VectorgetDefaultReadOnlyClasses()INTERNAL: Get the read-only classesabstract ClassDescriptorgetDescriptor(java.lang.Class domainClass)Get descriptorabstract ClassDescriptorgetDescriptorForAlias(java.lang.String alias)Get descriptorabstract LogingetLogin()Return the login informaiton from the server.abstract java.lang.ObjectgetSequenceNumberNamed(java.lang.Object remoteFunctionCall)INTERNAL: Perform remote function calljava.lang.StringgetServiceName()ADVANCED: This method is used to get the globally unique identifier for this connection.DistributedSessiongetSession()voidinitialize(DistributedSession session)Allow the connection to initialize an setting in the session.abstract voidinitializeIdentityMapsOnServerSession()abstract TransporterinstantiateRemoteValueHolderOnServer(RemoteValueHolder remoteValueHolder)Instantiated remote value holder.booleanisConnected()abstract voidprocessCommand(RemoteCommand remoteCommand)INTERNAL: This method is intended to be used by newly connecting nodes to notify the other nodes in a distributed system to send changes to this calling servervoidrelease()PUBLIC: Release the connection resource.abstract TransporterremoteExecute(DatabaseQuery query)Execute query remotely.abstract TransporterremoteExecuteNamedQuery(java.lang.String name, java.lang.Class javaClass, java.util.Vector arguments)Execute query remotely.abstract voidrollbackTransaction()Rollback a transaction on the database.abstract booleanscrollableCursorAbsolute(java.rmi.server.ObjID remoteScrollableCursorOid, int rows)Moves the cursor to the given row number in the result setabstract voidscrollableCursorAfterLast(java.rmi.server.ObjID remoteScrollableCursorOid)Moves the cursor to the end of the result set, just after the last row.abstract voidscrollableCursorBeforeFirst(java.rmi.server.ObjID remoteScrollableCursorOid)Moves the cursor to the front of the result set, just before the first rowabstract voidscrollableCursorClose(java.rmi.server.ObjID remoteScrollableCursorOid)Used for closing scrolable cursor across RMI.abstract intscrollableCursorCurrentIndex(java.rmi.server.ObjID remoteScrollableCursorOid)Retrieves the current row index numberabstract booleanscrollableCursorFirst(java.rmi.server.ObjID remoteScrollableCursorOid)Moves the cursor to the first row in the result setabstract booleanscrollableCursorIsAfterLast(java.rmi.server.ObjID remoteScrollableCursorOid)Indicates whether the cursor is after the last row in the result set.abstract booleanscrollableCursorIsBeforeFirst(java.rmi.server.ObjID remoteScrollableCursorOid)Indicates whether the cursor is before the first row in the result set.abstract booleanscrollableCursorIsFirst(java.rmi.server.ObjID remoteScrollableCursorOid)Indicates whether the cursor is on the first row of the result set.abstract booleanscrollableCursorIsLast(java.rmi.server.ObjID remoteScrollableCursorOid)Indicates whether the cursor is on the last row of the result set.abstract booleanscrollableCursorLast(java.rmi.server.ObjID remoteScrollableCursorOid)Moves the cursor to the last row in the result setabstract java.lang.ObjectscrollableCursorNextObject(java.rmi.server.ObjID remoteScrollableCursorOid, ReadQuery query, DistributedSession session)Retrieve next object from the remote scrollable cursorabstract java.lang.ObjectscrollableCursorPreviousObject(java.rmi.server.ObjID remoteScrollableCursorOid, ReadQuery query, DistributedSession session)Retrieve previous object from the remote scrollable cursorabstract booleanscrollableCursorRelative(java.rmi.server.ObjID remoteScrollableCursorOid, int rows)Moves the cursor a relative number of rows, either positive or negative.abstract intscrollableCursorSize(java.rmi.server.ObjID cursorId)Return the scrollable cursor sizevoidsetServiceName(java.lang.String newServiceName)ADVANCED: This method is used to set the globally unique identifier for this connection.voidsetSession(DistributedSession session)
-
-
-
Field Detail
-
serviceName
protected java.lang.String serviceName
This attribute is used to provide a globally unique identifier for this connection. It should be the same value as the JNDI context or the RMIRegistry context.
-
session
protected DistributedSession session
Back reference to owning session.
-
-
Method Detail
-
processCommand
public abstract void processCommand(RemoteCommand remoteCommand)
INTERNAL: This method is intended to be used by newly connecting nodes to notify the other nodes in a distributed system to send changes to this calling server- Parameters:
remoteTransporter- Transporter This transporter contains the RemoteDispatcher of the calling server.
-
initialize
public void initialize(DistributedSession session)
Allow the connection to initialize an setting in the session.
-
getSession
public DistributedSession getSession()
-
setSession
public void setSession(DistributedSession session)
-
isConnected
public boolean isConnected()
-
beginTransaction
public abstract void beginTransaction()
Begin a transaction on the database.
-
beginEarlyTransaction
public abstract void beginEarlyTransaction()
Begin an early unit of work transaction.
-
commitRootUnitOfWork
public abstract RemoteUnitOfWork commitRootUnitOfWork(RemoteUnitOfWork remoteUnitOfWork)
Commit remote unit of work
-
commitTransaction
public abstract void commitTransaction()
Commit a transaction on the database.
-
createRemoteSession
public abstract Session createRemoteSession()
Returns remote client session.
-
cursoredStreamClose
public abstract void cursoredStreamClose(java.rmi.server.ObjID id)
Used for closing cursored streams across RMI.
-
cursoredStreamNextPage
public abstract java.util.Vector cursoredStreamNextPage(RemoteCursoredStream remoteCursoredStream, ReadQuery query, DistributedSession session, int pageSize)
Retrieve next page size of objects from the remote cursored stream
-
cursoredStreamSize
public abstract int cursoredStreamSize(java.rmi.server.ObjID remoteCursoredStreamID)
Return the cursored stream size
-
cursorSelectObjects
public abstract RemoteCursoredStream cursorSelectObjects(CursoredStreamPolicy policy, DistributedSession session)
Get remote cursor stream.
-
cursorSelectObjects
public abstract RemoteScrollableCursor cursorSelectObjects(ScrollableCursorPolicy policy, DistributedSession session)
Get remote cursor stream.
-
getDefaultReadOnlyClasses
public abstract java.util.Vector getDefaultReadOnlyClasses()
INTERNAL: Get the read-only classes
-
getDescriptor
public abstract ClassDescriptor getDescriptor(java.lang.Class domainClass)
Get descriptor
-
getDescriptorForAlias
public abstract ClassDescriptor getDescriptorForAlias(java.lang.String alias)
Get descriptor
-
getLogin
public abstract Login getLogin()
Return the login informaiton from the server.
-
getSequenceNumberNamed
public abstract java.lang.Object getSequenceNumberNamed(java.lang.Object remoteFunctionCall)
INTERNAL: Perform remote function call
-
getServiceName
public java.lang.String getServiceName()
ADVANCED: This method is used to get the globally unique identifier for this connection. This identifier should be the same as the JNDI context the service was stored under.- Returns:
- java.lang.String the name
-
initializeIdentityMapsOnServerSession
public abstract void initializeIdentityMapsOnServerSession()
-
instantiateRemoteValueHolderOnServer
public abstract Transporter instantiateRemoteValueHolderOnServer(RemoteValueHolder remoteValueHolder)
Instantiated remote value holder.
-
remoteExecute
public abstract Transporter remoteExecute(DatabaseQuery query)
Execute query remotely.
-
remoteExecuteNamedQuery
public abstract Transporter remoteExecuteNamedQuery(java.lang.String name, java.lang.Class javaClass, java.util.Vector arguments)
Execute query remotely.
-
rollbackTransaction
public abstract void rollbackTransaction()
Rollback a transaction on the database.
-
scrollableCursorAbsolute
public abstract boolean scrollableCursorAbsolute(java.rmi.server.ObjID remoteScrollableCursorOid, int rows)Moves the cursor to the given row number in the result set
-
scrollableCursorAfterLast
public abstract void scrollableCursorAfterLast(java.rmi.server.ObjID remoteScrollableCursorOid)
Moves the cursor to the end of the result set, just after the last row.
-
scrollableCursorBeforeFirst
public abstract void scrollableCursorBeforeFirst(java.rmi.server.ObjID remoteScrollableCursorOid)
Moves the cursor to the front of the result set, just before the first row
-
scrollableCursorClose
public abstract void scrollableCursorClose(java.rmi.server.ObjID remoteScrollableCursorOid)
Used for closing scrolable cursor across RMI.
-
scrollableCursorCurrentIndex
public abstract int scrollableCursorCurrentIndex(java.rmi.server.ObjID remoteScrollableCursorOid)
Retrieves the current row index number
-
scrollableCursorFirst
public abstract boolean scrollableCursorFirst(java.rmi.server.ObjID remoteScrollableCursorOid)
Moves the cursor to the first row in the result set
-
scrollableCursorIsAfterLast
public abstract boolean scrollableCursorIsAfterLast(java.rmi.server.ObjID remoteScrollableCursorOid)
Indicates whether the cursor is after the last row in the result set.
-
scrollableCursorIsBeforeFirst
public abstract boolean scrollableCursorIsBeforeFirst(java.rmi.server.ObjID remoteScrollableCursorOid)
Indicates whether the cursor is before the first row in the result set.
-
scrollableCursorIsFirst
public abstract boolean scrollableCursorIsFirst(java.rmi.server.ObjID remoteScrollableCursorOid)
Indicates whether the cursor is on the first row of the result set.
-
scrollableCursorIsLast
public abstract boolean scrollableCursorIsLast(java.rmi.server.ObjID remoteScrollableCursorOid)
Indicates whether the cursor is on the last row of the result set.
-
scrollableCursorLast
public abstract boolean scrollableCursorLast(java.rmi.server.ObjID remoteScrollableCursorOid)
Moves the cursor to the last row in the result set
-
scrollableCursorNextObject
public abstract java.lang.Object scrollableCursorNextObject(java.rmi.server.ObjID remoteScrollableCursorOid, ReadQuery query, DistributedSession session)Retrieve next object from the remote scrollable cursor
-
scrollableCursorPreviousObject
public abstract java.lang.Object scrollableCursorPreviousObject(java.rmi.server.ObjID remoteScrollableCursorOid, ReadQuery query, DistributedSession session)Retrieve previous object from the remote scrollable cursor
-
scrollableCursorRelative
public abstract boolean scrollableCursorRelative(java.rmi.server.ObjID remoteScrollableCursorOid, int rows)Moves the cursor a relative number of rows, either positive or negative. Attempting to move beyond the first/last row in the result set positions the cursor before/after the the first/last row
-
scrollableCursorSize
public abstract int scrollableCursorSize(java.rmi.server.ObjID cursorId)
Return the scrollable cursor size
-
setServiceName
public void setServiceName(java.lang.String newServiceName)
ADVANCED: This method is used to set the globally unique identifier for this connection. This identifier should be the same as the JNDI context the service was stored under.- Parameters:
newServiceName- java.lang.String
-
release
public void release()
PUBLIC: Release the connection resource.
-
fixObjectReferences
public void fixObjectReferences(Transporter remoteCursoredStream, ObjectLevelReadQuery query, DistributedSession session)
INTERNAL: An object has been serialized from the server to the remote client. Replace the transient attributes of the remote value holders with client-side objects. Being used for the cursored stream only
-
-