|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SessionIfc
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 |
---|
static final long DEFAULT_LOCK_TIMEOUT
Method Detail |
---|
java.util.Enumeration getRootNames()
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
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
PersistentCapableIfc lookup(java.lang.String name)
name
- lookup name
boolean isBound(java.lang.String name)
name
- lookup name
TransactionIfc getCurrentTransaction()
DatabaseIfc getDatabase()
SessionManagerIfc getSessionManager()
void setSessionManager(SessionManagerIfc manager)
manager
- session managervoid createObject(PersistentCapableIfc object) throws TransactionNotInProgressException, DatabaseIOException
object
- object to create
TransactionNotInProgressException
DatabaseIOException
void updateObject(PersistentCapableIfc object) throws TransactionNotInProgressException, DatabaseIOException
object
- object to update
TransactionNotInProgressException
DatabaseIOException
void deleteObject(PersistentCapableIfc object) throws TransactionNotInProgressException, DatabaseIOException
object
- object to delete
TransactionNotInProgressException
DatabaseIOException
PersistentCapableIfc retrieveObject(long id) throws TransactionNotInProgressException, DatabaseIOException
id
- identity of object to retrieve
TransactionNotInProgressException
DatabaseIOException
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 lockint
- time we should wait in seconds
FailedToAcquireLockException
FailedToCreateLockException
TransactionNotInProgressException
HandleIfc createHandle(PersistentCapableIfc object) throws FailedToCreateHandleException, TransactionNotInProgressException
object
- PersistentCapableIfc
FailedToCreateHandleException
TransactionNotInProgressException
CollectionManagerIfc getCollectionManager()
long getSessionId()
boolean isValid()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |