[jboss-cvs] JBossCache/src/org/jboss/cache/config ...
Manik Surtani
msurtani at jboss.com
Fri Jan 5 06:42:52 EST 2007
User: msurtani
Date: 07/01/05 06:42:52
Modified: src/org/jboss/cache/config Configuration.java
RuntimeConfig.java
Log:
- Configurations are now cloned before being used by the factory to guarantee ownership
- Cloning configurations also resets RuntimeConfiguration of the clone
- RemoteCacheListenerTest updated for completeness and thoroughness
Revision Changes Path
1.31 +4 -2 JBossCache/src/org/jboss/cache/config/Configuration.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Configuration.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/config/Configuration.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- Configuration.java 3 Jan 2007 03:11:26 -0000 1.30
+++ Configuration.java 5 Jan 2007 11:42:52 -0000 1.31
@@ -668,6 +668,8 @@
if (runtimeConfig != null)
{
c.setRuntimeConfig((RuntimeConfig) runtimeConfig.clone());
+ // always make sure we reset the runtime when cloning.
+ c.getRuntimeConfig().reset();
}
return c;
}
1.4 +12 -2 JBossCache/src/org/jboss/cache/config/RuntimeConfig.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: RuntimeConfig.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/config/RuntimeConfig.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- RuntimeConfig.java 2 Jan 2007 19:19:05 -0000 1.3
+++ RuntimeConfig.java 5 Jan 2007 11:42:52 -0000 1.4
@@ -24,6 +24,18 @@
private transient MBeanServer mbeanServer;
private transient NodeFactory nodeFactory;
+ /**
+ * Resets the runtime to default values.
+ */
+ public void reset()
+ {
+ transactionManager = null;
+ muxChannelFactory = null;
+ mbeanServer = null;
+ nodeFactory = null;
+ }
+
+
public JChannelFactoryMBean getMuxChannelFactory()
{
return muxChannelFactory;
@@ -93,6 +105,4 @@
result = result * 29 + (mbeanServer == null ? 0 : mbeanServer.hashCode());
return result;
}
-
-
}
More information about the jboss-cvs-commits
mailing list