Package net.ontopia.topicmaps.impl.utils
Class AbstractTopicMapTransaction
- java.lang.Object
-
- net.ontopia.topicmaps.impl.utils.AbstractTopicMapTransaction
-
- All Implemented Interfaces:
TopicMapTransactionIF
- Direct Known Subclasses:
InMemoryTopicMapTransaction
,RDBMSTopicMapTransaction
public abstract class AbstractTopicMapTransaction extends Object implements TopicMapTransactionIF
INTERNAL: An abstract TopicMapTransactionIF implementation.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
active
protected TopicMapBuilderIF
builder
protected CollectionFactoryIF
cfactory
protected IndexManagerIF
imanager
protected boolean
invalid
protected AbstractTopicMapTransaction
parent
protected AbstractTopicMapStore
store
protected TopicMapIF
topicmap
-
Fields inherited from interface net.ontopia.topicmaps.impl.utils.TopicMapTransactionIF
EVENT_ABORT, EVENT_COMMIT
-
-
Constructor Summary
Constructors Constructor Description AbstractTopicMapTransaction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
abort()
PUBLIC: Aborts the transaction; all changes made inside the transaction are rolled back.void
abort(boolean invalidate)
void
commit()
PUBLIC: Commits the transaction.TopicMapTransactionIF
createNested()
TopicMapBuilderIF
getBuilder()
PUBLIC: Gets a topic map builder for use with this transaction.CollectionFactoryIF
getCollectionFactory()
IndexManagerIF
getIndexManager()
PUBLIC: Gets the index manager that manages the topic map indexes in the transaction.TopicMapTransactionIF
getParent()
TopicMapStoreIF
getStore()
PUBLIC: Gets the store to which the transaction is connected.TopicMapIF
getTopicMap()
PUBLIC: Gets the topic map that is accessible through the transaction.boolean
isActive()
PUBLIC: Returns true if the transaction is active (in process).abstract boolean
validate()
-
-
-
Field Detail
-
active
protected boolean active
-
invalid
protected boolean invalid
-
store
protected AbstractTopicMapStore store
-
parent
protected AbstractTopicMapTransaction parent
-
topicmap
protected TopicMapIF topicmap
-
builder
protected TopicMapBuilderIF builder
-
cfactory
protected CollectionFactoryIF cfactory
-
imanager
protected IndexManagerIF imanager
-
-
Method Detail
-
isActive
public boolean isActive()
Description copied from interface:TopicMapTransactionIF
PUBLIC: Returns true if the transaction is active (in process). A transaction is started immediately after it has been created, so there is no explicit method to call in order to activate a transaction.- Specified by:
isActive
in interfaceTopicMapTransactionIF
- Returns:
- Boolean: true if active, false if not active (either not yet aborted, or commited).
-
getBuilder
public TopicMapBuilderIF getBuilder()
Description copied from interface:TopicMapTransactionIF
PUBLIC: Gets a topic map builder for use with this transaction.- Specified by:
getBuilder
in interfaceTopicMapTransactionIF
- Returns:
- An object implementing TopicMapBuilderIF
-
getCollectionFactory
public CollectionFactoryIF getCollectionFactory()
-
getIndexManager
public IndexManagerIF getIndexManager()
Description copied from interface:TopicMapTransactionIF
PUBLIC: Gets the index manager that manages the topic map indexes in the transaction.- Specified by:
getIndexManager
in interfaceTopicMapTransactionIF
- Returns:
- The index manager used by the transaction: an object implementing IndexManagerIF.
-
getTopicMap
public TopicMapIF getTopicMap()
Description copied from interface:TopicMapTransactionIF
PUBLIC: Gets the topic map that is accessible through the transaction.- Specified by:
getTopicMap
in interfaceTopicMapTransactionIF
- Returns:
- The topic map in the transaction; an object implementing TopicMapIF.
-
getStore
public TopicMapStoreIF getStore()
Description copied from interface:TopicMapTransactionIF
PUBLIC: Gets the store to which the transaction is connected.- Specified by:
getStore
in interfaceTopicMapTransactionIF
-
getParent
public TopicMapTransactionIF getParent()
-
commit
public void commit()
Description copied from interface:TopicMapTransactionIF
PUBLIC: Commits the transaction. The changes made are written to the persistent store. The transaction will resume after the commit meaning that the objects retrieved through is still usable after the commit.- Specified by:
commit
in interfaceTopicMapTransactionIF
-
abort
public void abort()
Description copied from interface:TopicMapTransactionIF
PUBLIC: Aborts the transaction; all changes made inside the transaction are rolled back. The transaction will resume after the abort meaning that the objects retrieved through is still usable after the abort, but their state has been reverted to the state in the persistent store.- Specified by:
abort
in interfaceTopicMapTransactionIF
-
abort
public void abort(boolean invalidate)
-
validate
public abstract boolean validate()
-
createNested
public TopicMapTransactionIF createNested()
-
-