JBoss Cache SVN: r6002 - in core/trunk/src: main/java/org/jboss/cache/buddyreplication and 8 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-17 19:59:38 -0400 (Tue, 17 Jun 2008)
New Revision: 6002
Modified:
core/trunk/src/main/java/org/jboss/cache/CacheSPI.java
core/trunk/src/main/java/org/jboss/cache/DataContainer.java
core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java
core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java
core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactory.java
core/trunk/src/main/java/org/jboss/cache/factories/EmptyConstructorFactory.java
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/NotificationInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticCreateIfNotExistsInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
core/trunk/src/main/java/org/jboss/cache/lock/NodeBasedLockManager.java
core/trunk/src/main/java/org/jboss/cache/notifications/Notifier.java
core/trunk/src/main/java/org/jboss/cache/notifications/NotifierImpl.java
core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java
core/trunk/src/test/java/org/jboss/cache/notifications/RemoteCacheListenerTest.java
Log:
Fixed some ugliness around interfaces introduced for DataContainer and Notifier, as direct implementations of these were being used instead of the interfaces
Modified: core/trunk/src/main/java/org/jboss/cache/CacheSPI.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/CacheSPI.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/CacheSPI.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -13,7 +13,7 @@
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.loader.CacheLoaderManager;
import org.jboss.cache.marshall.Marshaller;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.statetransfer.StateTransferManager;
import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionTable;
@@ -204,10 +204,10 @@
* From 2.1.0, Interceptor authors should obtain this by injection rather than this method. See the
* {@link org.jboss.cache.factories.annotations.Inject} annotation.
*
- * @return the notifier attached with this instance of the cache. See {@link org.jboss.cache.notifications.NotifierImpl}, a class
+ * @return the notifier attached with this instance of the cache. See {@link org.jboss.cache.notifications.Notifier}, a class
* that is responsible for emitting notifications to registered CacheListeners.
*/
- NotifierImpl getNotifier();
+ Notifier getNotifier();
/**
* @return the name of the cluster. Null if running in local mode.
Modified: core/trunk/src/main/java/org/jboss/cache/DataContainer.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DataContainer.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/DataContainer.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -158,6 +158,16 @@
int getNumberOfAttributes(Fqn fqn);
/**
+ * Returns an <em>approximation</em> of the total number of attributes in
+ * the cache. Since this method doesn't acquire any locks, the number might
+ * be incorrect, or the method might even throw a
+ * ConcurrentModificationException
+ *
+ * @return number of attribs
+ */
+ int getNumberOfAttributes();
+
+ /**
* Removes the actual node from the tree data structure.
*
* @param f the Fqn of the node to remove
Modified: core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -14,7 +14,12 @@
import org.jboss.cache.optimistic.DataVersion;
import org.jboss.cache.transaction.GlobalTransaction;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
/**
* A container for the root node in the cache, which also provides helpers for efficiently accessing nodes, walking trees, etc.
@@ -396,14 +401,6 @@
return count;
}
- /**
- * Returns an <em>approximation</em> of the total number of attributes in
- * the cache. Since this method doesn't acquire any locks, the number might
- * be incorrect, or the method might even throw a
- * ConcurrentModificationException
- *
- * @return number of attribs
- */
public int getNumberOfAttributes()
{
return numAttributes(root);
Modified: core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -23,7 +23,7 @@
import org.jboss.cache.marshall.CommandAwareRpcDispatcher;
import org.jboss.cache.marshall.InactiveRegionAwareRpcDispatcher;
import org.jboss.cache.marshall.Marshaller;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.remoting.jgroups.ChannelMessageListener;
import org.jboss.cache.statetransfer.StateTransferManager;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -82,7 +82,7 @@
*/
private ChannelMessageListener messageListener;
private Configuration configuration;
- private NotifierImpl notifier;
+ private Notifier notifier;
private CacheSPI spi;
private InvocationContextContainer invocationContextContainer;
private final boolean trace = log.isTraceEnabled();
@@ -97,10 +97,10 @@
private LockManager lockManager;
@Inject
- public void setupDependencies(ChannelMessageListener messageListener, Configuration configuration, NotifierImpl notifier,
- CacheSPI spi, Marshaller marshaller, TransactionTable txTable,
- TransactionManager txManager, InvocationContextContainer container, InterceptorChain interceptorChain,
- ComponentRegistry componentRegistry, LockManager lockManager)
+ public void setupDependencies(ChannelMessageListener messageListener, Configuration configuration, Notifier notifier,
+ CacheSPI spi, Marshaller marshaller, TransactionTable txTable,
+ TransactionManager txManager, InvocationContextContainer container, InterceptorChain interceptorChain,
+ ComponentRegistry componentRegistry, LockManager lockManager)
{
this.messageListener = messageListener;
this.configuration = configuration;
Modified: core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -10,7 +10,7 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.CacheException;
import org.jboss.cache.CacheSPI;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
import org.jboss.cache.RPCManager;
@@ -32,7 +32,7 @@
import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.factories.annotations.Stop;
import org.jboss.cache.lock.TimeoutException;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.notifications.annotation.CacheListener;
import org.jboss.cache.notifications.annotation.ViewChanged;
import org.jboss.cache.notifications.event.ViewChangedEvent;
@@ -79,7 +79,7 @@
private CacheSPI<?, ?> cache;
private Configuration configuration;
private RegionManager regionManager;
- private NotifierImpl notifier;
+ private Notifier notifier;
private StateTransferManager stateTransferManager;
private RPCManager rpcManager;
/**
@@ -142,7 +142,7 @@
private ViewChangeListener viewChangeListener; // the view-change viewChangeListener
private boolean receivedBuddyInfo;
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
private BuddyFqnTransformer buddyFqnTransformer;
public BuddyManager()
@@ -181,8 +181,8 @@
@Inject
public void injectDependencies(CacheSPI cache, Configuration configuration, RegionManager regionManager,
- StateTransferManager stateTransferManager, RPCManager rpcManager, NotifierImpl notifier,
- CommandsFactory factory, DataContainerImpl dataContainer, BuddyFqnTransformer transformer)
+ StateTransferManager stateTransferManager, RPCManager rpcManager, Notifier notifier,
+ CommandsFactory factory, DataContainer dataContainer, BuddyFqnTransformer transformer)
{
this.cache = cache;
this.configuration = configuration;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -2,7 +2,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.DataCommand;
import org.jboss.cache.commands.ReplicableCommand;
@@ -30,7 +30,7 @@
private DataCommand dataCommand;
private boolean searchBackupSubtrees;
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
private InterceptorChain interceptorChain;
private static final Log log = LogFactory.getLog(ClusteredGetCommand.class);
@@ -46,7 +46,7 @@
{
}
- public void initialize(DataContainerImpl dataContainer, InterceptorChain interceptorChain)
+ public void initialize(DataContainer dataContainer, InterceptorChain interceptorChain)
{
this.dataContainer = dataContainer;
this.interceptorChain = interceptorChain;
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -2,7 +2,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
@@ -38,7 +38,7 @@
private TransactionTable transactionTable;
private InterceptorChain invoker;
private CommandsFactory commandsFactory;
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
/* parameters */
private GlobalTransaction globalTransaction;
@@ -58,7 +58,7 @@
}
public void initialize(BuddyManager buddyManager, InterceptorChain invoker, TransactionTable transactionTable,
- CommandsFactory commandsFactory, DataContainerImpl dataContainer, BuddyFqnTransformer buddyFqnTransformer)
+ CommandsFactory commandsFactory, DataContainer dataContainer, BuddyFqnTransformer buddyFqnTransformer)
{
this.buddyManager = buddyManager;
this.invoker = invoker;
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-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/factories/CommandsFactory.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -2,12 +2,12 @@
import org.jboss.cache.CacheException;
import org.jboss.cache.CacheSPI;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.RPCManager;
+import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
import org.jboss.cache.buddyreplication.BuddyGroup;
import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
import org.jboss.cache.commands.DataCommand;
import org.jboss.cache.commands.ReplicableCommand;
import org.jboss.cache.commands.ReversibleCommand;
@@ -18,7 +18,12 @@
import org.jboss.cache.commands.read.GetKeysCommand;
import org.jboss.cache.commands.read.GetNodeCommand;
import org.jboss.cache.commands.read.GravitateDataCommand;
-import org.jboss.cache.commands.remote.*;
+import org.jboss.cache.commands.remote.AnnounceBuddyPoolNameCommand;
+import org.jboss.cache.commands.remote.AssignToBuddyGroupCommand;
+import org.jboss.cache.commands.remote.ClusteredGetCommand;
+import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
+import org.jboss.cache.commands.remote.RemoveFromBuddyGroupCommand;
+import org.jboss.cache.commands.remote.ReplicateCommand;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
@@ -28,7 +33,7 @@
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.NonVolatile;
import org.jboss.cache.interceptors.InterceptorChain;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionTable;
import org.jgroups.Address;
@@ -54,8 +59,8 @@
public class CommandsFactory
{
private RPCManager rpcManager;
- private DataContainerImpl dataContainer;
- private NotifierImpl notifier;
+ private DataContainer dataContainer;
+ private Notifier notifier;
private InterceptorChain invoker;
private BuddyManager buddyManager;
private TransactionTable transactionTable;
@@ -69,7 +74,7 @@
}
@Inject
- public void initialize(RPCManager rpc, DataContainerImpl dataContainer, NotifierImpl notifier, BuddyManager buddyManager,
+ public void initialize(RPCManager rpc, DataContainer dataContainer, Notifier notifier, BuddyManager buddyManager,
InterceptorChain invoker, TransactionTable transactionTable, CacheSPI cacheSpi,
Configuration configuration, TransactionManager txManager, BuddyFqnTransformer buddyFqnTransformer)
{
@@ -178,7 +183,8 @@
command.initialize(txManager);
command.initialize(cacheSpi, dataContainer, notifier);
return command;
- } else
+ }
+ else
{
InvalidateCommand command = new InvalidateCommand(fqn);
command.initialize(cacheSpi, dataContainer, notifier);
@@ -450,7 +456,8 @@
returnValue.initialize(txManager);
returnValue.initialize(cacheSpi, dataContainer, notifier);
command = returnValue;
- } else
+ }
+ else
{
InvalidateCommand returnValue = new InvalidateCommand();
returnValue.initialize(cacheSpi, dataContainer, notifier);
Modified: core/trunk/src/main/java/org/jboss/cache/factories/EmptyConstructorFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/EmptyConstructorFactory.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/factories/EmptyConstructorFactory.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -1,6 +1,6 @@
package org.jboss.cache.factories;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.RegionManager;
import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
import org.jboss.cache.config.ConfigurationException;
@@ -11,7 +11,7 @@
import org.jboss.cache.lock.LockStrategyFactory;
import org.jboss.cache.marshall.Marshaller;
import org.jboss.cache.marshall.VersionAwareMarshaller;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.remoting.jgroups.ChannelMessageListener;
import org.jboss.cache.statetransfer.StateTransferManager;
import org.jboss.cache.transaction.TransactionTable;
@@ -22,9 +22,9 @@
* @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
* @since 2.1.0
*/
-@DefaultFactoryFor(classes = {StateTransferManager.class, RegionManager.class, NotifierImpl.class,
+@DefaultFactoryFor(classes = {StateTransferManager.class, RegionManager.class, Notifier.class,
ChannelMessageListener.class, CacheLoaderManager.class, Marshaller.class, InvocationContextContainer.class,
- CacheInvocationDelegate.class, TransactionTable.class, DataContainerImpl.class, CommandsFactory.class,
+ CacheInvocationDelegate.class, TransactionTable.class, DataContainer.class, CommandsFactory.class,
LockStrategyFactory.class, BuddyFqnTransformer.class})
public class EmptyConstructorFactory extends ComponentFactory
{
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -1,7 +1,7 @@
package org.jboss.cache.interceptors;
import org.jboss.cache.CacheException;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
@@ -29,7 +29,7 @@
import org.jboss.cache.lock.LockManager;
import org.jboss.cache.lock.LockType;
import org.jboss.cache.lock.TimeoutException;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.transaction.TransactionEntry;
import org.jboss.cache.transaction.TransactionTable;
@@ -55,8 +55,8 @@
protected TransactionTable txTable = null;
protected CacheLoader loader;
- protected DataContainerImpl dataContainer;
- protected NotifierImpl notifier;
+ protected DataContainer dataContainer;
+ protected Notifier notifier;
protected boolean isActivation = false;
protected boolean usingOptimisticInvalidation = false;
@@ -71,7 +71,7 @@
@Inject
protected void injectDependencies(TransactionTable txTable, CacheLoaderManager clm, Configuration configuration,
- DataContainerImpl dataContainer, LockManager lockManager, NotifierImpl notifier)
+ DataContainer dataContainer, LockManager lockManager, Notifier notifier)
{
this.txTable = txTable;
this.clm = clm;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -21,7 +21,7 @@
*/
package org.jboss.cache.interceptors;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.read.GetKeyValueCommand;
import org.jboss.cache.commands.write.EvictCommand;
@@ -52,10 +52,10 @@
private long m_start = System.currentTimeMillis();
private long m_reset = m_start;
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
@Inject
- public void setDependencies(DataContainerImpl dataContainer)
+ public void setDependencies(DataContainer dataContainer)
{
this.dataContainer = dataContainer;
}
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -1,7 +1,7 @@
package org.jboss.cache.interceptors;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.Modification;
@@ -14,7 +14,12 @@
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.commands.write.ClearDataCommand;
-import org.jboss.cache.commands.write.*;
+import org.jboss.cache.commands.write.MoveCommand;
+import org.jboss.cache.commands.write.PutDataMapCommand;
+import org.jboss.cache.commands.write.PutForExternalReadCommand;
+import org.jboss.cache.commands.write.PutKeyValueCommand;
+import org.jboss.cache.commands.write.RemoveKeyCommand;
+import org.jboss.cache.commands.write.RemoveNodeCommand;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.Start;
@@ -49,7 +54,7 @@
private Map<GlobalTransaction, Set<Fqn>> preparingTxs = new ConcurrentHashMap<GlobalTransaction, Set<Fqn>>();
private long cacheStores = 0;
private CacheLoader loader;
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
private CacheLoaderManager loaderManager;
public CacheStoreInterceptor()
@@ -59,7 +64,7 @@
}
@Inject
- protected void init(DataContainerImpl dataContainer, CacheLoaderManager loaderManager, TransactionManager txManager, CacheLoaderConfig clConfig)
+ protected void init(DataContainer dataContainer, CacheLoaderManager loaderManager, TransactionManager txManager, CacheLoaderConfig clConfig)
{
// never inject a CacheLoader at this stage - only a CacheLoaderManager, since the CacheLoaderManager only creates a CacheLoader instance when it @Starts.
this.loaderManager = loaderManager;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -6,13 +6,23 @@
*/
package org.jboss.cache.interceptors;
-import org.jboss.cache.*;
+import org.jboss.cache.CacheException;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.DataContainer;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.InvocationContext;
import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
import org.jboss.cache.buddyreplication.BuddyManager;
import org.jboss.cache.buddyreplication.GravitateResult;
import org.jboss.cache.commands.DataCommand;
import org.jboss.cache.commands.ReplicableCommand;
-import org.jboss.cache.commands.read.*;
+import org.jboss.cache.commands.read.ExistsCommand;
+import org.jboss.cache.commands.read.GetChildrenNamesCommand;
+import org.jboss.cache.commands.read.GetDataMapCommand;
+import org.jboss.cache.commands.read.GetKeyValueCommand;
+import org.jboss.cache.commands.read.GetKeysCommand;
+import org.jboss.cache.commands.read.GetNodeCommand;
+import org.jboss.cache.commands.read.GravitateDataCommand;
import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
@@ -59,13 +69,13 @@
* cleanup commands corresponding to all gravitate calls made during the course of the transaction in question.
*/
private Map<GlobalTransaction, List<ReplicableCommand>> cleanupCommands = new ConcurrentHashMap<GlobalTransaction, List<ReplicableCommand>>();
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
private CommandsFactory commandsFactory;
private CacheSPI cacheSPI;
private BuddyFqnTransformer buddyFqnTransformer;
@Inject
- public void injectComponents(BuddyManager buddyManager, DataContainerImpl dataContainer, CommandsFactory commandsFactory, CacheSPI cacheSPI, BuddyFqnTransformer transformer)
+ public void injectComponents(BuddyManager buddyManager, DataContainer dataContainer, CommandsFactory commandsFactory, CacheSPI cacheSPI, BuddyFqnTransformer transformer)
{
this.buddyManager = buddyManager;
this.dataContainer = dataContainer;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -7,7 +7,7 @@
*/
package org.jboss.cache.interceptors;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
@@ -17,7 +17,12 @@
import org.jboss.cache.commands.read.GetKeyValueCommand;
import org.jboss.cache.commands.read.GetNodeCommand;
import org.jboss.cache.commands.write.ClearDataCommand;
-import org.jboss.cache.commands.write.*;
+import org.jboss.cache.commands.write.EvictCommand;
+import org.jboss.cache.commands.write.PutDataMapCommand;
+import org.jboss.cache.commands.write.PutForExternalReadCommand;
+import org.jboss.cache.commands.write.PutKeyValueCommand;
+import org.jboss.cache.commands.write.RemoveKeyCommand;
+import org.jboss.cache.commands.write.RemoveNodeCommand;
import org.jboss.cache.eviction.EvictedEventNode;
import org.jboss.cache.eviction.NodeEventType;
import org.jboss.cache.factories.annotations.Inject;
@@ -36,10 +41,10 @@
{
protected RegionManager regionManager;
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
@Inject
- public void initialize(DataContainerImpl dataContainer)
+ public void initialize(DataContainer dataContainer)
{
this.dataContainer = dataContainer;
}
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/NotificationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/NotificationInterceptor.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/NotificationInterceptor.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -5,7 +5,7 @@
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
/**
* The interceptor in charge of firing off notifications to cache listeners
@@ -15,10 +15,10 @@
*/
public class NotificationInterceptor extends BaseTransactionalContextInterceptor
{
- private NotifierImpl notifier;
+ private Notifier notifier;
@Inject
- public void injectDependencies(NotifierImpl notifier)
+ public void injectDependencies(Notifier notifier)
{
this.notifier = notifier;
}
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticCreateIfNotExistsInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticCreateIfNotExistsInterceptor.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticCreateIfNotExistsInterceptor.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -8,7 +8,7 @@
import org.jboss.cache.CacheException;
import org.jboss.cache.CacheSPI;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeFactory;
@@ -46,14 +46,14 @@
*/
private NodeFactory nodeFactory;
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
private CacheSPI cache;
private long lockAcquisitionTimeout;
@Inject
- private void injectDependencies(NodeFactory nodeFactory, DataContainerImpl dataContainer, CacheSPI cacheSPI)
+ private void injectDependencies(NodeFactory nodeFactory, DataContainer dataContainer, CacheSPI cacheSPI)
{
this.nodeFactory = nodeFactory;
this.dataContainer = dataContainer;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -8,7 +8,7 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.CacheException;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeFactory;
@@ -20,17 +20,17 @@
import org.jboss.cache.commands.read.GetKeyValueCommand;
import org.jboss.cache.commands.read.GetKeysCommand;
import org.jboss.cache.commands.read.GetNodeCommand;
+import org.jboss.cache.commands.write.ClearDataCommand;
import org.jboss.cache.commands.write.MoveCommand;
import org.jboss.cache.commands.write.PutDataMapCommand;
import org.jboss.cache.commands.write.PutForExternalReadCommand;
import org.jboss.cache.commands.write.PutKeyValueCommand;
-import org.jboss.cache.commands.write.ClearDataCommand;
import org.jboss.cache.commands.write.RemoveKeyCommand;
import org.jboss.cache.commands.write.RemoveNodeCommand;
import org.jboss.cache.config.Option;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.Start;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import static org.jboss.cache.notifications.event.NodeModifiedEvent.ModificationType.*;
import org.jboss.cache.optimistic.DataVersion;
import org.jboss.cache.optimistic.DefaultDataVersion;
@@ -56,12 +56,12 @@
* Needed for the creation of workspace nodes based on underlying nodes in the cache.
*/
private NodeFactory nodeFactory;
- private NotifierImpl notifier;
- private DataContainerImpl dataContainer;
+ private Notifier notifier;
+ private DataContainer dataContainer;
private long lockAcquisitionTimeout;
@Inject
- protected void injectDependencies(NotifierImpl notifier, NodeFactory nodeFactory, DataContainerImpl dataContainer)
+ protected void injectDependencies(Notifier notifier, NodeFactory nodeFactory, DataContainer dataContainer)
{
this.notifier = notifier;
this.nodeFactory = nodeFactory;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -6,8 +6,11 @@
*/
package org.jboss.cache.interceptors;
-import org.jboss.cache.DataContainerImpl;
-import org.jboss.cache.*;
+import org.jboss.cache.CacheException;
+import org.jboss.cache.DataContainer;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.InvocationContext;
+import org.jboss.cache.NodeSPI;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
@@ -47,10 +50,10 @@
{
private boolean useTombstones;
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
@Inject
- public void initialize(DataContainerImpl dataContainer)
+ public void initialize(DataContainer dataContainer)
{
this.dataContainer = dataContainer;
}
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -1,6 +1,6 @@
package org.jboss.cache.interceptors;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
@@ -9,7 +9,7 @@
import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.loader.CacheLoaderManager;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import java.util.Collections;
import java.util.HashMap;
@@ -30,11 +30,11 @@
private final AtomicLong passivations = new AtomicLong(0);
protected CacheLoader loader;
- private NotifierImpl notifier;
- private DataContainerImpl dataContainer;
+ private Notifier notifier;
+ private DataContainer dataContainer;
@Inject
- public void setDependencies(NotifierImpl notifier, DataContainerImpl dataContainer, CacheLoaderManager loaderManager)
+ public void setDependencies(Notifier notifier, DataContainer dataContainer, CacheLoaderManager loaderManager)
{
this.notifier = notifier;
this.dataContainer = dataContainer;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -6,7 +6,7 @@
*/
package org.jboss.cache.interceptors;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
@@ -62,12 +62,12 @@
*/
public class PessimisticLockInterceptor extends PostProcessingCommandInterceptor
{
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
private PessimisticNodeBasedLockManager lockManager;
private CommandsFactory commandsFactory;
@Inject
- public void injectDependencies(DataContainerImpl dataContainer, LockManager lockManager, CommandsFactory commandsFactory)
+ public void injectDependencies(DataContainer dataContainer, LockManager lockManager, CommandsFactory commandsFactory)
{
this.dataContainer = dataContainer;
this.lockManager = (PessimisticNodeBasedLockManager) lockManager;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -31,7 +31,7 @@
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.invocation.InvocationContextContainer;
import org.jboss.cache.lock.LockManager;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionEntry;
import org.jboss.cache.transaction.TransactionTable;
@@ -63,7 +63,7 @@
{
protected CommandsFactory commandsFactory;
protected RPCManager rpcManager;
- private NotifierImpl notifier;
+ private Notifier notifier;
private InvocationContextContainer invocationContextContainer;
private ComponentRegistry componentRegistry;
@@ -80,7 +80,7 @@
@Inject
public void intialize(RPCManager rpcManager,
- NotifierImpl notifier, InvocationContextContainer icc,
+ Notifier notifier, InvocationContextContainer icc,
CommandsFactory factory, ComponentRegistry componentRegistry, LockManager lockManager)
{
this.commandsFactory = factory;
Modified: core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -24,7 +24,7 @@
import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.CacheLoaderManager;
import org.jboss.cache.marshall.Marshaller;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.statetransfer.StateTransferManager;
import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionTable;
@@ -52,21 +52,21 @@
// this stuff is needed since the SPI has methods to retrieve these.
private StateTransferManager stateTransferManager;
private CacheLoaderManager cacheLoaderManager;
- private NotifierImpl notifier;
+ private Notifier notifier;
private TransactionManager transactionManager;
private BuddyManager buddyManager;
private TransactionTable transactionTable;
private RPCManager rpcManager;
private RegionManager regionManager;
private Marshaller marshaller;
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
private CommandsFactory commandsFactory;
@Inject
- public void initialize(StateTransferManager stateTransferManager, CacheLoaderManager cacheLoaderManager, NotifierImpl notifier,
+ public void initialize(StateTransferManager stateTransferManager, CacheLoaderManager cacheLoaderManager, Notifier notifier,
TransactionManager transactionManager, BuddyManager buddyManager, TransactionTable transactionTable,
RPCManager rpcManager, RegionManager regionManager, Marshaller marshaller,
- CommandsFactory commandsFactory, DataContainerImpl dataContainer)
+ CommandsFactory commandsFactory, DataContainer dataContainer)
{
this.stateTransferManager = stateTransferManager;
this.cacheLoaderManager = cacheLoaderManager;
@@ -215,7 +215,7 @@
return peek(fqn, false, false) != null;
}
- public NotifierImpl getNotifier()
+ public Notifier getNotifier()
{
return notifier;
}
@@ -560,7 +560,7 @@
return getChildrenNames(Fqn.fromString(fqn));
}
- public DataContainerImpl getDataContainer()
+ public DataContainer getDataContainer()
{
return dataContainer;
}
Modified: core/trunk/src/main/java/org/jboss/cache/lock/NodeBasedLockManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/lock/NodeBasedLockManager.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/lock/NodeBasedLockManager.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -2,7 +2,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
@@ -26,11 +26,11 @@
protected Configuration configuration;
protected long lockAcquisitionTimeout;
- protected DataContainerImpl dataContainer;
+ protected DataContainer dataContainer;
protected NodeSPI rootNode;
@Inject
- public void inject(Configuration configuration, DataContainerImpl dataContainer)
+ public void inject(Configuration configuration, DataContainer dataContainer)
{
this.configuration = configuration;
this.dataContainer = dataContainer;
Modified: core/trunk/src/main/java/org/jboss/cache/notifications/Notifier.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/notifications/Notifier.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/notifications/Notifier.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -2,19 +2,17 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
-import org.jboss.cache.CacheSPI;
import org.jboss.cache.buddyreplication.BuddyGroup;
-import org.jboss.cache.factories.annotations.Start;
-import org.jboss.cache.factories.annotations.Stop;
import org.jboss.cache.notifications.event.NodeModifiedEvent;
import org.jgroups.View;
import javax.transaction.Transaction;
import java.util.Map;
+import java.util.Set;
/**
* Public interface with all allowed notifications.
- *
+ *
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
@@ -33,7 +31,7 @@
/**
* When notifying about node modifications, in many scenarios there is a need of building a new Map object. If no
* listeners are registered for notification then it is pointless building this object - so guard the notification
- * with this call.
+ * with this call.
*/
public boolean shouldNotifyOnNodeModified();
@@ -105,4 +103,23 @@
void notifyCacheBlocked(boolean pre);
void notifyCacheUnblocked(boolean pre);
+
+ /**
+ * Adds a cache listener to the list of cache listeners registered.
+ *
+ * @param listener
+ */
+ void addCacheListener(Object listener);
+
+ /**
+ * Removes a cache listener from the list of cache listeners registered.
+ *
+ * @param listener
+ */
+ void removeCacheListener(Object listener);
+
+ /**
+ * @return Retrieves an (unmodifiable) set of cache listeners registered.
+ */
+ Set<Object> getCacheListeners();
}
Modified: core/trunk/src/main/java/org/jboss/cache/notifications/NotifierImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/notifications/NotifierImpl.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/notifications/NotifierImpl.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -8,10 +8,18 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.*;
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheException;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.InvocationContext;
import org.jboss.cache.buddyreplication.BuddyGroup;
import org.jboss.cache.config.Configuration;
-import org.jboss.cache.factories.annotations.*;
+import org.jboss.cache.factories.annotations.Destroy;
+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.factories.annotations.Stop;
import org.jboss.cache.marshall.MarshalledValueMap;
import org.jboss.cache.notifications.annotation.*;
import org.jboss.cache.notifications.event.*;
@@ -23,7 +31,12 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
-import java.util.*;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
/**
@@ -153,21 +166,11 @@
result.add(li);
}
- /**
- * Adds a cache listener to the list of cache listeners registered.
- *
- * @param listener
- */
public void addCacheListener(Object listener)
{
validateAndAddListenerInvocation(listener);
}
- /**
- * Removes a cache listener from the list of cache listeners registered.
- *
- * @param listener
- */
public void removeCacheListener(Object listener)
{
for (Class annotation : allowedMethodAnnotations) removeListenerInvocation(annotation, listener);
@@ -210,9 +213,6 @@
buddyGroupChangedListeners.clear();
}
- /**
- * @return Retrieves an (unmodifiable) set of cache listeners registered.
- */
public Set<Object> getCacheListeners()
{
Set<Object> result = new HashSet<Object>();
Modified: core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -23,7 +23,7 @@
public static String printCacheDetails(Cache c)
{
// internal cast
- DataContainerImpl ci = ((CacheInvocationDelegate) c).getDataContainer();
+ DataContainerImpl ci = (DataContainerImpl) ((CacheInvocationDelegate) c).getDataContainer();
return ci.printDetails();
}
@@ -36,7 +36,7 @@
public static String printCacheLockingInfo(Cache c)
{
// internal cast
- DataContainerImpl cd = ((CacheInvocationDelegate) c).getDataContainer();
+ DataContainerImpl cd = (DataContainerImpl) ((CacheInvocationDelegate) c).getDataContainer();
return cd.printLockInfo();
}
Modified: core/trunk/src/test/java/org/jboss/cache/notifications/RemoteCacheListenerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/notifications/RemoteCacheListenerTest.java 2008-06-17 23:53:14 UTC (rev 6001)
+++ core/trunk/src/test/java/org/jboss/cache/notifications/RemoteCacheListenerTest.java 2008-06-17 23:59:38 UTC (rev 6002)
@@ -31,12 +31,12 @@
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.lock.IsolationLevel;
-import org.jboss.cache.util.TestingUtil;
import org.jboss.cache.notifications.event.Event;
import static org.jboss.cache.notifications.event.Event.Type.*;
import org.jboss.cache.notifications.event.EventImpl;
import org.jboss.cache.notifications.event.NodeModifiedEvent;
import static org.jboss.cache.notifications.event.NodeModifiedEvent.ModificationType.*;
+import org.jboss.cache.util.TestingUtil;
import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
@@ -114,7 +114,7 @@
cr1 = TestingUtil.extractComponentRegistry(cache1);
cr2 = TestingUtil.extractComponentRegistry(cache2);
assert cr1 != cr2;
- assert cr1.getComponent(NotifierImpl.class) != cr2.getComponent(NotifierImpl.class);
+ assert cr1.getComponent(Notifier.class) != cr2.getComponent(Notifier.class);
assert eventLog1 != eventLog2;
assert cache1.getLocalAddress() != cache2.getLocalAddress();
CacheSPI spi1, spi2;
16 years, 6 months
JBoss Cache SVN: r6001 - core/branches/2.2.X/src/test/java/org/jboss/cache/notifications.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-17 19:53:14 -0400 (Tue, 17 Jun 2008)
New Revision: 6001
Modified:
core/branches/2.2.X/src/test/java/org/jboss/cache/notifications/RemoteCacheListenerTest.java
Log:
Fixed some ugliness around interfaces introduced for DataContainer and Notifier, as direct implementations of these were being used instead of the interfaces
Modified: core/branches/2.2.X/src/test/java/org/jboss/cache/notifications/RemoteCacheListenerTest.java
===================================================================
--- core/branches/2.2.X/src/test/java/org/jboss/cache/notifications/RemoteCacheListenerTest.java 2008-06-17 23:43:54 UTC (rev 6000)
+++ core/branches/2.2.X/src/test/java/org/jboss/cache/notifications/RemoteCacheListenerTest.java 2008-06-17 23:53:14 UTC (rev 6001)
@@ -31,12 +31,12 @@
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.lock.IsolationLevel;
-import org.jboss.cache.util.TestingUtil;
import org.jboss.cache.notifications.event.Event;
import static org.jboss.cache.notifications.event.Event.Type.*;
import org.jboss.cache.notifications.event.EventImpl;
import org.jboss.cache.notifications.event.NodeModifiedEvent;
import static org.jboss.cache.notifications.event.NodeModifiedEvent.ModificationType.*;
+import org.jboss.cache.util.TestingUtil;
import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
@@ -114,7 +114,7 @@
cr1 = TestingUtil.extractComponentRegistry(cache1);
cr2 = TestingUtil.extractComponentRegistry(cache2);
assert cr1 != cr2;
- assert cr1.getComponent(NotifierImpl.class) != cr2.getComponent(NotifierImpl.class);
+ assert cr1.getComponent(Notifier.class) != cr2.getComponent(Notifier.class);
assert eventLog1 != eventLog2;
assert cache1.getLocalAddress() != cache2.getLocalAddress();
CacheSPI spi1, spi2;
16 years, 6 months
JBoss Cache SVN: r6000 - in core/branches/2.2.X/src/main/java/org/jboss/cache: buddyreplication and 7 other directories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-17 19:43:54 -0400 (Tue, 17 Jun 2008)
New Revision: 6000
Modified:
core/branches/2.2.X/src/main/java/org/jboss/cache/CacheSPI.java
core/branches/2.2.X/src/main/java/org/jboss/cache/DataContainer.java
core/branches/2.2.X/src/main/java/org/jboss/cache/RPCManagerImpl.java
core/branches/2.2.X/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
core/branches/2.2.X/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java
core/branches/2.2.X/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java
core/branches/2.2.X/src/main/java/org/jboss/cache/factories/CommandsFactory.java
core/branches/2.2.X/src/main/java/org/jboss/cache/factories/EmptyConstructorFactory.java
core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java
core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java
core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java
core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/NotificationInterceptor.java
core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/OptimisticCreateIfNotExistsInterceptor.java
core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java
core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java
core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java
core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
core/branches/2.2.X/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
core/branches/2.2.X/src/main/java/org/jboss/cache/lock/NodeBasedLockManager.java
core/branches/2.2.X/src/main/java/org/jboss/cache/notifications/Notifier.java
core/branches/2.2.X/src/main/java/org/jboss/cache/util/CachePrinter.java
Log:
Fixed some ugliness around interfaces introduced for DataContainer and Notifier, as direct implementations of these were being used instead of the interfaces
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/CacheSPI.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/CacheSPI.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/CacheSPI.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -13,7 +13,7 @@
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.loader.CacheLoaderManager;
import org.jboss.cache.marshall.Marshaller;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.statetransfer.StateTransferManager;
import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionTable;
@@ -204,10 +204,10 @@
* From 2.1.0, Interceptor authors should obtain this by injection rather than this method. See the
* {@link org.jboss.cache.factories.annotations.Inject} annotation.
*
- * @return the notifier attached with this instance of the cache. See {@link org.jboss.cache.notifications.NotifierImpl}, a class
+ * @return the notifier attached with this instance of the cache. See {@link org.jboss.cache.notifications.Notifier}, a class
* that is responsible for emitting notifications to registered CacheListeners.
*/
- NotifierImpl getNotifier();
+ Notifier getNotifier();
/**
* @return the name of the cluster. Null if running in local mode.
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/DataContainer.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/DataContainer.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/DataContainer.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -158,6 +158,16 @@
int getNumberOfAttributes(Fqn fqn);
/**
+ * Returns an <em>approximation</em> of the total number of attributes in
+ * the cache. Since this method doesn't acquire any locks, the number might
+ * be incorrect, or the method might even throw a
+ * ConcurrentModificationException
+ *
+ * @return number of attribs
+ */
+ int getNumberOfAttributes();
+
+ /**
* Removes the actual node from the tree data structure.
*
* @param f the Fqn of the node to remove
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/RPCManagerImpl.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/RPCManagerImpl.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/RPCManagerImpl.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -23,7 +23,7 @@
import org.jboss.cache.marshall.CommandAwareRpcDispatcher;
import org.jboss.cache.marshall.InactiveRegionAwareRpcDispatcher;
import org.jboss.cache.marshall.Marshaller;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.remoting.jgroups.ChannelMessageListener;
import org.jboss.cache.statetransfer.StateTransferManager;
import org.jboss.cache.transaction.GlobalTransaction;
@@ -82,7 +82,7 @@
*/
private ChannelMessageListener messageListener;
private Configuration configuration;
- private NotifierImpl notifier;
+ private Notifier notifier;
private CacheSPI spi;
private InvocationContextContainer invocationContextContainer;
private final boolean trace = log.isTraceEnabled();
@@ -97,7 +97,7 @@
private LockManager lockManager;
@Inject
- private void setupDependencies(ChannelMessageListener messageListener, Configuration configuration, NotifierImpl notifier,
+ private void setupDependencies(ChannelMessageListener messageListener, Configuration configuration, Notifier notifier,
CacheSPI spi, Marshaller marshaller, TransactionTable txTable,
TransactionManager txManager, InvocationContextContainer container, InterceptorChain interceptorChain,
ComponentRegistry componentRegistry, LockManager lockManager)
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -10,7 +10,7 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.CacheException;
import org.jboss.cache.CacheSPI;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
import org.jboss.cache.RPCManager;
@@ -32,7 +32,7 @@
import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.factories.annotations.Stop;
import org.jboss.cache.lock.TimeoutException;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.notifications.annotation.CacheListener;
import org.jboss.cache.notifications.annotation.ViewChanged;
import org.jboss.cache.notifications.event.ViewChangedEvent;
@@ -79,7 +79,7 @@
private CacheSPI<?, ?> cache;
private Configuration configuration;
private RegionManager regionManager;
- private NotifierImpl notifier;
+ private Notifier notifier;
private StateTransferManager stateTransferManager;
private RPCManager rpcManager;
/**
@@ -142,7 +142,7 @@
private ViewChangeListener viewChangeListener; // the view-change viewChangeListener
private boolean receivedBuddyInfo;
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
private BuddyFqnTransformer buddyFqnTransformer;
public BuddyManager()
@@ -181,8 +181,8 @@
@Inject
public void injectDependencies(CacheSPI cache, Configuration configuration, RegionManager regionManager,
- StateTransferManager stateTransferManager, RPCManager rpcManager, NotifierImpl notifier,
- CommandsFactory factory, DataContainerImpl dataContainer, BuddyFqnTransformer transformer)
+ StateTransferManager stateTransferManager, RPCManager rpcManager, Notifier notifier,
+ CommandsFactory factory, DataContainer dataContainer, BuddyFqnTransformer transformer)
{
this.cache = cache;
this.configuration = configuration;
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -2,7 +2,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.DataCommand;
import org.jboss.cache.commands.ReplicableCommand;
@@ -30,7 +30,7 @@
private DataCommand dataCommand;
private boolean searchBackupSubtrees;
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
private InterceptorChain interceptorChain;
private static final Log log = LogFactory.getLog(ClusteredGetCommand.class);
@@ -46,7 +46,7 @@
{
}
- public void initialize(DataContainerImpl dataContainer, InterceptorChain interceptorChain)
+ public void initialize(DataContainer dataContainer, InterceptorChain interceptorChain)
{
this.dataContainer = dataContainer;
this.interceptorChain = interceptorChain;
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -2,7 +2,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
@@ -38,7 +38,7 @@
private TransactionTable transactionTable;
private InterceptorChain invoker;
private CommandsFactory commandsFactory;
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
/* parameters */
private GlobalTransaction globalTransaction;
@@ -58,7 +58,7 @@
}
public void initialize(BuddyManager buddyManager, InterceptorChain invoker, TransactionTable transactionTable,
- CommandsFactory commandsFactory, DataContainerImpl dataContainer, BuddyFqnTransformer buddyFqnTransformer)
+ CommandsFactory commandsFactory, DataContainer dataContainer, BuddyFqnTransformer buddyFqnTransformer)
{
this.buddyManager = buddyManager;
this.invoker = invoker;
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/factories/CommandsFactory.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/factories/CommandsFactory.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/factories/CommandsFactory.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -2,12 +2,12 @@
import org.jboss.cache.CacheException;
import org.jboss.cache.CacheSPI;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.RPCManager;
+import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
import org.jboss.cache.buddyreplication.BuddyGroup;
import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
import org.jboss.cache.commands.DataCommand;
import org.jboss.cache.commands.ReplicableCommand;
import org.jboss.cache.commands.ReversibleCommand;
@@ -18,7 +18,12 @@
import org.jboss.cache.commands.read.GetKeysCommand;
import org.jboss.cache.commands.read.GetNodeCommand;
import org.jboss.cache.commands.read.GravitateDataCommand;
-import org.jboss.cache.commands.remote.*;
+import org.jboss.cache.commands.remote.AnnounceBuddyPoolNameCommand;
+import org.jboss.cache.commands.remote.AssignToBuddyGroupCommand;
+import org.jboss.cache.commands.remote.ClusteredGetCommand;
+import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
+import org.jboss.cache.commands.remote.RemoveFromBuddyGroupCommand;
+import org.jboss.cache.commands.remote.ReplicateCommand;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
@@ -28,7 +33,7 @@
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.NonVolatile;
import org.jboss.cache.interceptors.InterceptorChain;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionTable;
import org.jgroups.Address;
@@ -54,8 +59,8 @@
public class CommandsFactory
{
private RPCManager rpcManager;
- private DataContainerImpl dataContainer;
- private NotifierImpl notifier;
+ private DataContainer dataContainer;
+ private Notifier notifier;
private InterceptorChain invoker;
private BuddyManager buddyManager;
private TransactionTable transactionTable;
@@ -69,7 +74,7 @@
}
@Inject
- public void initialize(RPCManager rpc, DataContainerImpl dataContainer, NotifierImpl notifier, BuddyManager buddyManager,
+ public void initialize(RPCManager rpc, DataContainer dataContainer, Notifier notifier, BuddyManager buddyManager,
InterceptorChain invoker, TransactionTable transactionTable, CacheSPI cacheSpi,
Configuration configuration, TransactionManager txManager, BuddyFqnTransformer buddyFqnTransformer)
{
@@ -178,7 +183,8 @@
command.initialize(txManager);
command.initialize(cacheSpi, dataContainer, notifier);
return command;
- } else
+ }
+ else
{
InvalidateCommand command = new InvalidateCommand(fqn);
command.initialize(cacheSpi, dataContainer, notifier);
@@ -450,7 +456,8 @@
returnValue.initialize(txManager);
returnValue.initialize(cacheSpi, dataContainer, notifier);
command = returnValue;
- } else
+ }
+ else
{
InvalidateCommand returnValue = new InvalidateCommand();
returnValue.initialize(cacheSpi, dataContainer, notifier);
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/factories/EmptyConstructorFactory.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/factories/EmptyConstructorFactory.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/factories/EmptyConstructorFactory.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -1,6 +1,6 @@
package org.jboss.cache.factories;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.RegionManager;
import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
import org.jboss.cache.config.ConfigurationException;
@@ -11,7 +11,7 @@
import org.jboss.cache.lock.LockStrategyFactory;
import org.jboss.cache.marshall.Marshaller;
import org.jboss.cache.marshall.VersionAwareMarshaller;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.remoting.jgroups.ChannelMessageListener;
import org.jboss.cache.statetransfer.StateTransferManager;
import org.jboss.cache.transaction.TransactionTable;
@@ -22,9 +22,9 @@
* @author Manik Surtani (<a href="mailto:manik@jboss.org">manik(a)jboss.org</a>)
* @since 2.1.0
*/
-@DefaultFactoryFor(classes = {StateTransferManager.class, RegionManager.class, NotifierImpl.class,
+@DefaultFactoryFor(classes = {StateTransferManager.class, RegionManager.class, Notifier.class,
ChannelMessageListener.class, CacheLoaderManager.class, Marshaller.class, InvocationContextContainer.class,
- CacheInvocationDelegate.class, TransactionTable.class, DataContainerImpl.class, CommandsFactory.class,
+ CacheInvocationDelegate.class, TransactionTable.class, DataContainer.class, CommandsFactory.class,
LockStrategyFactory.class, BuddyFqnTransformer.class})
public class EmptyConstructorFactory extends ComponentFactory
{
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -1,7 +1,7 @@
package org.jboss.cache.interceptors;
import org.jboss.cache.CacheException;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
@@ -29,7 +29,7 @@
import org.jboss.cache.lock.LockManager;
import org.jboss.cache.lock.LockType;
import org.jboss.cache.lock.TimeoutException;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.transaction.TransactionEntry;
import org.jboss.cache.transaction.TransactionTable;
@@ -55,8 +55,8 @@
protected TransactionTable txTable = null;
protected CacheLoader loader;
- protected DataContainerImpl dataContainer;
- protected NotifierImpl notifier;
+ protected DataContainer dataContainer;
+ protected Notifier notifier;
protected boolean isActivation = false;
protected boolean usingOptimisticInvalidation = false;
@@ -71,7 +71,7 @@
@Inject
protected void injectDependencies(TransactionTable txTable, CacheLoaderManager clm, Configuration configuration,
- DataContainerImpl dataContainer, LockManager lockManager, NotifierImpl notifier)
+ DataContainer dataContainer, LockManager lockManager, Notifier notifier)
{
this.txTable = txTable;
this.clm = clm;
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -21,7 +21,7 @@
*/
package org.jboss.cache.interceptors;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.read.GetKeyValueCommand;
import org.jboss.cache.commands.write.EvictCommand;
@@ -52,10 +52,10 @@
private long m_start = System.currentTimeMillis();
private long m_reset = m_start;
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
@Inject
- public void setDependencies(DataContainerImpl dataContainer)
+ public void setDependencies(DataContainer dataContainer)
{
this.dataContainer = dataContainer;
}
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -1,7 +1,7 @@
package org.jboss.cache.interceptors;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.Modification;
@@ -14,7 +14,12 @@
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.commands.write.ClearDataCommand;
-import org.jboss.cache.commands.write.*;
+import org.jboss.cache.commands.write.MoveCommand;
+import org.jboss.cache.commands.write.PutDataMapCommand;
+import org.jboss.cache.commands.write.PutForExternalReadCommand;
+import org.jboss.cache.commands.write.PutKeyValueCommand;
+import org.jboss.cache.commands.write.RemoveKeyCommand;
+import org.jboss.cache.commands.write.RemoveNodeCommand;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.Start;
@@ -49,7 +54,7 @@
private Map<GlobalTransaction, Set<Fqn>> preparingTxs = new ConcurrentHashMap<GlobalTransaction, Set<Fqn>>();
private long cacheStores = 0;
private CacheLoader loader;
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
private CacheLoaderManager loaderManager;
public CacheStoreInterceptor()
@@ -59,7 +64,7 @@
}
@Inject
- protected void init(DataContainerImpl dataContainer, CacheLoaderManager loaderManager, TransactionManager txManager, CacheLoaderConfig clConfig)
+ protected void init(DataContainer dataContainer, CacheLoaderManager loaderManager, TransactionManager txManager, CacheLoaderConfig clConfig)
{
// never inject a CacheLoader at this stage - only a CacheLoaderManager, since the CacheLoaderManager only creates a CacheLoader instance when it @Starts.
this.loaderManager = loaderManager;
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -6,13 +6,23 @@
*/
package org.jboss.cache.interceptors;
-import org.jboss.cache.*;
+import org.jboss.cache.CacheException;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.DataContainer;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.InvocationContext;
import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
import org.jboss.cache.buddyreplication.BuddyManager;
import org.jboss.cache.buddyreplication.GravitateResult;
import org.jboss.cache.commands.DataCommand;
import org.jboss.cache.commands.ReplicableCommand;
-import org.jboss.cache.commands.read.*;
+import org.jboss.cache.commands.read.ExistsCommand;
+import org.jboss.cache.commands.read.GetChildrenNamesCommand;
+import org.jboss.cache.commands.read.GetDataMapCommand;
+import org.jboss.cache.commands.read.GetKeyValueCommand;
+import org.jboss.cache.commands.read.GetKeysCommand;
+import org.jboss.cache.commands.read.GetNodeCommand;
+import org.jboss.cache.commands.read.GravitateDataCommand;
import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
@@ -59,13 +69,13 @@
* cleanup commands corresponding to all gravitate calls made during the course of the transaction in question.
*/
private Map<GlobalTransaction, List<ReplicableCommand>> cleanupCommands = new ConcurrentHashMap<GlobalTransaction, List<ReplicableCommand>>();
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
private CommandsFactory commandsFactory;
private CacheSPI cacheSPI;
private BuddyFqnTransformer buddyFqnTransformer;
@Inject
- public void injectComponents(BuddyManager buddyManager, DataContainerImpl dataContainer, CommandsFactory commandsFactory, CacheSPI cacheSPI, BuddyFqnTransformer transformer)
+ public void injectComponents(BuddyManager buddyManager, DataContainer dataContainer, CommandsFactory commandsFactory, CacheSPI cacheSPI, BuddyFqnTransformer transformer)
{
this.buddyManager = buddyManager;
this.dataContainer = dataContainer;
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -7,7 +7,7 @@
*/
package org.jboss.cache.interceptors;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
@@ -17,7 +17,12 @@
import org.jboss.cache.commands.read.GetKeyValueCommand;
import org.jboss.cache.commands.read.GetNodeCommand;
import org.jboss.cache.commands.write.ClearDataCommand;
-import org.jboss.cache.commands.write.*;
+import org.jboss.cache.commands.write.EvictCommand;
+import org.jboss.cache.commands.write.PutDataMapCommand;
+import org.jboss.cache.commands.write.PutForExternalReadCommand;
+import org.jboss.cache.commands.write.PutKeyValueCommand;
+import org.jboss.cache.commands.write.RemoveKeyCommand;
+import org.jboss.cache.commands.write.RemoveNodeCommand;
import org.jboss.cache.eviction.EvictedEventNode;
import org.jboss.cache.eviction.NodeEventType;
import org.jboss.cache.factories.annotations.Inject;
@@ -36,10 +41,10 @@
{
protected RegionManager regionManager;
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
@Inject
- public void initialize(DataContainerImpl dataContainer)
+ public void initialize(DataContainer dataContainer)
{
this.dataContainer = dataContainer;
}
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/NotificationInterceptor.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/NotificationInterceptor.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/NotificationInterceptor.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -5,7 +5,7 @@
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
/**
* The interceptor in charge of firing off notifications to cache listeners
@@ -15,10 +15,10 @@
*/
public class NotificationInterceptor extends BaseTransactionalContextInterceptor
{
- private NotifierImpl notifier;
+ private Notifier notifier;
@Inject
- public void injectDependencies(NotifierImpl notifier)
+ public void injectDependencies(Notifier notifier)
{
this.notifier = notifier;
}
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/OptimisticCreateIfNotExistsInterceptor.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/OptimisticCreateIfNotExistsInterceptor.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/OptimisticCreateIfNotExistsInterceptor.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -8,7 +8,7 @@
import org.jboss.cache.CacheException;
import org.jboss.cache.CacheSPI;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeFactory;
@@ -46,14 +46,14 @@
*/
private NodeFactory nodeFactory;
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
private CacheSPI cache;
private long lockAcquisitionTimeout;
@Inject
- private void injectDependencies(NodeFactory nodeFactory, DataContainerImpl dataContainer, CacheSPI cacheSPI)
+ private void injectDependencies(NodeFactory nodeFactory, DataContainer dataContainer, CacheSPI cacheSPI)
{
this.nodeFactory = nodeFactory;
this.dataContainer = dataContainer;
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -8,7 +8,7 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.CacheException;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeFactory;
@@ -20,17 +20,17 @@
import org.jboss.cache.commands.read.GetKeyValueCommand;
import org.jboss.cache.commands.read.GetKeysCommand;
import org.jboss.cache.commands.read.GetNodeCommand;
+import org.jboss.cache.commands.write.ClearDataCommand;
import org.jboss.cache.commands.write.MoveCommand;
import org.jboss.cache.commands.write.PutDataMapCommand;
import org.jboss.cache.commands.write.PutForExternalReadCommand;
import org.jboss.cache.commands.write.PutKeyValueCommand;
-import org.jboss.cache.commands.write.ClearDataCommand;
import org.jboss.cache.commands.write.RemoveKeyCommand;
import org.jboss.cache.commands.write.RemoveNodeCommand;
import org.jboss.cache.config.Option;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.Start;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import static org.jboss.cache.notifications.event.NodeModifiedEvent.ModificationType.*;
import org.jboss.cache.optimistic.DataVersion;
import org.jboss.cache.optimistic.DefaultDataVersion;
@@ -56,12 +56,12 @@
* Needed for the creation of workspace nodes based on underlying nodes in the cache.
*/
private NodeFactory nodeFactory;
- private NotifierImpl notifier;
- private DataContainerImpl dataContainer;
+ private Notifier notifier;
+ private DataContainer dataContainer;
private long lockAcquisitionTimeout;
@Inject
- protected void injectDependencies(NotifierImpl notifier, NodeFactory nodeFactory, DataContainerImpl dataContainer)
+ protected void injectDependencies(Notifier notifier, NodeFactory nodeFactory, DataContainer dataContainer)
{
this.notifier = notifier;
this.nodeFactory = nodeFactory;
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/OptimisticValidatorInterceptor.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -6,8 +6,11 @@
*/
package org.jboss.cache.interceptors;
-import org.jboss.cache.DataContainerImpl;
-import org.jboss.cache.*;
+import org.jboss.cache.CacheException;
+import org.jboss.cache.DataContainer;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.InvocationContext;
+import org.jboss.cache.NodeSPI;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
@@ -47,10 +50,10 @@
{
private boolean useTombstones;
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
@Inject
- public void initialize(DataContainerImpl dataContainer)
+ public void initialize(DataContainer dataContainer)
{
this.dataContainer = dataContainer;
}
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -1,6 +1,6 @@
package org.jboss.cache.interceptors;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
@@ -9,7 +9,7 @@
import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.loader.CacheLoaderManager;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import java.util.Collections;
import java.util.HashMap;
@@ -30,11 +30,11 @@
private final AtomicLong passivations = new AtomicLong(0);
protected CacheLoader loader;
- private NotifierImpl notifier;
- private DataContainerImpl dataContainer;
+ private Notifier notifier;
+ private DataContainer dataContainer;
@Inject
- public void setDependencies(NotifierImpl notifier, DataContainerImpl dataContainer, CacheLoaderManager loaderManager)
+ public void setDependencies(Notifier notifier, DataContainer dataContainer, CacheLoaderManager loaderManager)
{
this.notifier = notifier;
this.dataContainer = dataContainer;
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -6,7 +6,7 @@
*/
package org.jboss.cache.interceptors;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
@@ -62,12 +62,12 @@
*/
public class PessimisticLockInterceptor extends PostProcessingCommandInterceptor
{
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
private PessimisticNodeBasedLockManager lockManager;
private CommandsFactory commandsFactory;
@Inject
- public void injectDependencies(DataContainerImpl dataContainer, LockManager lockManager, CommandsFactory commandsFactory)
+ public void injectDependencies(DataContainer dataContainer, LockManager lockManager, CommandsFactory commandsFactory)
{
this.dataContainer = dataContainer;
this.lockManager = (PessimisticNodeBasedLockManager) lockManager;
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -31,7 +31,7 @@
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.invocation.InvocationContextContainer;
import org.jboss.cache.lock.LockManager;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionEntry;
import org.jboss.cache.transaction.TransactionTable;
@@ -63,7 +63,7 @@
{
protected CommandsFactory commandsFactory;
protected RPCManager rpcManager;
- private NotifierImpl notifier;
+ private Notifier notifier;
private InvocationContextContainer invocationContextContainer;
private ComponentRegistry componentRegistry;
@@ -80,7 +80,7 @@
@Inject
public void intialize(RPCManager rpcManager,
- NotifierImpl notifier, InvocationContextContainer icc,
+ Notifier notifier, InvocationContextContainer icc,
CommandsFactory factory, ComponentRegistry componentRegistry, LockManager lockManager)
{
this.commandsFactory = factory;
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -24,7 +24,7 @@
import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.CacheLoaderManager;
import org.jboss.cache.marshall.Marshaller;
-import org.jboss.cache.notifications.NotifierImpl;
+import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.statetransfer.StateTransferManager;
import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionTable;
@@ -52,21 +52,21 @@
// this stuff is needed since the SPI has methods to retrieve these.
private StateTransferManager stateTransferManager;
private CacheLoaderManager cacheLoaderManager;
- private NotifierImpl notifier;
+ private Notifier notifier;
private TransactionManager transactionManager;
private BuddyManager buddyManager;
private TransactionTable transactionTable;
private RPCManager rpcManager;
private RegionManager regionManager;
private Marshaller marshaller;
- private DataContainerImpl dataContainer;
+ private DataContainer dataContainer;
private CommandsFactory commandsFactory;
@Inject
- public void initialize(StateTransferManager stateTransferManager, CacheLoaderManager cacheLoaderManager, NotifierImpl notifier,
+ public void initialize(StateTransferManager stateTransferManager, CacheLoaderManager cacheLoaderManager, Notifier notifier,
TransactionManager transactionManager, BuddyManager buddyManager, TransactionTable transactionTable,
RPCManager rpcManager, RegionManager regionManager, Marshaller marshaller,
- CommandsFactory commandsFactory, DataContainerImpl dataContainer)
+ CommandsFactory commandsFactory, DataContainer dataContainer)
{
this.stateTransferManager = stateTransferManager;
this.cacheLoaderManager = cacheLoaderManager;
@@ -215,7 +215,7 @@
return peek(fqn, false, false) != null;
}
- public NotifierImpl getNotifier()
+ public Notifier getNotifier()
{
return notifier;
}
@@ -560,7 +560,7 @@
return getChildrenNames(Fqn.fromString(fqn));
}
- public DataContainerImpl getDataContainer()
+ public DataContainer getDataContainer()
{
return dataContainer;
}
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/lock/NodeBasedLockManager.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/lock/NodeBasedLockManager.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/lock/NodeBasedLockManager.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -2,7 +2,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.DataContainerImpl;
+import org.jboss.cache.DataContainer;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
@@ -26,11 +26,11 @@
protected Configuration configuration;
protected long lockAcquisitionTimeout;
- protected DataContainerImpl dataContainer;
+ protected DataContainer dataContainer;
protected NodeSPI rootNode;
@Inject
- public void inject(Configuration configuration, DataContainerImpl dataContainer)
+ public void inject(Configuration configuration, DataContainer dataContainer)
{
this.configuration = configuration;
this.dataContainer = dataContainer;
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/notifications/Notifier.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/notifications/Notifier.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/notifications/Notifier.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -2,19 +2,17 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
-import org.jboss.cache.CacheSPI;
import org.jboss.cache.buddyreplication.BuddyGroup;
-import org.jboss.cache.factories.annotations.Start;
-import org.jboss.cache.factories.annotations.Stop;
import org.jboss.cache.notifications.event.NodeModifiedEvent;
import org.jgroups.View;
import javax.transaction.Transaction;
import java.util.Map;
+import java.util.Set;
/**
* Public interface with all allowed notifications.
- *
+ *
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
@@ -33,7 +31,7 @@
/**
* When notifying about node modifications, in many scenarios there is a need of building a new Map object. If no
* listeners are registered for notification then it is pointless building this object - so guard the notification
- * with this call.
+ * with this call.
*/
public boolean shouldNotifyOnNodeModified();
@@ -102,7 +100,36 @@
*/
void notifyTransactionRegistered(Transaction transaction, InvocationContext ctx);
+ /**
+ * Notify that a cache has been blocked
+ *
+ * @param pre
+ */
void notifyCacheBlocked(boolean pre);
+ /**
+ * Notify that a cache has been unblocked
+ *
+ * @param pre
+ */
void notifyCacheUnblocked(boolean pre);
+
+ /**
+ * Adds a cache listener to the list of cache listeners registered.
+ *
+ * @param listener
+ */
+ void addCacheListener(Object listener);
+
+ /**
+ * Removes a cache listener from the list of cache listeners registered.
+ *
+ * @param listener
+ */
+ void removeCacheListener(Object listener);
+
+ /**
+ * @return Retrieves an (unmodifiable) set of cache listeners registered.
+ */
+ Set<Object> getCacheListeners();
}
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/util/CachePrinter.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/util/CachePrinter.java 2008-06-17 23:34:34 UTC (rev 5999)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/util/CachePrinter.java 2008-06-17 23:43:54 UTC (rev 6000)
@@ -23,7 +23,7 @@
public static String printCacheDetails(Cache c)
{
// internal cast
- DataContainerImpl ci = ((CacheInvocationDelegate) c).getDataContainer();
+ DataContainerImpl ci = (DataContainerImpl) ((CacheInvocationDelegate) c).getDataContainer();
return ci.printDetails();
}
@@ -36,7 +36,7 @@
public static String printCacheLockingInfo(Cache c)
{
// internal cast
- DataContainerImpl cd = ((CacheInvocationDelegate) c).getDataContainer();
+ DataContainerImpl cd = (DataContainerImpl) ((CacheInvocationDelegate) c).getDataContainer();
return cd.printLockInfo();
}
16 years, 6 months
JBoss Cache SVN: r5999 - in core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors: base and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-17 19:34:34 -0400 (Tue, 17 Jun 2008)
New Revision: 5999
Modified:
core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/base/PostProcessingCommandInterceptor.java
Log:
Filled in missing visitXXX methods and bad method signatures - applying to 2.2.X branch
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-06-17 23:31:37 UTC (rev 5998)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-06-17 23:34:34 UTC (rev 5999)
@@ -290,7 +290,7 @@
}
@Override
- protected Object handleRemoveDataCommand(InvocationContext ctx, ClearDataCommand command) throws Throwable
+ protected Object handleClearDataCommand(InvocationContext ctx, ClearDataCommand command) throws Throwable
{
lockManager.lockPessimistically(ctx, command.getFqn(), WRITE, false, false, false, false, null, false);
return invokeNextInterceptor(ctx, command);
Modified: core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/base/PostProcessingCommandInterceptor.java
===================================================================
--- core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/base/PostProcessingCommandInterceptor.java 2008-06-17 23:31:37 UTC (rev 5998)
+++ core/branches/2.2.X/src/main/java/org/jboss/cache/interceptors/base/PostProcessingCommandInterceptor.java 2008-06-17 23:34:34 UTC (rev 5999)
@@ -13,15 +13,7 @@
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
-import org.jboss.cache.commands.write.EvictCommand;
-import org.jboss.cache.commands.write.InvalidateCommand;
-import org.jboss.cache.commands.write.MoveCommand;
-import org.jboss.cache.commands.write.PutDataMapCommand;
-import org.jboss.cache.commands.write.PutForExternalReadCommand;
-import org.jboss.cache.commands.write.PutKeyValueCommand;
-import org.jboss.cache.commands.write.ClearDataCommand;
-import org.jboss.cache.commands.write.RemoveKeyCommand;
-import org.jboss.cache.commands.write.RemoveNodeCommand;
+import org.jboss.cache.commands.write.*;
/**
* This interceptor will call {@link #doAfterCall(org.jboss.cache.InvocationContext,org.jboss.cache.commands.VisitableCommand)} after invoking each visit method
@@ -113,11 +105,30 @@
}
@Override
+ public final Object visitCreateNodeCommand(InvocationContext ctx, CreateNodeCommand command) throws Throwable
+ {
+ try
+ {
+ return handleCreateNodeCommand(ctx, command);
+ }
+ finally
+ {
+ doAfterCall(ctx, command);
+ }
+ }
+
+ protected Object handleCreateNodeCommand(InvocationContext ctx, CreateNodeCommand command) throws Throwable
+ {
+ return handleDefault(ctx, command);
+ }
+
+
+ @Override
public final Object visitClearDataCommand(InvocationContext ctx, ClearDataCommand command) throws Throwable
{
try
{
- return handleRemoveDataCommand(ctx, command);
+ return handleClearDataCommand(ctx, command);
}
finally
{
@@ -125,7 +136,7 @@
}
}
- protected Object handleRemoveDataCommand(InvocationContext ctx, ClearDataCommand command) throws Throwable
+ protected Object handleClearDataCommand(InvocationContext ctx, ClearDataCommand command) throws Throwable
{
return handleDefault(ctx, command);
}
16 years, 6 months
JBoss Cache SVN: r5998 - in core/trunk/src/main/java/org/jboss/cache/interceptors: base and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-06-17 19:31:37 -0400 (Tue, 17 Jun 2008)
New Revision: 5998
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/base/PostProcessingCommandInterceptor.java
Log:
Filled in missing visitXXX methods and bad method signatures
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-06-17 17:03:13 UTC (rev 5997)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-06-17 23:31:37 UTC (rev 5998)
@@ -290,7 +290,7 @@
}
@Override
- protected Object handleRemoveDataCommand(InvocationContext ctx, ClearDataCommand command) throws Throwable
+ protected Object handleClearDataCommand(InvocationContext ctx, ClearDataCommand command) throws Throwable
{
lockManager.lockPessimistically(ctx, command.getFqn(), WRITE, false, false, false, false, null, false);
return invokeNextInterceptor(ctx, command);
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/base/PostProcessingCommandInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/base/PostProcessingCommandInterceptor.java 2008-06-17 17:03:13 UTC (rev 5997)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/base/PostProcessingCommandInterceptor.java 2008-06-17 23:31:37 UTC (rev 5998)
@@ -13,15 +13,7 @@
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
-import org.jboss.cache.commands.write.EvictCommand;
-import org.jboss.cache.commands.write.InvalidateCommand;
-import org.jboss.cache.commands.write.MoveCommand;
-import org.jboss.cache.commands.write.PutDataMapCommand;
-import org.jboss.cache.commands.write.PutForExternalReadCommand;
-import org.jboss.cache.commands.write.PutKeyValueCommand;
-import org.jboss.cache.commands.write.ClearDataCommand;
-import org.jboss.cache.commands.write.RemoveKeyCommand;
-import org.jboss.cache.commands.write.RemoveNodeCommand;
+import org.jboss.cache.commands.write.*;
/**
* This interceptor will call {@link #doAfterCall(org.jboss.cache.InvocationContext,org.jboss.cache.commands.VisitableCommand)} after invoking each visit method
@@ -113,11 +105,30 @@
}
@Override
+ public final Object visitCreateNodeCommand(InvocationContext ctx, CreateNodeCommand command) throws Throwable
+ {
+ try
+ {
+ return handleCreateNodeCommand(ctx, command);
+ }
+ finally
+ {
+ doAfterCall(ctx, command);
+ }
+ }
+
+ protected Object handleCreateNodeCommand(InvocationContext ctx, CreateNodeCommand command) throws Throwable
+ {
+ return handleDefault(ctx, command);
+ }
+
+
+ @Override
public final Object visitClearDataCommand(InvocationContext ctx, ClearDataCommand command) throws Throwable
{
try
{
- return handleRemoveDataCommand(ctx, command);
+ return handleClearDataCommand(ctx, command);
}
finally
{
@@ -125,7 +136,7 @@
}
}
- protected Object handleRemoveDataCommand(InvocationContext ctx, ClearDataCommand command) throws Throwable
+ protected Object handleClearDataCommand(InvocationContext ctx, ClearDataCommand command) throws Throwable
{
return handleDefault(ctx, command);
}
16 years, 6 months
JBoss Cache SVN: r5997 - in core/trunk/src: test/java/org/jboss/cache/api and 3 other directories.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-06-17 13:03:13 -0400 (Tue, 17 Jun 2008)
New Revision: 5997
Added:
core/trunk/src/test/java/org/jboss/cache/config/parsing/
core/trunk/src/test/java/org/jboss/cache/config/parsing/CacheLoadersElementParserTest.java
core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java
Removed:
core/trunk/src/test/java/org/jboss/cache/config/XmlConfigurationParserTest.java
Modified:
core/trunk/src/main/java/org/jboss/cache/config/parsing/CacheLoadersElementParser.java
core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java
core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java
Log:
porting existing code to use the new XML parser
Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/CacheLoadersElementParser.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/CacheLoadersElementParser.java 2008-06-17 15:37:59 UTC (rev 5996)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/CacheLoadersElementParser.java 2008-06-17 17:03:13 UTC (rev 5997)
@@ -75,6 +75,11 @@
if (i > 0) result.append(",");
result.append(fqn2preload);
}
+ //no elements defined for preload so by default load the root
+ if (nodesToPreload.getLength() == 0)
+ {
+ result.append("");
+ }
return result.toString();
}
Modified: core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java 2008-06-17 15:37:59 UTC (rev 5996)
+++ core/trunk/src/test/java/org/jboss/cache/api/NodeMoveAPITest.java 2008-06-17 17:03:13 UTC (rev 5997)
@@ -2,17 +2,13 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.CacheSPI;
-import org.jboss.cache.DefaultCacheFactory;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.Node;
-import org.jboss.cache.NodeNotExistsException;
+import org.jboss.cache.*;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.Configuration;
-import org.jboss.cache.config.parsing.XmlConfigurationParserOld;
+import org.jboss.cache.config.parsing.CacheLoadersElementParser;
+import org.jboss.cache.config.parsing.XmlConfigHelper;
import org.jboss.cache.loader.DummyInMemoryCacheLoader;
import org.jboss.cache.util.TestingUtil;
-import org.jboss.cache.config.parsing.XmlConfigHelper;
import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
@@ -288,7 +284,7 @@
{
// cache.stop();
cache.destroy();
- cache.getConfiguration().setCacheLoaderConfig(getSingleCacheLoaderConfig(pasv, "", DummyInMemoryCacheLoader.class.getName(), null, false, false, false, false));
+ cache.getConfiguration().setCacheLoaderConfig(getSingleCacheLoaderConfig(pasv, "/", DummyInMemoryCacheLoader.class.getName(), null, false, false, false, false));
cache.start();
DummyInMemoryCacheLoader loader = (DummyInMemoryCacheLoader) cache.getCacheLoaderManager().getCacheLoader();
@@ -532,19 +528,20 @@
protected CacheLoaderConfig getSingleCacheLoaderConfig(boolean passivation, String preload, String cacheloaderClass, String properties, boolean async, boolean fetchPersistentState, boolean shared, boolean purgeOnStartup) throws Exception
{
- String xml = "<config>\n" +
- "<passivation>" + passivation + "</passivation>\n" +
- "<preload>" + preload + "</preload>\n" +
- "<cacheloader>\n" +
- "<class>" + cacheloaderClass + "</class>\n" +
- "<properties>" + properties + "</properties>\n" +
- "<async>" + async + "</async>\n" +
- "<shared>" + shared + "</shared>\n" +
- "<fetchPersistentState>" + fetchPersistentState + "</fetchPersistentState>\n" +
- "<purgeOnStartup>" + purgeOnStartup + "</purgeOnStartup>\n" +
- "</cacheloader>\n" +
- "</config>";
+ String xml =
+ " <cacheLoaders passivation=\"" + passivation + "\" shared=\"" + shared + "\">\n" +
+ " <preload>\n" +
+ " <node fqn=\"" + preload + "\"/>\n" +
+ " </preload>\n" +
+ " <cacheLoader class=\"" + cacheloaderClass + "\" async=\"" + async + "\" fetchPersistentState=\"" + fetchPersistentState + "\"\n" +
+ " purgeOnStartup=\"" + purgeOnStartup + "\">\n" +
+ " <properties>\n" +
+ properties +
+ " </properties>\n" +
+ " </cacheLoader>\n" +
+ " </cacheLoaders>";
Element element = XmlConfigHelper.stringToElement(xml);
- return XmlConfigurationParserOld.parseCacheLoaderConfig(element);
+ CacheLoadersElementParser elementParser = new CacheLoadersElementParser();
+ return elementParser.parseCacheLoadersElement(element);
}
}
Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java 2008-06-17 15:37:59 UTC (rev 5996)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicationTestsBase.java 2008-06-17 17:03:13 UTC (rev 5997)
@@ -13,7 +13,6 @@
import org.jboss.cache.config.BuddyReplicationConfig;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.Configuration;
-import org.jboss.cache.config.parsing.XmlConfigurationParserOld;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
import org.jboss.cache.loader.CacheLoader;
@@ -21,6 +20,8 @@
import org.jboss.cache.loader.DummyInMemoryCacheLoader;
import org.jboss.cache.util.TestingUtil;
import org.jboss.cache.config.parsing.XmlConfigHelper;
+import org.jboss.cache.config.parsing.CacheLoadersElementParser;
+import org.jboss.cache.config.parsing.XmlConfigurationParserOld;
import org.jgroups.Address;
import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
@@ -224,21 +225,16 @@
{
CacheSPI cache = createCache(1, null, useDataGravitation, removeOnFind, false);
- String cloader = "<config>\n" +
- "<passivation>" + passivation + "</passivation>\n" +
- "<preload></preload>\n" +
-
- "<cacheloader>\n" +
- "<class>" + DummyInMemoryCacheLoader.class.getName() + "</class>\n" +
- "<async>false</async>\n" +
- "<shared>false</shared>\n" +
- "<fetchPersistentState>" + fetchPersistent + "</fetchPersistentState>\n" +
- "</cacheloader>\n" +
- "</config>";
-
- Element element = XmlConfigHelper.stringToElement(cloader);
- CacheLoaderConfig cfg = XmlConfigurationParserOld.parseCacheLoaderConfig(element);
- cache.getConfiguration().setCacheLoaderConfig(cfg);
+ String xmlStr = " " +
+ " <cacheLoaders passivation=\"" + passivation + "\" shared=\"false\">\n" +
+ " <preload/>\n" +
+ " <cacheLoader class=\"" + DummyInMemoryCacheLoader.class.getName() + "\" async=\"false\" fetchPersistentState=\""+ fetchPersistent + "\"/>\n" +
+ " </cacheLoaders>";
+ System.out.println("xmlStr = +\n" + xmlStr);
+ Element xmlEl = XmlConfigHelper.stringToElement(xmlStr);
+ CacheLoadersElementParser parser = new CacheLoadersElementParser();
+ CacheLoaderConfig config = parser.parseCacheLoadersElement(xmlEl);
+ cache.getConfiguration().setCacheLoaderConfig(config);
if (start)
{
cache.start();
Deleted: core/trunk/src/test/java/org/jboss/cache/config/XmlConfigurationParserTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/config/XmlConfigurationParserTest.java 2008-06-17 15:37:59 UTC (rev 5996)
+++ core/trunk/src/test/java/org/jboss/cache/config/XmlConfigurationParserTest.java 2008-06-17 17:03:13 UTC (rev 5997)
@@ -1,226 +0,0 @@
-package org.jboss.cache.config;
-
-import org.jboss.cache.config.parsing.XmlConfigurationParser;
-import org.jboss.cache.eviction.LRUConfiguration;
-import org.jboss.cache.eviction.MRUConfiguration;
-import org.jboss.cache.lock.IsolationLevel;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import java.util.List;
-
-/**
- * @author Mircea.Markus(a)jboss.com
- * @since 3.0
- */
-@Test(groups = "unit")
-public class XmlConfigurationParserTest
-{
- Configuration config;
-
- @BeforeMethod
- public void setUp()
- {
- XmlConfigurationParser parser = new XmlConfigurationParser();
- config = parser.parseFile("META-INF/conf-test/parser-test-file-3.x.xml");
- }
-
- public void testTransactionManagerLookupClass()
- {
- assert config.getTransactionManagerLookupClass().equals("org.jboss.cache.transaction.GenericTransactionManagerLookup");
- }
-
- public void testIsolationLevel()
- {
- assert config.getIsolationLevel().equals(IsolationLevel.REPEATABLE_READ);
- }
-
- public void testCacheMode()
- {
- assert config.getCacheMode().equals(Configuration.CacheMode.REPL_SYNC);
- }
-
- public void testUseReplQueue()
- {
- assert !config.isUseReplQueue();
- }
-
- public void testClusterName()
- {
- assert config.getClusterName().equals("JBossCache-Cluster");
- }
-
- public void testGetClusterConfig()
- {
- assert config.getClusterConfig().indexOf("MERGE2") >= 0;
- }
-
- public void testFetchInMemoryState()
- {
- assert config.isFetchInMemoryState();
- }
-
- public void testStateRetrievalTimeout()
- {
- assert config.getStateRetrievalTimeout() == 15124;
- }
-
- public void testSyncReplTimeout()
- {
- assert config.getSyncReplTimeout() == 15421;
- }
-
- public void testLockAcquisitionTimeout()
- {
- assert config.getLockAcquisitionTimeout() == 10234;
- }
-
- public void testUseLazyDeserialization()
- {
- assert config.isUseLazyDeserialization();
- }
-
- public void testObjectInputStreamPoolSize()
- {
- assert 12 == config.getObjectInputStreamPoolSize();
- }
-
- public void testObjectOutputStreamPoolSize()
- {
- assert 14 == config.getObjectOutputStreamPoolSize();
- }
-
- public void testShutdownHookBehavior()
- {
- assert Configuration.ShutdownHookBehavior.REGISTER == config.getShutdownHookBehavior();
- }
-
- public void testSyncRollbackPhase()
- {
- assert config.isSyncRollbackPhase();
- }
-
- public void testSyncCommitPhase()
- {
- assert config.isSyncCommitPhase();
- }
-
- public void testUseReplicationVersion()
- {
- assert config.getReplicationVersion() == 124;
- }
-
- public void testGetMultiplexerStack()
- {
- assert "file_name".equals(config.getMultiplexerStack());
- }
-
- public void testMarshallerClass()
- {
- assert "some.Clazz".equals(config.getMarshallerClass());
- }
-
- public void testLockParentForChildInsertRemove()
- {
- assert config.isLockParentForChildInsertRemove();
- }
-
- public void testInactiveOnStartup()
- {
- assert config.isInactiveOnStartup();
- }
-
- public void testExposeManagementStatistics()
- {
- assert !config.getExposeManagementStatistics();
- }
-
- public void testCacheLoaderConfiguration()
- {
- CacheLoaderConfig clc = config.getCacheLoaderConfig();
- assert null != clc;
- assert clc.isPassivation();
- assert clc.isShared();
- assert "/a/b/c,/f/r/s".equals(clc.getPreload());
- CacheLoaderConfig.IndividualCacheLoaderConfig first = clc.getFirstCacheLoaderConfig();
- assert "org.jboss.cache.loader.JDBCCacheLoader".equals(first.getClassName());
- assert first.isAsync();
- assert first.isFetchPersistentState();
- assert first.isIgnoreModifications();
- assert first.isPurgeOnStartup();
- assert first.getProperties().get("cache.jdbc.table.name").equals("jbosscache");
- assert first.getProperties().get("cache.jdbc.table.create").equals("true");
- assert first.getProperties().get("cache.jdbc.table.drop").equals("true");
- }
-
- public void testBuddyReplicationConfig()
- {
- BuddyReplicationConfig brConfig = config.getBuddyReplicationConfig();
- assert brConfig.isEnabled();
- BuddyReplicationConfig.BuddyLocatorConfig locatorConfig = brConfig.getBuddyLocatorConfig();
- assert "org.jboss.cache.buddyreplication.NextMemberBuddyLocator".equals(locatorConfig.getBuddyLocatorClass());
- assert locatorConfig.getBuddyLocatorProperties().get("numBuddies").equals("1");
- assert locatorConfig.getBuddyLocatorProperties().get("ignoreColocatedBuddies").equals("true");
- assert brConfig.getBuddyPoolName().equals("myBuddyPoolReplicationGroup");
- assert brConfig.getBuddyCommunicationTimeout() == 2000;
- assert brConfig.isAutoDataGravitation();
- assert brConfig.isDataGravitationRemoveOnFind();
- assert brConfig.isDataGravitationSearchBackupTrees();
- }
-
- public void testUseRegionBasedMarshalling()
- {
- assert config.isUseRegionBasedMarshalling();
- }
-
- public void testEvictionPolicyConfig()
- {
- EvictionConfig evictionConfig = config.getEvictionConfig();
- assert "org.jboss.cache.eviction.LRUPolicy".equals(evictionConfig.getDefaultEvictionPolicyClass());
- assert 200000 == evictionConfig.getDefaultEventQueueSize();
- assert 5 == evictionConfig.getWakeupIntervalSeconds();
-
- List<EvictionRegionConfig> regionConfigs = evictionConfig.getEvictionRegionConfigs();
- assert regionConfigs.size() == 3;
-
- EvictionRegionConfig first = regionConfigs.get(0);
- assert first.getRegionName().equals("/_default_");
- assert first.getEvictionPolicyConfig() instanceof LRUConfiguration;
- LRUConfiguration firstConfiguration = (LRUConfiguration) first.getEvictionPolicyConfig();
- assert firstConfiguration.getMaxAge() <= 0;
- assert firstConfiguration.getTimeToLive() == 1000;
- assert firstConfiguration.getMaxNodes() == 5000;
-
- EvictionRegionConfig second = regionConfigs.get(1);
- LRUConfiguration secondConfiguration = (LRUConfiguration) second.getEvictionPolicyConfig();
- assert secondConfiguration.getMaxAge() == 0;
- assert secondConfiguration.getTimeToLive() == 1002;
- assert secondConfiguration.getMaxNodes() == 0;
-
- EvictionRegionConfig third = regionConfigs.get(2);
- MRUConfiguration thirdConfiguration = (MRUConfiguration) third.getEvictionPolicyConfig();
- assert thirdConfiguration.getMaxNodes() == 2103;
- assert thirdConfiguration.getMinTimeToLive() == 22;
- assert third.getEventQueueSize() == 21;
- }
-
- public void testCustomInterceptors()
- {
- List<CustomInterceptorConfig> interceptorConfigs = config.getCustomInterceptors();
- if (interceptorConfigs.isEmpty()) return; //todo drop this once you drop the old configuration
- assert interceptorConfigs.size() == 5;
- assert interceptorConfigs.get(0).getInterceptorClass().equals("com.myCompany.MyInterceptor1");
- assert interceptorConfigs.get(1).getInterceptorClass().equals("com.myCompany.MyInterceptor2");
- assert interceptorConfigs.get(2).getInterceptorClass().equals("com.myCompany.MyInterceptor3");
- assert interceptorConfigs.get(3).getInterceptorClass().equals("com.myCompany.MyInterceptor4");
- assert interceptorConfigs.get(4).getInterceptorClass().equals("com.myCompany.MyInterceptor5");
- assert interceptorConfigs.get(0).isFirst();
- assert !interceptorConfigs.get(0).isLast();
- assert interceptorConfigs.get(0).getProperties().get("x").equals("y");
- assert interceptorConfigs.get(0).getProperties().get("i").equals("10");
- assert interceptorConfigs.get(1).isLast();
- assert interceptorConfigs.get(2).getIndex() == 3;
- assert interceptorConfigs.get(3).getBeforeClass().equals("org.jboss.cache.interceptors.CallInterceptor");
- assert interceptorConfigs.get(4).getAfterClass().equals("org.jboss.cache.interceptors.CallInterceptor");
- }
-}
Added: core/trunk/src/test/java/org/jboss/cache/config/parsing/CacheLoadersElementParserTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/config/parsing/CacheLoadersElementParserTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/config/parsing/CacheLoadersElementParserTest.java 2008-06-17 17:03:13 UTC (rev 5997)
@@ -0,0 +1,64 @@
+package org.jboss.cache.config.parsing;
+
+import org.testng.annotations.Test;
+import org.w3c.dom.Element;
+import org.jboss.cache.config.CacheLoaderConfig;
+
+/**
+ * Tester class for {@link CacheLoadersElementParser}
+ *
+ * @author Mircea.Markus(a)jboss.com
+ * @since 3.0
+ */
+@Test(groups = "unit")
+public class CacheLoadersElementParserTest
+{
+ CacheLoadersElementParser parser = new CacheLoadersElementParser();
+
+
+ public void simpleParse() throws Exception
+ {
+
+ String xmlStr = " " +
+ " <cacheLoaders passivation=\"false\" shared=\"false\">\n" +
+ " <preload>\n" +
+ " <node fqn=\"/\"/>\n" +
+ " </preload>\n" +
+ " <cacheLoader class=\"org.jboss.cache.loader.JDBCCacheLoader\" async=\"true\" fetchPersistentState=\"false\"\n" +
+ " ignoreModifications=\"false\" purgeOnStartup=\"false\">\n" +
+ " <properties>\n" +
+ " cache.jdbc.table.name=jbosscache\n" +
+ " cache.jdbc.table.create=true\n" +
+ " cache.jdbc.table.drop=true\n" +
+ " </properties>\n" +
+ " </cacheLoader>\n" +
+ " </cacheLoaders>";
+ Element element = XmlConfigHelper.stringToElement(xmlStr);
+ CacheLoaderConfig config = parser.parseCacheLoadersElement(element);
+ assert !config.isPassivation();
+ assert !config.isShared();
+ assert config.getPreload().equals("/");
+ assert config.getFirstCacheLoaderConfig().getClassName().equals("org.jboss.cache.loader.JDBCCacheLoader");
+ assert config.getFirstCacheLoaderConfig().isAsync();
+ assert !config.getFirstCacheLoaderConfig().isFetchPersistentState();
+ assert !config.getFirstCacheLoaderConfig().isIgnoreModifications();
+ assert !config.getFirstCacheLoaderConfig().isPurgeOnStartup();
+ }
+
+ /**
+ * If so an empty preload string should apear.
+ */
+ public void testMissingPreloadNodes() throws Exception
+ {
+ String xmlStr = " " +
+ " <cacheLoaders passivation=\"false\" shared=\"false\">\n" +
+ " <preload/>\n" +
+ " <cacheLoader class=\"org.jboss.cache.loader.JDBCCacheLoader\" async=\"true\" fetchPersistentState=\"false\"\n" +
+ " ignoreModifications=\"false\" purgeOnStartup=\"false\"/>\n" +
+ " </cacheLoaders>";
+ Element element = XmlConfigHelper.stringToElement(xmlStr);
+ CacheLoaderConfig config = parser.parseCacheLoadersElement(element);
+ assert config.getPreload().length() == 0;
+ }
+
+}
Copied: core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java (from rev 5995, core/trunk/src/test/java/org/jboss/cache/config/XmlConfigurationParserTest.java)
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfigurationParserTest.java 2008-06-17 17:03:13 UTC (rev 5997)
@@ -0,0 +1,227 @@
+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;
+import org.jboss.cache.lock.IsolationLevel;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import java.util.List;
+
+/**
+ * @author Mircea.Markus(a)jboss.com
+ * @since 3.0
+ */
+@Test(groups = "unit")
+public class XmlConfigurationParserTest
+{
+ Configuration config;
+
+ @BeforeMethod
+ public void setUp()
+ {
+ XmlConfigurationParser parser = new XmlConfigurationParser();
+ config = parser.parseFile("META-INF/conf-test/parser-test-file-3.x.xml");
+ }
+
+ public void testTransactionManagerLookupClass()
+ {
+ assert config.getTransactionManagerLookupClass().equals("org.jboss.cache.transaction.GenericTransactionManagerLookup");
+ }
+
+ public void testIsolationLevel()
+ {
+ assert config.getIsolationLevel().equals(IsolationLevel.REPEATABLE_READ);
+ }
+
+ public void testCacheMode()
+ {
+ assert config.getCacheMode().equals(Configuration.CacheMode.REPL_SYNC);
+ }
+
+ public void testUseReplQueue()
+ {
+ assert !config.isUseReplQueue();
+ }
+
+ public void testClusterName()
+ {
+ assert config.getClusterName().equals("JBossCache-Cluster");
+ }
+
+ public void testGetClusterConfig()
+ {
+ assert config.getClusterConfig().indexOf("MERGE2") >= 0;
+ }
+
+ public void testFetchInMemoryState()
+ {
+ assert config.isFetchInMemoryState();
+ }
+
+ public void testStateRetrievalTimeout()
+ {
+ assert config.getStateRetrievalTimeout() == 15124;
+ }
+
+ public void testSyncReplTimeout()
+ {
+ assert config.getSyncReplTimeout() == 15421;
+ }
+
+ public void testLockAcquisitionTimeout()
+ {
+ assert config.getLockAcquisitionTimeout() == 10234;
+ }
+
+ public void testUseLazyDeserialization()
+ {
+ assert config.isUseLazyDeserialization();
+ }
+
+ public void testObjectInputStreamPoolSize()
+ {
+ assert 12 == config.getObjectInputStreamPoolSize();
+ }
+
+ public void testObjectOutputStreamPoolSize()
+ {
+ assert 14 == config.getObjectOutputStreamPoolSize();
+ }
+
+ public void testShutdownHookBehavior()
+ {
+ assert Configuration.ShutdownHookBehavior.REGISTER == config.getShutdownHookBehavior();
+ }
+
+ public void testSyncRollbackPhase()
+ {
+ assert config.isSyncRollbackPhase();
+ }
+
+ public void testSyncCommitPhase()
+ {
+ assert config.isSyncCommitPhase();
+ }
+
+ public void testUseReplicationVersion()
+ {
+ assert config.getReplicationVersion() == 124;
+ }
+
+ public void testGetMultiplexerStack()
+ {
+ assert "file_name".equals(config.getMultiplexerStack());
+ }
+
+ public void testMarshallerClass()
+ {
+ assert "some.Clazz".equals(config.getMarshallerClass());
+ }
+
+ public void testLockParentForChildInsertRemove()
+ {
+ assert config.isLockParentForChildInsertRemove();
+ }
+
+ public void testInactiveOnStartup()
+ {
+ assert config.isInactiveOnStartup();
+ }
+
+ public void testExposeManagementStatistics()
+ {
+ assert !config.getExposeManagementStatistics();
+ }
+
+ public void testCacheLoaderConfiguration()
+ {
+ CacheLoaderConfig clc = config.getCacheLoaderConfig();
+ assert null != clc;
+ assert clc.isPassivation();
+ assert clc.isShared();
+ assert "/a/b/c,/f/r/s".equals(clc.getPreload());
+ CacheLoaderConfig.IndividualCacheLoaderConfig first = clc.getFirstCacheLoaderConfig();
+ assert "org.jboss.cache.loader.JDBCCacheLoader".equals(first.getClassName());
+ assert first.isAsync();
+ assert first.isFetchPersistentState();
+ assert first.isIgnoreModifications();
+ assert first.isPurgeOnStartup();
+ assert first.getProperties().get("cache.jdbc.table.name").equals("jbosscache");
+ assert first.getProperties().get("cache.jdbc.table.create").equals("true");
+ assert first.getProperties().get("cache.jdbc.table.drop").equals("true");
+ }
+
+ public void testBuddyReplicationConfig()
+ {
+ BuddyReplicationConfig brConfig = config.getBuddyReplicationConfig();
+ assert brConfig.isEnabled();
+ BuddyReplicationConfig.BuddyLocatorConfig locatorConfig = brConfig.getBuddyLocatorConfig();
+ assert "org.jboss.cache.buddyreplication.NextMemberBuddyLocator".equals(locatorConfig.getBuddyLocatorClass());
+ assert locatorConfig.getBuddyLocatorProperties().get("numBuddies").equals("1");
+ assert locatorConfig.getBuddyLocatorProperties().get("ignoreColocatedBuddies").equals("true");
+ assert brConfig.getBuddyPoolName().equals("myBuddyPoolReplicationGroup");
+ assert brConfig.getBuddyCommunicationTimeout() == 2000;
+ assert brConfig.isAutoDataGravitation();
+ assert brConfig.isDataGravitationRemoveOnFind();
+ assert brConfig.isDataGravitationSearchBackupTrees();
+ }
+
+ public void testUseRegionBasedMarshalling()
+ {
+ assert config.isUseRegionBasedMarshalling();
+ }
+
+ public void testEvictionPolicyConfig()
+ {
+ EvictionConfig evictionConfig = config.getEvictionConfig();
+ assert "org.jboss.cache.eviction.LRUPolicy".equals(evictionConfig.getDefaultEvictionPolicyClass());
+ assert 200000 == evictionConfig.getDefaultEventQueueSize();
+ assert 5 == evictionConfig.getWakeupIntervalSeconds();
+
+ List<EvictionRegionConfig> regionConfigs = evictionConfig.getEvictionRegionConfigs();
+ assert regionConfigs.size() == 3;
+
+ EvictionRegionConfig first = regionConfigs.get(0);
+ assert first.getRegionName().equals("/_default_");
+ assert first.getEvictionPolicyConfig() instanceof LRUConfiguration;
+ LRUConfiguration firstConfiguration = (LRUConfiguration) first.getEvictionPolicyConfig();
+ assert firstConfiguration.getMaxAge() <= 0;
+ assert firstConfiguration.getTimeToLive() == 1000;
+ assert firstConfiguration.getMaxNodes() == 5000;
+
+ EvictionRegionConfig second = regionConfigs.get(1);
+ LRUConfiguration secondConfiguration = (LRUConfiguration) second.getEvictionPolicyConfig();
+ assert secondConfiguration.getMaxAge() == 0;
+ assert secondConfiguration.getTimeToLive() == 1002;
+ assert secondConfiguration.getMaxNodes() == 0;
+
+ EvictionRegionConfig third = regionConfigs.get(2);
+ MRUConfiguration thirdConfiguration = (MRUConfiguration) third.getEvictionPolicyConfig();
+ assert thirdConfiguration.getMaxNodes() == 2103;
+ assert thirdConfiguration.getMinTimeToLive() == 22;
+ assert third.getEventQueueSize() == 21;
+ }
+
+ public void testCustomInterceptors()
+ {
+ List<CustomInterceptorConfig> interceptorConfigs = config.getCustomInterceptors();
+ if (interceptorConfigs.isEmpty()) return; //todo drop this once you drop the old configuration
+ assert interceptorConfigs.size() == 5;
+ assert interceptorConfigs.get(0).getInterceptorClass().equals("com.myCompany.MyInterceptor1");
+ assert interceptorConfigs.get(1).getInterceptorClass().equals("com.myCompany.MyInterceptor2");
+ assert interceptorConfigs.get(2).getInterceptorClass().equals("com.myCompany.MyInterceptor3");
+ assert interceptorConfigs.get(3).getInterceptorClass().equals("com.myCompany.MyInterceptor4");
+ assert interceptorConfigs.get(4).getInterceptorClass().equals("com.myCompany.MyInterceptor5");
+ assert interceptorConfigs.get(0).isFirst();
+ assert !interceptorConfigs.get(0).isLast();
+ assert interceptorConfigs.get(0).getProperties().get("x").equals("y");
+ assert interceptorConfigs.get(0).getProperties().get("i").equals("10");
+ assert interceptorConfigs.get(1).isLast();
+ assert interceptorConfigs.get(2).getIndex() == 3;
+ assert interceptorConfigs.get(3).getBeforeClass().equals("org.jboss.cache.interceptors.CallInterceptor");
+ assert interceptorConfigs.get(4).getAfterClass().equals("org.jboss.cache.interceptors.CallInterceptor");
+ }
+}
16 years, 6 months
JBoss Cache SVN: r5996 - core/trunk/src/main/java/org/jboss/cache.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-06-17 11:37:59 -0400 (Tue, 17 Jun 2008)
New Revision: 5996
Modified:
core/trunk/src/main/java/org/jboss/cache/CacheStatus.java
core/trunk/src/main/java/org/jboss/cache/FqnComparator.java
core/trunk/src/main/java/org/jboss/cache/NodeFactory.java
core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
core/trunk/src/main/java/org/jboss/cache/RegionImpl.java
core/trunk/src/main/java/org/jboss/cache/StringFqn.java
core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java
core/trunk/src/main/java/org/jboss/cache/VersionedNode.java
Log:
find bugs fixes
Modified: core/trunk/src/main/java/org/jboss/cache/CacheStatus.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/CacheStatus.java 2008-06-17 15:36:31 UTC (rev 5995)
+++ core/trunk/src/main/java/org/jboss/cache/CacheStatus.java 2008-06-17 15:37:59 UTC (rev 5996)
@@ -92,16 +92,10 @@
case STARTING:
case STARTED:
case STOPPED:
- log.debug("Ignoring call to create() as current state is " + this);
- // fall through
case FAILED:
- return false;
case STOPPING:
case DESTROYING:
- log.warn("Ignoring call to create() while cache is " + this);
return false;
- case INSTANTIATED:
- case DESTROYED:
default:
return true;
}
@@ -127,16 +121,10 @@
case DESTROYED:
case STARTING:
case STARTED:
- log.debug("Ignoring call to start() as current state is " + this);
- // fall through
case FAILED:
- return false;
case STOPPING:
case DESTROYING:
- log.warn("Ignoring call to start() as current state is " + this);
return false;
- case CREATED:
- case STOPPED:
default:
return true;
}
Modified: core/trunk/src/main/java/org/jboss/cache/FqnComparator.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/FqnComparator.java 2008-06-17 15:36:31 UTC (rev 5995)
+++ core/trunk/src/main/java/org/jboss/cache/FqnComparator.java 2008-06-17 15:37:59 UTC (rev 5996)
@@ -9,6 +9,7 @@
import net.jcip.annotations.Immutable;
import java.util.Comparator;
+import java.io.Serializable;
/**
* Compares the order of two FQN.
@@ -23,7 +24,7 @@
* @author Steve Woodcock (<a href="mailto:stevew@jofti.com">stevew(a)jofti.com</a>)
*/
@Immutable
-public class FqnComparator implements Comparator<Fqn>
+public class FqnComparator implements Comparator<Fqn>, Serializable
{
public static final FqnComparator INSTANCE = new FqnComparator();
Modified: core/trunk/src/main/java/org/jboss/cache/NodeFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/NodeFactory.java 2008-06-17 15:36:31 UTC (rev 5995)
+++ core/trunk/src/main/java/org/jboss/cache/NodeFactory.java 2008-06-17 15:37:59 UTC (rev 5996)
@@ -61,7 +61,7 @@
}
@Inject
- private void injectDependencies(CacheSPI<K, V> cache, Configuration configuration,
+ public void injectDependencies(CacheSPI<K, V> cache, Configuration configuration,
InvocationContextContainer invocationContextContainer,
InterceptorChain interceptorChain, CommandsFactory commandsFactory, LockStrategyFactory lockStrategyFactory)
{
@@ -98,7 +98,7 @@
*/
public NodeSPI<K, V> createDataNode(Object childName, Fqn fqn, NodeSPI<K, V> parent, Map<K, V> data, boolean mapSafe)
{
- UnversionedNode un = optimistic ? new VersionedNode<K, V>(fqn, parent, data, cache) : new UnversionedNode<K, V>(childName, fqn, data, mapSafe, cache);
+ UnversionedNode un = optimistic ? new VersionedNode<K, V>(fqn, parent, data, cache) : new UnversionedNode<K, V>(childName, fqn, data, cache);
// always assume that new nodes do not have data loaded
un.setDataLoaded(false);
NodeInvocationDelegate<K, V> nid = new NodeInvocationDelegate(un);
Modified: core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java 2008-06-17 15:36:31 UTC (rev 5995)
+++ core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java 2008-06-17 15:37:59 UTC (rev 5996)
@@ -97,7 +97,7 @@
private LockManager lockManager;
@Inject
- private void setupDependencies(ChannelMessageListener messageListener, Configuration configuration, NotifierImpl notifier,
+ public void setupDependencies(ChannelMessageListener messageListener, Configuration configuration, NotifierImpl notifier,
CacheSPI spi, Marshaller marshaller, TransactionTable txTable,
TransactionManager txManager, InvocationContextContainer container, InterceptorChain interceptorChain,
ComponentRegistry componentRegistry, LockManager lockManager)
Modified: core/trunk/src/main/java/org/jboss/cache/RegionImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RegionImpl.java 2008-06-17 15:36:31 UTC (rev 5995)
+++ core/trunk/src/main/java/org/jboss/cache/RegionImpl.java 2008-06-17 15:37:59 UTC (rev 5996)
@@ -218,7 +218,7 @@
nodeEventQueue.clear();
}
- private synchronized void createQueue()
+ private void createQueue()
{
if (nodeEventQueue == null)
{
@@ -275,7 +275,7 @@
catch (Exception e)
{
log.fatal("Unable to instantiate eviction policy class " + className, e);
- return null;
+ throw new IllegalStateException(e);
}
}
Modified: core/trunk/src/main/java/org/jboss/cache/StringFqn.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/StringFqn.java 2008-06-17 15:36:31 UTC (rev 5995)
+++ core/trunk/src/main/java/org/jboss/cache/StringFqn.java 2008-06-17 15:37:59 UTC (rev 5996)
@@ -88,6 +88,7 @@
}
@Override
+ @SuppressWarnings(value = "unchecked")
public boolean isChildOrEquals(Fqn parentFqn)
{
if (parentFqn.getClass().equals(StringFqn.class))
Modified: core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java 2008-06-17 15:36:31 UTC (rev 5995)
+++ core/trunk/src/main/java/org/jboss/cache/UnversionedNode.java 2008-06-17 15:37:59 UTC (rev 5996)
@@ -37,7 +37,7 @@
/**
* Debug log.
*/
- protected static Log log = LogFactory.getLog(UnversionedNode.class);
+ static Log log = LogFactory.getLog(UnversionedNode.class);
protected static final boolean trace = log.isTraceEnabled();
/**
@@ -72,19 +72,16 @@
/**
* Constructs a new node with a name, etc.
*
- * @param mapSafe <code>true</code> if param <code>data</code> can safely be directly assigned to this object's
- * {@link #data} field; <code>false</code> if param <code>data</code>'s contents should be copied into
- * this object's {@link #data} field.
*/
- protected UnversionedNode(Object child_name, Fqn fqn, Map data, boolean mapSafe, CacheSPI cache)
+ protected UnversionedNode(Object childName, Fqn fqn, Map data, CacheSPI cache)
{
if (cache == null)
{
throw new IllegalArgumentException("no cache init for " + fqn);
}
- if (!fqn.isRoot() && !child_name.equals(fqn.getLastElement()))
+ if (!fqn.isRoot() && !childName.equals(fqn.getLastElement()))
{
- throw new IllegalArgumentException("Child " + child_name + " must be last part of " + fqn);
+ throw new IllegalArgumentException("Child " + childName + " must be last part of " + fqn);
}
initFlags();
Modified: core/trunk/src/main/java/org/jboss/cache/VersionedNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/VersionedNode.java 2008-06-17 15:36:31 UTC (rev 5995)
+++ core/trunk/src/main/java/org/jboss/cache/VersionedNode.java 2008-06-17 15:37:59 UTC (rev 5996)
@@ -27,7 +27,11 @@
public class VersionedNode<K, V> extends UnversionedNode<K, V>
{
private static final String DATA_VERSION_INTERNAL_KEY = "_JBOSS_INTERNAL_OPTIMISTIC_DATA_VERSION";
- private DataVersion version; // make sure this is NOT initialized to anything, even a null! Since the UnversionedNode constructor may set this value based on a data version passed along in the data map.
+ private DataVersion version; // make sure this is NOT initialized to anything, even a null! Since the UnversionedNode constructor may set this value based on a data version passed along in the data map.
+ static
+ {
+ log = LogFactory.getLog(VersionedNode.class);
+ }
/**
* Although this object has a reference to the CacheImpl, the optimistic
@@ -38,12 +42,10 @@
protected VersionedNode(Fqn fqn, NodeSPI<K, V> parent, Map<K, V> data, CacheSPI<K, V> cache)
{
- super(fqn.getLastElement(), fqn, data, false, cache);
+ super(fqn.getLastElement(), fqn, data, cache);
+ if (parent == null && !fqn.isRoot()) throw new NullPointerException("parent");
if (version == null) version = DefaultDataVersion.ZERO;
- if (parent == null && !fqn.isRoot()) throw new NullPointerException("parent");
this.parent = parent;
-
- log = LogFactory.getLog(VersionedNode.class);
}
/**
16 years, 6 months