org.mmbase.bridge.mock
Class MockTransaction

java.lang.Object
  extended by org.mmbase.bridge.util.AbstractCloud
      extended by org.mmbase.bridge.mock.MockCloud
          extended by org.mmbase.bridge.mock.MockTransaction
All Implemented Interfaces:
Cloud, Transaction

public class MockTransaction
extends MockCloud
implements Transaction

MockTransaction for the moment only does't give too much exceptions. It doesn't actually work, so cancel() still throws UnsupportedOperationException.

Since:
MMBase-1.9.2
Version:
$Id: MockTransaction.java 41989 2010-04-20 16:45:39Z michiel $
Author:
Michiel Meeuwissen
To Do:
EXPERIMENTAL

Field Summary
 
Fields inherited from class org.mmbase.bridge.mock.MockCloud
cloudContext
 
Fields inherited from class org.mmbase.bridge.util.AbstractCloud
transactions
 
Fields inherited from interface org.mmbase.bridge.Cloud
PROP_IGNOREVALIDATION, PROP_REQUEST, PROP_RESPONSE, PROP_SESSIONNAME, PROP_XMLMODE
 
Constructor Summary
MockTransaction(String n, MockCloud cloud)
           
 
Method Summary
 void cancel()
          Cancels this transaction.
 boolean commit()
          Commits this transaction.
 String getCloudName()
          Returns the name of the cloud this transaction uses
(package private)  Node getNode(MockCloudContext.NodeDescription nd, boolean n)
           
 NodeList getNodes()
           
 Cloud getNonTransactionalCloud()
          Returns a cloud which is not a Transaction.
 boolean isCanceled()
          Returns whether the transaction is canceled
 boolean isCommitted()
          Returns whether the transaction is committed
 
Methods inherited from class org.mmbase.bridge.mock.MockCloud
getCloudContext, getList, getNode, getNodeByAlias, getNodeManager, getNodeManagers, getRelationManager, getRelationManager, hasNode, newTransaction, toString
 
Methods inherited from class org.mmbase.bridge.util.AbstractCloud
createAggregatedQuery, createNodeList, createNodeManagerList, createNodeQuery, createQuery, createRelationList, createRelationManagerList, createTransaction, createTransaction, createTransaction, getDescription, getFunction, getFunctions, getList, getLocale, getName, getNode, getNodeManager, getPossibleContexts, getProperties, getProperty, getRelation, getRelation, getRelationManager, getRelationManager, getRelationManagers, getRelationManagers, getRelationManagers, getTransaction, getUser, hasNode, hasNodeManager, hasRelation, hasRelation, hasRelationManager, hasRelationManager, hasRelationManager, hasRole, may, mayRead, mayRead, setLocale, setProperty, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mmbase.bridge.Cloud
createAggregatedQuery, createNodeList, createNodeManagerList, createNodeQuery, createQuery, createRelationList, createRelationManagerList, createTransaction, createTransaction, createTransaction, getCloudContext, getDescription, getFunction, getFunctions, getList, getList, getLocale, getName, getNode, getNode, getNodeByAlias, getNodeManager, getNodeManager, getNodeManagers, getPossibleContexts, getProperties, getProperty, getRelation, getRelation, getRelationManager, getRelationManager, getRelationManager, getRelationManager, getRelationManagers, getRelationManagers, getRelationManagers, getTransaction, getUser, hasNode, hasNode, hasNodeManager, hasRelation, hasRelation, hasRelationManager, hasRelationManager, hasRelationManager, hasRole, may, mayRead, mayRead, setLocale, setProperty, shutdown
 

Constructor Detail

MockTransaction

MockTransaction(String n,
                MockCloud cloud)
Method Detail

commit

public boolean commit()
Description copied from interface: Transaction
Commits this transaction. This has no effect if the transaction itself was 'nested' in another transaction. In that case, nothing happens until the 'outer' transaction commits. This routine also removes the transaction as an 'active' transaction (it cannot be opened again).

Specified by:
commit in interface Transaction
Returns:
true if the commit succeeded, false otherwise

cancel

public void cancel()
Description copied from interface: Transaction
Cancels this transaction. If the transaction itself was 'nested' in another transaction, that 'outer' transaction is also canceled. This routine also removes the transaction (and all outer transactions) as an 'active' transaction (it cannot be opened again).

Specified by:
cancel in interface Transaction

isCommitted

public boolean isCommitted()
Description copied from interface: Transaction
Returns whether the transaction is committed

Specified by:
isCommitted in interface Transaction
Returns:
true when committed

isCanceled

public boolean isCanceled()
Description copied from interface: Transaction
Returns whether the transaction is canceled

Specified by:
isCanceled in interface Transaction
Returns:
true when canceled

getNodes

public NodeList getNodes()
Specified by:
getNodes in interface Transaction

getCloudName

public String getCloudName()
Description copied from interface: Transaction
Returns the name of the cloud this transaction uses

Specified by:
getCloudName in interface Transaction
Returns:
the name of the cloud

getNode

Node getNode(MockCloudContext.NodeDescription nd,
             boolean n)
Overrides:
getNode in class MockCloud

getNonTransactionalCloud

public Cloud getNonTransactionalCloud()
Description copied from interface: Cloud
Returns a cloud which is not a Transaction.

Specified by:
getNonTransactionalCloud in interface Cloud
Overrides:
getNonTransactionalCloud in class AbstractCloud
Returns:
This cloud or a parent cloud if this cloud is a Transaction


MMBase 2.0-SNAPSHOT - null