Commit bd8c12d4 authored by Pete Matern's avatar Pete Matern Committed by pete

Made ClusterTask Externalizable rather than Serializable. Removed useless method from CacheFactory.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@8213 b35dd754-fafc-0310-a699-88a17e54d16e
parent 82fccfec
...@@ -202,7 +202,7 @@ public class CacheFactory { ...@@ -202,7 +202,7 @@ public class CacheFactory {
} }
} }
cacheFactoryStrategy.doClusterTask(buildClusterTask(task)); cacheFactoryStrategy.doClusterTask(task);
} }
/** /**
...@@ -222,7 +222,7 @@ public class CacheFactory { ...@@ -222,7 +222,7 @@ public class CacheFactory {
} }
} }
return cacheFactoryStrategy.doSynchronousClusterTask(buildClusterTask(task), includeLocalMember); return cacheFactoryStrategy.doSynchronousClusterTask(task, includeLocalMember);
} }
...@@ -406,27 +406,6 @@ public class CacheFactory { ...@@ -406,27 +406,6 @@ public class CacheFactory {
} }
} }
/**
* Creates a new Cluster Task that will execute the wrapped task and ensure
* that any DAO context is also closed after the execution of the task.
*
* @param task the cluster task to wrap.
* @return new Cluster Task that will execute the wrapped task.
*/
public static ClusterTask buildClusterTask(final ClusterTask task) {
return new ClusterTask() {
ClusterTask taskToRun = task;
public void run() {
task.run();
}
public Object getResult() {
return task.getResult();
}
};
}
/** /**
* Listener interface for any object which needs to be notified when clustering starts or stops * Listener interface for any object which needs to be notified when clustering starts or stops
......
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
*/ */
package org.jivesoftware.util.cache; package org.jivesoftware.util.cache;
import java.io.Serializable; import java.io.Externalizable;
/** /**
* An interface to mix in Serializable and Runnable, which are both required for * An interface to mix in Serializable and Runnable, which are both required for
* sending invocable tasks across a cluster. * sending invocable tasks across a cluster.
*/ */
public interface ClusterTask extends Runnable, Serializable { public interface ClusterTask extends Runnable, Externalizable {
public Object getResult(); public Object getResult();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment