EclipseLink 2.2.0, build 'v20110202-r8913' API Reference

org.eclipse.persistence.sessions.remote
Class RemoteSession

java.lang.Object
  extended by org.eclipse.persistence.internal.sessions.AbstractSession
      extended by org.eclipse.persistence.sessions.remote.DistributedSession
          extended by org.eclipse.persistence.sessions.remote.RemoteSession
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, CommandProcessor, Session

public class RemoteSession
extends DistributedSession

Purpose: Provide transparent remote three-tiered replacation support. The remote session allows for complex three-tiered applications to be easily built. It gives the remote client the fully functionality of the TopLink api including,

This session is a primary interface which resides on the client side. Users would interact with session just the same way as if it was a normal session.

See Also:
Serialized Form

Field Summary
protected  org.eclipse.persistence.internal.sequencing.Sequencing sequencing
           
protected  boolean shouldEnableDistributedIndirectionGarbageCollection
           
 
Fields inherited from class org.eclipse.persistence.sessions.remote.DistributedSession
remoteConnection
 
Fields inherited from class org.eclipse.persistence.internal.sessions.AbstractSession
accessors, activeCommandThreads, broker, commandManager, commitManager, defaultReferenceMode, deferredEvents, descriptors, eventManager, exceptionHandler, externalTransactionController, identityMapAccessor, integrityChecker, isExecutingEvents, isFinalizersEnabled, isInBroker, isInProfile, isLoggingOff, isSynchronized, jpaQueries, lastDescriptorAccessed, logSessionString, name, numberOfActiveUnitsOfWork, objectsLockedForClone, partitioningPolicy, pessimisticLockTimeoutDefault, platform, profiler, project, properties, queries, queryTimeoutDefault, sessionLog, shouldCheckWriteLock, shouldPropagateChanges, staticMetamodelClasses, transactionMutex, wasJTSTransactionInternallyStarted
 
Fields inherited from interface org.eclipse.persistence.sessions.coordination.CommandProcessor
LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING
 
Constructor Summary
RemoteSession(org.eclipse.persistence.internal.sessions.remote.RemoteConnection remoteConnection)
          PUBLIC: Creates a RemoteSession.
 
