| 
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.lenya.cms.repository.SessionImpl
public class SessionImpl
Repository session.
| Field Summary | |
|---|---|
protected static java.lang.String | 
UNMODIFIABLE_SESSION_ID
 | 
| Constructor Summary | |
|---|---|
SessionImpl(Identity identity,
            boolean modifiable,
            org.apache.avalon.framework.service.ServiceManager manager,
            org.apache.avalon.framework.logger.Logger logger)
Ctor.  | 
|
| Method Summary | |
|---|---|
 void | 
addListener(RepositoryListener listener)
 | 
 void | 
commit()
Commits the transaction.  | 
 Lock | 
createLock(Lockable lockable,
           int version)
Creates a lock.  | 
protected  java.lang.String | 
createUuid()
 | 
 void | 
enqueueEvent(RepositoryEvent event)
 | 
 java.lang.String | 
getId()
 | 
 Identity | 
getIdentity()
 | 
protected  IdentityMap | 
getIdentityMap()
 | 
 RepositoryItem | 
getRepositoryItem(RepositoryItemFactory factory,
                  java.lang.String key)
 | 
protected  SharedItemStore | 
getSharedItemStore()
 | 
protected  UnitOfWork | 
getUnitOfWork()
 | 
 boolean | 
isDirty(Transactionable transactionable)
 | 
 boolean | 
isListenerRegistered(RepositoryListener listener)
Checks if a listener is registered.  | 
 boolean | 
isModifiable()
 | 
 void | 
registerDirty(Transactionable object)
Registers an object as modified.  | 
 void | 
registerNew(Transactionable object)
Registers an object as new.  | 
 void | 
registerRemoved(Transactionable object)
Registers an object as removed.  | 
 void | 
removeLock(Lockable lockable)
Removes a lock.  | 
 void | 
rollback()
Rolls the transaction back.  | 
protected  void | 
savePersistables()
Save all persistable objects to their nodes.  | 
 void | 
setIdentity(Identity identity)
 | 
| Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled | 
|---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected static final java.lang.String UNMODIFIABLE_SESSION_ID
| Constructor Detail | 
|---|
public SessionImpl(Identity identity,
                   boolean modifiable,
                   org.apache.avalon.framework.service.ServiceManager manager,
                   org.apache.avalon.framework.logger.Logger logger)
identity - The identity.modifiable - Determines if the repository items in this session can be modified.manager - The service manager.logger - The logger.| Method Detail | 
|---|
protected java.lang.String createUuid()
public Identity getIdentity()
getIdentity in interface Sessionprotected UnitOfWork getUnitOfWork()
public void commit()
            throws RepositoryException,
                   ConcurrentModificationException
commit in interface Sessioncommit in interface UnitOfWorkRepositoryException - if an error occurs.
ConcurrentModificationException - if a transactionable has been modified by another
         session.
protected void savePersistables()
                         throws RepositoryException
RepositoryException - if an error occurs.
public void rollback()
              throws RepositoryException
rollback in interface Sessionrollback in interface UnitOfWorkRepositoryException - if an error occurs.protected SharedItemStore getSharedItemStore()
public RepositoryItem getRepositoryItem(RepositoryItemFactory factory,
                                        java.lang.String key)
                                 throws RepositoryException
getRepositoryItem in interface Sessionfactory - The factory.key - The key.
RepositoryException - if an error occurs.Session.getRepositoryItem(org.apache.lenya.cms.repository.RepositoryItemFactory,
      java.lang.String)
public void registerNew(Transactionable object)
                 throws TransactionException
UnitOfWork
registerNew in interface UnitOfWorkobject - The object.
TransactionException - if an error occurs.
public void registerDirty(Transactionable object)
                   throws TransactionException
UnitOfWork
registerDirty in interface UnitOfWorkobject - The object.
TransactionException - if an error occurs.
public void registerRemoved(Transactionable object)
                     throws TransactionException
UnitOfWork
registerRemoved in interface UnitOfWorkobject - The object.
TransactionException - if an error occurs.public void setIdentity(Identity identity)
setIdentity in interface Sessionidentity - The identity.public boolean isDirty(Transactionable transactionable)
isDirty in interface UnitOfWorktransactionable - A transactionable.
public Lock createLock(Lockable lockable,
                       int version)
                throws TransactionException
UnitOfWork
createLock in interface UnitOfWorklockable - The lockable.version - The version.
TransactionException - if a lock is already placed on this transactionable.
public void removeLock(Lockable lockable)
                throws TransactionException
UnitOfWork
removeLock in interface UnitOfWorklockable - The lockable.
TransactionException - if no lock is placed on this transactionable.
public void addListener(RepositoryListener listener)
                 throws RepositoryException
addListener in interface Sessionlistener - The listener to add.
RepositoryException - if the listener is already registered.public boolean isListenerRegistered(RepositoryListener listener)
Session
isListenerRegistered in interface Sessionlistener - The listener.
public void enqueueEvent(RepositoryEvent event)
enqueueEvent in interface Sessionevent - The event to add to the queue.protected IdentityMap getIdentityMap()
public boolean isModifiable()
isModifiable in interface Sessionpublic java.lang.String getId()
getId in interface Session
  | 
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||