Author: manik.surtani(a)jboss.com
Date: 2009-01-30 11:48:58 -0500 (Fri, 30 Jan 2009)
New Revision: 7616
Removed:
core/branches/flat/src/main/java/org/horizon/marshall/NodeData.java
core/branches/flat/src/main/java/org/horizon/marshall/NodeDataExceptionMarker.java
core/branches/flat/src/main/java/org/horizon/marshall/NodeDataMarker.java
core/branches/flat/src/main/java/org/horizon/util/concurrent/SelfInitializingConcurrentHashMap.java
Modified:
core/branches/flat/src/main/java/org/horizon/loader/AbstractCacheLoader.java
core/branches/flat/src/main/java/org/horizon/loader/Modification.java
core/branches/flat/src/main/java/org/horizon/loader/SingletonStoreCacheLoader.java
core/branches/flat/src/main/java/org/horizon/lock/LockManager.java
core/branches/flat/src/main/java/org/horizon/marshall/EntryData.java
core/branches/flat/src/main/java/org/horizon/marshall/EntryDataExceptionMarker.java
core/branches/flat/src/main/java/org/horizon/notifications/CacheNotifier.java
core/branches/flat/src/main/java/org/horizon/notifications/CacheNotifierImpl.java
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryActivated.java
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryCreated.java
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryEvicted.java
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryInvalidated.java
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryLoaded.java
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryModified.java
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryPassivated.java
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryRemoved.java
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryVisited.java
core/branches/flat/src/main/java/org/horizon/notifications/annotation/Listener.java
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryActivatedEvent.java
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryCreatedEvent.java
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryEvent.java
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryEvictedEvent.java
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryLoadedEvent.java
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryModifiedEvent.java
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryPassivatedEvent.java
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryRemovedEvent.java
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryVisitedEvent.java
core/branches/flat/src/main/java/org/horizon/notifications/event/Event.java
core/branches/flat/src/main/java/org/horizon/statetransfer/DefaultStateTransferManager.java
core/branches/flat/src/main/java/org/horizon/transaction/GlobalTransaction.java
core/branches/flat/src/main/resources/cache-jdbc.properties
core/branches/flat/src/main/resources/config-samples/all.xml
core/branches/flat/src/test/java/org/horizon/api/mvcc/LockAssert.java
core/branches/flat/src/test/java/org/horizon/api/mvcc/LockTestBase.java
core/branches/flat/src/test/java/org/horizon/api/mvcc/PutForExternalReadTest.java
core/branches/flat/src/test/java/org/horizon/profiling/ProfileTest.java
core/branches/flat/src/test/java/org/horizon/replication/SyncCacheListenerTest.java
core/branches/flat/src/test/resources/cache-jdbc.properties
Log:
Javadocs, comments, variable names
Modified: core/branches/flat/src/main/java/org/horizon/loader/AbstractCacheLoader.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/loader/AbstractCacheLoader.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/loader/AbstractCacheLoader.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -77,7 +77,7 @@
}
if (objectFromStream instanceof EntryDataExceptionMarker) {
EntryDataExceptionMarker ndem = (EntryDataExceptionMarker) objectFromStream;
- throw new CacheException("State provider cacheloader at node " +
ndem.getCacheNodeIdentity()
+ throw new CacheException("State provider cacheloader at node " +
ndem.getKey()
+ " threw exception during loadState (see Caused by)",
ndem.getCause());
}
Modified: core/branches/flat/src/main/java/org/horizon/loader/Modification.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/loader/Modification.java 2009-01-30
14:22:32 UTC (rev 7615)
+++ core/branches/flat/src/main/java/org/horizon/loader/Modification.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -26,11 +26,8 @@
/**
- * Represents a modification in the cache. Contains the nature of the modification (e.g.
PUT, REMOVE), the fqn of the
- * node, the new value and the previous value. A list of modifications will be sent to
all nodes in a cluster when a
- * transaction has been committed (PREPARE phase). A Modification is also used to roll
back changes, e.g. since we know
- * the previous value, we can reconstruct the previous state by applying the changes in a
modification listin reverse
- * order.
+ * Represents a modification in the cache. Contains the nature of the modification (e.g.
PUT, REMOVE), the entry's key,
+ * the new value and the previous value.
*
* @author <a href="mailto:bela@jboss.org">Bela Ban</a> Apr 12,
2003
* @since 1.0
Modified:
core/branches/flat/src/main/java/org/horizon/loader/SingletonStoreCacheLoader.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/loader/SingletonStoreCacheLoader.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/loader/SingletonStoreCacheLoader.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -47,10 +47,10 @@
import java.util.concurrent.TimeoutException;
/**
- * SingletonStoreCacheLoader is a delegating cache loader used for situations when only
one node should interact with
- * the underlying store. The coordinator of the cluster will be responsible for the
underlying CacheLoader.
- * SingletonStoreCacheLoader is a simply facade to a real CacheLoader implementation. It
always delegates reads to the
- * real CacheLoader.
+ * SingletonStoreCacheLoader is a delegating cache loader used for situations when only
one cache instance should
+ * interact with the underlying store. The coordinator of the cluster will be responsible
for the underlying
+ * CacheLoader. SingletonStoreCacheLoader is a simply facade to a real CacheLoader
implementation. It always delegates
+ * reads to the real CacheLoader.
* <p/>
* Writes are forwarded only if this SingletonStoreCacheLoader is currently the
cordinator. This avoid having all
* CacheLoaders in a cluster writing the same data to the same underlying store. Although
not incorrect (e.g. a DB will
@@ -100,8 +100,8 @@
private Address localAddress;
/**
- * Whether the the current node is the coordinator and therefore
SingletonStoreCacheLoader is active. Being active
- * means delegating calls to the underlying cache loader.
+ * Whether the the current cache instance is the coordinator and therefore
SingletonStoreCacheLoader is active. Being
+ * active means delegating calls to the underlying cache loader.
*/
private boolean active;
@@ -176,11 +176,11 @@
}
/**
- * Method called when the node either becomes the coordinator or stops being the
coordinator. If it becomes the
- * coordinator, it can optionally start the in-memory state transfer to the underlying
cache store.
+ * Method called when the cache instance either becomes the coordinator or stops being
the coordinator. If it becomes
+ * the coordinator, it can optionally start the in-memory state transfer to the
underlying cache store.
*
- * @param newActiveState true if the node just became the coordinator, false if the
nodes stopped being the
- * coordinator.
+ * @param newActiveState true if the cache instance just became the coordinator, false
if the cache instance stopped
+ * being the coordinator.
*/
protected void activeStatusChanged(boolean newActiveState) throws PushStateException
{
active = newActiveState;
@@ -211,33 +211,14 @@
}
/**
- * Pushes the state of a specific node by reading the node's data from the cache
and putting in the cache store
+ * Pushes the state of a specific cache entry by reading the entry's data from the
cache and putting in the cache store
* via the cache loader. This method is call recursively so that it iterates through
the whole cache.
*
- * @param node instance of NodeSPI to push to the cache loader
- * @throws Exception if there's any issues reading the data from the cache or
pushing the node's data to the cache
- * loader.
*/
// TODO implement me
-// protected void pushState(NodeSPI node) throws Exception
+// protected void pushState(Object key) throws Exception
// {
-// /* Put the node's data first */
-// Set keys = node.getKeysDirect();
-// Fqn fqn = node.getFqn();
-//
-// for (Object aKey : keys)
-// {
-// Object value = cache.get(fqn, aKey);
-// put(fqn, aKey, value);
-// }
-//
-// /* Navigates to the children */
-// Collection<NodeSPI> children = node.getChildrenDirect();
-// for (NodeSPI aChildren : children)
-// {
-// //Map.Entry entry = (Map.Entry) aChildren;
-// pushState(aChildren);
-// }
+// /* Put the key's data first */
// }
/**
@@ -268,9 +249,9 @@
}
/**
- * Called when the SingletonStoreCacheLoader discovers that the node has become the
coordinator and push in memory
- * state has been enabled. It might not actually push the state if there's an
ongoing push task running, in which
- * case will wait for the push task to finish.
+ * Called when the SingletonStoreCacheLoader discovers that the cache instance has
become the coordinator and push in
+ * memory state has been enabled. It might not actually push the state if there's
an ongoing push task running, in
+ * which case will wait for the push task to finish.
*
* @throws PushStateException when the push state task reports an issue.
*/
@@ -318,10 +299,10 @@
}
/**
- * Indicates whether the current nodes is the coordinator of the cluster.
+ * Indicates whether the current cache instances is the coordinator of the cluster.
*
- * @param newView View instance containing the new view of the cluster
- * @return whether the current node is the coordinator or not.
+ * @param members new member list
+ * @return whether the current cache instance is the coordinator or not.
*/
private boolean isCoordinator(List<Address> members) {
if (members != null && localAddress != null) {
@@ -333,7 +314,7 @@
}
/**
- * Calls the underlying cache loader's operation if the current node is the
coordinator.
+ * Calls the underlying cache loader's operation if the current cache instance is
the coordinator.
*/
// @Override
public Object put(Fqn name, Object key, Object value) throws Exception {
@@ -345,7 +326,7 @@
}
/**
- * Calls the underlying cache loader's operation if the current node is the
coordinator.
+ * Calls the underlying cache loader's operation if the current cache instance is
the coordinator.
*/
// @Override
public void put(Fqn name, Map attributes) throws Exception {
@@ -357,7 +338,7 @@
}
/**
- * Calls the underlying cache loader's operation if the current node is the
coordinator.
+ * Calls the underlying cache loader's operation if the current cache instance is
the coordinator.
*/
// @Override
// public void put(List<Modification> modifications) throws Exception
@@ -370,7 +351,7 @@
// }
/**
- * Calls the underlying cache loader's operation if the current node is the
coordinator.
+ * Calls the underlying cache loader's operation if the current cache instance is
the coordinator.
*/
// @Override
public Object remove(Fqn fqn, Object key) throws Exception {
@@ -382,7 +363,7 @@
}
/**
- * Calls the underlying cache loader's operation if the current node is the
coordinator.
+ * Calls the underlying cache loader's operation if the current cache instance is
the coordinator.
*/
// @Override
public void remove(Fqn fqn) throws Exception {
@@ -392,7 +373,7 @@
}
/**
- * Calls the underlying cache loader's operation if the current node is the
coordinator.
+ * Calls the underlying cache loader's operation if the current cache instance is
the coordinator.
*/
// @Override
public void removeData(Fqn fqn) throws Exception {
@@ -402,7 +383,7 @@
}
/**
- * Calls the underlying cache loader's operation if the current node is the
coordinator.
+ * Calls the underlying cache loader's operation if the current cache instance is
the coordinator.
*/
// @Override
// public void prepare(Object tx, List<Modification> modifications, boolean
one_phase) throws Exception
@@ -414,7 +395,7 @@
// }
/**
- * Calls the underlying cache loader's operation if the current node is the
coordinator.
+ * Calls the underlying cache loader's operation if the current cache instance is
the coordinator.
*/
@Override
public void commit(Object tx) // throws Exception
@@ -425,7 +406,7 @@
}
/**
- * Calls the underlying cache loader's operation if the current node is the
coordinator.
+ * Calls the underlying cache loader's operation if the current cache instance is
the coordinator.
*/
@Override
public void rollback(Object tx) {
@@ -435,7 +416,7 @@
}
/**
- * Calls the underlying cache loader's operation if the current node is the
coordinator.
+ * Calls the underlying cache loader's operation if the current cache instance is
the coordinator.
*/
@Override
public void storeEntireState(ObjectInputStream is) //throws Exception
@@ -446,7 +427,7 @@
}
/**
- * Calls the underlying cache loader's operation if the current node is the
coordinator.
+ * Calls the underlying cache loader's operation if the current cache instance is
the coordinator.
*/
// @Override
public void storeState(Fqn subtree, ObjectInputStream is) throws Exception {
@@ -456,7 +437,7 @@
}
/**
- * Calls the underlying cache loader's operation if the current node is the
coordinator.
+ * Calls the underlying cache loader's operation if the current cache instance is
the coordinator.
*/
@Override
public String toString() {
@@ -465,14 +446,14 @@
/**
* Cache listener that reacts to cluster topology changes to find out whether a new
coordinator is elected.
- * SingletonStoreCacheLoader reacts to these changes in order to decide which node
should interact with the
+ * SingletonStoreCacheLoader reacts to these changes in order to decide which cache
instance should interact with the
* underlying cache store.
*/
@Listener
public class SingletonStoreListener {
/**
- * Cache started, check whether the node is the coordinator and set the singleton
store cache loader's active
- * status.
+ * Cache started, check whether the cache instance is the coordinator and set the
singleton store cache loader's
+ * active status.
*/
@CacheStarted
public void cacheStarted(Event e) {
@@ -487,9 +468,10 @@
}
/**
- * The cluster formation changed, so determine whether the current node stopped
being the coordinator or became
- * the coordinator. This method can lead to an optional in memory to cache loader
state push, if the current node
- * became the coordinator. This method will report any issues that could
potentially arise from this push.
+ * The cluster formation changed, so determine whether the current cache instance
stopped being the coordinator or
+ * became the coordinator. This method can lead to an optional in memory to cache
loader state push, if the
+ * current cache instance became the coordinator. This method will report any
issues that could potentially arise
+ * from this push.
*/
@ViewChanged
public void viewChange(ViewChangedEvent event) {
@@ -500,7 +482,7 @@
activeStatusChanged(tmp);
}
catch (PushStateException e) {
- log.error("exception reported changing nodes active status",
e);
+ log.error("exception reported changing cache instance's active
status", e);
}
}
Modified: core/branches/flat/src/main/java/org/horizon/lock/LockManager.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/lock/LockManager.java 2009-01-30 14:22:32
UTC (rev 7615)
+++ core/branches/flat/src/main/java/org/horizon/lock/LockManager.java 2009-01-30 16:48:58
UTC (rev 7616)
@@ -24,7 +24,7 @@
import org.horizon.context.InvocationContext;
/**
- * An interface to deal with all aspects of acquiring and releasing locks for nodes in
the cache.
+ * An interface to deal with all aspects of acquiring and releasing locks for cache
entries.
*
* @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
* @since 1.0
@@ -41,9 +41,9 @@
Object getLockOwner(InvocationContext ctx);
/**
- * Acquires a lock of type lockType, for a given owner, on a specific Node in the
cache, denoted by fqn. This method
- * will try for {@link org.horizon.config.Configuration#getLockAcquisitionTimeout()}
milliseconds and give up if it
- * is unable to acquire the required lock.
+ * Acquires a lock of type lockType, for a given owner, on a specific entry in the
cache. This method will try for
+ * {@link org.horizon.config.Configuration#getLockAcquisitionTimeout()} milliseconds
and give up if it is unable to
+ * acquire the required lock.
*
* @param key key to lock
* @param owner owner to acquire the lock for
@@ -53,8 +53,8 @@
boolean lock(Object key, Object owner) throws InterruptedException;
/**
- * Acquires a lock of type lockType, for a given owner, on a specific Node in the
cache, denoted by fqn. This method
- * will try for timeout milliseconds and give up if it is unable to acquire the
required lock.
+ * Acquires a lock of type lockType, for a given owner, on a specific entry in the
cache. This method will try for
+ * timeout milliseconds and give up if it is unable to acquire the required lock.
*
* @param key key to lock
* @param owner owner to acquire the lock for
@@ -65,13 +65,13 @@
boolean lock(Object key, Object owner, long timeout) throws InterruptedException;
/**
- * Acquires a lock of type lockType, on a specific Node in the cache, denoted by fqn.
This method will try for a
- * period of time and give up if it is unable to acquire the required lock. The
period of time is specified in
- * {@link org.horizon.config.Option#getLockAcquisitionTimeout()} and, if this is
unset, the default timeout set in
- * {@link org.horizon.config.Configuration#getLockAcquisitionTimeout()} is used.
+ * Acquires a lock of type lockType, on a specific entry in the cache. This method
will try for a period of time and
+ * give up if it is unable to acquire the required lock. The period of time is
specified in {@link
+ * org.horizon.config.Option#getLockAcquisitionTimeout()} and, if this is unset, the
default timeout set in {@link
+ * org.horizon.config.Configuration#getLockAcquisitionTimeout()} is used.
* <p/>
* In addition, any locks acquired are added to the context OR transaction entry using
{@link
- * InvocationContext#addLock(Object)}.
+ * org.horizon.context.InvocationContext#addKeyLocked(Object)}
* <p/>
* The owner for the lock is determined by passing the invocation context to {@link
* #getLockOwner(InvocationContext)}.
@@ -107,12 +107,12 @@
* Tests whether a given owner owns a lock of lockType on a particular Fqn.
*
* @param owner owner
- * @return true if the owner does own the specified lock type on the specified node,
false otherwise.
+ * @return true if the owner does own the specified lock type on the specified cache
entry, false otherwise.
*/
boolean ownsLock(Object key, Object owner);
/**
- * Returns true if the node is locked (either for reading or writing) by anyone, and
false otherwise.
+ * Returns true if the cache entry is locked (either for reading or writing) by
anyone, and false otherwise.
*
* @return true of locked; false if not.
*/
Modified: core/branches/flat/src/main/java/org/horizon/marshall/EntryData.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/marshall/EntryData.java 2009-01-30
14:22:32 UTC (rev 7615)
+++ core/branches/flat/src/main/java/org/horizon/marshall/EntryData.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -28,12 +28,11 @@
import java.util.Map;
/**
- * Serializable representation of the data of a node (FQN and attributes)
+ * Serializable representation of an entry in the cache
*
* @author Bela Ban
* @since 1.0
*/
-// TODO: 3.0.0: remove Externalizable and rely on the CacheMarshaller.
public class EntryData<K, V> implements Externalizable, Map.Entry<K, V> {
private K key;
private V value;
@@ -53,13 +52,13 @@
return value;
}
- // TODO: 3.0.0: Remove and replace with marshallNodeData/unmarshallNodeData methods in
the CacheMarshaller so that we can use the same marshalling framework for Fqns.
+ // TODO: Remove and replace with methods in the CacheMarshaller so that we can use the
same marshalling framework
public void writeExternal(ObjectOutput out) throws IOException {
out.writeObject(key);
out.writeObject(value);
}
- // TODO: 3.0.0: Remove in and replace with marshallNodeData/unmarshallNodeData methods
in the CacheMarshaller so that we can use the same marshalling framework for Fqns.
+ // TODO: Remove in and replace with methods in the CacheMarshaller so that we can use
the same marshalling framework
@SuppressWarnings("unchecked")
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
key = (K) in.readObject();
Modified:
core/branches/flat/src/main/java/org/horizon/marshall/EntryDataExceptionMarker.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/marshall/EntryDataExceptionMarker.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/marshall/EntryDataExceptionMarker.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -29,28 +29,28 @@
public class EntryDataExceptionMarker implements Externalizable {
private static final long serialVersionUID = 240199474174502551L;
private Throwable cause;
- private Object cacheNodeIdentity;
+ private Object key;
- public EntryDataExceptionMarker(Throwable t, Object node) {
+ public EntryDataExceptionMarker(Throwable t, Object key) {
cause = t;
- cacheNodeIdentity = node;
+ key = key;
}
public Throwable getCause() {
return cause;
}
- public Object getCacheNodeIdentity() {
- return cacheNodeIdentity;
+ public Object getKey() {
+ return key;
}
public void writeExternal(ObjectOutput out) throws IOException {
out.writeObject(cause);
- out.writeObject(cacheNodeIdentity);
+ out.writeObject(key);
}
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
cause = (Throwable) in.readObject();
- cacheNodeIdentity = in.readObject();
+ key = in.readObject();
}
}
\ No newline at end of file
Deleted: core/branches/flat/src/main/java/org/horizon/marshall/NodeData.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/marshall/NodeData.java 2009-01-30
14:22:32 UTC (rev 7615)
+++ core/branches/flat/src/main/java/org/horizon/marshall/NodeData.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -1,127 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.horizon.marshall;
-
-import org.horizon.tree.Fqn;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Serializable representation of the data of a node (FQN and attributes)
- *
- * @author Bela Ban
- * @since 1.0
- */
-// TODO: 3.0.0: remove Externalizable and rely on the CacheMarshaller.
-public class NodeData<K, V> implements Externalizable {
- private Fqn fqn = null;
- private Map<K, V> attrs = null;
-
- static final long serialVersionUID = -7571995794010294485L;
-
- public NodeData() {
- }
-
- public NodeData(Fqn fqn) {
- this.fqn = fqn;
- }
-
- public NodeData(Fqn fqn, Map<K, V> attrs, boolean mapSafe) {
- this.fqn = fqn;
- if (mapSafe || attrs == null)
- this.attrs = attrs;
- else
- this.attrs = new HashMap<K, V>(attrs);
- }
-
- public NodeData(String fqn, Map<K, V> attrs, boolean mapSafe) {
- this(Fqn.fromString(fqn), attrs, mapSafe);
- }
-
- public Map<K, V> getAttributes() {
- return attrs;
- }
-
- public Fqn getFqn() {
- return fqn;
- }
-
- public boolean isMarker() {
- return false;
- }
-
- public boolean isExceptionMarker() {
- return false;
- }
-
- // TODO: 3.0.0: Remove and replace with marshallNodeData/unmarshallNodeData methods in
the CacheMarshaller so that we can use the same marshalling framework for Fqns.
- public void writeExternal(ObjectOutput out) throws IOException {
- out.writeObject(fqn);
- if (attrs != null) {
- out.writeBoolean(true);
- out.writeObject(attrs);
- } else {
- out.writeBoolean(false);
- }
- }
-
- // TODO: 3.0.0: Remove in and replace with marshallNodeData/unmarshallNodeData methods
in the CacheMarshaller so that we can use the same marshalling framework for Fqns.
- @SuppressWarnings("unchecked")
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- fqn = (Fqn) in.readObject();
- if (in.readBoolean()) {
- attrs = (Map<K, V>) in.readObject();
- }
- }
-
- @Override
- public String toString() {
- return "NodeData {fqn: " + fqn + ", attrs=" + attrs +
"}";
- }
-
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- NodeData nodeData = (NodeData) o;
-
- if (attrs != null ? !attrs.equals(nodeData.attrs) : nodeData.attrs != null) return
false;
- if (fqn != null ? !fqn.equals(nodeData.fqn) : nodeData.fqn != null) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result;
- result = (fqn != null ? fqn.hashCode() : 0);
- result = 31 * result + (attrs != null ? attrs.hashCode() : 0);
- return result;
- }
-}
Deleted:
core/branches/flat/src/main/java/org/horizon/marshall/NodeDataExceptionMarker.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/marshall/NodeDataExceptionMarker.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/marshall/NodeDataExceptionMarker.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -1,74 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.horizon.marshall;
-
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-public class NodeDataExceptionMarker extends NodeData {
-
- private static final long serialVersionUID = 240199474174502551L;
- private Throwable cause;
- private Object cacheNodeIdentity;
-
- public NodeDataExceptionMarker() {
- super();
- }
-
- public NodeDataExceptionMarker(Throwable t, Object node) {
- cause = t;
- cacheNodeIdentity = node;
- }
-
- public Throwable getCause() {
- return cause;
- }
-
- public Object getCacheNodeIdentity() {
- return cacheNodeIdentity;
- }
-
- @Override
- public boolean isExceptionMarker() {
- return true;
- }
-
- @Override
- public void writeExternal(ObjectOutput out) throws IOException {
- super.writeExternal(out);
- out.writeObject(cause);
- out.writeObject(cacheNodeIdentity);
- }
-
- @Override
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
- super.readExternal(in);
- cause = (Throwable) in.readObject();
- cacheNodeIdentity = in.readObject();
- }
-
- @Override
- public String toString() {
- return "NodeDataExceptionMarker";
- }
-}
Deleted: core/branches/flat/src/main/java/org/horizon/marshall/NodeDataMarker.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/marshall/NodeDataMarker.java 2009-01-30
14:22:32 UTC (rev 7615)
+++ core/branches/flat/src/main/java/org/horizon/marshall/NodeDataMarker.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.horizon.marshall;
-
-public class NodeDataMarker extends NodeData {
-
- private static final long serialVersionUID = 4851793846346021014L;
-
- @Override
- public boolean isMarker() {
- return true;
- }
-
- @Override
- public String toString() {
- return "NodeDataMarker";
- }
-}
Modified: core/branches/flat/src/main/java/org/horizon/notifications/CacheNotifier.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/CacheNotifier.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/CacheNotifier.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -33,54 +33,47 @@
*/
public interface CacheNotifier extends Listenable {
/**
- * Notifies all registered listeners of a nodeCreated event.
+ * Notifies all registered listeners of a CacheEntryCreated event.
*/
void notifyCacheEntryCreated(Object key, boolean pre, InvocationContext ctx);
/**
- * Notifies all registered listeners of a nodeModified event.
+ * Notifies all registered listeners of a CacheEntryModified event.
*/
void notifyCacheEntryModified(Object key, boolean pre, InvocationContext ctx);
/**
- * 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.
+ * Notifies all registered listeners of a CacheEntryRemoved event.
*/
- boolean shouldNotifyOnNodeModified();
-
- /**
- * Notifies all registered listeners of a nodeRemoved event.
- */
void notifyCacheEntryRemoved(Object key, boolean pre, InvocationContext ctx);
/**
- * Notifies all registered listeners of a nodeVisited event.
+ * Notifies all registered listeners of a CacheEntryVisited event.
*/
void notifyCacheEntryVisited(Object key, boolean pre, InvocationContext ctx);
/**
- * Notifies all registered listeners of a nodeEvicted event.
+ * Notifies all registered listeners of a CacheEntryEvicted event.
*/
void notifyCacheEntryEvicted(Object key, boolean pre, InvocationContext ctx);
/**
- * Notifies all registered listeners of a nodeInvalidated event.
+ * Notifies all registered listeners of a CacheEntryInvalidated event.
*/
void notifyCacheEntryInvalidated(Object key, boolean pre, InvocationContext ctx);
/**
- * Notifies all registered listeners of a nodeLoaded event.
+ * Notifies all registered listeners of a CacheEntryLoaded event.
*/
void notifyCacheEntryLoaded(Object key, boolean pre, InvocationContext ctx);
/**
- * Notifies all registered listeners of a nodeActivated event.
+ * Notifies all registered listeners of a CacheEntryActivated event.
*/
void notifyCacheEntryActivated(Object key, boolean pre, InvocationContext ctx);
/**
- * Notifies all registered listeners of a nodePassivated event.
+ * Notifies all registered listeners of a CacheEntryPassivated event.
*/
void notifyCacheEntryPassivated(Object key, boolean pre, InvocationContext ctx);
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/CacheNotifierImpl.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/CacheNotifierImpl.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/CacheNotifierImpl.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -72,35 +72,32 @@
private static final Class[] allowedMethodAnnotations =
{
CacheStarted.class, CacheStopped.class, CacheEntryCreated.class,
CacheEntryRemoved.class, CacheEntryVisited.class, CacheEntryModified.class,
- CacheEntryActivated.class, CacheEntryPassivated.class,
CacheEntryLoaded.class, CacheEntryEvicted.class, TransactionRegistered.class,
TransactionCompleted.class, ViewChanged.class,
+ CacheEntryActivated.class, CacheEntryPassivated.class,
CacheEntryLoaded.class, CacheEntryEvicted.class, TransactionRegistered.class,
TransactionCompleted.class,
CacheEntryInvalidated.class
};
private static final Class[] parameterTypes =
{
CacheStartedEvent.class, CacheStoppedEvent.class,
CacheEntryCreatedEvent.class, CacheEntryRemovedEvent.class, CacheEntryVisitedEvent.class,
CacheEntryModifiedEvent.class,
- CacheEntryActivatedEvent.class, CacheEntryPassivatedEvent.class,
CacheEntryLoadedEvent.class, CacheEntryEvictedEvent.class,
TransactionRegisteredEvent.class, TransactionCompletedEvent.class,
ViewChangedEvent.class,
+ CacheEntryActivatedEvent.class, CacheEntryPassivatedEvent.class,
CacheEntryLoadedEvent.class, CacheEntryEvictedEvent.class,
TransactionRegisteredEvent.class, TransactionCompletedEvent.class,
CacheEntryInvalidatedEvent.class
};
final Map<Class<? extends Annotation>, List<ListenerInvocation>>
listenersMap = new HashMap<Class<? extends Annotation>,
List<ListenerInvocation>>(16, 0.99f);
final List<ListenerInvocation> cacheStartedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
final List<ListenerInvocation> cacheStoppedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
- final List<ListenerInvocation> nodeCreatedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
- final List<ListenerInvocation> nodeRemovedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
- final List<ListenerInvocation> nodeVisitedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
- final List<ListenerInvocation> nodeModifiedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
- final List<ListenerInvocation> nodeActivatedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
- final List<ListenerInvocation> nodePassivatedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
- final List<ListenerInvocation> nodeLoadedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
- final List<ListenerInvocation> nodeInvalidatedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
- final List<ListenerInvocation> nodeEvictedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
+ final List<ListenerInvocation> cacheEntryCreatedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
+ final List<ListenerInvocation> cacheEntryRemovedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
+ final List<ListenerInvocation> cacheEntryVisitedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
+ final List<ListenerInvocation> cacheEntryModifiedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
+ final List<ListenerInvocation> cacheEntryActivatedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
+ final List<ListenerInvocation> cacheEntryPassivatedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
+ final List<ListenerInvocation> cacheEntryLoadedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
+ final List<ListenerInvocation> cacheEntryInvalidatedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
+ final List<ListenerInvocation> cacheEntryEvictedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
final List<ListenerInvocation> transactionRegisteredListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
final List<ListenerInvocation> transactionCompletedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
- final List<ListenerInvocation> viewChangedListeners = new
CopyOnWriteArrayList<ListenerInvocation>();
- // final Map<Class, List<ListenerInvocation>> listenerInvocations = new
ConcurrentHashMap<Class, List<ListenerInvocation>>();
private Cache cache;
- private boolean useMarshalledValueMaps;
private Configuration config;
// two separate executor services, one for sync and one for async listeners
private ExecutorService syncProcessor;
@@ -110,18 +107,17 @@
public CacheNotifierImpl() {
listenersMap.put(CacheStarted.class, cacheStartedListeners);
listenersMap.put(CacheStopped.class, cacheStoppedListeners);
- listenersMap.put(CacheEntryCreated.class, nodeCreatedListeners);
- listenersMap.put(CacheEntryRemoved.class, nodeRemovedListeners);
- listenersMap.put(CacheEntryVisited.class, nodeVisitedListeners);
- listenersMap.put(CacheEntryModified.class, nodeModifiedListeners);
- listenersMap.put(CacheEntryActivated.class, nodeActivatedListeners);
- listenersMap.put(CacheEntryPassivated.class, nodePassivatedListeners);
- listenersMap.put(CacheEntryLoaded.class, nodeLoadedListeners);
- listenersMap.put(CacheEntryEvicted.class, nodeEvictedListeners);
+ listenersMap.put(CacheEntryCreated.class, cacheEntryCreatedListeners);
+ listenersMap.put(CacheEntryRemoved.class, cacheEntryRemovedListeners);
+ listenersMap.put(CacheEntryVisited.class, cacheEntryVisitedListeners);
+ listenersMap.put(CacheEntryModified.class, cacheEntryModifiedListeners);
+ listenersMap.put(CacheEntryActivated.class, cacheEntryActivatedListeners);
+ listenersMap.put(CacheEntryPassivated.class, cacheEntryPassivatedListeners);
+ listenersMap.put(CacheEntryLoaded.class, cacheEntryLoadedListeners);
+ listenersMap.put(CacheEntryEvicted.class, cacheEntryEvictedListeners);
listenersMap.put(TransactionRegistered.class, transactionRegisteredListeners);
listenersMap.put(TransactionCompleted.class, transactionCompletedListeners);
- listenersMap.put(ViewChanged.class, viewChangedListeners);
- listenersMap.put(CacheEntryInvalidated.class, nodeInvalidatedListeners);
+ listenersMap.put(CacheEntryInvalidated.class, cacheEntryInvalidatedListeners);
}
@Inject
@@ -145,7 +141,6 @@
@Start
void start() {
- useMarshalledValueMaps = config.isUseLazyDeserialization();
syncProcessor = new WithinThreadExecutor();
}
@@ -229,17 +224,16 @@
public void removeAllCacheListeners() {
cacheStartedListeners.clear();
cacheStoppedListeners.clear();
- nodeCreatedListeners.clear();
- nodeRemovedListeners.clear();
- nodeVisitedListeners.clear();
- nodeModifiedListeners.clear();
- nodeActivatedListeners.clear();
- nodePassivatedListeners.clear();
- nodeLoadedListeners.clear();
- nodeEvictedListeners.clear();
+ cacheEntryCreatedListeners.clear();
+ cacheEntryRemovedListeners.clear();
+ cacheEntryVisitedListeners.clear();
+ cacheEntryModifiedListeners.clear();
+ cacheEntryActivatedListeners.clear();
+ cacheEntryPassivatedListeners.clear();
+ cacheEntryLoadedListeners.clear();
+ cacheEntryEvictedListeners.clear();
transactionRegisteredListeners.clear();
transactionCompletedListeners.clear();
- viewChangedListeners.clear();
}
public Set<Object> getListeners() {
@@ -251,7 +245,7 @@
}
public void notifyCacheEntryCreated(Object key, boolean pre, InvocationContext ctx) {
- if (!nodeCreatedListeners.isEmpty()) {
+ if (!cacheEntryCreatedListeners.isEmpty()) {
boolean originLocal = ctx.isOriginLocal();
Transaction tx = ctx.getTransaction();
InvocationContext backup = resetInvocationContext(ctx);
@@ -262,13 +256,13 @@
e.setKey(key);
e.setTransaction(tx);
e.setType(CACHE_ENTRY_CREATED);
- for (ListenerInvocation listener : nodeCreatedListeners) listener.invoke(e);
+ for (ListenerInvocation listener : cacheEntryCreatedListeners)
listener.invoke(e);
restoreInvocationContext(backup);
}
}
public void notifyCacheEntryModified(Object key, boolean pre, InvocationContext ctx)
{
- if (!nodeModifiedListeners.isEmpty()) {
+ if (!cacheEntryModifiedListeners.isEmpty()) {
boolean originLocal = ctx.isOriginLocal();
Transaction tx = ctx.getTransaction();
InvocationContext backup = resetInvocationContext(ctx);
@@ -279,17 +273,13 @@
e.setKey(key);
e.setTransaction(tx);
e.setType(CACHE_ENTRY_MODIFIED);
- for (ListenerInvocation listener : nodeModifiedListeners) listener.invoke(e);
+ for (ListenerInvocation listener : cacheEntryModifiedListeners)
listener.invoke(e);
restoreInvocationContext(backup);
}
}
- public boolean shouldNotifyOnNodeModified() {
- return !nodeModifiedListeners.isEmpty();
- }
-
public void notifyCacheEntryRemoved(Object key, boolean pre, InvocationContext ctx) {
- if (!nodeRemovedListeners.isEmpty()) {
+ if (!cacheEntryRemovedListeners.isEmpty()) {
boolean originLocal = ctx.isOriginLocal();
Transaction tx = ctx.getTransaction();
InvocationContext backup = resetInvocationContext(ctx);
@@ -300,13 +290,13 @@
e.setKey(key);
e.setTransaction(tx);
e.setType(CACHE_ENTRY_REMOVED);
- for (ListenerInvocation listener : nodeRemovedListeners) listener.invoke(e);
+ for (ListenerInvocation listener : cacheEntryRemovedListeners)
listener.invoke(e);
restoreInvocationContext(backup);
}
}
public void notifyCacheEntryVisited(Object key, boolean pre, InvocationContext ctx) {
- if (!nodeVisitedListeners.isEmpty()) {
+ if (!cacheEntryVisitedListeners.isEmpty()) {
Transaction tx = ctx.getTransaction();
InvocationContext backup = resetInvocationContext(ctx);
EventImpl e = new EventImpl();
@@ -315,13 +305,13 @@
e.setKey(key);
e.setTransaction(tx);
e.setType(CACHE_ENTRY_VISITED);
- for (ListenerInvocation listener : nodeVisitedListeners) listener.invoke(e);
+ for (ListenerInvocation listener : cacheEntryVisitedListeners)
listener.invoke(e);
restoreInvocationContext(backup);
}
}
public void notifyCacheEntryEvicted(final Object key, final boolean pre,
InvocationContext ctx) {
- if (!nodeEvictedListeners.isEmpty()) {
+ if (!cacheEntryEvictedListeners.isEmpty()) {
final boolean originLocal = ctx.isOriginLocal();
Transaction tx = ctx.getTransaction();
InvocationContext backup = resetInvocationContext(ctx);
@@ -332,13 +322,13 @@
e.setKey(key);
e.setTransaction(tx);
e.setType(CACHE_ENTRY_EVICTED);
- for (ListenerInvocation listener : nodeEvictedListeners) listener.invoke(e);
+ for (ListenerInvocation listener : cacheEntryEvictedListeners)
listener.invoke(e);
restoreInvocationContext(backup);
}
}
public void notifyCacheEntryInvalidated(final Object key, final boolean pre,
InvocationContext ctx) {
- if (!nodeInvalidatedListeners.isEmpty()) {
+ if (!cacheEntryInvalidatedListeners.isEmpty()) {
final boolean originLocal = ctx.isOriginLocal();
Transaction tx = ctx.getTransaction();
InvocationContext backup = resetInvocationContext(ctx);
@@ -349,13 +339,13 @@
e.setKey(key);
e.setTransaction(tx);
e.setType(CACHE_ENTRY_INVALIDATED);
- for (ListenerInvocation listener : nodeInvalidatedListeners)
listener.invoke(e);
+ for (ListenerInvocation listener : cacheEntryInvalidatedListeners)
listener.invoke(e);
restoreInvocationContext(backup);
}
}
public void notifyCacheEntryLoaded(Object key, boolean pre, InvocationContext ctx) {
- if (!nodeLoadedListeners.isEmpty()) {
+ if (!cacheEntryLoadedListeners.isEmpty()) {
boolean originLocal = ctx.isOriginLocal();
Transaction tx = ctx.getTransaction();
InvocationContext backup = resetInvocationContext(ctx);
@@ -366,13 +356,13 @@
e.setKey(key);
e.setTransaction(tx);
e.setType(CACHE_ENTRY_LOADED);
- for (ListenerInvocation listener : nodeLoadedListeners) listener.invoke(e);
+ for (ListenerInvocation listener : cacheEntryLoadedListeners)
listener.invoke(e);
restoreInvocationContext(backup);
}
}
public void notifyCacheEntryActivated(Object key, boolean pre, InvocationContext ctx)
{
- if (!nodeActivatedListeners.isEmpty()) {
+ if (!cacheEntryActivatedListeners.isEmpty()) {
boolean originLocal = ctx.isOriginLocal();
Transaction tx = ctx.getTransaction();
InvocationContext backup = resetInvocationContext(ctx);
@@ -383,13 +373,13 @@
e.setKey(key);
e.setTransaction(tx);
e.setType(CACHE_ENTRY_ACTIVATED);
- for (ListenerInvocation listener : nodeActivatedListeners) listener.invoke(e);
+ for (ListenerInvocation listener : cacheEntryActivatedListeners)
listener.invoke(e);
restoreInvocationContext(backup);
}
}
public void notifyCacheEntryPassivated(Object key, boolean pre, InvocationContext ctx)
{
- if (!nodePassivatedListeners.isEmpty()) {
+ if (!cacheEntryPassivatedListeners.isEmpty()) {
Transaction tx = ctx.getTransaction();
InvocationContext backup = resetInvocationContext(ctx);
EventImpl e = new EventImpl();
@@ -398,7 +388,7 @@
e.setKey(key);
e.setTransaction(tx);
e.setType(CACHE_ENTRY_PASSIVATED);
- for (ListenerInvocation listener : nodePassivatedListeners) listener.invoke(e);
+ for (ListenerInvocation listener : cacheEntryPassivatedListeners)
listener.invoke(e);
restoreInvocationContext(backup);
}
}
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryActivated.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryActivated.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryActivated.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -27,15 +27,15 @@
import java.lang.annotation.Target;
/**
- * This annotation should be used on methods that need to be notified when a node is
activated.
+ * This annotation should be used on methods that need to be notified when a cache entry
is activated.
* <p/>
* Methods annotated with this annotation should be public and take in a single
parameter, a {@link
- * org.horizon.notifications.event.NodeActivatedEvent} otherwise an {@link
org.horizon.notifications.IncorrectCacheListenerException}
+ * org.horizon.notifications.event.CacheEntryActivatedEvent} otherwise an {@link
org.horizon.notifications.IncorrectCacheListenerException}
* will be thrown when registering your cache listener.
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @see Listener
- * @see org.horizon.notifications.annotation.NodePassivated
+ * @see CacheEntryPassivated
* @since 1.0
*/
@Retention(RetentionPolicy.RUNTIME)
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryCreated.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryCreated.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryCreated.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -27,10 +27,10 @@
import java.lang.annotation.Target;
/**
- * This annotation should be used on methods that need to be notified when a node is
created.
+ * This annotation should be used on methods that need to be notified when a cache entry
is created.
* <p/>
* Methods annotated with this annotation should be public and take in a single
parameter, a {@link
- * org.horizon.notifications.event.NodeCreatedEvent} otherwise an {@link
org.horizon.notifications.IncorrectCacheListenerException}
+ * org.horizon.notifications.event.CacheEntryCreatedEvent} otherwise an {@link
org.horizon.notifications.IncorrectCacheListenerException}
* will be thrown when registering your cache listener.
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryEvicted.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryEvicted.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryEvicted.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -27,15 +27,15 @@
import java.lang.annotation.Target;
/**
- * This annotation should be used on methods that need to be notified when a node is
evicted.
+ * This annotation should be used on methods that need to be notified when a cache entry
is evicted.
* <p/>
* Methods annotated with this annotation should be public and take in a single
parameter, a {@link
- * org.horizon.notifications.event.NodeEvictedEvent} otherwise an {@link
org.horizon.notifications.IncorrectCacheListenerException}
+ * org.horizon.notifications.event.CacheEntryEvictedEvent} otherwise an {@link
org.horizon.notifications.IncorrectCacheListenerException}
* will be thrown when registering your cache listener.
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @see Listener
- * @see org.horizon.notifications.annotation.NodeLoaded
+ * @see CacheEntryLoaded
* @since 1.0
*/
@Retention(RetentionPolicy.RUNTIME)
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryInvalidated.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryInvalidated.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryInvalidated.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -27,11 +27,11 @@
import java.lang.annotation.Target;
/**
- * This annotation should be used on methods that need to be notified when a node is
invalidated.
+ * This annotation should be used on methods that need to be notified when a cache entry
is invalidated.
* <p/>
* Methods annotated with this annotation should be public and take in a single
parameter, a {@link
- * org.horizon.notifications.event.NodeInvalidatedEvent} otherwise an {@link
org.horizon.notifications.IncorrectCacheListenerException}
- * will be thrown when registering your cache listener.
+ * org.horizon.notifications.event.CacheEntryInvalidatedEvent} otherwise an {@link
+ * org.horizon.notifications.IncorrectCacheListenerException} will be thrown when
registering your cache listener.
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @see Listener
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryLoaded.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryLoaded.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryLoaded.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -27,11 +27,11 @@
import java.lang.annotation.Target;
/**
- * This annotation should be used on methods that need to be notified when a node is
loaded from a {@link
+ * This annotation should be used on methods that need to be notified when a cache entry
is loaded from a {@link
* org.horizon.loader.CacheLoader}.
* <p/>
* Methods annotated with this annotation should be public and take in a single
parameter, a {@link
- * org.horizon.notifications.event.NodeEvictedEvent} otherwise an {@link
org.horizon.notifications.IncorrectCacheListenerException}
+ * org.horizon.notifications.event.CacheEntryLoadedEvent} otherwise an {@link
org.horizon.notifications.IncorrectCacheListenerException}
* will be thrown when registering your cache listener.
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryModified.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryModified.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryModified.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -27,10 +27,10 @@
import java.lang.annotation.Target;
/**
- * This annotation should be used on methods that need to be notified when a node has
been modified.
+ * This annotation should be used on methods that need to be notified when a cache entry
has been modified.
* <p/>
* Methods annotated with this annotation should be public and take in a single
parameter, a {@link
- * org.horizon.notifications.event.NodeModifiedEvent} otherwise an {@link
org.horizon.notifications.IncorrectCacheListenerException}
+ * org.horizon.notifications.event.CacheEntryModifiedEvent} otherwise an {@link
org.horizon.notifications.IncorrectCacheListenerException}
* will be thrown when registering your cache listener.
* <p/>
*
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryPassivated.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryPassivated.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryPassivated.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -27,10 +27,10 @@
import java.lang.annotation.Target;
/**
- * This annotation should be used on methods that need to be notified when a node is
passivated.
+ * This annotation should be used on methods that need to be notified when a cache entry
is passivated.
* <p/>
* Methods annotated with this annotation should accept a single parameter, a {@link
- * org.horizon.notifications.event.NodePassivatedEvent} otherwise a {@link
org.horizon.notifications.IncorrectCacheListenerException}
+ * org.horizon.notifications.event.CacheEntryPassivatedEvent} otherwise a {@link
org.horizon.notifications.IncorrectCacheListenerException}
* will be thrown when registering your listener.
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryRemoved.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryRemoved.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryRemoved.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -27,10 +27,10 @@
import java.lang.annotation.Target;
/**
- * This annotation should be used on methods that need to be notified when a node is
removed from the cache.
+ * This annotation should be used on methods that need to be notified when a cache entry
is removed from the cache.
* <p/>
* Methods annotated with this annotation should accept a single parameter, a {@link
- * org.horizon.notifications.event.TransactionRegisteredEvent} otherwise a {@link
org.horizon.notifications.IncorrectCacheListenerException}
+ * org.horizon.notifications.event.CacheEntryRemovedEvent} otherwise a {@link
org.horizon.notifications.IncorrectCacheListenerException}
* will be thrown when registering your listener.
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryVisited.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryVisited.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/annotation/CacheEntryVisited.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -27,10 +27,10 @@
import java.lang.annotation.Target;
/**
- * This annotation should be used on methods that need to be notified when a node is
visited.
+ * This annotation should be used on methods that need to be notified when a cache entry
is visited.
* <p/>
* Methods annotated with this annotation should accept a single parameter, a {@link
- * org.horizon.notifications.event.NodeVisitedEvent} otherwise a {@link
org.horizon.notifications.IncorrectCacheListenerException}
+ * org.horizon.notifications.event.CacheEntryVisitedEvent} otherwise a {@link
org.horizon.notifications.IncorrectCacheListenerException}
* will be thrown when registering your listener.
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/annotation/Listener.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/annotation/Listener.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/annotation/Listener.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -28,33 +28,34 @@
/**
* Class-level annotation used to annotate an object as being a valid cache listener.
Used with the {@link
- * org.horizon.Cache_Legacy#addCacheListener(Object)} and related APIs. <p/> Note
that even if a class is annotated with
- * this annotation, it still needs method-level annotation (such as {@link
org.horizon.notifications.annotation.CacheStarted})
+ * org.horizon.Cache#addListener(Object)} and related APIs. <p/> Note that even if
a class is annotated with this
+ * annotation, it still needs method-level annotation (such as {@link
org.horizon.notifications.annotation.CacheStarted})
* to actually receive notifications. <p/> Objects annotated with this annotation -
listeners - can be attached to a
- * running {@link org.horizon.Cache_Legacy} so users can be notified of {@link
org.horizon.Cache_Legacy} events. <p/>
- * <p/> There can be multiple methods that are annotated to receive the same event,
and a method may receive multiple
- * events by using a super type. </p> <p/> <h4>Delivery
Semantics</h4> <p/> An event is delivered immediately after the
- * respective operation, but before the underlying cache call returns. For this reason it
is important to keep listener
- * processing logic short-lived. If a long running task needs to be performed, it's
recommended to use another thread.
- * </p> <p/> <h4>Transactional Semantics</h4> <p/> Since
the event is delivered during the actual cache call, the
- * transactional outcome is not yet known. For this reason, <i>events are always
delivered, even if the changes they
- * represent are discarded by their containing transaction</i>. For applications
that must only process events that
- * represent changes in a completed transaction, {@link
org.horizon.notifications.event.TransactionalEvent#getTransaction()}
- * can be used, along with {@link
org.horizon.notifications.event.TransactionCompletedEvent#isSuccessful()} to record
- * events and later process them once the transaction has been successfully committed.
Example 4 demonstrates this. </p>
- * <p/> <h4>Threading Semantics</h4> <p/> A listener
implementation must be capable of handling concurrent invocations.
- * Local notifications reuse the calling thread; remote notifications reuse the network
thread. </p> <p/> Since
- * notifications reuse the calling or network thread, it is important to realise that if
your listener implementation
- * blocks or performs a long-running task, the original caller which triggered the cache
event may block until the
- * listener callback completes. It is therefore a good idea to use the listener to be
notified of an event but to
- * perform any long running tasks in a separate thread so as not to block the original
caller. </p> <p/> In addition,
- * any locks acquired for the operation being performed will still be held for the
callback. This needs to be kept in
- * mind as locks may be held longer than necessary or intended to and may cause
deadlocking in certain situations. See
- * above paragraph on long-running tasks that should be run in a separate thread.
</p> <b>Note</b>: Since 3.0, a new
+ * running {@link org.horizon.Cache} so users can be notified of {@link
org.horizon.Cache} events. <p/> <p/> There can
+ * be multiple methods that are annotated to receive the same event, and a method may
receive multiple events by using a
+ * super type. </p> <p/> <h4>Delivery Semantics</h4> <p/>
An event is delivered immediately after the respective
+ * operation, but before the underlying cache call returns. For this reason it is
important to keep listener processing
+ * logic short-lived. If a long running task needs to be performed, it's recommended
to use another thread. </p> <p/>
+ * <h4>Transactional Semantics</h4> <p/> Since the event is delivered
during the actual cache call, the transactional
+ * outcome is not yet known. For this reason, <i>events are always delivered, even
if the changes they represent are
+ * discarded by their containing transaction</i>. For applications that must only
process events that represent changes
+ * in a completed transaction, {@link
org.horizon.notifications.event.TransactionalEvent#getTransaction()} can be used,
+ * along with {@link
org.horizon.notifications.event.TransactionCompletedEvent#isSuccessful()} to record events
and
+ * later process them once the transaction has been successfully committed. Example 4
demonstrates this. </p> <p/>
+ * <h4>Threading Semantics</h4> <p/> A listener implementation must be
capable of handling concurrent invocations. Local
+ * notifications reuse the calling thread; remote notifications reuse the network thread.
</p> <p/> Since notifications
+ * reuse the calling or network thread, it is important to realise that if your listener
implementation blocks or
+ * performs a long-running task, the original caller which triggered the cache event may
block until the listener
+ * callback completes. It is therefore a good idea to use the listener to be notified of
an event but to perform any
+ * long running tasks in a separate thread so as not to block the original caller.
</p> <p/> In addition, any locks
+ * acquired for the operation being performed will still be held for the callback. This
needs to be kept in mind as
+ * locks may be held longer than necessary or intended to and may cause deadlocking in
certain situations. See above
+ * paragraph on long-running tasks that should be run in a separate thread. </p>
<b>Note</b>: Since 3.0, a new
* parameter, <tt>sync</tt>, has been introduced on this annotation. This
defaults to <tt>true</tt> which provides the
* above semantics. Alternatively, if you set <tt>sync</tt> to
<tt>false</tt>, then invocations are made in a
* <i>separate</i> thread, which will not cause any blocking on the caller or
network thread. The separate thread is
- * taken from a pool, which can be configured using {@link
org.horizon.config.Configuration#setListenerAsyncPoolSize(int)}.
+ * taken from a pool, which can be configured using {@link
org.horizon.config.GlobalConfiguration#setAsyncListenerExecutorProperties(java.util.Properties)}
+ * and {@link
org.horizon.config.GlobalConfiguration#setAsyncListenerExecutorFactoryClass(String)}.
* <p/>
* <b>Summary of Notification Annotations</b> <table border="1"
cellpadding="1" cellspacing="1" summary="Summary of
* notification annotations"> <tr> <th bgcolor="#CCCCFF"
align="left">Annotation</th> <th bgcolor="#CCCCFF"
@@ -62,43 +63,34 @@
* CacheStarted}</td> <td valign="top">{@link
org.horizon.notifications.event.CacheStartedEvent}</td> <td
valign="top">A
* cache was started</td> </tr> <tr> <td
valign="top">{@link CacheStopped}</td> <td
valign="top">{@link
* org.horizon.notifications.event.CacheStoppedEvent}</td> <td
valign="top">A cache was stopped</td> </tr> <tr> <td
- * valign="top">{@link CacheEntryModified}</td> <td
valign="top">{@link
org.horizon.notifications.event.NodeModifiedEvent}</td>
- * <td valign="top">A node was modified</td> </tr> <tr>
<td valign="top">{@link NodeMoved}</td> <td
valign="top">{@link
- * org.horizon.notifications.event.NodeMovedEvent}</td> <td
valign="top">A node was moved</td> </tr> <tr> <td
- * valign="top">{@link CacheEntryCreated}</td> <td
valign="top">{@link
org.horizon.notifications.event.NodeCreatedEvent}</td>
- * <td valign="top">A node was created</td> </tr> <tr>
<td valign="top">{@link CacheEntryRemoved}</td> <td
- * valign="top">{@link
org.horizon.notifications.event.NodeRemovedEvent}</td> <td
valign="top">A node was removed</td>
- * </tr> <tr> <td valign="top">{@link
CacheEntryVisited}</td> <td valign="top">{@link
- * org.horizon.notifications.event.NodeVisitedEvent}</td> <td
valign="top">A node was visited</td> </tr> <tr> <td
- * valign="top">{@link CacheEntryLoaded}</td> <td
valign="top">{@link
org.horizon.notifications.event.NodeLoadedEvent}</td>
- * <td valign="top">A node was loaded</td> </tr> <tr>
<td valign="top">{@link
org.horizon.notifications.annotation.NodeEvicted}</td>
- * <td valign="top">{@link
org.horizon.notifications.event.NodeEvictedEvent}</td> <td
valign="top">A node was
- * evicted</td> </tr> <tr> <td valign="top">{@link
org.horizon.notifications.annotation.NodeActivated}</td> <td
- * valign="top">{@link
org.horizon.notifications.event.NodeActivatedEvent}</td> <td
valign="top">A node was
- * activated</td> </tr> <tr> <td valign="top">{@link
org.horizon.notifications.annotation.NodePassivated}</td> <td
- * valign="top">{@link
org.horizon.notifications.event.NodePassivatedEvent}</td> <td
valign="top">A node was
- * passivated</td> </tr> <tr> <td valign="top">{@link
org.horizon.notifications.annotation.ViewChanged}</td> <td
+ * valign="top">{@link CacheEntryModified}</td> <td
valign="top">{@link
org.horizon.notifications.event.CacheEntryModifiedEvent}</td>
+ * <td valign="top">A cache entry was modified</td> </tr>
<tr> <td valign="top">{@link CacheEntryCreated}</td> <td
+ * valign="top">{@link
org.horizon.notifications.event.CacheEntryCreatedEvent}</td> <td
valign="top">A cache entry was
+ * created</td> </tr> <tr> <td valign="top">{@link
CacheEntryRemoved}</td> <td valign="top">{@link
+ * org.horizon.notifications.event.CacheEntryRemovedEvent}</td> <td
valign="top">A cache entry was removed</td> </tr>
+ * <tr> <td valign="top">{@link CacheEntryVisited}</td>
<td valign="top">{@link
org.horizon.notifications.event.CacheEntryVisitedEvent}</td>
+ * <td valign="top">A cache entry was visited</td> </tr>
<tr> <td valign="top">{@link CacheEntryLoaded}</td> <td
+ * valign="top">{@link
org.horizon.notifications.event.CacheEntryLoadedEvent}</td> <td
valign="top">A cache entry was
+ * loaded</td> </tr> <tr> <td valign="top">{@link
CacheEntryEvicted}</td> <td valign="top">{@link
+ * org.horizon.notifications.event.CacheEntryEvictedEvent}</td> <td
valign="top">A cache entry was evicted</td> </tr>
+ * <tr> <td valign="top">{@link CacheEntryActivated}</td>
<td valign="top">{@link
org.horizon.notifications.event.CacheEntryActivatedEvent}</td>
+ * <td valign="top">A cache entry was activated</td> </tr>
<tr> <td valign="top">{@link CacheEntryPassivated}</td>
<td
+ * valign="top">{@link
org.horizon.notifications.event.CacheEntryPassivatedEvent}</td> <td
valign="top">A cache entry
+ * was passivated</td> </tr> <tr> <td
valign="top">{@link
org.horizon.notifications.annotation.ViewChanged}</td> <td
* valign="top">{@link
org.horizon.notifications.event.ViewChangedEvent}</td> <td
valign="top">A view change event was
- * detected</td> </tr> <tr> <td valign="top">{@link
org.horizon.notifications.annotation.CacheBlocked}</td> <td
- * valign="top">{@link
org.horizon.notifications.event.CacheBlockedEvent}</td> <td
valign="top">A cache block event was
- * detected</td> </tr> <tr> <td valign="top">{@link
CacheUnblocked}</td> <td valign="top">{@link
- * org.horizon.notifications.event.CacheUnblockedEvent}</td> <td
valign="top">A cache unblock event was detected</td>
- * </tr> <tr> <td valign="top">{@link
TransactionRegistered}</td> <td valign@="top">{@link
+ * detected</td> </tr> <tr> <td valign="top">{@link
TransactionRegistered}</td> <td valign@="top">{@link
* org.horizon.notifications.event.TransactionRegisteredEvent}</td> <td
valign="top">The cache has started to
* participate in a transaction</td> </tr> <tr> <td
valign="top">{@link TransactionCompleted}</td> <td
* valign=@"top">{@link
org.horizon.notifications.event.TransactionCompletedEvent}</td> <td
valign="top">The cache has
- * completed its participation in a transaction</td> </tr> <tr> <td
valign="top">{@link BuddyGroupChanged}</td> <td
- * valign=@"top">{@link
org.horizon.notifications.event.BuddyGroupChangedEvent}</td> <td
valign="top">Buddy replication
- * is enabled and one of the buddy groups that the instance is a member of has changed
its membership.</td> </tr> <tr>
- * <td valign="top">{@link CacheEntryInvalidated}</td> <td
valign=@"top">{@link
org.horizon.notifications.event.NodeInvalidatedEvent}</td>
- * <td valign="top">A node was invalidated by a remote cache. Only if
cache mode is INVALIDATION_SYNC or
- * INVALIDATION_ASYNC.</td> </tr>
+ * completed its participation in a transaction</td> </tr> <tr> <td
valign="top">{@link CacheEntryInvalidated}</td> <td
+ * valign=@"top">{@link
org.horizon.notifications.event.CacheEntryInvalidatedEvent}</td> <td
valign="top">A cache entry
+ * was invalidated by a remote cache. Only if cache mode is INVALIDATION_SYNC or
INVALIDATION_ASYNC.</td> </tr>
* <p/>
* </table>
* <p/>
* <h4>Example 1 - Method receiving a single event</h4>
* <pre>
- * @CacheListener
+ * @Listener
* public class SingleEventListener
* {
* @CacheStarted
@@ -111,7 +103,7 @@
* <p/>
* <h4>Example 2 - Method receiving multiple events</h4>
* <pre>
- * @CacheListener
+ * @Listener
* public class MultipleEventListener
* {
* @CacheStarted
@@ -128,7 +120,7 @@
* <p/>
* <h4>Example 3 - Multiple methods receiving the same event</h4>
* <pre>
- * @CAcheListener
+ * @Listener
* public class SingleEventListener
* {
* @CacheStarted
@@ -153,7 +145,7 @@
* <b>Example 4 - Processing only events with a committed transaction.</b>
* <p/>
* <pre>
- * @CacheListener
+ * @Listener
* public class TxGuaranteedListener
* {
* private class TxEventQueue
@@ -187,10 +179,9 @@
* <p/>
* private TxEventQueue events = new TxEventQueue();
* <p/>
- * @NodeModified
- * @NodeMoved
- * @NodeCreated
- * @NodeRemoved
+ * @CacheEntryModified
+ * @CacheEntryCreated
+ * @CacheEntryRemoved
* public void handle(Event event)
* {
* events.offer(event);
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryActivatedEvent.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryActivatedEvent.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryActivatedEvent.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -22,7 +22,7 @@
package org.horizon.notifications.event;
/**
- * This event is passed in to any method annotated with {@link
org.horizon.notifications.annotation.NodeActivated}.
+ * This event is passed in to any method annotated with {@link
org.horizon.notifications.annotation.CacheEntryActivated}.
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @since 1.0
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryCreatedEvent.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryCreatedEvent.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryCreatedEvent.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -22,7 +22,7 @@
package org.horizon.notifications.event;
/**
- * This event is passed in to any method annotated with {@link
org.horizon.notifications.annotation.NodeCreated}.
+ * This event is passed in to any method annotated with {@link
org.horizon.notifications.annotation.CacheEntryCreated}.
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @since 1.0
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryEvent.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryEvent.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryEvent.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -22,14 +22,14 @@
package org.horizon.notifications.event;
/**
- * Transactional events that additionally expose an Fqn as such events pertain to a
specific node.
+ * Transactional events that additionally expose an Fqn as such events pertain to a
specific cache entry.
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @since 1.0
*/
public interface CacheEntryEvent extends TransactionalEvent {
/**
- * @return the Fqn pointing to the node that is affected.
+ * @return the key to the affected cache entry.
*/
Object getKey();
}
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryEvictedEvent.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryEvictedEvent.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryEvictedEvent.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -22,7 +22,7 @@
package org.horizon.notifications.event;
/**
- * This event is passed in to any method annotated with {@link
org.horizon.notifications.annotation.NodeEvicted}.
+ * This event is passed in to any method annotated with {@link
org.horizon.notifications.annotation.CacheEntryEvicted}.
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @since 1.0
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryLoadedEvent.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryLoadedEvent.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryLoadedEvent.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -22,7 +22,7 @@
package org.horizon.notifications.event;
/**
- * This event is passed in to any method annotated with {@link
org.horizon.notifications.annotation.NodeLoaded}.
+ * This event is passed in to any method annotated with {@link
org.horizon.notifications.annotation.CacheEntryLoaded}.
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @since 1.0
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryModifiedEvent.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryModifiedEvent.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryModifiedEvent.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -22,7 +22,7 @@
package org.horizon.notifications.event;
/**
- * This event is passed in to any method annotated with {@link
org.horizon.notifications.annotation.NodeModified}
+ * This event is passed in to any method annotated with {@link
org.horizon.notifications.annotation.CacheEntryModified}
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @since 1.0
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryPassivatedEvent.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryPassivatedEvent.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryPassivatedEvent.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -22,7 +22,7 @@
package org.horizon.notifications.event;
/**
- * This event is passed in to any method annotated with {@link
org.horizon.notifications.annotation.NodePassivated}.
+ * This event is passed in to any method annotated with {@link
org.horizon.notifications.annotation.CacheEntryPassivated}.
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @since 1.0
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryRemovedEvent.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryRemovedEvent.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryRemovedEvent.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -22,7 +22,7 @@
package org.horizon.notifications.event;
/**
- * This event is passed in to any method annotated with {@link
org.horizon.notifications.annotation.NodeRemoved}.
+ * This event is passed in to any method annotated with {@link
org.horizon.notifications.annotation.CacheEntryRemoved}.
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @since 1.0
Modified:
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryVisitedEvent.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryVisitedEvent.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/notifications/event/CacheEntryVisitedEvent.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -22,7 +22,7 @@
package org.horizon.notifications.event;
/**
- * This event is passed in to any method annotated with {@link
org.horizon.notifications.annotation.NodeVisited}.
+ * This event is passed in to any method annotated with {@link
org.horizon.notifications.annotation.CacheEntryVisited}.
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
* @since 1.0
Modified: core/branches/flat/src/main/java/org/horizon/notifications/event/Event.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/notifications/event/Event.java 2009-01-30
14:22:32 UTC (rev 7615)
+++ core/branches/flat/src/main/java/org/horizon/notifications/event/Event.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -33,7 +33,7 @@
static enum Type {
CACHE_STARTED, CACHE_STOPPED, CACHE_ENTRY_ACTIVATED, CACHE_ENTRY_PASSIVATED,
CACHE_ENTRY_VISITED,
CACHE_ENTRY_LOADED, CACHE_ENTRY_EVICTED, CACHE_ENTRY_CREATED, CACHE_ENTRY_REMOVED,
CACHE_ENTRY_MODIFIED,
- TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, VIEW_CHANGED, BUDDY_GROUP_CHANGED,
CACHE_ENTRY_INVALIDATED
+ TRANSACTION_COMPLETED, TRANSACTION_REGISTERED, CACHE_ENTRY_INVALIDATED,
VIEW_CHANGED_EVENT
}
/**
Modified:
core/branches/flat/src/main/java/org/horizon/statetransfer/DefaultStateTransferManager.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/statetransfer/DefaultStateTransferManager.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/statetransfer/DefaultStateTransferManager.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -29,8 +29,6 @@
import org.horizon.logging.Log;
import org.horizon.logging.LogFactory;
import org.horizon.marshall.Marshaller;
-import org.horizon.marshall.NodeData;
-import org.horizon.marshall.NodeDataMarker;
import org.horizon.tree.Fqn;
import java.io.ObjectInputStream;
@@ -46,7 +44,7 @@
protected final static Log log =
LogFactory.getLog(DefaultStateTransferManager.class);
protected static final boolean trace = log.isTraceEnabled();
- public static final NodeData STREAMING_DELIMITER_NODE = new NodeDataMarker();
+ public static final Object STREAMING_DELIMITER_NODE = new Object();
public static final String PARTIAL_STATE_DELIMITER =
"_PARTIAL_STATE_DELIMITER";
Modified: core/branches/flat/src/main/java/org/horizon/transaction/GlobalTransaction.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/transaction/GlobalTransaction.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/transaction/GlobalTransaction.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -30,7 +30,7 @@
/**
- * Uniquely identifies a transaction that spans all nodes in a cluster. This is used when
replicating all modifications
+ * Uniquely identifies a transaction that spans all JVMs in a cluster. This is used when
replicating all modifications
* in a transaction; the PREPARE and COMMIT (or ROLLBACK) messages have to have a unique
identifier to associate the
* changes with<br>
*
Deleted:
core/branches/flat/src/main/java/org/horizon/util/concurrent/SelfInitializingConcurrentHashMap.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/util/concurrent/SelfInitializingConcurrentHashMap.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/main/java/org/horizon/util/concurrent/SelfInitializingConcurrentHashMap.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -1,144 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.horizon.util.concurrent;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-/**
- * Primarily used to hold child maps for nodes. Underlying CHM is null initially, and
once threads start writing to
- * this map, the CHM is initialized.
- *
- * @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
- * @since 1.0
- */
-public class SelfInitializingConcurrentHashMap<K, V> implements ConcurrentMap<K,
V> {
- private volatile ConcurrentMap<K, V> delegate;
-
- // -------------- initialization methods and helpers ----------------------
- private ConcurrentMap<K, V> getDelegate() {
- if (delegate == null) init();
- return delegate;
- }
-
- private synchronized void init() {
- // Reminiscent of DCL but the delegate here is volatile so construction reordering
should not affect.
- if (delegate == null) delegate = new ConcurrentHashMap<K, V>(1, 0.75f, 4);
- }
-
- // -------------- Public API methods that will trigger initialization
----------------------
-
- public final V put(K key, V value) {
- return getDelegate().put(key, value);
- }
-
- public final V remove(Object key) {
- return getDelegate().remove(key);
- }
-
- public final void putAll(Map<? extends K, ? extends V> m) {
- getDelegate().putAll(m);
- }
-
- public final V putIfAbsent(K key, V value) {
- return getDelegate().putIfAbsent(key, value);
- }
-
- public final boolean replace(K key, V oldValue, V newValue) {
- return getDelegate().replace(key, oldValue, newValue);
- }
-
- public final V replace(K key, V value) {
- return getDelegate().replace(key, value);
- }
-
- // -------------- Public API methods that won't trigger initialization
----------------------
-
- public final boolean remove(Object key, Object value) {
- return delegate != null && delegate.remove(key, value);
- }
-
- public final int size() {
- return delegate == null ? 0 : delegate.size();
- }
-
- public final boolean isEmpty() {
- return delegate == null || delegate.isEmpty();
- }
-
- public final boolean containsKey(Object key) {
- return delegate != null && delegate.containsKey(key);
- }
-
- public final boolean containsValue(Object value) {
- return delegate != null && delegate.containsValue(value);
- }
-
- public final V get(Object key) {
- return delegate == null ? null : delegate.get(key);
- }
-
- public final void clear() {
- if (delegate != null) delegate.clear();
- }
-
- public final Set<K> keySet() {
- if (delegate == null || delegate.isEmpty()) return Collections.emptySet();
- return delegate.keySet();
- }
-
- public final Collection<V> values() {
- if (delegate == null || delegate.isEmpty()) return Collections.emptySet();
- return delegate.values();
- }
-
- public final Set<Entry<K, V>> entrySet() {
- if (delegate == null || delegate.isEmpty()) return Collections.emptySet();
- return delegate.entrySet();
- }
-
- @Override
- public String toString() {
- return "SelfInitializingConcurrentHashMap{" +
- "delegate=" + delegate +
- '}';
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- SelfInitializingConcurrentHashMap that = (SelfInitializingConcurrentHashMap) o;
- return !(delegate != null ? !delegate.equals(that.delegate) : that.delegate !=
null);
- }
-
- @Override
- public int hashCode() {
- int result;
- result = (delegate != null ? delegate.hashCode() : 0);
- return result;
- }
-}
Modified: core/branches/flat/src/main/resources/cache-jdbc.properties
===================================================================
--- core/branches/flat/src/main/resources/cache-jdbc.properties 2009-01-30 14:22:32 UTC
(rev 7615)
+++ core/branches/flat/src/main/resources/cache-jdbc.properties 2009-01-30 16:48:58 UTC
(rev 7616)
@@ -3,67 +3,64 @@
# The table name can also be prepended with schema name for the given table.
# Even though there is an Sql92 standard syntax for this: <schema_name>.<table
name>
#schema has different meanings accross various DBMS: Oracle - user name; PointBase -
database name
-# Microsoft SQL Server & DB2 - schema name corresponds to the catalog owner
-cache.jdbc.table.name=jbosscache
-cache.jdbc.table.create=true
-cache.jdbc.table.drop=false
-cache.jdbc.table.primarykey=jbosscache_pk
-cache.jdbc.fqn.column=fqn
-cache.jdbc.fqn.type=varchar(255)
-cache.jdbc.node.column=node
-cache.jdbc.node.type=blob
-cache.jdbc.parent.column=parent
-# Specify your DBMS's string concatenation function syntax in the following manner:
concat(1 , 2) -> '12'.
-# This syntax should work an most popular DBMS like oracle, db2, mssql, mysql,
PostgreSQL. Derby - on which
-#the tests are run does not support 'concat', but '1 || 2' . If no value
is sepcified then concat(1 , 2) is used by default.
-cache.jdbc.sql-concat=1 || 2
+# Microsoft SQL Server & DB2 - schema name corresponds to the catalog owner
-# JBoss Cache Table properties for Hypersonic, just overrides
-#cache.jdbc.node.type=OBJECT
+horizon.jdbc.table.name=horizon
+horizon.jdbc.table.create=true
+horizon.jdbc.table.drop=false
+horizon.jdbc.table.primarykey=CACHE_KEY
+horizon.jdbc.key.column=CACHE_KEY
+horizon.jdbc.key.type=VARCHAR(255)
+horizon.jdbc.value.column=CACHE_VALUE
##
# DataSource
-#cache.jdbc.datasource=DefaultDS
+# horizon.jdbc.datasource=DefaultDS
##
# JDBC driver specific properties
# Hypersonic
-#cache.jdbc.node.type=OBJECT
+horizon.jdbc.value.type=BINARY
+horizon.jdbc.driver = org.hsqldb.jdbcDriver
+horizon.jdbc.url=jdbc:hsqldb:mem:horizondb
+horizon.jdbc.user=sa
+horizon.jdbc.password=
+
## MySql
-#cache.jdbc.driver=com.mysql.jdbc.Driver
-#cache.jdbc.url=jdbc:mysql://localhost:3306/jbossdb
-#cache.jdbc.user=root
-#cache.jdbc.password=admin
+#horizon.jdbc.driver=com.mysql.jdbc.Driver
+#horizon.jdbc.url=jdbc:mysql://localhost:3306/horizondb
+#horizon.jdbc.user=root
+#horizon.jdbc.password=admin
## Oracle
-#cache.jdbc.driver=oracle.jdbc.OracleDriver
-#cache.jdbc.url=jdbc:oracle:thin:@192.168.0.100:1521:JBOSSDB
-#cache.jdbc.user=jboss
-#cache.jdbc.password=sa
+#horizon.jdbc.driver=oracle.jdbc.OracleDriver
+#horizon.jdbc.url=jdbc:oracle:thin:@192.168.0.100:1521:HORIZONDB
+#horizon.jdbc.user=scott
+#horizon.jdbc.password=tiger
## MS Sql Server
-#cache.jdbc.driver=com.microsoft.jdbc.sqlserver.SQLServerDriver
-#cache.jdbc.url=jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=jbossdb;SelectMethod=cursor
-#cache.jdbc.user=sa
-#cache.jdbc.password=
-#cache.jdbc.node.type=image
+#horizon.jdbc.driver=com.microsoft.jdbc.sqlserver.SQLServerDriver
+#horizon.jdbc.url=jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=horizondb;SelectMethod=cursor
+#horizon.jdbc.user=sa
+#horizon.jdbc.password=
+#horizon.jdbc.value.type=image
## Pointbase
-#cache.jdbc.driver=com.pointbase.jdbc.jdbcUniversalDriver
-#cache.jdbc.url=jdbc:pointbase:server://localhost:9092/jboss,new
-#cache.jdbc.user=PBPUBLIC
-#cache.jdbc.password=PBPUBLIC
+#horizon.jdbc.driver=com.pointbase.jdbc.jdbcUniversalDriver
+#horizon.jdbc.url=jdbc:pointbase:server://localhost:9092/horizon,new
+#horizon.jdbc.user=PBPUBLIC
+#horizon.jdbc.password=PBPUBLIC
## PostgreSQL
-#cache.jdbc.driver = org.postgresql.Driver
-#cache.jdbc.url=jdbc:postgresql://192.168.0.100:5432/jbossdb
-#cache.jdbc.user=postgres
-#cache.jdbc.password=admin
+#horizon.jdbc.driver = org.postgresql.Driver
+#horizon.jdbc.url=jdbc:postgresql://192.168.0.100:5432/horizondb
+#horizon.jdbc.user=postgres
+#horizon.jdbc.password=admin
## Derby
-cache.jdbc.driver = org.apache.derby.jdbc.EmbeddedDriver
-cache.jdbc.url=jdbc:derby:jbossdb;create=true
-cache.jdbc.user=user1
-cache.jdbc.password=user1
\ No newline at end of file
+#horizon.jdbc.driver = org.apache.derby.jdbc.EmbeddedDriver
+#horizon.jdbc.url=jdbc:derby:horizondb;create=true
+#horizon.jdbc.user=user1
+#horizon.jdbc.password=user1
\ No newline at end of file
Modified: core/branches/flat/src/main/resources/config-samples/all.xml
===================================================================
--- core/branches/flat/src/main/resources/config-samples/all.xml 2009-01-30 14:22:32 UTC
(rev 7615)
+++ core/branches/flat/src/main/resources/config-samples/all.xml 2009-01-30 16:48:58 UTC
(rev 7616)
@@ -116,7 +116,7 @@
the eviction thread will never run. A separate executor is used for eviction in
each cache.
-->
<eviction wakeUpInterval="500"
algorithmClass="org.horizon.eviction.LRUAlgorithm"
eventQueueSize="200000">
- <property name="maxNodes" value="5000"/>
+ <property name="maxEntries" value="5000"/>
<property name="timeToLive" value="1000"/>
</eviction>
Modified: core/branches/flat/src/test/java/org/horizon/api/mvcc/LockAssert.java
===================================================================
--- core/branches/flat/src/test/java/org/horizon/api/mvcc/LockAssert.java 2009-01-30
14:22:32 UTC (rev 7615)
+++ core/branches/flat/src/test/java/org/horizon/api/mvcc/LockAssert.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -17,8 +17,7 @@
}
public static void assertNotLocked(Object key, InvocationContextContainer icc) {
- // can't rely on the negative test since other nodes may share the same lock
with lock striping.
-// assert !lockManager.isLocked(fqn) : fqn + " is locked!";
+ // can't rely on the negative test since other entries may share the same lock
with lock striping.
assert !icc.get().getKeysLocked().contains(key) : key + " lock
recorded!";
}
Modified: core/branches/flat/src/test/java/org/horizon/api/mvcc/LockTestBase.java
===================================================================
--- core/branches/flat/src/test/java/org/horizon/api/mvcc/LockTestBase.java 2009-01-30
14:22:32 UTC (rev 7615)
+++ core/branches/flat/src/test/java/org/horizon/api/mvcc/LockTestBase.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -123,11 +123,11 @@
assertNoLocks();
}
- public void testLocksOnEvictNode() throws Exception {
+ public void testLocksOnEvict() throws Exception {
LockTestBaseTL tl = threadLocal.get();
Cache<String, String> cache = tl.cache;
TransactionManager tm = tl.tm;
- // init some data on a node
+ // init some data
cache.putAll(Collections.singletonMap("k", "v"));
assert "v".equals(cache.get("k"));
@@ -140,7 +140,7 @@
assertNoLocks();
}
- public void testLocksOnRemoveNonexistentNode() throws Exception {
+ public void testLocksOnRemoveNonexistent() throws Exception {
LockTestBaseTL tl = threadLocal.get();
Cache<String, String> cache = tl.cache;
TransactionManager tm = tl.tm;
@@ -154,7 +154,7 @@
assertNoLocks();
}
- public void testLocksOnEvictNonexistentNode() throws Exception {
+ public void testLocksOnEvictNonexistent() throws Exception {
LockTestBaseTL tl = threadLocal.get();
Cache<String, String> cache = tl.cache;
TransactionManager tm = tl.tm;
@@ -172,7 +172,7 @@
LockTestBaseTL tl = threadLocal.get();
Cache<String, String> cache = tl.cache;
TransactionManager tm = tl.tm;
- // init some data on a node
+ // init some data
cache.put("k", "v");
cache.put("k2", "v2");
@@ -299,7 +299,7 @@
assertNoLocks();
}
- public void testRollbacksOnNullNode() throws Exception {
+ public void testRollbacksOnNullEntry() throws Exception {
LockTestBaseTL tl = threadLocal.get();
Cache<String, String> cache = tl.cache;
TransactionManager tm = tl.tm;
Modified:
core/branches/flat/src/test/java/org/horizon/api/mvcc/PutForExternalReadTest.java
===================================================================
---
core/branches/flat/src/test/java/org/horizon/api/mvcc/PutForExternalReadTest.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/test/java/org/horizon/api/mvcc/PutForExternalReadTest.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -124,7 +124,6 @@
}
public void testTxSuspension() throws Exception {
- // create parent node first
replListener2.expect(PutKeyValueCommand.class);
cache1.put(key + "0", value);
replListener2.waitForRPC();
@@ -255,7 +254,6 @@
assert tt2.getNumLocalTransactions() == 0 : "Cache 2 should have no stale
local TXs";
System.out.println("PutForExternalReadTest.testMemLeakOnSuspendedTransactions");
- //do not expectWithTx a PFER replication, as the node already exists so this is a
no-op
replListener2.expectWithTx(PutKeyValueCommand.class);
tm1.begin();
cache1.putForExternalRead(key, value);
@@ -280,7 +278,6 @@
assert tt2.getNumGlobalTransactions() == 0 : "Cache 2 should have no stale
global TXs";
assert tt2.getNumLocalTransactions() == 0 : "Cache 2 should have no stale
local TXs";
- //do not expectWithTx a PFER replication, as the node already exists so this is a
no-op
replListener2.expectWithTx(PutKeyValueCommand.class, PutKeyValueCommand.class);
tm1.begin();
cache1.put(key, value);
Modified: core/branches/flat/src/test/java/org/horizon/profiling/ProfileTest.java
===================================================================
--- core/branches/flat/src/test/java/org/horizon/profiling/ProfileTest.java 2009-01-30
14:22:32 UTC (rev 7615)
+++ core/branches/flat/src/test/java/org/horizon/profiling/ProfileTest.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -103,7 +103,7 @@
for (final Object key : keys) {
exec.execute(new Runnable() {
public void run() {
- // this will create the necessary nodes.
+ // this will create the necessary entries.
cache.put(key, Collections.emptyMap());
}
});
@@ -125,7 +125,6 @@
long duration = System.currentTimeMillis() - startTime;
log.warn("Finished warmup. " + printDuration(duration));
- //cache.removeNode(Fqn.ROOT);
((Cache) cache).stop();
startup();
Modified:
core/branches/flat/src/test/java/org/horizon/replication/SyncCacheListenerTest.java
===================================================================
---
core/branches/flat/src/test/java/org/horizon/replication/SyncCacheListenerTest.java 2009-01-30
14:22:32 UTC (rev 7615)
+++
core/branches/flat/src/test/java/org/horizon/replication/SyncCacheListenerTest.java 2009-01-30
16:48:58 UTC (rev 7616)
@@ -170,16 +170,16 @@
}
@CacheEntryModified
- public void nodeModified(Event ne) {
+ public void modified(Event ne) {
if (!ne.isPre()) {
- log.debug("nodeModified visited with fqn: " + key);
+ log.debug("modified visited with key: " + key);
try {
// test out if we can get the read lock since there is a write lock going
as well.
cache1.get(key);
}
catch (CacheException e) {
- e.printStackTrace();//To change body of catch statement use File |
Settings | File Templates.
- fail("nodeModified: test failed with exception: " + e);
+ e.printStackTrace();
+ fail("modified: test failed with exception: " + e);
}
}
}
@@ -194,7 +194,7 @@
public void callback(TransactionalEvent e) {
System.out.println("Callback got event " + e);
log.debug("Callback got event " + e);
- assertFalse("node was removed on remote cache so isLocal should be
false", e.isOriginLocal());
+ assertFalse("entry was removed on remote cache so isLocal should be
false", e.isOriginLocal());
}
}
}
Modified: core/branches/flat/src/test/resources/cache-jdbc.properties
===================================================================
--- core/branches/flat/src/test/resources/cache-jdbc.properties 2009-01-30 14:22:32 UTC
(rev 7615)
+++ core/branches/flat/src/test/resources/cache-jdbc.properties 2009-01-30 16:48:58 UTC
(rev 7616)
@@ -11,56 +11,56 @@
horizon.jdbc.table.primarykey=CACHE_KEY
horizon.jdbc.key.column=CACHE_KEY
horizon.jdbc.key.type=VARCHAR(255)
-horizon.jdbc.node.column=CACHE_VALUE
+horizon.jdbc.value.column=CACHE_VALUE
##
# DataSource
-#cache.jdbc.datasource=DefaultDS
+# horizon.jdbc.datasource=DefaultDS
##
# JDBC driver specific properties
# Hypersonic
-cache.jdbc.node.type=BINARY
-cache.jdbc.driver = org.hsqldb.jdbcDriver
-cache.jdbc.url=jdbc:hsqldb:mem:horizondb
-cache.jdbc.user=sa
-cache.jdbc.password=
+horizon.jdbc.value.type=BINARY
+horizon.jdbc.driver = org.hsqldb.jdbcDriver
+horizon.jdbc.url=jdbc:hsqldb:mem:horizondb
+horizon.jdbc.user=sa
+horizon.jdbc.password=
## MySql
-#cache.jdbc.driver=com.mysql.jdbc.Driver
-#cache.jdbc.url=jdbc:mysql://localhost:3306/horizondb
-#cache.jdbc.user=root
-#cache.jdbc.password=admin
+#horizon.jdbc.driver=com.mysql.jdbc.Driver
+#horizon.jdbc.url=jdbc:mysql://localhost:3306/horizondb
+#horizon.jdbc.user=root
+#horizon.jdbc.password=admin
## Oracle
-#cache.jdbc.driver=oracle.jdbc.OracleDriver
-#cache.jdbc.url=jdbc:oracle:thin:@192.168.0.100:1521:HORIZONDB
-#cache.jdbc.user=scott
-#cache.jdbc.password=tiger
+#horizon.jdbc.driver=oracle.jdbc.OracleDriver
+#horizon.jdbc.url=jdbc:oracle:thin:@192.168.0.100:1521:HORIZONDB
+#horizon.jdbc.user=scott
+#horizon.jdbc.password=tiger
## MS Sql Server
-#cache.jdbc.driver=com.microsoft.jdbc.sqlserver.SQLServerDriver
-#cache.jdbc.url=jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=horizondb;SelectMethod=cursor
-#cache.jdbc.user=sa
-#cache.jdbc.password=
-#cache.jdbc.node.type=image
+#horizon.jdbc.driver=com.microsoft.jdbc.sqlserver.SQLServerDriver
+#horizon.jdbc.url=jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=horizondb;SelectMethod=cursor
+#horizon.jdbc.user=sa
+#horizon.jdbc.password=
+#horizon.jdbc.value.type=image
## Pointbase
-#cache.jdbc.driver=com.pointbase.jdbc.jdbcUniversalDriver
-#cache.jdbc.url=jdbc:pointbase:server://localhost:9092/horizon,new
-#cache.jdbc.user=PBPUBLIC
-#cache.jdbc.password=PBPUBLIC
+#horizon.jdbc.driver=com.pointbase.jdbc.jdbcUniversalDriver
+#horizon.jdbc.url=jdbc:pointbase:server://localhost:9092/horizon,new
+#horizon.jdbc.user=PBPUBLIC
+#horizon.jdbc.password=PBPUBLIC
## PostgreSQL
-#cache.jdbc.driver = org.postgresql.Driver
-#cache.jdbc.url=jdbc:postgresql://192.168.0.100:5432/horizondb
-#cache.jdbc.user=postgres
-#cache.jdbc.password=admin
+#horizon.jdbc.driver = org.postgresql.Driver
+#horizon.jdbc.url=jdbc:postgresql://192.168.0.100:5432/horizondb
+#horizon.jdbc.user=postgres
+#horizon.jdbc.password=admin
## Derby
-#cache.jdbc.driver = org.apache.derby.jdbc.EmbeddedDriver
-#cache.jdbc.url=jdbc:derby:horizondb;create=true
-#cache.jdbc.user=user1
-#cache.jdbc.password=user1
\ No newline at end of file
+#horizon.jdbc.driver = org.apache.derby.jdbc.EmbeddedDriver
+#horizon.jdbc.url=jdbc:derby:horizondb;create=true
+#horizon.jdbc.user=user1
+#horizon.jdbc.password=user1
\ No newline at end of file