Method Summary
 Session acquireHistoricalSession(AsOfClause clause)
          INTERNAL: Acquires a special historical session for reading objects as of a past time.
 org.eclipse.persistence.internal.sessions.UnitOfWorkImpl acquireUnitOfWork()
          PUBLIC: Return a unit of work for this session.
 org.eclipse.persistence.internal.sessions.UnitOfWorkImpl acquireUnitOfWork(ReferenceMode referenceMode)
          PUBLIC: Return a unit of work for this session.
 java.lang.Object executeQuery(DatabaseQuery query)
          PUBLIC: Execute the database query.
 Login getDatasourceLogin()
          PUBLIC: Return the login.
 java.lang.Object getObjectCorrespondingTo(java.lang.Object serverSideDomainObject, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query)
          INTERNAL: Return the corresponding objects from the remote session for the objects read from the server.
 java.lang.Object getObjectsCorrespondingToAll(java.lang.Object serverSideDomainObjects, java.util.Map objectDescriptors, java.util.Map processedObjects, ObjectLevelReadQuery query, org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
          INTERNAL: Return the corresponding objects from the remote session for the objects read from the server.
 org.eclipse.persistence.internal.sequencing.Sequencing getSequencing()
          INTERNAL: Return the Sequencing object used by the session.
 void initializeSequencing()
          ADVANCED: Creates sequencing object for the session.
 java.lang.Object instantiateRemoteValueHolderOnServer(org.eclipse.persistence.internal.sessions.remote.RemoteValueHolder remoteValueHolder)
          INTERNAL: This will instantiate value holder on the server.
 boolean isRemoteSession()
          INTERNAL: Return if this session is remote.
 void setShouldEnableDistributedIndirectionGarbageCollection(boolean shouldEnableDistributedIndirectionGarbageCollection)
          ADVANCED: Allow the server-side value holders to be cleaned-up when the client-side value holder finalize.
 boolean shouldEnableDistributedIndirectionGarbageCollection()
          ADVANCED: Allow the server-side value holders to be cleaned-up when the client-side value holder finalize.
 
Methods inherited from class org.eclipse.persistence.sessions.remote.DistributedSession
beginTransaction, commitTransaction, cursorSelectObjects, cursorSelectObjects, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, getDefaultReadOnlyClasses, getDescriptor, getDescriptorCorrespondingTo, getRemoteConnection, hasCorrespondingDescriptor, initializeIdentityMapAccessor, isConnected, isDistributedSession, privilegedAddDescriptor, release, rollbackTransaction, setRemoteConnection, toString
 
Methods inherited from class org.eclipse.persistence.internal.sessions.AbstractSession
acquireNonSynchronizedUnitOfWork, acquireNonSynchronizedUnitOfWork, addAlias, addJPAQuery, addQuery, addQuery, addStaticMetamodelClass, basicBeginTransaction, basicBeginTransaction, basicBeginTransaction, basicCommitTransaction, basicExecuteCall, basicRollbackTransaction, beginExternalTransaction, checkAndRefreshInvalidObject, checkHierarchyForDescriptor, clearDescriptors, clearIntegrityChecker, clearLastDescriptorAccessed, clearProfile, clone, commitExternalTransaction, compareObjects, compareObjectsDontMatch, config, containsQuery, copy, copy, copyDescriptorNamedQueries, copyInternal, copyObject, copyObject, copyReadOnlyClasses, createCloneQueryValueHolder, createCloneTransformationValueHolder, createProtectedInstanceFromCachedData, deferEvent, deleteAllObjects, deleteAllObjects, deleteObject, doesObjectExist, dontLogMessages, endOperationProfile, endOperationProfile, executeCall, executeDeferredEvents, executeNonSelectingCall, executeNonSelectingSQL, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeSelectingCall, executeSQL, fine, finer, finest, getAccessor, getAccessors, getAccessors, getActiveCommandThreads, getActiveSession, getActiveUnitOfWork, getAliasDescriptors, getAllQueries, getAsOfClause, getBroker, getCacheKeyFromTargetSessionForMerge, getClassDescriptor, getClassDescriptor, getClassDescriptorForAlias, getCommandManager, getCommitManager, getDatasourcePlatform, getDefaultReferenceMode, getDescriptor, getDescriptorForAlias, getDescriptors, getEventManager, getExceptionHandler, getExceptionHandlerClass, getExecutionSession, getExternalTransactionController, getId, getIdentityMapAccessor, getIdentityMapAccessorInstance, getIntegrityChecker, getJPAQueries, getLoader, getLog, getLogin, getLogLevel, getLogLevel, getLogSessionString, getName, getNextQueryId, getNextSequenceNumberValue, getNumberOfActiveUnitsOfWork, getParent, getParentIdentityMapSession, getParentIdentityMapSession, getParentIdentityMapSession, getPartitioningPolicy, getPessimisticLockTimeoutDefault, getPlatform, getPlatform, getProfiler, getProject, getProperties, getProperty, getQueries, getQuery, getQuery, getQuery, getQueryTimeoutDefault, getRootSession, getServerPlatform, getSessionForClass, getSessionLog, getSessionTypeString, getStaticMetamodelClass, getTransactionMutex, handleException, handleSevere, hasBroker, hasCommitManager, hasDescriptor, hasEventManager, hasExceptionHandler, hasExternalTransactionController, hasProperties, incrementProfile, incrementProfile, info, insertObject, internalExecuteQuery, isBroker, isClassReadOnly, isClassReadOnly, isClientSession, isConsideredInvalid, isDatabaseSession, isExclusiveConnectionRequired, isExclusiveIsolatedClientSession, isFinalizersEnabled, isHistoricalSession, isInBroker, isInProfile, isInTransaction, isIsolatedClientSession, isLoggingOff, isProtectedSession, isRemoteUnitOfWork, isServerSession, isSessionBroker, isSynchronized, isUnitOfWork, keyFromObject, keyFromObject, load, log, log, log, log, log, log, log, log, log, log, logMessage, logMessage, logThrowable, postAcquireConnection, prepareDatabaseQuery, preReleaseConnection, processCommand, processJPAQueries, readAllObjects, readAllObjects, readAllObjects, readAllObjects, readObject, readObject, readObject, readObject, readObject, refreshAndLockObject, refreshAndLockObject, refreshObject, registerFinalizer, releaseJTSConnection, releaseReadConnection, releaseUnitOfWork, removeProperty, removeQuery, removeQuery, retrieveCacheKey, rollbackExternalTransaction, setAccessor, setBroker, setCommandManager, setCommitManager, setDatasourceLogin, setDefaultReferenceMode, setEventManager, setExceptionHandler, setExternalTransactionController, setIntegrityChecker, setIsFinalizersEnabled, setIsInBroker, setIsInProfile, setLog, setLogin, setLogin, setLogLevel, setName, setNumberOfActiveUnitsOfWork, setPartitioningPolicy, setPessimisticLockTimeoutDefault, setProfiler, setProject, setProperties, setProperty, setQueries, setQueryTimeoutDefault, setSessionLog, setShouldPropagateChanges, setSynchronized, setTransactionMutex, setWasJTSTransactionInternallyStarted, severe, shouldDisplayData, shouldLog, shouldLogMessages, shouldLogMessages, shouldPropagateChanges, startOperationProfile, startOperationProfile, unwrapObject, updateObject, updateProfile, validateCache, validateQuery, verifyDelete, warning, wasJTSTransactionInternallyStarted, wrapObject, writeAllObjectsWithChangeSet, writeObject, writesCompleted
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sequencing

protected org.eclipse.persistence.internal.sequencing.Sequencing sequencing

shouldEnableDistributedIndirectionGarbageCollection

protected boolean shouldEnableDistributedIndirectionGarbageCollection
Constructor Detail

RemoteSession

public RemoteSession(org.eclipse.persistence.internal.sessions.remote.RemoteConnection remoteConnection)
PUBLIC: Creates a RemoteSession.

Parameters:
remoteConnection - remote session requires a remote connection. This must be accessed remotely from the client through RMI or CORBA.
Method Detail

setShouldEnableDistributedIndirectionGarbageCollection

public void setShouldEnableDistributedIndirectionGarbageCollection(boolean shouldEnableDistributedIndirectionGarbageCollection)
ADVANCED: Allow the server-side value holders to be cleaned-up when the client-side value holder finalize.


shouldEnableDistributedIndirectionGarbageCollection

public boolean shouldEnableDistributedIndirectionGarbageCollection()
ADVANCED: Allow the server-side value holders to be cleaned-up when the client-side value holder finalize.


acquireHistoricalSession

public Session acquireHistoricalSession(AsOfClause clause)
                                 throws ValidationException
INTERNAL: Acquires a special historical session for reading objects as of a past time.

Specified by:
acquireHistoricalSession in interface Session
Overrides:
acquireHistoricalSession in class org.eclipse.persistence.internal.sessions.AbstractSession
Parameters:
clause - Represents a valid snap shot time.
Throws:
ValidationException - if this not a ClientSession, plain Session, or SessionBroker.
See Also:
AsOfClause, Expression.asOf(org.eclipse.persistence.history.AsOfClause), ObjectLevelReadQuery.setAsOfClause(org.eclipse.persistence.history.AsOfClause), HistoryPolicy

acquireUnitOfWork

public org.eclipse.persistence.internal.sessions.UnitOfWorkImpl acquireUnitOfWork()
PUBLIC: Return a unit of work for this session. The unit of work is an object level transaction that allows a group of changes to be applied as a unit.

Specified by:
acquireUnitOfWork in interface Session
Specified by:
acquireUnitOfWork in class DistributedSession
See Also:
UnitOfWorkImpl

acquireUnitOfWork

public org.eclipse.persistence.internal.sessions.UnitOfWorkImpl acquireUnitOfWork(ReferenceMode referenceMode)
PUBLIC: Return a unit of work for this session. The unit of work is an object level transaction that allows a group of changes to be applied as a unit.

Specified by:
acquireUnitOfWork in interface Session
Overrides:
acquireUnitOfWork in class org.eclipse.persistence.internal.sessions.AbstractSession
Parameters:
referenceMode - The reference type the UOW should use internally when referencing Working clones. Setting this to WEAK means the UOW will use weak references to reference clones and if the application no longer references the clone the clone may be garbage collected. If the clone has uncommitted changes then those changes will be lost.
See Also:
UnitOfWorkImpl

executeQuery

public java.lang.Object executeQuery(DatabaseQuery query)
PUBLIC: Execute the database query.

Specified by:
executeQuery in interface Session
Specified by:
executeQuery in class DistributedSession
See Also:
DatabaseQuery

getDatasourceLogin

public Login getDatasourceLogin()
PUBLIC: Return the login. This must retreive the login information from the server this first time called. This is useful to be able to do things differently depending on the database platform.

Specified by:
getDatasourceLogin in interface Session
Overrides:
getDatasourceLogin in class org.eclipse.persistence.internal.sessions.AbstractSession

getObjectCorrespondingTo

public java.lang.Object getObjectCorrespondingTo(java.lang.Object serverSideDomainObject,
                                                 java.util.Map objectDescriptors,
                                                 java.util.Map processedObjects,
                                                 ObjectLevelReadQuery query)
INTERNAL: Return the corresponding objects from the remote session for the objects read from the server.

Specified by:
getObjectCorrespondingTo in class DistributedSession

getObjectsCorrespondingToAll

public java.lang.Object getObjectsCorrespondingToAll(java.lang.Object serverSideDomainObjects,
                                                     java.util.Map objectDescriptors,
                                                     java.util.Map processedObjects,
                                                     ObjectLevelReadQuery query,
                                                     org.eclipse.persistence.internal.queries.ContainerPolicy containerPolicy)
INTERNAL: Return the corresponding objects from the remote session for the objects read from the server.

Specified by:
getObjectsCorrespondingToAll in class DistributedSession

instantiateRemoteValueHolderOnServer

public java.lang.Object instantiateRemoteValueHolderOnServer(org.eclipse.persistence.internal.sessions.remote.RemoteValueHolder remoteValueHolder)
INTERNAL: This will instantiate value holder on the server.

Specified by:
instantiateRemoteValueHolderOnServer in class DistributedSession

isRemoteSession

public boolean isRemoteSession()
INTERNAL: Return if this session is remote.

Specified by:
isRemoteSession in interface Session
Overrides:
isRemoteSession in class DistributedSession

getSequencing

public org.eclipse.persistence.internal.sequencing.Sequencing getSequencing()
INTERNAL: Return the Sequencing object used by the session.

Overrides:
getSequencing in class org.eclipse.persistence.internal.sessions.AbstractSession

initializeSequencing

public void initializeSequencing()
ADVANCED: Creates sequencing object for the session. Typically there is no need for the user to call this method - it is called from the constructor.


EclipseLink 2.2.0, build 'v20110202-r8913' API Reference