|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A session defines a communication pipe for clients and servers to exchange information. A session is responsible for authorisation and authentication and for providing a mediating interface to the specific service. It is the first point of contact for clients to your service.
Because it is a mediating interface is supports functions from DatabaseIfc and TransactionIfc.
Sessions are transient objects that can only be created by the SessionManager.
SessionManager
Field Summary | |
static long |
DEFAULT_LOCK_TIMEOUT
|
Method Summary | |
void |
acquireLock(PersistentCapableIfc object,
int timeout)
Acquire an exclusive lock on the specified object. |
void |
bind(java.lang.String name,
PersistentCapableIfc object)
Bind the specified name to an object. |
HandleIfc |
createHandle(PersistentCapableIfc object)
Create a handle for the specified PersistentCapableIfc object. |
void |
createObject(PersistentCapableIfc object)
Create the specified persistent object in the database for this session. |
void |
deleteObject(PersistentCapableIfc object)
Delete the specified persistent object in the database for this session. |
CollectionManagerIfc |
getCollectionManager()
Return a reference to the collection manager, which is used to allocate different collection types includinng queues and vectors. |
TransactionIfc |
getCurrentTransaction()
Return the current transaction for this session. |
DatabaseIfc |
getDatabase()
Return the database that this session is associated with. |
java.util.Enumeration |
getRootNames()
Return an enumeration of all the database root names. |
long |
getSessionId()
Return the session id associated with this object |
SessionManagerIfc |
getSessionManager()
Return the session manager responsible for allocating this session |
boolean |
isBound(java.lang.String name)
Check if an object is already bound to the specified name |
boolean |
isValid()
Check the validity of the session |
PersistentCapableIfc |
lookup(java.lang.String name)
Lookup the object specified by name. |
PersistentCapableIfc |
retrieveObject(long id)
Retrieve the persistent object associated with the id. |
void |
setSessionManager(SessionManagerIfc manager)
Set the session manager that allocated this session. |
void |
unbind(java.lang.String name)
Unbind the object associated with the specified name. |
void |
updateObject(PersistentCapableIfc object)
Update the specified persistent object in the database for this session. |
Field Detail |
public static final long DEFAULT_LOCK_TIMEOUT
Method Detail |
public java.util.Enumeration getRootNames()
public void bind(java.lang.String name, PersistentCapableIfc object) throws ObjectNameExistsException, DatabaseIOException, TransactionNotInProgressException
The TransactionNotInProgressException is thrown when bind is called outside a transaction.
name
- binding nameobject
- object to bind
ObjectNameExistsException
DatabaseIOException
TransactionNotInProgressException
public void unbind(java.lang.String name) throws ObjectNameNotFoundException, DatabaseIOException, TransactionNotInProgressException
The TransactionNotInProgressException is thrown when unbind is called outside a transaction.
name
- binding name
ObjectNameNotFoundException
DatabaseIOException
TransactionNotInProgressException
public PersistentCapableIfc lookup(java.lang.String name)
name
- lookup name
public boolean isBound(java.lang.String name)
name
- lookup name
public TransactionIfc getCurrentTransaction()
public DatabaseIfc getDatabase()
public SessionManagerIfc getSessionManager()
public void setSessionManager(SessionManagerIfc manager)
manager
- session managerpublic void createObject(PersistentCapableIfc object) throws TransactionNotInProgressException, DatabaseIOException
object
- object to create
TransactionNotInProgressException
DatabaseIOException
public void updateObject(PersistentCapableIfc object) throws TransactionNotInProgressException, DatabaseIOException
object
- object to update
TransactionNotInProgressException
DatabaseIOException
public void deleteObject(PersistentCapableIfc object) throws TransactionNotInProgressException, DatabaseIOException
object
- object to delete
TransactionNotInProgressException
DatabaseIOException
public PersistentCapableIfc retrieveObject(long id) throws TransactionNotInProgressException, DatabaseIOException
id
- identity of object to retrieve
TransactionNotInProgressException
DatabaseIOException
public void acquireLock(PersistentCapableIfc object, int timeout) throws FailedToAcquireLockException, FailedToCreateLockException, TransactionNotInProgressException
The timeout determines how long to wait for the lock. A value of DEFAULT_LOCK_TIMEOUT is used to wait the default time.
All locks granted to a session will be automatically released in an abort, commit or rollback
object
- object to lock
FailedToAcquireLockException
FailedToCreateLockException
TransactionNotInProgressException
public HandleIfc createHandle(PersistentCapableIfc object) throws FailedToCreateHandleException, TransactionNotInProgressException
object
- PersistentCapableIfc
FailedToCreateHandleException
TransactionNotInProgressException
public CollectionManagerIfc getCollectionManager()
public long getSessionId()
public boolean isValid()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |