JBoss Cache SVN: r6069 - core/trunk/src/main/java/org/jboss/cache/commands/write.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-26 17:42:34 -0400 (Thu, 26 Jun 2008)
New Revision: 6069
Removed:
core/trunk/src/main/java/org/jboss/cache/commands/write/OptimisticInvalidateCommand.java
Log:
Files to be removed. Missed by a previous check-in.
Deleted: core/trunk/src/main/java/org/jboss/cache/commands/write/OptimisticInvalidateCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/OptimisticInvalidateCommand.java 2008-06-26 17:55:25 UTC (rev 6068)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/OptimisticInvalidateCommand.java 2008-06-26 21:42:34 UTC (rev 6069)
@@ -1,188 +0,0 @@
-package org.jboss.cache.commands.write;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.CacheException;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.VersionedDataCommand;
-import org.jboss.cache.config.Option;
-import org.jboss.cache.invocation.InvocationContext;
-import org.jboss.cache.optimistic.DataVersion;
-import org.jboss.cache.transaction.GlobalTransaction;
-
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-import java.util.Collections;
-
-/**
- * Behaves like {@link org.jboss.cache.commands.write.InvalidateCommand}. Also, potentially throws a cache exception if
- * data versioning is used and the node in memory has a newer data version than what is passed in.
- * <p/>
- * Finally, the data version of the in-memory node is updated to the version being evicted to prevent versions
- * going out of sync.
- * <p/>
- *
- * @author Mircea.Markus(a)jboss.com
- * @since 2.2
- */
-public class OptimisticInvalidateCommand extends InvalidateCommand implements VersionedDataCommand
-{
- private static final Log log = LogFactory.getLog(OptimisticInvalidateCommand.class);
- private static boolean trace = log.isTraceEnabled();
-
- /*
- dependencies
- */
- private TransactionManager transactionManager;
-
- /**
- * Params.
- */
- protected GlobalTransaction globalTransaction;
- private DataVersion dataVersion;
-
- public OptimisticInvalidateCommand(Fqn fqn)
- {
- super(fqn);
- }
-
- public OptimisticInvalidateCommand()
- {
- }
-
- public void initialize(TransactionManager txManager)
- {
- this.transactionManager = txManager;
- }
-
- @Override
- public Object perform(InvocationContext ctx)
- {
- NodeSPI node = enforceNodeLoading();
- if (trace) log.trace("Invalidating fqn:" + fqn);
- if (node == null)
- {
- // check if a tombstone already exists
- NodeSPI nodeSPI = dataContainer.peek(fqn, false, true);
- if (nodeSPI == null)
- {
- if (dataVersion == null)
- {
- if (trace)
- log.trace("Would have created a tombstone since the node doesn't exist, but the version to invalidate is null and hence cannot create a tombstone!");
- return null;
- }
- createTombstone(ctx);
- nodeSPI = (NodeSPI) dataContainer.getRoot().getChild(fqn);
- }
- node = nodeSPI;
- }
- removeData(ctx);
- invalidateNode(node);
- updateDataVersion();
- return null;
- }
-
- protected void createTombstone(InvocationContext ctx)
- {
- if (trace)
- log.trace("Node doesn't exist; creating a tombstone with data version " + dataVersion);
- // create the node we need.
- Option o = ctx.getOptionOverrides();
- boolean origCacheModeLocal = o.isCacheModeLocal();
- o.setCacheModeLocal(true);
- o.setDataVersion(dataVersion);
- // if we are in a tx this call should happen outside of any tx
- try
- {
- Transaction suspended = null;
- if (transactionManager != null)
- {
- suspended = transactionManager.suspend();
- }
- spi.put(fqn, Collections.emptyMap());
- if (suspended != null) transactionManager.resume(suspended);
- ctx.getOptionOverrides().setCacheModeLocal(origCacheModeLocal);
- }
- catch (Exception e)
- {
- log.error("Unable to create tombstone!", e);
- }
- }
-
- private void updateDataVersion()
- {
- if (dataVersion != null)
- {
- NodeSPI n = dataContainer.peek(fqn, false, true);
- n.setVersion(dataVersion);
- }
- }
-
- protected void removeData(InvocationContext ctx) throws CacheException
- {
- NodeSPI n = dataContainer.peekVersioned(fqn, dataVersion);
- if (n == null)
- {
- log.warn("node " + fqn + " not found");
- return;
- }
- notifier.notifyNodeEvicted(fqn, true, ctx);
- n.clearDataDirect();
- n.setDataLoaded(false);
- notifier.notifyNodeEvicted(fqn, false, ctx);
- }
-
- public DataVersion getDataVersion()
- {
- return dataVersion;
- }
-
- public void setDataVersion(DataVersion dataVersion)
- {
- this.dataVersion = dataVersion;
- }
-
- public GlobalTransaction getGlobalTransaction()
- {
- return globalTransaction;
- }
-
- public void setGlobalTransaction(GlobalTransaction gtx)
- {
- this.globalTransaction = gtx;
- }
-
- public boolean isVersioned()
- {
- return dataVersion != null;
- }
-
- @Override
- public String toString()
- {
- return "OptimisticInvalidateCommand{" +
- "dataVersion=" + dataVersion +
- " ,fqn=" + fqn +
- '}';
- }
-
- @Override
- public Object[] getParameters()
- {
- return new Object[]{fqn, dataVersion};
- }
-
- @Override
- public void setParameters(int commandId, Object[] args)
- {
- fqn = (Fqn) args[0];
- dataVersion = (DataVersion) args[1];
- }
-
- public void rollback()
- {
- //no op
- }
-}
16 years, 6 months
JBoss Cache SVN: r6068 - core/branches/2.2.X/src/test/java/org/jboss/cache/optimistic.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-26 13:55:25 -0400 (Thu, 26 Jun 2008)
New Revision: 6068
Modified:
core/branches/2.2.X/src/test/java/org/jboss/cache/optimistic/ConcurrentTransactionTest.java
Log:
Minor corrections
Modified: core/branches/2.2.X/src/test/java/org/jboss/cache/optimistic/ConcurrentTransactionTest.java
===================================================================
--- core/branches/2.2.X/src/test/java/org/jboss/cache/optimistic/ConcurrentTransactionTest.java 2008-06-26 17:40:47 UTC (rev 6067)
+++ core/branches/2.2.X/src/test/java/org/jboss/cache/optimistic/ConcurrentTransactionTest.java 2008-06-26 17:55:25 UTC (rev 6068)
@@ -10,12 +10,12 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.util.TestingUtil;
import org.jboss.cache.commands.VisitableCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor;
import org.jboss.cache.interceptors.TxInterceptor;
import org.jboss.cache.interceptors.base.CommandInterceptor;
+import org.jboss.cache.util.TestingUtil;
import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
@@ -258,6 +258,7 @@
final String fastThreadName = "FAST";
CommandInterceptor slowdownInterceptor = new CommandInterceptor()
{
+ @Override
public Object handleDefault(InvocationContext ctx, VisitableCommand command) throws Throwable
{
if (Thread.currentThread().getName().equals(slowThreadName))
@@ -294,7 +295,8 @@
final String fastThreadName = "FAST";
CommandInterceptor slowdownInterceptor = new CommandInterceptor()
{
- public Object hanldeDefault(InvocationContext ctx, VisitableCommand command) throws Throwable
+ @Override
+ public Object handleDefault(InvocationContext ctx, VisitableCommand command) throws Throwable
{
if (Thread.currentThread().getName().equals(slowThreadName) && ctx.getMethodCall().getMethodId() == OptimisticPrepareCommand.METHOD_ID)
{
16 years, 6 months
JBoss Cache SVN: r6067 - in core/trunk/src/main/java/org/jboss/cache: factories/context and 2 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-26 13:40:47 -0400 (Thu, 26 Jun 2008)
New Revision: 6067
Modified:
core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
core/trunk/src/main/java/org/jboss/cache/factories/LockManagerFactory.java
core/trunk/src/main/java/org/jboss/cache/factories/context/ContextMetaFactory.java
core/trunk/src/main/java/org/jboss/cache/factories/context/OptimisticContextFactory.java
core/trunk/src/main/java/org/jboss/cache/factories/context/PessimisticContextFactory.java
core/trunk/src/main/java/org/jboss/cache/invocation/InvocationContextContainer.java
core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java
Log:
Make sure the right factory is used
Modified: core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-06-26 17:32:25 UTC (rev 6066)
+++ core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-06-26 17:40:47 UTC (rev 6067)
@@ -531,7 +531,7 @@
}
}
- if (trace) log.trace("Reset volatile components");
+ if (trace) log.trace("Reset volatile components. Registry now contains " + componentLookup.keySet());
}
// ------------------------------ START: Publicly available lifecycle methods -----------------------------
Modified: core/trunk/src/main/java/org/jboss/cache/factories/LockManagerFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/LockManagerFactory.java 2008-06-26 17:32:25 UTC (rev 6066)
+++ core/trunk/src/main/java/org/jboss/cache/factories/LockManagerFactory.java 2008-06-26 17:40:47 UTC (rev 6067)
@@ -19,6 +19,7 @@
@SuppressWarnings({"unchecked", "deprecation"})
protected <T> T construct(Class<T> componentType)
{
+ if (log.isTraceEnabled()) log.trace("Cache configuration is " + configuration.getNodeLockingScheme());
switch (configuration.getNodeLockingScheme())
{
case MVCC:
Modified: core/trunk/src/main/java/org/jboss/cache/factories/context/ContextMetaFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/context/ContextMetaFactory.java 2008-06-26 17:32:25 UTC (rev 6066)
+++ core/trunk/src/main/java/org/jboss/cache/factories/context/ContextMetaFactory.java 2008-06-26 17:40:47 UTC (rev 6067)
@@ -16,13 +16,17 @@
@SuppressWarnings("unchecked")
protected <T> T construct(Class<T> componentType)
{
+ if (log.isTraceEnabled()) log.trace("Cache configuration is " + configuration.getNodeLockingScheme());
switch (configuration.getNodeLockingScheme())
{
case MVCC:
+ if (log.isTraceEnabled()) log.trace("Creating an MVCC context factory");
return (T) new MVCCContextFactory();
case OPTIMISTIC:
+ if (log.isTraceEnabled()) log.trace("Creating an optimistic context factory");
return (T) new OptimisticContextFactory();
case PESSIMISTIC:
+ if (log.isTraceEnabled()) log.trace("Creating a pessimistic context factory");
return (T) new PessimisticContextFactory();
}
throw new ConfigurationException("Unknown configuration node locking scheme");
Modified: core/trunk/src/main/java/org/jboss/cache/factories/context/OptimisticContextFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/context/OptimisticContextFactory.java 2008-06-26 17:32:25 UTC (rev 6066)
+++ core/trunk/src/main/java/org/jboss/cache/factories/context/OptimisticContextFactory.java 2008-06-26 17:40:47 UTC (rev 6067)
@@ -1,6 +1,5 @@
package org.jboss.cache.factories.context;
-import org.jboss.cache.factories.annotations.NonVolatile;
import org.jboss.cache.transaction.OptimisticTransactionContext;
import org.jboss.cache.transaction.TransactionContext;
@@ -14,7 +13,6 @@
* @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
* @since 3.0
*/
-@NonVolatile
public class OptimisticContextFactory extends PessimisticContextFactory
{
@Override
Modified: core/trunk/src/main/java/org/jboss/cache/factories/context/PessimisticContextFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/context/PessimisticContextFactory.java 2008-06-26 17:32:25 UTC (rev 6066)
+++ core/trunk/src/main/java/org/jboss/cache/factories/context/PessimisticContextFactory.java 2008-06-26 17:40:47 UTC (rev 6067)
@@ -2,7 +2,6 @@
import org.jboss.cache.DataContainer;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.factories.annotations.NonVolatile;
import org.jboss.cache.invocation.InvocationContext;
import org.jboss.cache.invocation.LegacyInvocationContext;
import org.jboss.cache.transaction.PessimisticTransactionContext;
@@ -18,7 +17,6 @@
* @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
* @since 3.0
*/
-@NonVolatile
public class PessimisticContextFactory implements ContextFactory
{
DataContainer container;
Modified: core/trunk/src/main/java/org/jboss/cache/invocation/InvocationContextContainer.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/invocation/InvocationContextContainer.java 2008-06-26 17:32:25 UTC (rev 6066)
+++ core/trunk/src/main/java/org/jboss/cache/invocation/InvocationContextContainer.java 2008-06-26 17:40:47 UTC (rev 6067)
@@ -1,6 +1,7 @@
package org.jboss.cache.invocation;
import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.factories.annotations.NonVolatile;
import org.jboss.cache.factories.context.ContextFactory;
/**
@@ -9,6 +10,7 @@
* @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
* @since 2.1.0
*/
+@NonVolatile
public class InvocationContextContainer extends ThreadLocal<InvocationContext>
{
ContextFactory contextFactory;
Modified: core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java 2008-06-26 17:32:25 UTC (rev 6066)
+++ core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java 2008-06-26 17:40:47 UTC (rev 6067)
@@ -11,6 +11,7 @@
import org.jboss.cache.CacheException;
import org.jboss.cache.RPCManager;
import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.factories.annotations.NonVolatile;
import org.jboss.cache.factories.context.ContextFactory;
import org.jboss.cache.invocation.InvocationContext;
import org.jgroups.Address;
@@ -29,6 +30,7 @@
* @author <a href="mailto:bela@jboss.org">Bela Ban</a> Apr 14, 2003
* @version $Revision$
*/
+@NonVolatile
public class TransactionTable
{
private static final Log log = LogFactory.getLog(TransactionTable.class);
16 years, 6 months
JBoss Cache SVN: r6066 - searchable/trunk/src/main/java/org/jboss/cache/search.
by jbosscache-commits@lists.jboss.org
Author: navssurtani
Date: 2008-06-26 13:32:25 -0400 (Thu, 26 Jun 2008)
New Revision: 6066
Modified:
searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java
Log:
Javadocced QRII
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java 2008-06-26 17:22:45 UTC (rev 6065)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java 2008-06-26 17:32:25 UTC (rev 6066)
@@ -6,8 +6,8 @@
import java.util.NoSuchElementException;
/**
- * This is the implementation class for the interface QueryResultIterator. It is what is returned when the iterate()
- * method is run on a CacheQuery instance.
+ * This is the implementation class for the interface QueryResultIterator which extends ListIterator. It is what is
+ * returned when the iterate() method is run on a CacheQuery instance.
*
* @author Navin Surtani - navin(a)surtani.org
*/
@@ -30,6 +30,15 @@
upperLimit = idList.size() - 1;
}
+ /**
+ * Jumps to a given index in the list of results.
+ *
+ *
+ * @param index to jump to
+ * @throws IndexOutOfBoundsException
+ */
+
+
public void jumpToResult(int index) throws IndexOutOfBoundsException
{
if (index > idList.size() || index < 0)
@@ -39,51 +48,104 @@
this.index = index;
}
+ /**
+ * Jumps to first element in the list.
+ */
+
+
public void first()
{
index = 0;
}
+ /**
+ * Jumps to last element in the list.
+ */
+
+
public void last()
{
index = idList.size() - 1;
}
+ /**
+ * Jumps to second element in the list.
+ */
+
+
public void afterFirst()
{
index = 1;
}
+ /**
+ * Jumps to penultimate element in the list.
+ */
+
+
public void beforeLast()
{
index = idList.size() - 2;
}
+ /**
+ *
+ * @return true if the current element is the first in the list.
+ */
+
+
public boolean isFirst()
{
return idList.get(index) == idList.get(0);
}
+ /**
+ *
+ * @return true if the current result is the last one.
+ */
+
+
public boolean isLast()
{
return idList.get(index) == idList.get(idList.size() - 1);
}
+ /**
+ *
+ * @return true if the current result is one after the first.
+ */
+
+
public boolean isAfterFirst()
{
return idList.get(index) == idList.get(1);
}
+ /**
+ * @return true if the current result is one before the last
+ */
+
public boolean isBeforeLast()
{
return idList.get(index) == idList.get(idList.size() - 2);
}
+ /**
+ * Returns true if the list has more elements when traversing the list in the forward direction.
+ *
+ * @return true if the list has more elements when traversing the list in the forward direction.
+ */
+
public boolean hasNext()
{
return index <= upperLimit;
}
+ /**
+ * Returns the next element in the list
+ *
+ * @return The next element in the list.
+ */
public Object next()
{
if (!hasNext()) throw new NoSuchElementException("Out of boundaries");
@@ -92,11 +154,21 @@
return toReturn;
}
+ /**
+ * Returns true if the list has more elements when traversing the list in the reverse direction.
+ *
+ * @return true if the list iterator has more elements when traversing the list in the reverse direction
+ */
public boolean hasPrevious()
{
return index >= lowerLimit;
}
+ /**
+ * Returns the previous element in the list.
+ *
+ * @return The previous element in the list.
+ */
public Object previous()
{
@@ -106,6 +178,12 @@
return toReturn;
}
+ /**
+ * Returns the index of the element that would be returned by a subsequent call to next.
+ *
+ * @return Index of next element.
+ */
+
public int nextIndex()
{
if (!hasNext()) throw new NoSuchElementException("Out of boundaries");
@@ -113,22 +191,44 @@
}
+ /**
+ * Returns the index of the element that would be returned by a subsequent call to previous.
+ *
+ * @return Index of previous element.
+ */
+
public int previousIndex()
{
if (!hasPrevious()) throw new NoSuchElementException("Out of boundaries");
return index - 1;
}
+ /**
+ * This method is not supported and should not be used. Use cache.remove() instead.
+ */
public void remove()
{
throw new UnsupportedOperationException("Not supported as you are trying to change something in the cache");
}
+ /**
+ * This method is not supported in and should not be called. Use cache.put() instead.
+ *
+ * @param o
+ * @throws UnsupportedOperationException
+ */
public void set(Object o) throws UnsupportedOperationException
{
throw new UnsupportedOperationException("Not supported as you are trying to change something in the cache");
}
+ /**
+ * This method is not supported in and should not be called. Use cache.put() instead.
+ *
+ * @param o
+ * @throws UnsupportedOperationException
+ */
+
public void add(Object o)
{
throw new UnsupportedOperationException("Not supported as you are trying to change something in the cache");
16 years, 6 months
JBoss Cache SVN: r6065 - in core/trunk/src: main/java/org/jboss/cache/commands/write and 6 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-26 13:22:45 -0400 (Thu, 26 Jun 2008)
New Revision: 6065
Added:
core/trunk/src/test/java/org/jboss/cache/commands/TestContextBase.java
Removed:
core/trunk/src/test/java/org/jboss/cache/commands/write/OptimisticInvalidateCommandTest.java
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/read/ExistsCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/GetChildrenNamesCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/GetDataMapCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeyValueCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeysCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/GetNodeCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/read/GravitateDataCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/AbstractVersionedDataCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/ClearDataCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/CreateNodeCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/PutKeyValueCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java
core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactory.java
core/trunk/src/main/java/org/jboss/cache/invocation/InvocationContextContainer.java
core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java
core/trunk/src/test/java/org/jboss/cache/commands/read/AbstractDataCommandTest.java
core/trunk/src/test/java/org/jboss/cache/commands/read/ExistsCommandTest.java
core/trunk/src/test/java/org/jboss/cache/commands/read/GetChildrenNamesCommandTest.java
core/trunk/src/test/java/org/jboss/cache/commands/read/GetDataMapCommandTest.java
core/trunk/src/test/java/org/jboss/cache/commands/read/GetKeyValueCommandTest.java
core/trunk/src/test/java/org/jboss/cache/commands/read/GetKeysCommandTest.java
core/trunk/src/test/java/org/jboss/cache/commands/write/AbstractVersionedDataCommandTest.java
core/trunk/src/test/java/org/jboss/cache/commands/write/CreateNodeCommandTest.java
core/trunk/src/test/java/org/jboss/cache/commands/write/MoveCommandTest.java
core/trunk/src/test/java/org/jboss/cache/commands/write/PutDataMapCommandTest.java
core/trunk/src/test/java/org/jboss/cache/commands/write/PutKeyValueCommandTest.java
core/trunk/src/test/java/org/jboss/cache/commands/write/RemoveKeyCommandTest.java
Log:
Preparing commands for MVCC
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/ExistsCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/ExistsCommand.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/ExistsCommand.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -40,6 +40,7 @@
*/
public Object perform(InvocationContext ctx)
{
+ // this command will use the data container directly since it does not require any form of locking.
return dataContainer.exists(fqn);
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/GetChildrenNamesCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/GetChildrenNamesCommand.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/GetChildrenNamesCommand.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -41,7 +41,7 @@
*/
public Object perform(InvocationContext ctx)
{
- NodeSPI n = dataContainer.peek(fqn);
+ NodeSPI n = ctx.lookUpNode(fqn);
if (n == null) return null;
Map childrenMap = n.getChildrenMapDirect();
if (childrenMap == null || childrenMap.isEmpty()) return Collections.emptySet();
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/GetDataMapCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/GetDataMapCommand.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/GetDataMapCommand.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -35,7 +35,7 @@
*/
public Object perform(InvocationContext ctx)
{
- NodeSPI n = dataContainer.peek(fqn);
+ NodeSPI n = ctx.lookUpNode(fqn);
if (n == null) return null;
return new MapCopy(n.getDataDirect());
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeyValueCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeyValueCommand.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeyValueCommand.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -57,7 +57,7 @@
log.trace(new StringBuffer("get(").append("\"").append(fqn).append("\", \"").append(key).append("\", \"").
append(sendNodeEvent).append("\")"));
}
- NodeSPI n = dataContainer.peek(fqn);
+ NodeSPI n = ctx.lookUpNode(fqn);
if (n == null)
{
log.trace("node not found");
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeysCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeysCommand.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/GetKeysCommand.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -36,7 +36,7 @@
@SuppressWarnings("unchecked")
public Object perform(InvocationContext ctx)
{
- NodeSPI n = dataContainer.peek(fqn);
+ NodeSPI n = ctx.lookUpNode(fqn);
if (n == null) return null;
return n.getKeysDirect();
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/GetNodeCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/GetNodeCommand.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/GetNodeCommand.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -34,7 +34,7 @@
*/
public Object perform(InvocationContext ctx)
{
- return dataContainer.peek(fqn);
+ return ctx.lookUpNode(fqn);
}
public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
Modified: core/trunk/src/main/java/org/jboss/cache/commands/read/GravitateDataCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/read/GravitateDataCommand.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/main/java/org/jboss/cache/commands/read/GravitateDataCommand.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -73,6 +73,8 @@
@SuppressWarnings("unchecked")
public Object perform(InvocationContext ctx)
{
+ // TODO: Test this with MVCC.
+
// for now, perform a very simple series of getData calls.
if (trace) log.trace("Caller is asking for " + fqn);
try
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/AbstractVersionedDataCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/AbstractVersionedDataCommand.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/AbstractVersionedDataCommand.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -1,5 +1,6 @@
package org.jboss.cache.commands.write;
+import org.jboss.cache.CacheException;
import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.commands.VersionedDataCommand;
@@ -20,13 +21,24 @@
protected DataVersion dataVersion;
protected GlobalTransaction globalTransaction;
+ private boolean suppressRollbacks;
- public void initialize(Notifier notifier, DataContainer dataContainer)
+ public void initialize(Notifier notifier, DataContainer dataContainer, boolean suppressRollbacks)
{
this.notifier = notifier;
this.dataContainer = dataContainer;
+ this.suppressRollbacks = suppressRollbacks;
}
+ /**
+ * Test if the current node locking scheme allows for rollbacks.
+ */
+ protected void assertRollbackAllowed()
+ {
+ if (suppressRollbacks)
+ throw new CacheException("Rollback should never be called directly on a command when using MVCC, since this should be dealt with in the MVCCLockingInterceptor.");
+ }
+
public DataVersion getDataVersion()
{
return dataVersion;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/ClearDataCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/ClearDataCommand.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/ClearDataCommand.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -49,7 +49,9 @@
public Object perform(InvocationContext ctx)
{
if (trace) log.trace("perform(" + globalTransaction + ", \"" + fqn + "\")");
+
NodeSPI targetNode = dataContainer.peekVersioned(fqn, dataVersion);
+// NodeSPI targetNode = ctx.lookUpNode(fqn);
if (targetNode == null)
{
log.warn("node " + fqn + " not found");
@@ -74,6 +76,7 @@
public void rollback()
{
+ assertRollbackAllowed();
if (trace) log.trace("rollback(" + globalTransaction + ", \"" + fqn + "\", " + originalData + ")");
NodeSPI nodeSpi = dataContainer.peek(fqn, false, true);
if (nodeSpi == null)
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/CreateNodeCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/CreateNodeCommand.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/CreateNodeCommand.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -1,5 +1,6 @@
package org.jboss.cache.commands.write;
+import org.jboss.cache.CacheException;
import org.jboss.cache.Fqn;
import org.jboss.cache.NodeSPI;
import org.jboss.cache.commands.ReversibleCommand;
@@ -21,10 +22,12 @@
{
public static final int METHOD_ID = 48;
private final List<Fqn> newlyCreated = new LinkedList<Fqn>();
+ private boolean suppressRollbacks;
- public CreateNodeCommand(Fqn fqn)
+ public CreateNodeCommand(Fqn fqn, boolean suppressRollbacks)
{
this.fqn = fqn;
+ this.suppressRollbacks = suppressRollbacks;
newlyCreated.add(fqn);
}
@@ -32,6 +35,15 @@
{
}
+ /**
+ * Test if the current node locking scheme allows for rollbacks.
+ */
+ protected void assertRollbackAllowed()
+ {
+ if (suppressRollbacks)
+ throw new CacheException("Rollback should never be called directly on a command when using MVCC, since this should be dealt with in the MVCCLockingInterceptor.");
+ }
+
public int getCommandId()
{
return METHOD_ID;
@@ -76,6 +88,7 @@
public void rollback()
{
+ assertRollbackAllowed();
if (newlyCreated != null)
{
for (Fqn f : newlyCreated) dataContainer.removeFromDataStructure(f, true);
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/MoveCommand.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -2,6 +2,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.CacheException;
import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.NodeNotExistsException;
@@ -25,6 +26,7 @@
public static final int METHOD_ID = 36;
private static final Log log = LogFactory.getLog(MoveCommand.class);
private static boolean trace = log.isTraceEnabled();
+ private boolean suppressRollbacks;
/* dependencies */
private Notifier notifier;
@@ -37,10 +39,11 @@
{
}
- public void initialize(Notifier notifier, DataContainer dataContainer)
+ public void initialize(Notifier notifier, DataContainer dataContainer, boolean suppressRollbacks)
{
this.notifier = notifier;
this.dataContainer = dataContainer;
+ this.suppressRollbacks = suppressRollbacks;
}
public MoveCommand(Fqn from, Fqn to)
@@ -49,6 +52,15 @@
this.to = to;
}
+ /**
+ * Test if the current node locking scheme allows for rollbacks.
+ */
+ protected void assertRollbackAllowed()
+ {
+ if (suppressRollbacks)
+ throw new CacheException("Rollback should never be called directly on a command when using MVCC, since this should be dealt with in the MVCCLockingInterceptor.");
+ }
+
public GlobalTransaction getGlobalTransaction()
{
return globalTransaction;
@@ -73,6 +85,7 @@
public void rollback()
{
+ assertRollbackAllowed();
move(Fqn.fromRelativeElements(to, fqn.getLastElement()), fqn.getParent(), true, null);
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -3,6 +3,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.Fqn;
+import org.jboss.cache.NodeNotExistsException;
import org.jboss.cache.NodeSPI;
import org.jboss.cache.commands.Visitor;
import org.jboss.cache.invocation.InvocationContext;
@@ -54,7 +55,9 @@
{
log.trace("perform(" + globalTransaction + ", \"" + fqn + "\", " + data + ")");
}
- NodeSPI nodeSPI = dataContainer.peekStrict(globalTransaction, fqn, false);
+// NodeSPI nodeSPI = dataContainer.peekStrict(globalTransaction, fqn, false);
+ NodeSPI nodeSPI = ctx.lookUpNode(fqn);
+ if (nodeSPI == null) throw new NodeNotExistsException("Node " + fqn + " does not exist!");
Map existingData = nodeSPI.getDataDirect();
if (!existingData.isEmpty())
{
@@ -75,6 +78,7 @@
public void rollback()
{
+ assertRollbackAllowed();
if (trace) log.trace("rollback(" + globalTransaction + ", " + fqn + ", " + data + ")");
NodeSPI n = dataContainer.peek(fqn, false, true);
if (n != null)
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/PutKeyValueCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/PutKeyValueCommand.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/PutKeyValueCommand.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -4,6 +4,7 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.CacheException;
import org.jboss.cache.Fqn;
+import org.jboss.cache.NodeNotExistsException;
import org.jboss.cache.NodeSPI;
import org.jboss.cache.commands.Visitor;
import org.jboss.cache.invocation.InvocationContext;
@@ -58,7 +59,11 @@
log.trace(new StringBuffer("perform(").append(globalTransaction).append(", \"").
append(fqn).append("\", k=").append(key).append(", v=").append(value).append(")"));
}
- NodeSPI n = dataContainer.peekStrict(globalTransaction, fqn, false);
+// NodeSPI n = dataContainer.peekStrict(globalTransaction, fqn, false);
+ NodeSPI n = ctx.lookUpNode(fqn);
+ if (n == null) throw new NodeNotExistsException("Node " + fqn + " does not exist!");
+
+
if (notifier.shouldNotifyOnNodeModified())
{
notifier.notifyNodeModified(fqn, true, NodeModifiedEvent.ModificationType.PUT_DATA, n.getDataDirect(), ctx);
@@ -75,6 +80,7 @@
public void rollback()
{
+ assertRollbackAllowed();
NodeSPI n = dataContainer.peek(fqn, false, false);
if (n == null) throw new CacheException("node " + fqn + " not found for rollback!");
if (oldValue == null)
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -54,7 +54,8 @@
{
if (trace) log.trace("perform(" + globalTransaction + ", \"" + fqn + "\", key=" + key + ")");
- NodeSPI n = dataContainer.peek(fqn, false, false);
+// NodeSPI n = dataContainer.peek(fqn, false, false);
+ NodeSPI n = ctx.lookUpNode(fqn);
if (n == null)
{
if (log.isDebugEnabled()) log.debug("node " + fqn + " not found");
@@ -75,6 +76,7 @@
public void rollback()
{
+ assertRollbackAllowed();
NodeSPI targetNode = dataContainer.peek(fqn, false, true);
if (oldValue != null)
{
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -96,6 +96,7 @@
public void rollback()
{
+ assertRollbackAllowed();
if (targetNode != null)
{
Object childName = targetNode.getFqn().getLastElement();
Modified: core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactory.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactory.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -30,8 +30,10 @@
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.commands.write.*;
import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.NonVolatile;
+import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.interceptors.InterceptorChain;
import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -68,6 +70,7 @@
private Configuration configuration;
private TransactionManager txManager;
private BuddyFqnTransformer buddyFqnTransformer;
+ private boolean suppressRollbacks;
public CommandsFactory()
{
@@ -90,25 +93,31 @@
this.buddyFqnTransformer = buddyFqnTransformer;
}
+ @Start
+ public void start()
+ {
+ suppressRollbacks = configuration.getNodeLockingScheme() == NodeLockingScheme.MVCC;
+ }
+
public PutDataMapCommand buildPutDataMapCommand(GlobalTransaction gtx, Fqn fqn, Map data)
{
PutDataMapCommand cmd = new PutDataMapCommand(gtx, fqn, data);
- cmd.initialize(notifier, dataContainer);
+ cmd.initialize(notifier, dataContainer, suppressRollbacks);
return cmd;
}
public PutKeyValueCommand buildPutKeyValueCommand(GlobalTransaction gtx, Fqn fqn, Object key, Object value)
{
- PutKeyValueCommand command = new PutKeyValueCommand(gtx, fqn, key, value);
- command.initialize(notifier, dataContainer);
- return command;
+ PutKeyValueCommand cmd = new PutKeyValueCommand(gtx, fqn, key, value);
+ cmd.initialize(notifier, dataContainer, suppressRollbacks);
+ return cmd;
}
public PutForExternalReadCommand buildPutForExternalReadCommand(GlobalTransaction gtx, Fqn fqn, Object key, Object value)
{
- PutForExternalReadCommand command = new PutForExternalReadCommand(gtx, fqn, key, value);
- command.initialize(notifier, dataContainer);
- return command;
+ PutForExternalReadCommand cmd = new PutForExternalReadCommand(gtx, fqn, key, value);
+ cmd.initialize(notifier, dataContainer, suppressRollbacks);
+ return cmd;
}
public ReplicateCommand buildReplicateCommand(ReplicableCommand command)
@@ -156,16 +165,16 @@
public RemoveNodeCommand buildRemoveNodeCommand(GlobalTransaction gtx, Fqn fqn)
{
- RemoveNodeCommand command = new RemoveNodeCommand(gtx, fqn);
- command.initialize(notifier, dataContainer);
- return command;
+ RemoveNodeCommand cmd = new RemoveNodeCommand(gtx, fqn);
+ cmd.initialize(notifier, dataContainer, suppressRollbacks);
+ return cmd;
}
public ClearDataCommand buildClearDataCommand(GlobalTransaction gtx, Fqn fqn)
{
- ClearDataCommand command = new ClearDataCommand(gtx, fqn);
- command.initialize(notifier, dataContainer);
- return command;
+ ClearDataCommand cmd = new ClearDataCommand(gtx, fqn);
+ cmd.initialize(notifier, dataContainer, suppressRollbacks);
+ return cmd;
}
public EvictCommand buildEvictFqnCommand(Fqn fqn)
@@ -194,9 +203,9 @@
public RemoveKeyCommand buildRemoveKeyCommand(GlobalTransaction tx, Fqn<?> fqn, Object key)
{
- RemoveKeyCommand command = new RemoveKeyCommand(tx, fqn, key);
- command.initialize(notifier, dataContainer);
- return command;
+ RemoveKeyCommand cmd = new RemoveKeyCommand(tx, fqn, key);
+ cmd.initialize(notifier, dataContainer, suppressRollbacks);
+ return cmd;
}
public GetDataMapCommand buildGetDataMapCommand(Fqn fqn)
@@ -243,9 +252,9 @@
public MoveCommand buildMoveCommand(Fqn from, Fqn to)
{
- MoveCommand command = new MoveCommand(from, to);
- command.initialize(notifier, dataContainer);
- return command;
+ MoveCommand cmd = new MoveCommand(from, to);
+ cmd.initialize(notifier, dataContainer, suppressRollbacks);
+ return cmd;
}
public RollbackCommand buildRollbackCommand(GlobalTransaction gtx)
@@ -288,7 +297,7 @@
public CreateNodeCommand buildCreateNodeCommand(Fqn fqn)
{
- CreateNodeCommand command = new CreateNodeCommand(fqn);
+ CreateNodeCommand command = new CreateNodeCommand(fqn, suppressRollbacks);
command.initialize(dataContainer);
return command;
}
@@ -350,7 +359,7 @@
case MoveCommand.METHOD_ID:
{
MoveCommand returnValue = new MoveCommand();
- returnValue.initialize(notifier, dataContainer);
+ returnValue.initialize(notifier, dataContainer, suppressRollbacks);
command = returnValue;
break;
}
@@ -360,7 +369,7 @@
case PutDataMapCommand.VERSIONED_METHOD_ID:
{
PutDataMapCommand returnValue = new PutDataMapCommand();
- returnValue.initialize(notifier, dataContainer);
+ returnValue.initialize(notifier, dataContainer, suppressRollbacks);
command = returnValue;
break;
}
@@ -368,7 +377,7 @@
case PutKeyValueCommand.VERSIONED_METHOD_ID:
{
PutKeyValueCommand returnValue = new PutKeyValueCommand();
- returnValue.initialize(notifier, dataContainer);
+ returnValue.initialize(notifier, dataContainer, suppressRollbacks);
command = returnValue;
break;
}
@@ -376,7 +385,7 @@
case PutForExternalReadCommand.VERSIONED_METHOD_ID:
{
PutForExternalReadCommand returnValue = new PutForExternalReadCommand();
- returnValue.initialize(notifier, dataContainer);
+ returnValue.initialize(notifier, dataContainer, suppressRollbacks);
command = returnValue;
break;
}
@@ -384,7 +393,7 @@
case ClearDataCommand.VERSIONED_METHOD_ID:
{
ClearDataCommand returnValue = new ClearDataCommand();
- returnValue.initialize(notifier, dataContainer);
+ returnValue.initialize(notifier, dataContainer, suppressRollbacks);
command = returnValue;
break;
}
@@ -392,7 +401,7 @@
case RemoveKeyCommand.VERSIONED_METHOD_ID:
{
RemoveKeyCommand returnValue = new RemoveKeyCommand();
- returnValue.initialize(notifier, dataContainer);
+ returnValue.initialize(notifier, dataContainer, suppressRollbacks);
command = returnValue;
break;
}
@@ -401,13 +410,13 @@
case RemoveNodeCommand.VERSIONED_METHOD_ID:
{
RemoveNodeCommand returnValue = new RemoveNodeCommand();
- returnValue.initialize(notifier, dataContainer);
+ returnValue.initialize(notifier, dataContainer, suppressRollbacks);
command = returnValue;
break;
}
case CreateNodeCommand.METHOD_ID:
{
- CreateNodeCommand returnValue = new CreateNodeCommand();
+ CreateNodeCommand returnValue = new CreateNodeCommand(null, suppressRollbacks);
returnValue.initialize(dataContainer);
command = returnValue;
break;
Modified: core/trunk/src/main/java/org/jboss/cache/invocation/InvocationContextContainer.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/invocation/InvocationContextContainer.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/main/java/org/jboss/cache/invocation/InvocationContextContainer.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -1,7 +1,6 @@
package org.jboss.cache.invocation;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.factories.annotations.NonVolatile;
import org.jboss.cache.factories.context.ContextFactory;
/**
@@ -10,7 +9,6 @@
* @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
* @since 2.1.0
*/
-@NonVolatile
public class InvocationContextContainer extends ThreadLocal<InvocationContext>
{
ContextFactory contextFactory;
Modified: core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -11,7 +11,6 @@
import org.jboss.cache.CacheException;
import org.jboss.cache.RPCManager;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.factories.annotations.NonVolatile;
import org.jboss.cache.factories.context.ContextFactory;
import org.jboss.cache.invocation.InvocationContext;
import org.jgroups.Address;
@@ -30,7 +29,6 @@
* @author <a href="mailto:bela@jboss.org">Bela Ban</a> Apr 14, 2003
* @version $Revision$
*/
-@NonVolatile
public class TransactionTable
{
private static final Log log = LogFactory.getLog(TransactionTable.class);
Added: core/trunk/src/test/java/org/jboss/cache/commands/TestContextBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/commands/TestContextBase.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/commands/TestContextBase.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -0,0 +1,19 @@
+package org.jboss.cache.commands;
+
+import org.jboss.cache.DataContainer;
+import org.jboss.cache.invocation.InvocationContext;
+import org.jboss.cache.invocation.LegacyInvocationContext;
+import org.jboss.cache.invocation.MVCCInvocationContext;
+
+public class TestContextBase
+{
+ protected InvocationContext createMVCCInvocationContext()
+ {
+ return new MVCCInvocationContext();
+ }
+
+ protected InvocationContext createLegacyInvocationContext(DataContainer dc)
+ {
+ return new LegacyInvocationContext(dc);
+ }
+}
Modified: core/trunk/src/test/java/org/jboss/cache/commands/read/AbstractDataCommandTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/commands/read/AbstractDataCommandTest.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/test/java/org/jboss/cache/commands/read/AbstractDataCommandTest.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -3,8 +3,8 @@
import static org.easymock.EasyMock.createMock;
import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
+import org.jboss.cache.commands.TestContextBase;
import org.jboss.cache.invocation.InvocationContext;
-import org.jboss.cache.invocation.LegacyInvocationContext;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@@ -15,7 +15,7 @@
* @since 2.2
*/
@Test(groups = "unit")
-public abstract class AbstractDataCommandTest
+public abstract class AbstractDataCommandTest extends TestContextBase
{
protected Fqn testFqn = Fqn.fromString("/testfqn");
protected DataContainer container;
@@ -25,7 +25,7 @@
final public void setUp()
{
container = createMock(DataContainer.class);
- ctx = new LegacyInvocationContext(container);
+ ctx = createLegacyInvocationContext(container);
moreSetup();
}
Modified: core/trunk/src/test/java/org/jboss/cache/commands/read/ExistsCommandTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/commands/read/ExistsCommandTest.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/test/java/org/jboss/cache/commands/read/ExistsCommandTest.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -5,10 +5,11 @@
/**
* Tester class for {@link org.jboss.cache.commands.read.ExistsCommand}
+ *
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-@Test(groups="unit")
+@Test(groups = "unit")
public class ExistsCommandTest extends AbstractDataCommandTest
{
private ExistsCommand command;
@@ -21,12 +22,12 @@
public void testPerform()
{
- expect(container.exists(testFqn)).andReturn(Boolean.FALSE);
+ expect(container.exists(testFqn)).andReturn(false);
replay(container);
- assert Boolean.FALSE == command.perform(null);
+ assert !((Boolean) command.perform(null));
reset(container);
-
- expect(container.exists(testFqn)).andReturn(Boolean.TRUE);
+
+ expect(container.exists(testFqn)).andReturn(true);
replay(container);
assert Boolean.TRUE == command.perform(null);
}
Modified: core/trunk/src/test/java/org/jboss/cache/commands/read/GetChildrenNamesCommandTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/commands/read/GetChildrenNamesCommandTest.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/test/java/org/jboss/cache/commands/read/GetChildrenNamesCommandTest.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -1,10 +1,10 @@
package org.jboss.cache.commands.read;
-import static org.easymock.EasyMock.*;
-
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import org.jboss.cache.mock.MockNodesFixture;
+import org.jboss.cache.mock.NodeSpiMock;
import org.testng.annotations.Test;
-import org.jboss.cache.mock.NodeSpiMock;
-import org.jboss.cache.mock.MockNodesFixture;
import java.util.Set;
@@ -14,7 +14,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-@Test (groups="unit")
+@Test(groups = "unit")
public class GetChildrenNamesCommandTest extends AbstractDataCommandTest
{
private GetChildrenNamesCommand command;
@@ -32,15 +32,15 @@
NodeSpiMock node = new NodeSpiMock(testFqn);
expect(container.peek(testFqn)).andReturn(node);
replay(container);
- Set result = (Set) command.perform(null);
+ Set result = (Set) command.perform(ctx);
assert result.isEmpty() : "empty result expected";
}
-
+
public void testPerformInexistingNode()
{
expect(container.peek(testFqn)).andReturn(null);
replay(container);
- Set result = (Set) command.perform(null);
+ Set result = (Set) command.perform(ctx);
assert result == null : "empty result expected";
}
@@ -48,7 +48,7 @@
{
expect(container.peek(testFqn)).andReturn(nodes.adfNode);
replay(container);
- Set result = (Set) command.perform(null);
+ Set result = (Set) command.perform(ctx);
assert result.size() == 2;
assert result.contains("h");
assert result.contains("g");
@@ -59,7 +59,7 @@
nodes.adfgNode.markAsDeleted(true);
expect(container.peek(testFqn)).andReturn(nodes.adfNode);
replay(container);
- Set result = (Set) command.perform(null);
+ Set result = (Set) command.perform(ctx);
assert result.size() == 1;
assert result.contains("h");
}
Modified: core/trunk/src/test/java/org/jboss/cache/commands/read/GetDataMapCommandTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/commands/read/GetDataMapCommandTest.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/test/java/org/jboss/cache/commands/read/GetDataMapCommandTest.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -1,8 +1,9 @@
package org.jboss.cache.commands.read;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import org.jboss.cache.mock.NodeSpiMock;
import org.testng.annotations.Test;
-import static org.easymock.EasyMock.*;
-import org.jboss.cache.mock.NodeSpiMock;
import java.util.Map;
@@ -27,17 +28,17 @@
{
expect(container.peek(testFqn)).andReturn(null);
replay(container);
- assert null == command.perform(null);
+ assert null == command.perform(ctx);
}
public void testForExistingNode()
{
NodeSpiMock node = new NodeSpiMock(testFqn);
- node.putDirect("k1","v1");
- node.putDirect("k2","v2");
+ node.putDirect("k1", "v1");
+ node.putDirect("k2", "v2");
expect(container.peek(testFqn)).andReturn(node);
replay(container);
- Map result = (Map) command.perform(null);
+ Map result = (Map) command.perform(ctx);
assert 2 == result.entrySet().size();
assert result.get("k1").equals("v1");
assert result.get("k2").equals("v2");
@@ -46,7 +47,8 @@
{
result.put("k3", "v3");
assert false : "map should be immutable";
- } catch (RuntimeException ex)
+ }
+ catch (RuntimeException ex)
{
//expected
}
Modified: core/trunk/src/test/java/org/jboss/cache/commands/read/GetKeyValueCommandTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/commands/read/GetKeyValueCommandTest.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/test/java/org/jboss/cache/commands/read/GetKeyValueCommandTest.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -1,13 +1,16 @@
package org.jboss.cache.commands.read;
-import org.testng.annotations.Test;
-import org.testng.annotations.BeforeMethod;
-import static org.easymock.EasyMock.*;
-import org.easymock.*;
-import org.jboss.cache.notifications.Notifier;
+import static org.easymock.EasyMock.createStrictControl;
+import static org.easymock.EasyMock.expect;
+import org.easymock.IMocksControl;
import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
+import org.jboss.cache.commands.TestContextBase;
+import org.jboss.cache.invocation.InvocationContext;
import org.jboss.cache.mock.NodeSpiMock;
+import org.jboss.cache.notifications.Notifier;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
/**
* Tester class for {@link GetKeyValueCommand}.
@@ -16,7 +19,7 @@
* @since 2.2
*/
@Test(groups = "unit")
-public class GetKeyValueCommandTest
+public class GetKeyValueCommandTest extends TestContextBase
{
private IMocksControl control;
Notifier notifierMock;
@@ -24,6 +27,7 @@
GetKeyValueCommand command;
Fqn fqn = Fqn.fromString("/dummy");
String key = "key";
+ InvocationContext ctx;
@BeforeMethod
protected void setUup()
@@ -33,13 +37,14 @@
notifierMock = control.createMock(Notifier.class);
command = new GetKeyValueCommand(fqn, key, false);
command.initialize(containerMock, notifierMock);
+ ctx = createLegacyInvocationContext(containerMock);
}
public void testNonexistentNodeNoNotifications()
{
expect(containerMock.peek(fqn)).andReturn(null);
control.replay();
- assert null == command.perform(null);
+ assert null == command.perform(ctx);
}
public void testExistentNodeNoNotifications()
@@ -49,7 +54,7 @@
node.put(key, value);
expect(containerMock.peek(fqn)).andReturn(node);
control.replay();
- assert value.equals(command.perform(null));
+ assert value.equals(command.perform(ctx));
}
/**
@@ -60,7 +65,7 @@
command.sendNodeEvent = true;
expect(containerMock.peek(fqn)).andReturn(null);
control.replay();
- assert null == command.perform(null);
+ assert null == command.perform(ctx);
}
public void testExistentNodeWithNotifications()
@@ -72,11 +77,11 @@
//not ordred because the peek hapens before notification - that is to make sure that no notification
// is sent for an nonexistent node.
control.checkOrder(false);
- notifierMock.notifyNodeVisited(fqn, true, null);
+ notifierMock.notifyNodeVisited(fqn, true, ctx);
expect(containerMock.peek(fqn)).andReturn(node);
- notifierMock.notifyNodeVisited(fqn, false, null);
+ notifierMock.notifyNodeVisited(fqn, false, ctx);
control.replay();
- assert value.equals(command.perform(null));
+ assert value.equals(command.perform(ctx));
control.verify();
}
}
Modified: core/trunk/src/test/java/org/jboss/cache/commands/read/GetKeysCommandTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/commands/read/GetKeysCommandTest.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/test/java/org/jboss/cache/commands/read/GetKeysCommandTest.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -1,9 +1,9 @@
package org.jboss.cache.commands.read;
-import org.testng.annotations.Test;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import org.jboss.cache.mock.NodeSpiMock;
+import org.testng.annotations.Test;
import java.util.Set;
@@ -29,7 +29,7 @@
{
expect(container.peek(testFqn)).andReturn(null);
replay(container);
- assert null == command.perform(null);
+ assert null == command.perform(ctx);
}
public void testForExistingNode()
@@ -39,7 +39,7 @@
node.putDirect("k2", "v2");
expect(container.peek(testFqn)).andReturn(node);
replay(container);
- Set result = (Set) command.perform(null);
+ Set result = (Set) command.perform(ctx);
assert 2 == result.size();
assert result.contains("k1");
assert result.contains("k2");
Modified: core/trunk/src/test/java/org/jboss/cache/commands/write/AbstractVersionedDataCommandTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/commands/write/AbstractVersionedDataCommandTest.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/test/java/org/jboss/cache/commands/write/AbstractVersionedDataCommandTest.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -4,8 +4,8 @@
import org.easymock.IMocksControl;
import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
+import org.jboss.cache.commands.TestContextBase;
import org.jboss.cache.invocation.InvocationContext;
-import org.jboss.cache.invocation.LegacyInvocationContext;
import org.jboss.cache.mock.MockNodesFixture;
import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.optimistic.DataVersion;
@@ -21,7 +21,7 @@
* @since 2.2
*/
@Test(groups = "unit")
-public abstract class AbstractVersionedDataCommandTest
+public abstract class AbstractVersionedDataCommandTest extends TestContextBase
{
Notifier notifier;
DataContainer container;
@@ -43,10 +43,10 @@
nodes = new MockNodesFixture();
globalTransaction = new GlobalTransaction();
dataVersion = new DefaultDataVersion(10);
- ctx = new LegacyInvocationContext(container);
+ ctx = createLegacyInvocationContext(container);
AbstractVersionedDataCommand command = moreSetUp();
- command.initialize(notifier, container);
+ command.initialize(notifier, container, false);
}
public abstract AbstractVersionedDataCommand moreSetUp();
Modified: core/trunk/src/test/java/org/jboss/cache/commands/write/CreateNodeCommandTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/commands/write/CreateNodeCommandTest.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/test/java/org/jboss/cache/commands/write/CreateNodeCommandTest.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -1,10 +1,9 @@
package org.jboss.cache.commands.write;
import static org.easymock.EasyMock.*;
-
-import org.testng.annotations.Test;
import org.jboss.cache.commands.read.AbstractDataCommandTest;
import org.jboss.cache.mock.MockNodesFixture;
+import org.testng.annotations.Test;
import java.util.ArrayList;
@@ -23,7 +22,7 @@
protected void moreSetup()
{
- command = new CreateNodeCommand(testFqn);
+ command = new CreateNodeCommand(testFqn, false);
command.initialize(container);
createdNodes = new ArrayList();
result = new Object[2];
Modified: core/trunk/src/test/java/org/jboss/cache/commands/write/MoveCommandTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/commands/write/MoveCommandTest.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/test/java/org/jboss/cache/commands/write/MoveCommandTest.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -1,14 +1,14 @@
package org.jboss.cache.commands.write;
-import static org.easymock.EasyMock.*;
-import org.jboss.cache.notifications.Notifier;
-import org.jboss.cache.mock.MockNodesFixture;
-import org.jboss.cache.commands.read.AbstractDataCommandTest;
+import static org.easymock.EasyMock.createStrictControl;
+import static org.easymock.EasyMock.expect;
+import org.easymock.IMocksControl;
import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.NodeNotExistsException;
-import org.easymock.IMocksControl;
-import static org.easymock.EasyMock.createStrictControl;
+import org.jboss.cache.commands.read.AbstractDataCommandTest;
+import org.jboss.cache.mock.MockNodesFixture;
+import org.jboss.cache.notifications.Notifier;
import org.testng.annotations.Test;
/**
@@ -34,7 +34,7 @@
notifier = control.createMock(Notifier.class);
container = control.createMock(DataContainer.class);
command = new MoveCommand(source, destination);
- command.initialize(notifier, container);
+ command.initialize(notifier, container, false);
nodes = new MockNodesFixture();
}
@@ -48,7 +48,8 @@
{
command.perform(ctx);
assert false : "should have thrown an exception as the source is null";
- } catch (NodeNotExistsException e)
+ }
+ catch (NodeNotExistsException e)
{
//expected
}
@@ -64,7 +65,8 @@
{
command.perform(ctx);
assert false : "should have thrown an exception as the source is null";
- } catch (NodeNotExistsException e)
+ }
+ catch (NodeNotExistsException e)
{
//expected
}
Deleted: core/trunk/src/test/java/org/jboss/cache/commands/write/OptimisticInvalidateCommandTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/commands/write/OptimisticInvalidateCommandTest.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/test/java/org/jboss/cache/commands/write/OptimisticInvalidateCommandTest.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -1,137 +0,0 @@
-package org.jboss.cache.commands.write;
-
-import static org.easymock.EasyMock.*;
-import org.easymock.IMocksControl;
-import org.jboss.cache.CacheSPI;
-import org.jboss.cache.DataContainer;
-import org.jboss.cache.optimistic.DataVersion;
-import org.jboss.cache.optimistic.DefaultDataVersion;
-import org.jboss.cache.commands.read.AbstractDataCommandTest;
-import org.jboss.cache.mock.MockNodesFixture;
-import org.jboss.cache.notifications.Notifier;
-import org.testng.annotations.Test;
-
-import javax.transaction.TransactionManager;
-import javax.transaction.Transaction;
-import java.util.Collections;
-
-/**
- * tester class for {@link OptimisticInvalidateCommand}.
- *
- * @author Mircea.Markus(a)jboss.com
- * @since 2.2
- */
-@Test(groups = "unit")
-public class OptimisticInvalidateCommandTest extends AbstractDataCommandTest
-{
- DataVersion dataVersion;
- OptimisticInvalidateCommand command;
- IMocksControl control;
-
- Notifier notifier;
- TransactionManager tmMock;
-
- MockNodesFixture nodes;
- CacheSPI spiMock;
-
- protected void moreSetup()
- {
- control = createStrictControl();
- notifier = control.createMock(Notifier.class);
- container = control.createMock(DataContainer.class);
- tmMock = control.createMock(TransactionManager.class);
- spiMock = control.createMock(CacheSPI.class);
- nodes = new MockNodesFixture();
-
- command = new OptimisticInvalidateCommand(testFqn);
- dataVersion = new DefaultDataVersion(10);
- command.setDataVersion(dataVersion);
- command.initialize(spiMock, container, notifier);
- command.initialize(tmMock);
- }
-
- public void testWithExistingNode()
- {
- nodes.adfNode.put("key", "value");
- nodes.adfNode.setDataLoaded(true);
- expect(spiMock.getNode(testFqn)).andReturn(nodes.adfNode);
- expect(container.peekVersioned(testFqn, dataVersion)).andReturn(nodes.adfNode);
- notifier.notifyNodeEvicted(testFqn, true, ctx);
- notifier.notifyNodeEvicted(testFqn, false, ctx);
- expect(container.peek(testFqn, false, true)).andReturn(nodes.adfNode);
-
- control.replay();
- assert null == command.perform(ctx);
- assert nodes.adfNode.getData().isEmpty();
- assert !nodes.adfNode.isDataLoaded();
- assert !nodes.adfNode.isValid();
- assert nodes.adfNode.getVersion().equals(dataVersion);
-
- control.verify();
- }
-
- public void testWithExistingNodeInvalidVersion()
- {
- nodes.adfNode.put("key", "value");
- nodes.adfNode.setDataLoaded(true);
- expect(spiMock.getNode(testFqn)).andReturn(nodes.adfNode);
- expect(container.peekVersioned(testFqn, dataVersion)).andThrow(new RuntimeException());
- control.replay();
-
- try
- {
- command.perform(ctx);
- assert false : "exception expected";
- } catch (Exception e)
- {
- //expected as there is a version mismatch
- }
- assert !nodes.adfNode.getData().isEmpty();
- assert nodes.adfNode.isDataLoaded();
- assert nodes.adfNode.isValid();
- assert !dataVersion.equals(nodes.adfNode.getVersion());
-
- control.verify();
- }
-
- public void testExistingTumbstone()
- {
- nodes.adfNode.setValid(false, true);
- expect(spiMock.getNode(testFqn)).andReturn(null);
- expect(container.peek(testFqn, false, true)).andReturn(nodes.adfNode);
- expect(container.peekVersioned(testFqn, dataVersion)).andReturn(nodes.adfNode);
- notifier.notifyNodeEvicted(testFqn, true, ctx);
- notifier.notifyNodeEvicted(testFqn, false, ctx);
- expect(container.peek(testFqn, false, true)).andReturn(nodes.adfNode);
-
- control.replay();
- assert null == command.perform(ctx);
- assert nodes.adfNode.getData().isEmpty();
- assert !nodes.adfNode.isDataLoaded();
- assert !nodes.adfNode.isValid();
- assert nodes.adfNode.getVersion().equals(dataVersion);
- control.verify();
- }
-
- public void testCreateTumbstone() throws Exception
- {
- Transaction tx = control.createMock(Transaction.class);
- expect(tmMock.suspend()).andReturn(tx);
- spiMock.put(testFqn, Collections.emptyMap());
- tmMock.resume(tx);
-
- control.replay();
- command.createTombstone(ctx);
- control.verify();
- }
-
- public void testCreateTumbstoneNoTx() throws Exception
- {
- expect(tmMock.suspend()).andReturn(null);
- spiMock.put(testFqn, Collections.EMPTY_MAP);
-
- control.replay();
- command.createTombstone(ctx);
- control.verify();
- }
-}
Modified: core/trunk/src/test/java/org/jboss/cache/commands/write/PutDataMapCommandTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/commands/write/PutDataMapCommandTest.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/test/java/org/jboss/cache/commands/write/PutDataMapCommandTest.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -1,18 +1,21 @@
package org.jboss.cache.commands.write;
-import static org.easymock.EasyMock.*;
+import static org.easymock.EasyMock.createStrictControl;
+import static org.easymock.EasyMock.expect;
import org.easymock.IMocksControl;
-import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.cache.DataContainer;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.commands.TestContextBase;
+import org.jboss.cache.invocation.InvocationContext;
+import org.jboss.cache.mock.NodeSpiMock;
import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.notifications.event.NodeModifiedEvent;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.DataContainer;
-import org.jboss.cache.mock.NodeSpiMock;
+import org.jboss.cache.transaction.GlobalTransaction;
+import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-import org.testng.annotations.BeforeMethod;
+import java.util.HashMap;
import java.util.Map;
-import java.util.HashMap;
/**
* Tester class for {@link PutDataMapCommand}
@@ -21,17 +24,17 @@
* @since 2.2
*/
@Test(groups = "unit")
-public class PutDataMapCommandTest
+public class PutDataMapCommandTest extends TestContextBase
{
Fqn testFqn = Fqn.fromString("/testfqn");
PutDataMapCommand command;
-
GlobalTransaction gtx;
Notifier notifier;
DataContainer container;
Map dataMap;
IMocksControl control;
NodeSpiMock node;
+ InvocationContext ctx;
@BeforeMethod
@@ -43,30 +46,31 @@
control = createStrictControl();
notifier = control.createMock(Notifier.class);
container = control.createMock(DataContainer.class);
- command.initialize(notifier, container);
+ command.initialize(notifier, container, false);
node = new NodeSpiMock(testFqn);
- node.put("k","v");
+ node.put("k", "v");
+ ctx = createLegacyInvocationContext(container);
}
public void testAddDataNoErase()
{
- expect(container.peekStrict(gtx, testFqn, false)).andReturn(node);
+ expect(container.peek(testFqn)).andReturn(node);
dataMap.put("k2", "v2");
Map expected = new HashMap(dataMap);
expected.putAll(node.getDataDirect());
expect(notifier.shouldNotifyOnNodeModified()).andReturn(true);
- notifier.notifyNodeModified(testFqn, true, NodeModifiedEvent.ModificationType.PUT_MAP, node.getData(), null);
+ notifier.notifyNodeModified(testFqn, true, NodeModifiedEvent.ModificationType.PUT_MAP, node.getData(), ctx);
expect(notifier.shouldNotifyOnNodeModified()).andReturn(true);
- notifier.notifyNodeModified(testFqn, false, NodeModifiedEvent.ModificationType.PUT_MAP, expected, null);
-
+ notifier.notifyNodeModified(testFqn, false, NodeModifiedEvent.ModificationType.PUT_MAP, expected, ctx);
+
control.replay();
- assert null == command.perform(null) : "null result is always expected";
+ assert null == command.perform(ctx) : "null result is always expected";
assert command.getOldData().size() == 1;
assert command.getOldData().get("k").equals("v");
control.verify();
}
-
+
public void testRollbackNonexistentNode()
{
expect(container.peek(testFqn, false, true)).andReturn(null);
Modified: core/trunk/src/test/java/org/jboss/cache/commands/write/PutKeyValueCommandTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/commands/write/PutKeyValueCommandTest.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/test/java/org/jboss/cache/commands/write/PutKeyValueCommandTest.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -1,12 +1,12 @@
package org.jboss.cache.commands.write;
-import static org.easymock.EasyMock.*;
+import static org.easymock.EasyMock.expect;
+import org.jboss.cache.NodeNotExistsException;
+import org.jboss.cache.notifications.event.NodeModifiedEvent;
import org.testng.annotations.Test;
-import org.jboss.cache.CacheException;
-import org.jboss.cache.notifications.event.NodeModifiedEvent;
+import java.util.HashMap;
import java.util.Map;
-import java.util.HashMap;
/**
* tester class for {@link PutKeyValueCommand}.
@@ -27,13 +27,14 @@
public void testInexistentNode()
{
- expect(container.peekStrict(globalTransaction, fqn, false)).andThrow(new CacheException());
+ expect(container.peek(fqn)).andReturn(null); // simulate node not existing.
control.replay();
try
{
command.perform(ctx);
assert false : "exception should have been thrown as data does not exists.";
- } catch (Exception e)
+ }
+ catch (NodeNotExistsException e)
{
//expected
}
@@ -43,7 +44,7 @@
public void testAddNewData()
{
nodes.adfNode.put("existingKey", "existingValue");
- expect(container.peekStrict(globalTransaction, fqn, false)).andReturn(nodes.adfNode);
+ expect(container.peek(fqn)).andReturn(nodes.adfNode);
expect(notifier.shouldNotifyOnNodeModified()).andReturn(true);
notifier.notifyNodeModified(fqn, true, NodeModifiedEvent.ModificationType.PUT_DATA, nodes.adfNode.getDataDirect(), ctx);
Map expected = new HashMap();
@@ -69,7 +70,7 @@
public void testOverWriteData()
{
nodes.adfNode.put("k", "oldValue");
- expect(container.peekStrict(globalTransaction, fqn, false)).andReturn(nodes.adfNode);
+ expect(container.peek(fqn)).andReturn(nodes.adfNode);
expect(notifier.shouldNotifyOnNodeModified()).andReturn(true);
notifier.notifyNodeModified(fqn, true, NodeModifiedEvent.ModificationType.PUT_DATA, nodes.adfNode.getDataDirect(), ctx);
Map expected = new HashMap();
@@ -88,6 +89,6 @@
command.rollback();
assert nodes.adfNode.getData().size() == 1;
assert "oldValue".equals(nodes.adfNode.getData().get("k"));
- control.verify();
+ control.verify();
}
}
Modified: core/trunk/src/test/java/org/jboss/cache/commands/write/RemoveKeyCommandTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/commands/write/RemoveKeyCommandTest.java 2008-06-26 17:19:42 UTC (rev 6064)
+++ core/trunk/src/test/java/org/jboss/cache/commands/write/RemoveKeyCommandTest.java 2008-06-26 17:22:45 UTC (rev 6065)
@@ -1,12 +1,11 @@
package org.jboss.cache.commands.write;
-import static org.easymock.EasyMock.*;
-import org.testng.annotations.Test;
+import static org.easymock.EasyMock.expect;
import org.jboss.cache.notifications.event.NodeModifiedEvent;
+import org.testng.annotations.Test;
-import java.util.Collections;
-import java.util.Map;
import java.util.HashMap;
+import java.util.Map;
/**
* tester class for {@link RemoveKeyCommand}.
@@ -14,7 +13,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-@Test(groups="unit")
+@Test(groups = "unit")
public class RemoveKeyCommandTest extends AbstractVersionedDataCommandTest
{
RemoveKeyCommand command;
@@ -29,7 +28,7 @@
public void testNonexistentNode()
{
- expect(container.peek(fqn, false, false)).andReturn(null);
+ expect(container.peek(fqn)).andReturn(null);
control.replay();
assert null == command.perform(ctx);
control.verify();
@@ -38,13 +37,13 @@
public void testRemoveNonexistentPair()
{
Map expected = new HashMap();
- expected.put("newKey","newValue");
+ expected.put("newKey", "newValue");
nodes.adfgNode.putAll(expected);
- expect(container.peek(fqn, false, false)).andReturn(nodes.adfgNode);
+ expect(container.peek(fqn)).andReturn(nodes.adfgNode);
expect(notifier.shouldNotifyOnNodeModified()).andReturn(true);
notifier.notifyNodeModified(fqn, true, NodeModifiedEvent.ModificationType.REMOVE_DATA, expected, ctx);
expected = new HashMap();
- expected.put(key,null);
+ expected.put(key, null);
expect(notifier.shouldNotifyOnNodeModified()).andReturn(true);
notifier.notifyNodeModified(fqn, false, NodeModifiedEvent.ModificationType.REMOVE_DATA, expected, ctx);
control.replay();
@@ -65,9 +64,9 @@
public void testRemoveExistentPair()
{
Map expected = new HashMap();
- expected.put(key,"newValue");
+ expected.put(key, "newValue");
nodes.adfgNode.putAll(expected);
- expect(container.peek(fqn, false, false)).andReturn(nodes.adfgNode);
+ expect(container.peek(fqn)).andReturn(nodes.adfgNode);
expect(notifier.shouldNotifyOnNodeModified()).andReturn(true);
notifier.notifyNodeModified(fqn, true, NodeModifiedEvent.ModificationType.REMOVE_DATA, expected, ctx);
expect(notifier.shouldNotifyOnNodeModified()).andReturn(true);
@@ -94,12 +93,6 @@
{
expect(container.peek(fqn, false, true)).andReturn(null);
control.replay();
- try
- {
- command.rollback();
- } catch (Exception ex)
- {
- assert false : "No exception should be thrown here.";
- }
+ command.rollback();
}
}
16 years, 6 months
JBoss Cache SVN: r6064 - core/trunk/src/main/resources.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-06-26 13:19:42 -0400 (Thu, 26 Jun 2008)
New Revision: 6064
Modified:
core/trunk/src/main/resources/config2to3.xslt
Log:
fixed test
Modified: core/trunk/src/main/resources/config2to3.xslt
===================================================================
--- core/trunk/src/main/resources/config2to3.xslt 2008-06-26 17:10:38 UTC (rev 6063)
+++ core/trunk/src/main/resources/config2to3.xslt 2008-06-26 17:19:42 UTC (rev 6064)
@@ -37,7 +37,7 @@
</xsl:attribute>
</xsl:if>
<xsl:if test="//attribute[@name='NodeLockingScheme']">
- <xsl:attribute name="optimistic">
+ <xsl:attribute name="nodeLockingScheme">
<xsl:value-of select="normalize-space(//attribute[@name='NodeLockingScheme'])"/>
</xsl:attribute>
</xsl:if>
16 years, 6 months
JBoss Cache SVN: r6063 - in core/trunk/src: main/java/org/jboss/cache/config/parsing and 6 other directories.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-06-26 13:10:38 -0400 (Thu, 26 Jun 2008)
New Revision: 6063
Modified:
core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java
core/trunk/src/test/java/org/jboss/cache/DataContainerTest.java
core/trunk/src/test/java/org/jboss/cache/api/DeletedChildResurrectionTest.java
core/trunk/src/test/java/org/jboss/cache/api/ResidentNodesTest.java
core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java
core/trunk/src/test/java/org/jboss/cache/eviction/OptimisticEvictionTest.java
core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java
core/trunk/src/test/resources/META-INF/conf-test/all-elements-file-3.x.xml
core/trunk/src/test/resources/META-INF/conf-test/parser-test-file-3.x.xml
Log:
updated node locking scheme
Modified: core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/Configuration.java 2008-06-26 17:05:52 UTC (rev 6062)
+++ core/trunk/src/main/java/org/jboss/cache/config/Configuration.java 2008-06-26 17:10:38 UTC (rev 6063)
@@ -200,7 +200,7 @@
@Dynamic
private boolean syncRollbackPhase = false;
private BuddyReplicationConfig buddyReplicationConfig;
- private boolean nodeLockingOptimistic = false;
+
private NodeLockingScheme nodeLockingScheme = NodeLockingScheme.PESSIMISTIC; // TODO: Make this default MVCC once MVCC is completely implemented.
private String muxStackName = null;
private boolean usingMultiplexer = false;
@@ -379,7 +379,6 @@
testImmutability("nodeLockingScheme");
testImmutability("nodeLockingOptimistic");
this.nodeLockingScheme = nodeLockingScheme;
- this.nodeLockingOptimistic = (nodeLockingScheme == NodeLockingScheme.OPTIMISTIC);
}
public void setUseReplQueue(boolean useReplQueue)
@@ -394,10 +393,16 @@
this.isolationLevel = isolationLevel;
}
+ /**
+ * Starting with 3.x there are 3 locking schemes, so if true is passed in then state is not defined.
+ * It is here for backward compatibility reasons only and should not be used by new code.
+ */
+ @Deprecated
public void setNodeLockingOptimistic(boolean nodeLockingOptimistic)
{
testImmutability("nodeLockingOptimistic");
- this.nodeLockingOptimistic = nodeLockingOptimistic;
+ if (nodeLockingOptimistic) setNodeLockingScheme(NodeLockingScheme.OPTIMISTIC);
+ else setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
}
public void setStateRetrievalTimeout(long stateRetrievalTimeout)
@@ -409,7 +414,6 @@
public void setNodeLockingScheme(String nodeLockingScheme)
{
testImmutability("nodeLockingScheme");
- testImmutability("nodeLockingOptimistic");
if (nodeLockingScheme == null)
{
throw new ConfigurationException("Node locking scheme cannot be null", "NodeLockingScheme");
@@ -420,8 +424,6 @@
log.warn("Unknown node locking scheme '" + nodeLockingScheme + "', using defaults.");
this.nodeLockingScheme = NodeLockingScheme.PESSIMISTIC;
}
-
- this.nodeLockingOptimistic = (this.nodeLockingScheme == NodeLockingScheme.OPTIMISTIC);
}
public String getNodeLockingSchemeString()
@@ -558,7 +560,7 @@
@Deprecated
public boolean isNodeLockingOptimistic()
{
- return nodeLockingOptimistic;
+ return nodeLockingScheme == NodeLockingScheme.OPTIMISTIC;
}
public boolean isUseReplQueue()
@@ -786,7 +788,6 @@
if (inactiveOnStartup != that.inactiveOnStartup) return false;
if (lockAcquisitionTimeout != that.lockAcquisitionTimeout) return false;
if (lockParentForChildInsertRemove != that.lockParentForChildInsertRemove) return false;
- if (nodeLockingOptimistic != that.nodeLockingOptimistic) return false;
if (objectInputStreamPoolSize != that.objectInputStreamPoolSize) return false;
if (objectOutputStreamPoolSize != that.objectOutputStreamPoolSize) return false;
if (replQueueInterval != that.replQueueInterval) return false;
@@ -850,7 +851,6 @@
result = 31 * result + (syncCommitPhase ? 1 : 0);
result = 31 * result + (syncRollbackPhase ? 1 : 0);
result = 31 * result + (buddyReplicationConfig != null ? buddyReplicationConfig.hashCode() : 0);
- result = 31 * result + (nodeLockingOptimistic ? 1 : 0);
result = 31 * result + (nodeLockingScheme != null ? nodeLockingScheme.hashCode() : 0);
result = 31 * result + (muxStackName != null ? muxStackName.hashCode() : 0);
result = 31 * result + (usingMultiplexer ? 1 : 0);
Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java 2008-06-26 17:05:52 UTC (rev 6062)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java 2008-06-26 17:10:38 UTC (rev 6063)
@@ -266,8 +266,8 @@
if (existsAttribute(lockParentForChildInsertRemove)) config.setLockParentForChildInsertRemove(getBoolean(lockParentForChildInsertRemove));
String lockAcquisitionTimeout = locking.getAttribute("lockAcquisitionTimeout");
if (existsAttribute(lockAcquisitionTimeout)) config.setLockAcquisitionTimeout(getLong(lockAcquisitionTimeout));
- String optimistic = locking.getAttribute("optimistic");
- if (existsAttribute(optimistic)) config.setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
+ String nodeLockingScheme = locking.getAttribute("nodeLockingScheme");
+ if (existsAttribute(nodeLockingScheme)) config.setNodeLockingScheme(nodeLockingScheme);
}
private Element getSingleElement(String elementName)
Modified: core/trunk/src/test/java/org/jboss/cache/DataContainerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/DataContainerTest.java 2008-06-26 17:05:52 UTC (rev 6062)
+++ core/trunk/src/test/java/org/jboss/cache/DataContainerTest.java 2008-06-26 17:10:38 UTC (rev 6063)
@@ -75,13 +75,13 @@
//test pessimistic loking
Configuration config = new Configuration();
- config.setNodeLockingOptimistic(false);
+ config.setNodeLockingScheme(Configuration.NodeLockingScheme.PESSIMISTIC);
DataVersion dataVersion = new DefaultDataVersion(2);
container.setDependencies(config, null, null);
assert nodes.adfgNode == container.peekVersioned(nodes.adfg, dataVersion, true) : "if NOT opt locking same value as peek(boolean, boolean) expected";
//test optimistic locking with same version
- config.setNodeLockingOptimistic(true);
+ config.setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
DataVersion adfgDataVersion = new DefaultDataVersion(2);
nodes.adfgNode.setVersion(adfgDataVersion);
assert nodes.adfgNode == container.peekVersioned(nodes.adfg, adfgDataVersion, true) : "same version, expcting node to be returned";
Modified: core/trunk/src/test/java/org/jboss/cache/api/DeletedChildResurrectionTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/DeletedChildResurrectionTest.java 2008-06-26 17:05:52 UTC (rev 6062)
+++ core/trunk/src/test/java/org/jboss/cache/api/DeletedChildResurrectionTest.java 2008-06-26 17:10:38 UTC (rev 6063)
@@ -55,7 +55,7 @@
*/
public void testDeletedChildResurrectionPessimistic1() throws Exception
{
- deletedChildResurrectionTest1(false);
+ deletedChildResurrectionTest1(Configuration.NodeLockingScheme.PESSIMISTIC);
}
/**
@@ -66,7 +66,7 @@
*/
public void testDeletedChildResurrectionOptimistic1() throws Exception
{
- deletedChildResurrectionTest1(true);
+ deletedChildResurrectionTest1(Configuration.NodeLockingScheme.OPTIMISTIC);
}
/**
@@ -77,7 +77,7 @@
*/
public void testDeletedChildResurrectionPessimistic2() throws Exception
{
- deletedChildResurrectionTest2(false);
+ deletedChildResurrectionTest2(Configuration.NodeLockingScheme.PESSIMISTIC);
}
/**
@@ -88,7 +88,7 @@
*/
public void testDeletedChildResurrectionOptimistic2() throws Exception
{
- deletedChildResurrectionTest2(true);
+ deletedChildResurrectionTest2(Configuration.NodeLockingScheme.OPTIMISTIC);
}
/**
@@ -96,9 +96,9 @@
* child and then inserting a different child under the parent Fqn results
* in the pre-existing child remaining in the cache after tx commit.
*/
- private void deletedChildResurrectionTest1(boolean optimistic) throws Exception
+ private void deletedChildResurrectionTest1(Configuration.NodeLockingScheme lockingScheme) throws Exception
{
- cache.getConfiguration().setNodeLockingOptimistic(optimistic);
+ cache.getConfiguration().setNodeLockingScheme(lockingScheme);
cache.start();
CacheSPI spi = (CacheSPI) cache;
Node<Object, Object> root = cache.getRoot();
@@ -123,9 +123,9 @@
* child and then inserting a different child under the parent Fqn results
* in the pre-existing child remaining in the cache after tx commit.
*/
- private void deletedChildResurrectionTest2(boolean optimistic) throws Exception
+ private void deletedChildResurrectionTest2(Configuration.NodeLockingScheme lockingScheme) throws Exception
{
- cache.getConfiguration().setNodeLockingOptimistic(optimistic);
+ cache.getConfiguration().setNodeLockingScheme(lockingScheme);
cache.start();
Node<Object, Object> root = cache.getRoot();
Modified: core/trunk/src/test/java/org/jboss/cache/api/ResidentNodesTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/ResidentNodesTest.java 2008-06-26 17:05:52 UTC (rev 6062)
+++ core/trunk/src/test/java/org/jboss/cache/api/ResidentNodesTest.java 2008-06-26 17:10:38 UTC (rev 6063)
@@ -176,7 +176,7 @@
Configuration config = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
config.setCacheMode(Configuration.CacheMode.LOCAL);
- config.setNodeLockingOptimistic(true);
+ config.setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
CacheSPI<Object, Object> cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(config, true);
cache.put(Fqn.fromString("/a/b"), "key", "value");
Modified: core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java 2008-06-26 17:05:52 UTC (rev 6062)
+++ core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java 2008-06-26 17:10:38 UTC (rev 6063)
@@ -1,6 +1,5 @@
package org.jboss.cache.config.parsing;
-import org.jboss.cache.config.parsing.XmlConfigurationParser;
import org.jboss.cache.config.*;
import org.jboss.cache.eviction.LRUConfiguration;
import org.jboss.cache.eviction.MRUConfiguration;
Modified: core/trunk/src/test/java/org/jboss/cache/eviction/OptimisticEvictionTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/eviction/OptimisticEvictionTest.java 2008-06-26 17:05:52 UTC (rev 6062)
+++ core/trunk/src/test/java/org/jboss/cache/eviction/OptimisticEvictionTest.java 2008-06-26 17:10:38 UTC (rev 6063)
@@ -51,7 +51,7 @@
{
txManager = new DummyTransactionManagerLookup().getTransactionManager();
Configuration config = UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.LOCAL, true);
- config.setNodeLockingOptimistic(true);
+ config.setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
config.setEvictionConfig(buildEvictionConfig());
cache = (CacheSPI<Object, Object>) new DefaultCacheFactory().createCache(config);
}
Modified: core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java 2008-06-26 17:05:52 UTC (rev 6062)
+++ core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java 2008-06-26 17:10:38 UTC (rev 6063)
@@ -6,6 +6,7 @@
import org.jboss.cache.config.BuddyReplicationConfig;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.EvictionConfig;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.parsing.XmlConfigHelper;
import org.jboss.cache.config.parsing.element.BuddyElementParser;
import org.jboss.cache.config.parsing.element.LoadersElementParser;
@@ -192,7 +193,7 @@
public void testOptimisticChain() throws Exception
{
cache.getConfiguration().setExposeManagementStatistics(false);
- cache.getConfiguration().setNodeLockingOptimistic(true);
+ cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
List<CommandInterceptor> list = chain.asList();
@@ -215,7 +216,7 @@
public void testOptimisticReplicatedChain() throws Exception
{
cache.getConfiguration().setExposeManagementStatistics(false);
- cache.getConfiguration().setNodeLockingOptimistic(true);
+ cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
cache.getConfiguration().setCacheMode("REPL_SYNC");
InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
@@ -240,7 +241,7 @@
public void testOptimisticCacheLoaderChain() throws Exception
{
cache.getConfiguration().setExposeManagementStatistics(false);
- cache.getConfiguration().setNodeLockingOptimistic(true);
+ cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig(false, false));
cache.create();
InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
@@ -266,7 +267,7 @@
public void testOptimisticPassivationCacheLoaderChain() throws Exception
{
cache.getConfiguration().setExposeManagementStatistics(false);
- cache.getConfiguration().setNodeLockingOptimistic(true);
+ cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.OPTIMISTIC);
cache.getConfiguration().setCacheLoaderConfig(getCacheLoaderConfig(true, false));
cache.create();
InterceptorChain chain = getInterceptorChainFactory(cache).buildInterceptorChain();
Modified: core/trunk/src/test/resources/META-INF/conf-test/all-elements-file-3.x.xml
===================================================================
--- core/trunk/src/test/resources/META-INF/conf-test/all-elements-file-3.x.xml 2008-06-26 17:05:52 UTC (rev 6062)
+++ core/trunk/src/test/resources/META-INF/conf-test/all-elements-file-3.x.xml 2008-06-26 17:10:38 UTC (rev 6063)
@@ -3,7 +3,7 @@
<jbosscache>
<locking isolationLevel="REPEATABLE_READ" lockParentForChildInsertRemove="true" lockAcquisitionTimeout="10234"
- optimistic="false"/>
+ nodeLockingScheme="Optimistic"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"
syncRollbackPhase="true" syncCommitPhase="true"/>
Modified: core/trunk/src/test/resources/META-INF/conf-test/parser-test-file-3.x.xml
===================================================================
--- core/trunk/src/test/resources/META-INF/conf-test/parser-test-file-3.x.xml 2008-06-26 17:05:52 UTC (rev 6062)
+++ core/trunk/src/test/resources/META-INF/conf-test/parser-test-file-3.x.xml 2008-06-26 17:10:38 UTC (rev 6063)
@@ -2,7 +2,8 @@
<jbosscache>
- <locking isolationLevel="REPEATABLE_READ" lockParentForChildInsertRemove="true" lockAcquisitionTimeout="10234"/>
+ <locking isolationLevel="REPEATABLE_READ" lockParentForChildInsertRemove="true" lockAcquisitionTimeout="10234"
+ nodeLockingScheme="Optimistic"/>
<transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"
syncRollbackPhase="true" syncCommitPhase="true"/>
16 years, 6 months
JBoss Cache SVN: r6062 - searchable/trunk/src/main/java/org/jboss/cache/search.
by jbosscache-commits@lists.jboss.org
Author: navssurtani
Date: 2008-06-26 13:05:52 -0400 (Thu, 26 Jun 2008)
New Revision: 6062
Modified:
searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java
Log:
Nicened up hasPrevious and hasNext methods in QRII
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java 2008-06-26 17:01:49 UTC (rev 6061)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java 2008-06-26 17:05:52 UTC (rev 6062)
@@ -20,11 +20,14 @@
private int nextObjectIndex = -1;
private List<CacheEntityId> idList;
private CacheEntityLoader entityLoader;
+ private int lowerLimit = 0;
+ private int upperLimit = 0;
public QueryResultIteratorImpl(List<CacheEntityId> idList, CacheEntityLoader entityLoader)
{
this.idList = idList;
this.entityLoader = entityLoader;
+ upperLimit = idList.size() - 1;
}
public void jumpToResult(int index) throws IndexOutOfBoundsException
@@ -78,14 +81,7 @@
public boolean hasNext()
{
- if (idList.size() != 1)
- {
- return !isLast();
- }
- else
- {
- return false;
- }
+ return index <= upperLimit;
}
public Object next()
@@ -98,16 +94,10 @@
public boolean hasPrevious()
{
- if (idList.size() != 1)
- {
- return !isFirst();
- }
- else
- {
- return false;
- }
+ return index >= lowerLimit;
}
+
public Object previous()
{
if (!hasPrevious()) throw new NoSuchElementException("Out of boundaries");
16 years, 6 months
JBoss Cache SVN: r6061 - in searchable/trunk/src: test/java/org/jboss/cache/search and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: navssurtani
Date: 2008-06-26 13:01:49 -0400 (Thu, 26 Jun 2008)
New Revision: 6061
Modified:
searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java
searchable/trunk/src/test/java/org/jboss/cache/search/QueryResultIteratorImplTest.java
Log:
Implemented QueryResultIteratorImpl.
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java
===================================================================
--- searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java 2008-06-26 16:40:06 UTC (rev 6060)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIteratorImpl.java 2008-06-26 17:01:49 UTC (rev 6061)
@@ -29,79 +29,104 @@
public void jumpToResult(int index) throws IndexOutOfBoundsException
{
- //TODO: Implement
+ if (index > idList.size() || index < 0)
+ {
+ throw new IndexOutOfBoundsException("The index you entered is either greater than the size of the list or negative");
+ }
+ this.index = index;
}
public void first()
{
- //TODO: Implement
+ index = 0;
}
public void last()
{
- //TODO: Implement
+ index = idList.size() - 1;
}
public void afterFirst()
{
- //TODO: Implement
+ index = 1;
}
public void beforeLast()
{
- //TODO: Implement
+ index = idList.size() - 2;
}
public boolean isFirst()
{
- return false; //TODO: Implement
+ return idList.get(index) == idList.get(0);
}
public boolean isLast()
{
- return false; //TODO: Implement
+ return idList.get(index) == idList.get(idList.size() - 1);
}
public boolean isAfterFirst()
{
- return false; //TODO: Implement
+ return idList.get(index) == idList.get(1);
}
public boolean isBeforeLast()
{
- return false; //TODO: Implement
+ return idList.get(index) == idList.get(idList.size() - 2);
}
public boolean hasNext()
{
- return false; //TODO: Implement
+ if (idList.size() != 1)
+ {
+ return !isLast();
+ }
+ else
+ {
+ return false;
+ }
}
public Object next()
{
if (!hasNext()) throw new NoSuchElementException("Out of boundaries");
+ Object toReturn = entityLoader.load(idList.get(index));
index++;
- return next;
+ return toReturn;
}
public boolean hasPrevious()
{
- return false; //TODO: Implement
+ if (idList.size() != 1)
+ {
+ return !isFirst();
+ }
+ else
+ {
+ return false;
+ }
}
public Object previous()
{
- return null; //TODO: Implement
+ if (!hasPrevious()) throw new NoSuchElementException("Out of boundaries");
+ Object toReturn = entityLoader.load(idList.get(index));
+ index--;
+ return toReturn;
}
public int nextIndex()
{
- return 0; //TODO: Implement
+ if (!hasNext()) throw new NoSuchElementException("Out of boundaries");
+ return index + 1;
+
}
public int previousIndex()
{
- return 0; //TODO: Implement
+ if (!hasPrevious()) throw new NoSuchElementException("Out of boundaries");
+ return index - 1;
}
public void remove()
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/QueryResultIteratorImplTest.java
===================================================================
--- searchable/trunk/src/test/java/org/jboss/cache/search/QueryResultIteratorImplTest.java 2008-06-26 16:40:06 UTC (rev 6060)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/QueryResultIteratorImplTest.java 2008-06-26 17:01:49 UTC (rev 6061)
@@ -102,14 +102,13 @@
//Makes sure that the iterator is pointing at the last element.
assert iterator.isLast();
- //Iterator points at the previous element.
- Object previous = iterator.previous();
+ Object next = iterator.next();
//Returns the size of the list of ids.
int size = ids.size();
//Makes sure that previous is the last element.
- assert previous == dummyResults.get(ids.get(size - 1));
+ assert next == dummyResults.get(ids.get(size - 1));
//Check that the iterator is NOT pointing at the last element.
assert !iterator.isLast();
@@ -126,7 +125,7 @@
//Previous element in the list
Object previous = iterator.previous();
- //Check that previous is the second element.
+ //Check that previous is the first element.
assert previous == dummyResults.get(ids.get(0));
//Make sure that the iterator isn't pointing at the second element.
@@ -147,7 +146,7 @@
//Check that next is the penultimate element.
int size = ids.size();
- assert next == dummyResults.get(ids.get(size - 1));
+ assert next == dummyResults.get(ids.get(size - 2));
//Make sure that the iterator is not pointing at the penultimate element.
assert !iterator.isAfterFirst();
@@ -186,78 +185,28 @@
assert iterator.isBeforeLast();
}
- public void testHasNext()
+ public void testNextAndHasNext()
{
- int size = ids.size();
-
- if (size > 1)
- {
- iterator.first();
- assert iterator.hasNext();
-
- iterator.last();
- assert !iterator.hasNext();
-
- }
-
- else
- {
- assert false;
- }
-
- }
-
- public void testNext()
- {
iterator.first();
- if (iterator.hasNext())
+ for (int i = 0; i < ids.size(); i++)
{
- iterator.next();
-
- assert iterator.isAfterFirst();
- assert !iterator.isFirst();
+ Object expectedValue = dummyResults.get(ids.get(i));
+ assert iterator.hasNext(); // should have next as long as we are less than the number of elements.
+ assert expectedValue == iterator.next(); // tests next()
}
-
- else
- {
- assert false;
- }
+ assert !iterator.hasNext(); // this should now NOT be true.
}
- public void testHasPrevious()
+ public void testPreviousAndHasPrevious()
{
- int size = ids.size();
-
- if (size > 1)
- {
- iterator.first();
- assert !iterator.hasPrevious();
-
- iterator.last();
- assert iterator.hasPrevious();
-
- }
-
- else
- {
- assert false;
- }
- }
-
- public void testPrevious()
- {
iterator.last();
- if(iterator.hasPrevious())
+ for (int i = ids.size(); i > 0; i--)
{
- iterator.previous();
- assert iterator.isBeforeLast();
- assert !iterator.isLast();
-
+ Object expectedValue = dummyResults.get(ids.get(i));
+ assert iterator.hasPrevious(); // should have next as long as we are less than the number of elements.
+ assert expectedValue == iterator.previous(); // tests next()
}
- else
- {
- assert false;
- }
+ assert !iterator.hasPrevious(); // this should now NOT be true.
}
@@ -271,7 +220,7 @@
}
- public void previousIndexTest()
+ public void testPreviousIndex()
{
iterator.first();
assert iterator.previousIndex() == -1;
@@ -280,6 +229,16 @@
assert iterator.previousIndex() == (ids.size() - 1);
}
+ public void testPreviousAndNext()
+ {
+ iterator.jumpToResult(5);
+ for (int i=0; i<10; i++) // repeat 10 times
+ {
+ assert iterator.next() == iterator.previous();
+ }
+
+ }
+
public static class DummyEntityLoader extends CacheEntityLoader
{
private List<CacheEntityId> allKnownIds;
16 years, 6 months
JBoss Cache SVN: r6060 - in core/trunk: src/main and 6 other directories.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-06-26 12:40:06 -0400 (Thu, 26 Jun 2008)
New Revision: 6060
Added:
core/trunk/src/main/resources/
core/trunk/src/main/resources/META-INF/
core/trunk/src/main/resources/cache-config.xml
core/trunk/src/main/resources/cache-jdbc.properties
core/trunk/src/main/resources/config2to3.xslt
core/trunk/src/main/resources/dependencies.xml
core/trunk/src/main/resources/jndi.properties
Removed:
core/trunk/src/main/etc/
core/trunk/src/main/resources/META-INF/
core/trunk/src/main/resources/cache-config.xml
core/trunk/src/main/resources/cache-jdbc.properties
core/trunk/src/main/resources/dependencies.xml
core/trunk/src/main/resources/jndi.properties
Modified:
core/trunk/assembly/all.xml
core/trunk/assembly/bin.xml
core/trunk/src/main/docbook/faq/en/master.xml
core/trunk/src/main/docbook/tutorial/en/master.xml
core/trunk/src/main/docbook/userguide/en/modules/configuration_reference.xml
core/trunk/src/main/release/build.xml
core/trunk/src/test/java/org/jboss/cache/config/ConfigurationTransformerTest.java
Log:
renamed etc to resources
Modified: core/trunk/assembly/all.xml
===================================================================
--- core/trunk/assembly/all.xml 2008-06-26 16:32:57 UTC (rev 6059)
+++ core/trunk/assembly/all.xml 2008-06-26 16:40:06 UTC (rev 6060)
@@ -23,8 +23,8 @@
<!-- resources -->
<fileSet>
- <directory>src/main/etc</directory>
- <outputDirectory>etc</outputDirectory>
+ <directory>src/main/resources</directory>
+ <outputDirectory>resources</outputDirectory>
</fileSet>
<!-- srcs -->
Modified: core/trunk/assembly/bin.xml
===================================================================
--- core/trunk/assembly/bin.xml 2008-06-26 16:32:57 UTC (rev 6059)
+++ core/trunk/assembly/bin.xml 2008-06-26 16:40:06 UTC (rev 6060)
@@ -22,8 +22,8 @@
<!-- resources -->
<fileSet>
- <directory>src/main/etc</directory>
- <outputDirectory>etc</outputDirectory>
+ <directory>src/main/resources</directory>
+ <outputDirectory>resources</outputDirectory>
</fileSet>
<!-- EULAs and license files -->
Modified: core/trunk/src/main/docbook/faq/en/master.xml
===================================================================
--- core/trunk/src/main/docbook/faq/en/master.xml 2008-06-26 16:32:57 UTC (rev 6059)
+++ core/trunk/src/main/docbook/faq/en/master.xml 2008-06-26 16:40:06 UTC (rev 6060)
@@ -313,7 +313,7 @@
<literal>all</literal>
configuration whereby the
necessary jars are present). Under the standalone package
- <literal>etc/META-INF</literal>
+ <literal>resources/META-INF</literal>
directory , there are example
configuration files for different cache modes that can be used to
deploy JBoss Cache as well.
Modified: core/trunk/src/main/docbook/tutorial/en/master.xml
===================================================================
--- core/trunk/src/main/docbook/tutorial/en/master.xml 2008-06-26 16:32:57 UTC (rev 6059)
+++ core/trunk/src/main/docbook/tutorial/en/master.xml 2008-06-26 16:40:06 UTC (rev 6060)
@@ -77,7 +77,7 @@
</para>
<para>The configuration files are located in the
- <literal>JBossCache/etc</literal>
+ <literal>JBossCache/resources</literal>
directory. You can
modify the behavior of the cache by editing the various configuration files.
</para>
Modified: core/trunk/src/main/docbook/userguide/en/modules/configuration_reference.xml
===================================================================
--- core/trunk/src/main/docbook/userguide/en/modules/configuration_reference.xml 2008-06-26 16:32:57 UTC (rev 6059)
+++ core/trunk/src/main/docbook/userguide/en/modules/configuration_reference.xml 2008-06-26 16:40:06 UTC (rev 6060)
@@ -253,7 +253,7 @@
<literal>MultiplexerStack</literal>
are used.
See the various *-service.xml files in the source distribution
- <literal>etc/META-INF</literal>
+ <literal>resources/META-INF</literal>
folder for examples.
See the
<ulink url="http://www.jgroups.org">JGroups documentation</ulink>
Modified: core/trunk/src/main/release/build.xml
===================================================================
--- core/trunk/src/main/release/build.xml 2008-06-26 16:32:57 UTC (rev 6059)
+++ core/trunk/src/main/release/build.xml 2008-06-26 16:40:06 UTC (rev 6060)
@@ -12,7 +12,7 @@
<property name="output" value="${basedir}/output"/>
<property name="build" value="${output}/classes"/>
<property name="lib" value="${basedir}/lib"/>
- <property name="etc" value="${basedir}/etc"/>
+ <property name="resources" value="${basedir}/resources"/>
<property name="reports" value="${output}/reports"/>
<!-- JVM args for when running tests -->
@@ -49,7 +49,7 @@
<path refid="build.classpath"/>
<path refid="cache.classpath"/>
<path refid="lib.classpath"/>
- <pathelement path="${etc}"/>
+ <pathelement path="${resources}"/>
<!-- this needs to be in the test classpath as well since it contains test configuration XML files -->
<pathelement path="${source}"/>
</path>
@@ -103,7 +103,7 @@
</javac>
<copy todir="${output}/etc">
- <fileset dir="${etc}">
+ <fileset dir="${resources}">
<include name="**/*"/>
</fileset>
</copy>
Copied: core/trunk/src/main/resources (from rev 6057, core/trunk/src/main/etc)
Copied: core/trunk/src/main/resources/META-INF (from rev 6059, core/trunk/src/main/etc/META-INF)
Deleted: core/trunk/src/main/resources/cache-config.xml
===================================================================
--- core/trunk/src/main/etc/cache-config.xml 2008-06-26 14:57:18 UTC (rev 6057)
+++ core/trunk/src/main/resources/cache-config.xml 2008-06-26 16:40:06 UTC (rev 6060)
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
-
- <mbean code="org.jboss.cache.pojo.jmx.PojoCacheJmxWrapper"
- name="jboss.cache:service=LabconnTreeCacheAop">
- <depends>jboss:service=Naming</depends>
- <depends>jboss:service=TransactionManager</depends>
- <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
- </attribute>
- <attribute name="IsolationLevel">READ_COMMITTED</attribute>
-
- <attribute name="CacheMode">LOCAL</attribute>
-
- <attribute name="CacheLoaderConfig" replace="false">
- <config>
- <cacheloader>
- <class>org.jboss.cache.loader.bdbje.BdbjeCacheLoader</class>
- <properties>
- location=./
- </properties>
- </cacheloader>
- </config>
- </attribute>
- </mbean>
-</server>
Copied: core/trunk/src/main/resources/cache-config.xml (from rev 6059, core/trunk/src/main/etc/cache-config.xml)
===================================================================
--- core/trunk/src/main/resources/cache-config.xml (rev 0)
+++ core/trunk/src/main/resources/cache-config.xml 2008-06-26 16:40:06 UTC (rev 6060)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+
+ <mbean code="org.jboss.cache.pojo.jmx.PojoCacheJmxWrapper"
+ name="jboss.cache:service=LabconnTreeCacheAop">
+ <depends>jboss:service=Naming</depends>
+ <depends>jboss:service=TransactionManager</depends>
+ <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+ </attribute>
+ <attribute name="IsolationLevel">READ_COMMITTED</attribute>
+
+ <attribute name="CacheMode">LOCAL</attribute>
+
+ <attribute name="CacheLoaderConfig" replace="false">
+ <config>
+ <cacheloader>
+ <class>org.jboss.cache.loader.bdbje.BdbjeCacheLoader</class>
+ <properties>
+ location=./
+ </properties>
+ </cacheloader>
+ </config>
+ </attribute>
+ </mbean>
+</server>
Deleted: core/trunk/src/main/resources/cache-jdbc.properties
===================================================================
--- core/trunk/src/main/etc/cache-jdbc.properties 2008-06-26 14:57:18 UTC (rev 6057)
+++ core/trunk/src/main/resources/cache-jdbc.properties 2008-06-26 16:40:06 UTC (rev 6060)
@@ -1,69 +0,0 @@
-##
-# Standard JBC table properties
-# The table name can also be prepended with schema name for the given table.
-# Even though there is an Sql92 standard syntax for this: <schema_name>.<table name>
-#schema has different meanings accross various DBMS: Oracle - user name; PointBase - database name
-# Microsoft SQL Server & DB2 - schema name corresponds to the catalog owner
-cache.jdbc.table.name=jbosscache
-cache.jdbc.table.create=true
-cache.jdbc.table.drop=false
-cache.jdbc.table.primarykey=jbosscache_pk
-cache.jdbc.fqn.column=fqn
-cache.jdbc.fqn.type=varchar(255)
-cache.jdbc.node.column=node
-cache.jdbc.node.type=blob
-cache.jdbc.parent.column=parent
-# Specify your DBMS's string concatenation function syntax in the following manner: concat(1 , 2) -> '12'.
-# This syntax should work an most popular DBMS like oracle, db2, mssql, mysql, PostgreSQL. Derby - on which
-#the tests are run does not support 'concat', but '1 || 2' . If no value is sepcified then concat(1 , 2) is used by default.
-cache.jdbc.sql-concat=1 || 2
-
-# JBoss Cache Table properties for Hypersonic, just overrides
-#cache.jdbc.node.type=OBJECT
-
-##
-# DataSource
-#cache.jdbc.datasource=DefaultDS
-
-##
-# JDBC driver specific properties
-
-# Hypersonic
-#cache.jdbc.node.type=OBJECT
-
-## MySql
-#cache.jdbc.driver=com.mysql.jdbc.Driver
-#cache.jdbc.url=jdbc:mysql://localhost:3306/jbossdb
-#cache.jdbc.user=root
-#cache.jdbc.password=admin
-
-## Oracle
-#cache.jdbc.driver=oracle.jdbc.OracleDriver
-#cache.jdbc.url=jdbc:oracle:thin:@192.168.0.100:1521:JBOSSDB
-#cache.jdbc.user=jboss
-#cache.jdbc.password=sa
-
-## MS Sql Server
-#cache.jdbc.driver=com.microsoft.jdbc.sqlserver.SQLServerDriver
-#cache.jdbc.url=jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=jbossdb;SelectMethod=cursor
-#cache.jdbc.user=sa
-#cache.jdbc.password=
-#cache.jdbc.node.type=image
-
-## Pointbase
-#cache.jdbc.driver=com.pointbase.jdbc.jdbcUniversalDriver
-#cache.jdbc.url=jdbc:pointbase:server://localhost:9092/jboss,new
-#cache.jdbc.user=PBPUBLIC
-#cache.jdbc.password=PBPUBLIC
-
-## PostgreSQL
-#cache.jdbc.driver = org.postgresql.Driver
-#cache.jdbc.url=jdbc:postgresql://192.168.0.100:5432/jbossdb
-#cache.jdbc.user=postgres
-#cache.jdbc.password=admin
-
-## Derby
-cache.jdbc.driver = org.apache.derby.jdbc.EmbeddedDriver
-cache.jdbc.url=jdbc:derby:jbossdb;create=true
-cache.jdbc.user=user1
-cache.jdbc.password=user1
\ No newline at end of file
Copied: core/trunk/src/main/resources/cache-jdbc.properties (from rev 6059, core/trunk/src/main/etc/cache-jdbc.properties)
===================================================================
--- core/trunk/src/main/resources/cache-jdbc.properties (rev 0)
+++ core/trunk/src/main/resources/cache-jdbc.properties 2008-06-26 16:40:06 UTC (rev 6060)
@@ -0,0 +1,69 @@
+##
+# Standard JBC table properties
+# The table name can also be prepended with schema name for the given table.
+# Even though there is an Sql92 standard syntax for this: <schema_name>.<table name>
+#schema has different meanings accross various DBMS: Oracle - user name; PointBase - database name
+# Microsoft SQL Server & DB2 - schema name corresponds to the catalog owner
+cache.jdbc.table.name=jbosscache
+cache.jdbc.table.create=true
+cache.jdbc.table.drop=false
+cache.jdbc.table.primarykey=jbosscache_pk
+cache.jdbc.fqn.column=fqn
+cache.jdbc.fqn.type=varchar(255)
+cache.jdbc.node.column=node
+cache.jdbc.node.type=blob
+cache.jdbc.parent.column=parent
+# Specify your DBMS's string concatenation function syntax in the following manner: concat(1 , 2) -> '12'.
+# This syntax should work an most popular DBMS like oracle, db2, mssql, mysql, PostgreSQL. Derby - on which
+#the tests are run does not support 'concat', but '1 || 2' . If no value is sepcified then concat(1 , 2) is used by default.
+cache.jdbc.sql-concat=1 || 2
+
+# JBoss Cache Table properties for Hypersonic, just overrides
+#cache.jdbc.node.type=OBJECT
+
+##
+# DataSource
+#cache.jdbc.datasource=DefaultDS
+
+##
+# JDBC driver specific properties
+
+# Hypersonic
+#cache.jdbc.node.type=OBJECT
+
+## MySql
+#cache.jdbc.driver=com.mysql.jdbc.Driver
+#cache.jdbc.url=jdbc:mysql://localhost:3306/jbossdb
+#cache.jdbc.user=root
+#cache.jdbc.password=admin
+
+## Oracle
+#cache.jdbc.driver=oracle.jdbc.OracleDriver
+#cache.jdbc.url=jdbc:oracle:thin:@192.168.0.100:1521:JBOSSDB
+#cache.jdbc.user=jboss
+#cache.jdbc.password=sa
+
+## MS Sql Server
+#cache.jdbc.driver=com.microsoft.jdbc.sqlserver.SQLServerDriver
+#cache.jdbc.url=jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=jbossdb;SelectMethod=cursor
+#cache.jdbc.user=sa
+#cache.jdbc.password=
+#cache.jdbc.node.type=image
+
+## Pointbase
+#cache.jdbc.driver=com.pointbase.jdbc.jdbcUniversalDriver
+#cache.jdbc.url=jdbc:pointbase:server://localhost:9092/jboss,new
+#cache.jdbc.user=PBPUBLIC
+#cache.jdbc.password=PBPUBLIC
+
+## PostgreSQL
+#cache.jdbc.driver = org.postgresql.Driver
+#cache.jdbc.url=jdbc:postgresql://192.168.0.100:5432/jbossdb
+#cache.jdbc.user=postgres
+#cache.jdbc.password=admin
+
+## Derby
+cache.jdbc.driver = org.apache.derby.jdbc.EmbeddedDriver
+cache.jdbc.url=jdbc:derby:jbossdb;create=true
+cache.jdbc.user=user1
+cache.jdbc.password=user1
\ No newline at end of file
Added: core/trunk/src/main/resources/config2to3.xslt
===================================================================
--- core/trunk/src/main/resources/config2to3.xslt (rev 0)
+++ core/trunk/src/main/resources/config2to3.xslt 2008-06-26 16:40:06 UTC (rev 6060)
@@ -0,0 +1,425 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <xsl:output method="xml" indent="yes"/>
+
+ <xsl:template match="/">
+ <xsl:element name="jbosscache">
+ <xsl:call-template name="locking"/>
+ <xsl:call-template name="transaction"/>
+ <xsl:call-template name="serialization"/>
+ <xsl:call-template name="startup"/>
+ <xsl:call-template name="transport"/>
+ <xsl:apply-templates select="//attribute"/>
+ <!--<xsl:call-template name="invalidation"/> -->
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="//attribute"/>
+
+ <xsl:template name="locking">
+ <xsl:if
+ test="//attribute[@name='IsolationLevel'] | //attribute[@name='LockAcquisitionTimeout'] | //attribute[@name='LockParentForChildInsertRemove']">
+ <xsl:element name="locking">
+ <xsl:if test="//attribute[@name='IsolationLevel']">
+ <xsl:attribute name="isolationLevel">
+ <xsl:value-of select="normalize-space(//attribute[@name='IsolationLevel'])"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//attribute[@name='LockAcquisitionTimeout']">
+ <xsl:attribute name="lockAcquisitionTimeout">
+ <xsl:value-of select="normalize-space(//attribute[@name='LockAcquisitionTimeout'])"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//attribute[@name='LockParentForChildInsertRemove']">
+ <xsl:attribute name="lockParentForChildInsertRemove">
+ <xsl:value-of select="normalize-space(//attribute[@name='LockParentForChildInsertRemove'])"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//attribute[@name='NodeLockingScheme']">
+ <xsl:attribute name="optimistic">
+ <xsl:value-of select="normalize-space(//attribute[@name='NodeLockingScheme'])"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="transaction">
+ <xsl:if
+ test="//attribute[@name='TransactionManagerLookupClass'] | //attribute[@name='SyncRollbackPhase'] | //attribute[@name='SyncCommitPhase']">
+ <xsl:element name="transaction">
+ <xsl:if test="//attribute[@name='TransactionManagerLookupClass']">
+ <xsl:attribute name="transactionManagerLookupClass">
+ <xsl:value-of select="normalize-space(//attribute[@name='TransactionManagerLookupClass'])"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//attribute[@name='SyncCommitPhase']">
+ <xsl:attribute name="syncCommitPhase">
+ <xsl:value-of select="normalize-space(//attribute[@name='SyncCommitPhase'])"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//attribute[@name='SyncRollbackPhase']">
+ <xsl:attribute name="syncRollbackPhase">
+ <xsl:value-of select="normalize-space(//attribute[@name='SyncRollbackPhase'])"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="serialization">
+ <xsl:if
+ test="//attribute[@name='ObjectInputStreamPoolSize'] | //attribute[@name='ObjectOutputStreamPoolSize'] | //attribute[@name='ReplicationVersion'] | //attribute[@name='MarshallerClass'] | //attribute[@name='UseLazyDeserialization'] | //attribute[@name='UseRegionBasedMarshalling']">
+ <serialization>
+ <xsl:if test="//attribute[@name='ObjectInputStreamPoolSize']">
+ <xsl:attribute name="objectInputStreamPoolSize">
+ <xsl:value-of select="normalize-space(//attribute[@name='ObjectInputStreamPoolSize'])"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//attribute[@name='ObjectOutputStreamPoolSize']">
+ <xsl:attribute name="objectOutputStreamPoolSize">
+ <xsl:value-of select="normalize-space(//attribute[@name='ObjectOutputStreamPoolSize'])"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//attribute[@name='ReplicationVersion']">
+ <xsl:attribute name="version">
+ <xsl:value-of select="normalize-space(//attribute[@name='ReplicationVersion'])"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//attribute[@name='MarshallerClass']">
+ <xsl:attribute name="marshallerClass">
+ <xsl:value-of select="normalize-space(//attribute[@name='MarshallerClass'])"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//attribute[@name='UseLazyDeserialization']">
+ <xsl:attribute name="useLazyDeserialization">
+ <xsl:value-of select="normalize-space(//attribute[@name='UseLazyDeserialization'])"/>
+ </xsl:attribute>
+ </xsl:if>
+
+ <xsl:if test="//attribute[@name='UseRegionBasedMarshalling']">
+ <xsl:attribute name="useRegionBasedMarshalling">
+ <xsl:value-of select="normalize-space(//attribute[@name='UseRegionBasedMarshalling'])"/>
+ </xsl:attribute>
+ </xsl:if>
+ </serialization>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="//attribute[@name='CacheMode']">
+ <xsl:if test="(normalize-space(.) = 'INVALIDATION_ASYNC') or (normalize-space(.) = 'INVALIDATION_SYNC')">
+ <invalidation>
+ <xsl:if test="(normalize-space(.) = 'INVALIDATION_ASYNC')">
+ <xsl:element name="async">
+ <xsl:call-template name="asyncAttributes"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="(normalize-space(.) = 'INVALIDATION_SYNC')">
+ <xsl:element name="sync">
+ <xsl:call-template name="syncAttributes"/>
+ </xsl:element>
+ </xsl:if>
+ </invalidation>
+ </xsl:if>
+ <xsl:if test="(normalize-space(.) = 'REPL_ASYNC') or (normalize-space(.) = 'REPL_SYNC')">
+ <replication>
+ <xsl:if test="(normalize-space(.) = 'REPL_ASYNC')">
+ <xsl:element name="async">
+ <xsl:call-template name="asyncAttributes"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="(normalize-space(.) = 'REPL_SYNC')">
+ <xsl:element name="sync">
+ <xsl:call-template name="syncAttributes"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:call-template name="buddy"/>
+ </replication>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="buddy">
+ <xsl:if test="//attribute[@name='BuddyReplicationConfig']">
+ <buddy>
+ <xsl:if test="//buddyReplicationEnabled">
+ <xsl:attribute name="enabled">
+ <xsl:value-of select="//buddyReplicationEnabled"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//buddyPoolName">
+ <xsl:attribute name="poolName">
+ <xsl:value-of select="//buddyPoolName"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//buddyCommunicationTimeout">
+ <xsl:attribute name="communicationTimeout">
+ <xsl:value-of select="//buddyCommunicationTimeout"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//autoDataGravitation | //dataGravitationRemoveOnFind | //dataGravitationSearchBackupTrees">
+ <dataGravitation>
+ <xsl:if test="//autoDataGravitation">
+ <xsl:attribute name="auto">
+ <xsl:value-of select="//autoDataGravitation"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//dataGravitationRemoveOnFind">
+ <xsl:attribute name="removeOnFind">
+ <xsl:value-of select="//dataGravitationRemoveOnFind"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//dataGravitationSearchBackupTrees">
+ <xsl:attribute name="searchBackupTrees">
+ <xsl:value-of select="//dataGravitationSearchBackupTrees"/>
+ </xsl:attribute>
+ </xsl:if>
+ </dataGravitation>
+ </xsl:if>
+ <xsl:if test="//buddyLocatorProperties">
+ <locator>
+ <xsl:if test="//buddyLocatorClass">
+ <xsl:attribute name="class">
+ <xsl:value-of select="//buddyLocatorClass"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//buddyLocatorProperties">
+ <properties>
+ <xsl:value-of select="//buddyLocatorProperties"/>
+ </properties>
+ </xsl:if>
+ </locator>
+ </xsl:if>
+ </buddy>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="asyncAttributes">
+ <xsl:if test="//attribute[@name='UseReplQueue']">
+ <xsl:attribute name="useReplQueue">
+ <xsl:value-of select="//attribute[@name='UseReplQueue']"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//attribute[@name='ReplQueueInterval']">
+ <xsl:attribute name="replQueueInterval">
+ <xsl:value-of select="//attribute[@name='ReplQueueInterval']"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//attribute[@name='ReplQueueMaxElements']">
+ <xsl:attribute name="replQueueMaxElements">
+ <xsl:value-of select="//attribute[@name='ReplQueueMaxElements']"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="syncAttributes">
+ <xsl:if test="//attribute[@name='SyncReplTimeout']">
+ <xsl:attribute name="replTimeout">
+ <xsl:value-of select="//attribute[@name='SyncReplTimeout']"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="startup">
+ <xsl:if
+ test="//attribute[@name='FetchInMemoryState'] | //attribute[@name='StateRetrievalTimeout'] | //attribute[@name='InactiveOnStartup']">
+ <xsl:element name="startup">
+ <xsl:if test="//attribute[@name='FetchInMemoryState']">
+ <xsl:attribute name="fetchInMemoryState">
+ <xsl:value-of select="normalize-space(//attribute[@name='FetchInMemoryState'])"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//attribute[@name='StateRetrievalTimeout']">
+ <xsl:attribute name="stateRetrievalTimeout">
+ <xsl:value-of select="normalize-space(//attribute[@name='StateRetrievalTimeout'])"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//attribute[@name='InactiveOnStartup']">
+ <xsl:attribute name="inactiveOnStartup">
+ <xsl:value-of select="normalize-space(//attribute[@name='InactiveOnStartup'])"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="//attribute[@name='ShutdownHookBehavior']">
+ <shutdown>
+ <xsl:attribute name="hookBehavior">
+ <xsl:value-of select="normalize-space(.)"/>
+ </xsl:attribute>
+ </shutdown>
+ </xsl:template>
+
+ <xsl:template match="//attribute[@name='ExposeManagementStatistics']">
+ <jmxStatistics>
+ <xsl:attribute name="enabled">
+ <xsl:value-of select="normalize-space(.)"/>
+ </xsl:attribute>
+ </jmxStatistics>
+ </xsl:template>
+
+ <xsl:template match="//attribute[@name='EvictionPolicyConfig']">
+ <eviction>
+ <xsl:if test="./config/attribute[@name='wakeUpIntervalSeconds']">
+ <xsl:attribute name="wakeUpInterval">
+ <xsl:value-of select="concat(normalize-space(./config/attribute[@name='wakeUpIntervalSeconds']), '000')"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="./config/attribute[@name='policyClass'] | ./config/attribute[@name='policyClass']">
+ <defaults>
+ <xsl:if test="./config/attribute[@name='policyClass']">
+ <xsl:attribute name="policyClass">
+ <xsl:value-of select="normalize-space(./config/attribute[@name='policyClass'])"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="./config/attribute[@name='eventQueueSize']">
+ <xsl:attribute name="eventQueueSize">
+ <xsl:value-of select="normalize-space(./config/attribute[@name='eventQueueSize'])"/>
+ </xsl:attribute>
+ </xsl:if>
+ </defaults>
+ </xsl:if>
+ <xsl:if test="./config/region[@name='/_default_']">
+ <root>
+ <xsl:copy-of select="./config/region[@name='/_default_']/*"/>
+ </root>
+ </xsl:if>
+ <xsl:for-each select="./config/region[@name!='/_default_']">
+ <region>
+ <xsl:if test="@name">
+ <xsl:attribute name="name">
+ <xsl:value-of select="@name"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="./*"/>
+ </region>
+ </xsl:for-each>
+ </eviction>
+ </xsl:template>
+
+ <xsl:template match="//attribute[@name='CacheLoaderConfiguration']">
+ <loaders>
+ <xsl:if test="./config/passivation">
+ <xsl:attribute name="passivation">
+ <xsl:value-of select="./config/passivation"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="./config/shared">
+ <xsl:attribute name="shared">
+ <xsl:value-of select="./config/shared"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="./config/preload">
+ <preload>
+ <xsl:call-template name="preloadTokenizer">
+ <xsl:with-param name="string" select="./config/preload"/>
+ <xsl:with-param name="delimiter" select="','"/>
+ </xsl:call-template>
+ </preload>
+ </xsl:if>
+ <xsl:for-each select="./config/cacheloader">
+ <loader>
+ <xsl:if test="./class">
+ <xsl:attribute name="class">
+ <xsl:value-of select="./class"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="./async">
+ <xsl:attribute name="async">
+ <xsl:value-of select="./async"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="./fetchPersistentState">
+ <xsl:attribute name="fetchPersistentState">
+ <xsl:value-of select="./fetchPersistentState"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="./ignoreModifications">
+ <xsl:attribute name="ignoreModifications">
+ <xsl:value-of select="./ignoreModifications"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="./purgeOnStartup">
+ <xsl:attribute name="purgeOnStartup">
+ <xsl:value-of select="./purgeOnStartup"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="./properties">
+ <xsl:copy-of select="./properties"/>
+ </xsl:if>
+ <xsl:if test="./singletonStore">
+ <singletonStore>
+ <xsl:if test="./singletonStore/enabled">
+ <xsl:attribute name="enabled">
+ <xsl:value-of select="./singletonStore/enabled"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="./singletonStore/enabled">
+ <xsl:attribute name="enabled">
+ <xsl:value-of select="./singletonStore/enabled"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="./singletonStore/class">
+ <xsl:attribute name="class">
+ <xsl:value-of select="./singletonStore/class"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="./singletonStore/properties"/>
+ </singletonStore>
+ </xsl:if>
+ </loader>
+ </xsl:for-each>
+ </loaders>
+ </xsl:template>
+
+ <xsl:template name="preloadTokenizer">
+ <xsl:param name="string"/>
+ <xsl:param name="delimiter" select="' '"/>
+ <xsl:choose>
+ <xsl:when test="$delimiter and contains($string, $delimiter)">
+ <node>
+ <xsl:attribute name="fqn">
+ <xsl:value-of select="substring-before($string,$delimiter)"/>
+ </xsl:attribute>
+ </node>
+ <xsl:call-template name="preloadTokenizer">
+ <xsl:with-param name="string" select="substring-after($string,$delimiter)"/>
+ <xsl:with-param name="delimiter" select="$delimiter"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <node>
+ <xsl:attribute name="fqn">
+ <xsl:value-of select="$string"/>
+ </xsl:attribute>
+ </node>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <xsl:template name="transport">
+ <xsl:if
+ test="//attribute[@name='ClusterName'] | //attribute[@name='MultiplexerStack'] | //attribute[@name='ClusterConfig']">
+ <transport>
+ <xsl:if test="//attribute[@name='ClusterName']">
+ <xsl:attribute name="clusterName">
+ <xsl:value-of select="normalize-space(//attribute[@name='ClusterName'])"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//attribute[@name='MultiplexerStack']">
+ <xsl:attribute name="multiplexerStack">
+ <xsl:value-of select="normalize-space(//attribute[@name='MultiplexerStack'])"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//attribute[@name='ClusterConfig']">
+ <jgroupsConfig>
+ <xsl:copy-of select="//attribute[@name='ClusterConfig']/config/*"/>
+ </jgroupsConfig>
+ </xsl:if>
+ </transport>
+ </xsl:if>
+ </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file
Deleted: core/trunk/src/main/resources/dependencies.xml
===================================================================
--- core/trunk/src/main/etc/dependencies.xml 2008-06-26 14:57:18 UTC (rev 6057)
+++ core/trunk/src/main/resources/dependencies.xml 2008-06-26 16:40:06 UTC (rev 6060)
@@ -1,114 +0,0 @@
-<!--
-Describes the version(s) of the libraries JBossCache depends on
-Author: Bela Ban
-Version: $Id$
- -->
-
-<dependencies>
- <jdk>1.4</jdk>
-
- <lib name="beanshell">
- <jar>bsh-2.0b4.jar</jar>
- <version>1.3.0</version>
- <version>2.0b4</version>
- <description>Embeddable Java source interpreter. Used in distribution demo. </description>
- </lib>
-
- <lib name="commons-logging">
- <jar>commons-logging.jar</jar>
- <version>1.0.3</version>
- <description>Apache commons logging. Used in logging now.</description>
- </lib>
-
- <lib name="concurrent">
- <jar>concurrent.jar</jar>
- <version>1.3.4</version>
- <description>Doug Lea's concurrent package.</description>
- </lib>
-
- <lib name="javassist">
- <jar>javassist.jar</jar>
- <version>3.1RC2</version>
- <description>Simple Java bytecode manipulation. Used by Aop.</description>
- </lib>
-
- <lib name="qdox">
- <jar>qdox.jar</jar>
- <version>1.4</version>
- <description>Parser for annotation used in Aop.</description>
- </lib>
-
- <lib name="jboss-aop">
- <jar>jboss-aop.jar</jar>
- <version>1.3.5</version>
- <description>Standalone JBoss Aop.</description>
- </lib>
-
- <lib name="jboss-aop-15">
- <jar>jboss-aop-jdk50.jar</jar>
- <version>1.3.5</version>
- <description>Standalone JBoss Aop for JDK50.</description>
- </lib>
-
- <lib name="jboss-common">
- <jar>jboss-common.jar</jar>
- <version>4.0.3</version>
- <description>JBoss common classes</description>
- </lib>
-
- <lib name="jboss-j2ee">
- <jar>jboss-j2ee.jar</jar>
- <version>4.0.3</version>
- <description>j2ee interfaces</description>
- </lib>
-
- <lib name="jboss-jmx">
- <jar>jboss-jmx.jar</jar>
- <version>4.0.3</version>
- <description>jmx implementaiton</description>
- </lib>
-
- <lib name="jboss-minimal">
- <jar>jboss-minimal.jar</jar>
- <version>4.0.3</version>
- <description></description>
- </lib>
-
- <lib name="jboss-system">
- <jar>jboss-system.jar</jar>
- <version>4.0.3</version>
- <description></description>
- </lib>
-
- <lib name="jgroups">
- <jar>jgroups.jar</jar>
- <version>2.2.7</version>
- <version>2.2.8</version>
- <description>Reliable messaging library. Used in replication.</description>
- </lib>
-
- <lib name="junit">
- <jar>junit.jar</jar>
- <version>3.8.1</version>
- <description>Unit testing framework. Used for examples.</description>
- </lib>
-
- <lib name="sleepycat">
- <jar>sleepycat/je.jar</jar>
- <version>1.7.0</version>
- <version>2.0.54</version>
- <description>Embeded DB. Used for JE cache loader.</description>
- </lib>
-
- <lib name="trove">
- <jar>trove.jar</jar>
- <version>1.0.2</version>
- <description>High performance collections for Java. Used by Aop.</description>
- </lib>
-
-</dependencies>
-
-
-
-
-
Copied: core/trunk/src/main/resources/dependencies.xml (from rev 6059, core/trunk/src/main/etc/dependencies.xml)
===================================================================
--- core/trunk/src/main/resources/dependencies.xml (rev 0)
+++ core/trunk/src/main/resources/dependencies.xml 2008-06-26 16:40:06 UTC (rev 6060)
@@ -0,0 +1,114 @@
+<!--
+Describes the version(s) of the libraries JBossCache depends on
+Author: Bela Ban
+Version: $Id$
+ -->
+
+<dependencies>
+ <jdk>1.4</jdk>
+
+ <lib name="beanshell">
+ <jar>bsh-2.0b4.jar</jar>
+ <version>1.3.0</version>
+ <version>2.0b4</version>
+ <description>Embeddable Java source interpreter. Used in distribution demo. </description>
+ </lib>
+
+ <lib name="commons-logging">
+ <jar>commons-logging.jar</jar>
+ <version>1.0.3</version>
+ <description>Apache commons logging. Used in logging now.</description>
+ </lib>
+
+ <lib name="concurrent">
+ <jar>concurrent.jar</jar>
+ <version>1.3.4</version>
+ <description>Doug Lea's concurrent package.</description>
+ </lib>
+
+ <lib name="javassist">
+ <jar>javassist.jar</jar>
+ <version>3.1RC2</version>
+ <description>Simple Java bytecode manipulation. Used by Aop.</description>
+ </lib>
+
+ <lib name="qdox">
+ <jar>qdox.jar</jar>
+ <version>1.4</version>
+ <description>Parser for annotation used in Aop.</description>
+ </lib>
+
+ <lib name="jboss-aop">
+ <jar>jboss-aop.jar</jar>
+ <version>1.3.5</version>
+ <description>Standalone JBoss Aop.</description>
+ </lib>
+
+ <lib name="jboss-aop-15">
+ <jar>jboss-aop-jdk50.jar</jar>
+ <version>1.3.5</version>
+ <description>Standalone JBoss Aop for JDK50.</description>
+ </lib>
+
+ <lib name="jboss-common">
+ <jar>jboss-common.jar</jar>
+ <version>4.0.3</version>
+ <description>JBoss common classes</description>
+ </lib>
+
+ <lib name="jboss-j2ee">
+ <jar>jboss-j2ee.jar</jar>
+ <version>4.0.3</version>
+ <description>j2ee interfaces</description>
+ </lib>
+
+ <lib name="jboss-jmx">
+ <jar>jboss-jmx.jar</jar>
+ <version>4.0.3</version>
+ <description>jmx implementaiton</description>
+ </lib>
+
+ <lib name="jboss-minimal">
+ <jar>jboss-minimal.jar</jar>
+ <version>4.0.3</version>
+ <description></description>
+ </lib>
+
+ <lib name="jboss-system">
+ <jar>jboss-system.jar</jar>
+ <version>4.0.3</version>
+ <description></description>
+ </lib>
+
+ <lib name="jgroups">
+ <jar>jgroups.jar</jar>
+ <version>2.2.7</version>
+ <version>2.2.8</version>
+ <description>Reliable messaging library. Used in replication.</description>
+ </lib>
+
+ <lib name="junit">
+ <jar>junit.jar</jar>
+ <version>3.8.1</version>
+ <description>Unit testing framework. Used for examples.</description>
+ </lib>
+
+ <lib name="sleepycat">
+ <jar>sleepycat/je.jar</jar>
+ <version>1.7.0</version>
+ <version>2.0.54</version>
+ <description>Embeded DB. Used for JE cache loader.</description>
+ </lib>
+
+ <lib name="trove">
+ <jar>trove.jar</jar>
+ <version>1.0.2</version>
+ <description>High performance collections for Java. Used by Aop.</description>
+ </lib>
+
+</dependencies>
+
+
+
+
+
Deleted: core/trunk/src/main/resources/jndi.properties
===================================================================
--- core/trunk/src/main/etc/jndi.properties 2008-06-26 14:57:18 UTC (rev 6057)
+++ core/trunk/src/main/resources/jndi.properties 2008-06-26 16:40:06 UTC (rev 6060)
@@ -1,5 +0,0 @@
-# DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING
-#
-#java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-#java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
-#java.naming.provider.url=localhost:1099
\ No newline at end of file
Copied: core/trunk/src/main/resources/jndi.properties (from rev 6059, core/trunk/src/main/etc/jndi.properties)
===================================================================
--- core/trunk/src/main/resources/jndi.properties (rev 0)
+++ core/trunk/src/main/resources/jndi.properties 2008-06-26 16:40:06 UTC (rev 6060)
@@ -0,0 +1,5 @@
+# DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING
+#
+#java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+#java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+#java.naming.provider.url=localhost:1099
\ No newline at end of file
Modified: core/trunk/src/test/java/org/jboss/cache/config/ConfigurationTransformerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/config/ConfigurationTransformerTest.java 2008-06-26 16:32:57 UTC (rev 6059)
+++ core/trunk/src/test/java/org/jboss/cache/config/ConfigurationTransformerTest.java 2008-06-26 16:40:06 UTC (rev 6060)
@@ -1,7 +1,6 @@
package org.jboss.cache.config;
import org.testng.annotations.Test;
-import org.testng.annotations.BeforeMethod;
import org.jboss.cache.config.parsing.ConfigFilesConvertor;
import org.jboss.cache.config.parsing.XmlConfigurationParser;
import org.jboss.cache.config.parsing.XmlConfigurationParser2x;
16 years, 6 months