|
EclipseLink 1.0_1.0M2 API Reference - Incubation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectAbstractSession
org.eclipse.persistence.sessions.server.ClientSession
public class ClientSession
Purpose: Acts as a client to the server session.
Description: This session is brokered by the server session for use in three-tiered applications. It is used to store the context of the connection, i.e. the login to be used for this cleint. This allows each client connected to the server to contain its own user login.
Responsibilities:
This class is an implementation of Session
.
Please refer to that class for a full API. The public interface should be used.
Server
,
UnitOfWork
Field Summary | |
---|---|
protected ConnectionPolicy |
connectionPolicy
|
protected boolean |
isActive
|
protected ServerSession |
parent
|
protected Sequencing |
sequencing
|
protected Accessor |
writeConnection
|
Constructor Summary | |
---|---|
protected |
ClientSession(Project project)
|
|
ClientSession(ServerSession parent,
ConnectionPolicy connectionPolicy)
INTERNAL: Create and return a new client session. |
Method Summary | |
---|---|
void |
afterTransaction(boolean committed,
boolean isExternalTransaction)
INTERNAL: Called after transaction is completed (committed or rolled back) |
void |
basicBeginTransaction()
INTERNAL: This is internal to the unit of work and should never be called otherwise. |
void |
basicCommitTransaction(AbstractSession callingSession)
INTERNAL: This is internal to the unit of work and should not be called otherwise. |
void |
basicRollbackTransaction(AbstractSession callingSession)
INTERNAL: This is internal to the unit of work and should not be called otherwise. |
void |
connect()
INTERNAL: Connect the session only (this must be the write connection as the read is shared). |
boolean |
containsQuery(java.lang.String queryName)
INTERNAL: Was PUBLIC: customer will be redirected to Session . |
void |
disconnect()
INTERNAL: Disconnect the accessor only (this must be the write connection as the read is shared). |
Accessor |
getAccessor()
INTERNAL: Return the read or write connection depending on the transaction state. |
CacheSynchronizationManager |
getCacheSynchronizationManager()
INTERNAL: Was PUBLIC: customer will be redirected to Session . |
CommandManager |
getCommandManager()
INTERNAL: Return the manager that allows this processor to receive or propagate commands from/to TopLink cluster |
ConnectionPolicy |
getConnectionPolicy()
ADVANCED: This method will return the connection policy that was used during the acquisition of this client session. |
java.util.Map |
getDescriptors()
INTERNAL: Was PUBLIC: customer will be redirected to Session . |
AbstractSession |
getExecutionSession(DatabaseQuery query)
INTERNAL: Gets the session which this query will be executed on. |
ServerSession |
getParent()
INTERNAL: Return the parent. |
AbstractSession |
getParentIdentityMapSession(DatabaseQuery query,
boolean canReturnSelf,
boolean terminalOnly)
INTERNAL: Gets the next link in the chain of sessions followed by a query's check early return, the chain of sessions with identity maps all the way up to the root session. |
java.lang.Object |
getProperty(java.lang.String name)
Search for and return the user defined property from this client session, if it not found then search for the property from parent. |
DatabaseQuery |
getQuery(java.lang.String name)
INTERNAL: Was PUBLIC: customer will be redirected to Session . |
DatabaseQuery |
getQuery(java.lang.String name,
java.util.Vector args)
INTERNAL: |
Sequencing |
getSequencing()
INTERNAL: Return the Sequencing object used by the session. |
ServerPlatform |
getServerPlatform()
INTERNAL: Marked internal as this is not customer API but helper methods for accessing the server platform from within TopLink's other sessions types (ie not DatabaseSession) |
java.lang.String |
getSessionTypeString()
INTERNAL: Returns the type of session, its class. |
Accessor |
getWriteConnection()
INTERNAL: Return the connection to be used for database modification. |
boolean |
hasCacheSynchronizationManager()
INTERNAL: Was PUBLIC: customer will be redirected to Session . |
protected boolean |
hasWriteConnection()
INTERNAL: Return if this session has been connected. |
void |
initializeIdentityMapAccessor()
INTERNAL: Set up the IdentityMapManager. |
void |
initializeSequencing()
INTERNAL: was ADVANCED: Creates sequencing object for the session. |
boolean |
isActive()
INTERNAL: Was PUBLIC: customer will be redirected to Session . |
boolean |
isClientSession()
INTERNAL: Return if this session is a client session. |
boolean |
isConnected()
INTERNAL: Was PUBLIC: customer will be redirected to Session . |
void |
release()
INTERNAL: Was PUBLIC: customer will be redirected to Session . |
void |
releaseReadConnection(Accessor connection)
INTERNAL: |
protected void |
releaseWriteConnection()
INTERNAL: This is internal to the unit of work and should not be called otherwise. |
void |
setConnectionPolicy(ConnectionPolicy connectionPolicy)
INTERNAL: Set the connection policy. |
protected void |
setIsActive(boolean isActive)
INTERNAL: Set if the client session is actvie (has not been released). |
protected void |
setParent(ServerSession parent)
INTERNAL: Set the parent. |
void |
setWriteConnection(Accessor writeConnection)
INTERNAL: Set the connection to be used for database modification. |
boolean |
shouldPropagateChanges()
INTERNAL: Return whether changes should be propagated to TopLink cluster. |
java.lang.String |
toString()
INTERNAL: Print the connection status with the session. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected ServerSession parent
protected ConnectionPolicy connectionPolicy
protected Accessor writeConnection
protected boolean isActive
protected Sequencing sequencing
Constructor Detail |
---|
public ClientSession(ServerSession parent, ConnectionPolicy connectionPolicy)
protected ClientSession(Project project)
Method Detail |
---|
public void afterTransaction(boolean committed, boolean isExternalTransaction)
public void basicBeginTransaction()
public void basicCommitTransaction(AbstractSession callingSession)
public void basicRollbackTransaction(AbstractSession callingSession)
public void connect() throws DatabaseException
DatabaseException
public boolean containsQuery(java.lang.String queryName)
Session
.
Return true if the pre-defined query is defined on the session.
public void disconnect() throws DatabaseException
DatabaseException
public Accessor getAccessor()
public CacheSynchronizationManager getCacheSynchronizationManager()
Session
.
Returns the Synchronization Policy for this session.
public ConnectionPolicy getConnectionPolicy()
public java.util.Map getDescriptors()
Session
.
Return all registered descriptors.
The clients session inherits its parent's descriptors.
public AbstractSession getParentIdentityMapSession(DatabaseQuery query, boolean canReturnSelf, boolean terminalOnly)
Used for session broker which delegates to registered sessions, or UnitOfWork which checks parent identity map also.
canReturnSelf
- true when method calls itself. If the path
starting at this
is acceptable. Sometimes true if want to
move to the first valid session, i.e. executing on ClientSession when really
should be on ServerSession.terminalOnly
- return the session we will execute the call on, not
the next step towards it.
public java.lang.Object getProperty(java.lang.String name)
public AbstractSession getExecutionSession(DatabaseQuery query)
Since the execution session also knows the correct datasource platform to execute on, it is often used in the mappings where the platform is needed for type conversion, or where calls are translated.
Is also the session with the accessor. Will return a ClientSession if it is in transaction and has a write connection.
query
- may store session name or reference class for brokers case
public ServerSession getParent()
public DatabaseQuery getQuery(java.lang.String name)
Session
.
Return the query from the session pre-defined queries with the given name.
This allows for common queries to be pre-defined, reused and executed by name.
public DatabaseQuery getQuery(java.lang.String name, java.util.Vector args)
public void initializeSequencing()
public Sequencing getSequencing()
public ServerPlatform getServerPlatform()
public java.lang.String getSessionTypeString()
Override to hide from the user when they are using an internal subclass of a known class.
A user does not need to know that their UnitOfWork is a non-deferred UnitOfWork, or that their ClientSession is an IsolatedClientSession.
public Accessor getWriteConnection()
public boolean hasCacheSynchronizationManager()
Session
.
Return true if a cache synchronisation manager exists.
protected boolean hasWriteConnection()
public void initializeIdentityMapAccessor()
public boolean isActive()
Session
.
Return if the client session is actvie (has not been released).
public boolean isClientSession()
public boolean isConnected()
Session
.
Return if this session has been connected to the database.
public void release() throws DatabaseException
Session
.
Release the client session.
This releases the client session back to it server.
Normally this will logout of the client session's connection,
and allow the client session to garbage collect.
DatabaseException
protected void releaseWriteConnection()
public void setConnectionPolicy(ConnectionPolicy connectionPolicy)
protected void setIsActive(boolean isActive)
protected void setParent(ServerSession parent)
public void setWriteConnection(Accessor writeConnection)
public java.lang.String toString()
public CommandManager getCommandManager()
#CommandManager
public boolean shouldPropagateChanges()
public void releaseReadConnection(Accessor connection)
|
EclipseLink 1.0_1.0M2 API Reference - Incubation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |