[jboss-cvs] JBossCache/src/org/jboss/cache/jmx ...
Brian Stansberry
brian.stansberry at jboss.com
Fri May 11 18:40:59 EDT 2007
User: bstansberry
Date: 07/05/11 18:40:59
Modified: src/org/jboss/cache/jmx CacheLegacyJmxWrapperMBean.java
CacheLegacyJmxWrapper.java
Log:
[JBCACHE-1056] Wrapper class to allow PojoCache deployment via legacy AS ServiceController
Revision Changes Path
1.6 +8 -269 JBossCache/src/org/jboss/cache/jmx/CacheLegacyJmxWrapperMBean.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheLegacyJmxWrapperMBean.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/jmx/CacheLegacyJmxWrapperMBean.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- CacheLegacyJmxWrapperMBean.java 9 May 2007 18:27:33 -0000 1.5
+++ CacheLegacyJmxWrapperMBean.java 11 May 2007 22:40:59 -0000 1.6
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2007, 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.
*
@@ -21,278 +21,17 @@
*/
package org.jboss.cache.jmx;
-import org.jboss.cache.Region;
-import org.jgroups.ChannelFactory;
-import org.w3c.dom.Element;
-
-import javax.transaction.TransactionManager;
/**
- * StandardMBean interface for {@link CacheLegacyJmxWrapper}.
+ * StandardMBean interface for {@link CacheLegacyJmxWrapper}. Extends
+ * <code>CacheJmxWrapperMBean</code> by adding the
+ * {@link LegacyConfiguration legacy configuration} attributes from JBC 1.x.
*
* @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
-public interface CacheLegacyJmxWrapperMBean extends CacheJmxWrapperMBean
+public interface CacheLegacyJmxWrapperMBean
+ extends CacheJmxWrapperMBean, LegacyConfiguration
{
- /**
- * Get the name of the replication group
- */
- String getClusterName();
-
- /**
- * Set the name of the replication group
- */
- void setClusterName(String name);
-
- /**
- * Sets whether marshalling uses scoped class loaders on a per region basis.
- * <p/>
- * This property must be set to <code>true</code> before any call to
- * {@link Region#registerContextClassLoader(ClassLoader)}.
- *
- * @param isTrue
- */
- void setUseRegionBasedMarshalling(boolean isTrue);
-
- /**
- * Gets whether marshalling uses scoped class loaders on a per region basis.
- *
- * @return true if region based marshalling is used.
- */
- boolean getUseRegionBasedMarshalling();
-
- /**
- * Gets whether the cache should create interceptor mbeans
- * that are used to capture and publish interceptor statistics.
- *
- * @return true if mbeans should be created for each interceptor
- */
- boolean getExposeManagementStatistics();
-
- void setExposeManagementStatistics(boolean expose);
-
- /**
- * Get the cluster properties (e.g. the protocol stack specification in case of JGroups)
- */
- String getClusterProperties();
-
- /**
- * Set the cluster properties. If the cache is to use the new properties, it has to be redeployed
- *
- * @param cluster_props The properties for the cluster (JGroups)
- */
- void setClusterProperties(String cluster_props);
-
- Element getCacheLoaderConfiguration();
-
- void setCacheLoaderConfiguration(Element cache_loader_config);
-
- boolean getSyncCommitPhase();
-
- void setSyncCommitPhase(boolean sync_commit_phase);
-
- boolean getSyncRollbackPhase();
-
- void setSyncRollbackPhase(boolean sync_rollback_phase);
-
- Element getEvictionPolicyConfig();
-
- /**
- * Setup eviction policy configuration
- */
- void setEvictionPolicyConfig(Element config);
-
- /**
- * Convert a list of elements to the JG property string
- */
- void setClusterConfig(Element config);
-
- /**
- * Get the max time to wait until the initial state is retrieved. This is used in a replicating cache: when a new cache joins the cluster, it needs to acquire the (replicated) state of the other members to initialize itself. If no state has been received within <tt>timeout</tt> milliseconds, the map will be empty.
- *
- * @return long Number of milliseconds to wait for the state. 0 means to wait forever.
- */
- long getInitialStateRetrievalTimeout();
-
- /**
- * Set the initial state transfer timeout (see {@link #getInitialStateRetrievalTimeout()})
- */
- void setInitialStateRetrievalTimeout(long timeout);
-
- /**
- * Returns the current caching mode. Valid values are <ul> <li>LOCAL <li>REPL_ASYNC <li>REPL_SYNC <ul>
- *
- * @return String The caching mode
- */
- String getCacheMode();
-
- /**
- * Sets the default caching mode)
- */
- void setCacheMode(String mode) throws Exception;
-
- /**
- * Returns the default max timeout after which synchronous replication calls return.
- *
- * @return long Number of milliseconds after which a sync repl call must return. 0 means to wait forever
- */
- long getSyncReplTimeout();
-
- /**
- * Sets the default maximum wait time for synchronous replication to receive all results
- */
- void setSyncReplTimeout(long timeout);
-
- boolean getUseReplQueue();
-
- void setUseReplQueue(boolean flag);
-
- long getReplQueueInterval();
-
- void setReplQueueInterval(long interval);
-
- int getReplQueueMaxElements();
-
- void setReplQueueMaxElements(int max_elements);
-
- /**
- * Returns the transaction isolation level.
- */
- String getIsolationLevel();
-
- /**
- * Set the transaction isolation level. This determines the locking strategy to be used
- */
- void setIsolationLevel(String level);
-
- /**
- * Returns whether or not any initial state transfer or subsequent partial
- * state transfer following an <code>activateRegion</code> call should
- * include in-memory state. Allows for warm/hot caches (true/false). The
- * characteristics of a state transfer can be further defined by a cache
- * loader's FetchPersistentState property.
- */
- boolean getFetchInMemoryState();
-
- /**
- * Sets whether or not any initial or subsequent partial state transfer
- * should include in-memory state.
- */
- void setFetchInMemoryState(boolean flag);
-
- /**
- * Gets the format version of the data transferred during an initial state
- * transfer or a call to {@link Region#activate()}. Different
- * releases of JBossCache may format this data differently; this property
- * identifies the format version being used by this cache instance.
- * <p/>
- * The default value for this property is
- * {@link org.jboss.cache.config.Configuration#DEFAULT_REPLICATION_VERSION}.
- * </p>
- *
- * @return a short identifying JBossCache release; e.g. <code>124</code>
- * for JBossCache 1.2.4
- */
- String getReplicationVersion();
-
- /**
- * Sets the format version of the data transferred during an initial state
- * transfer or a call to {@link Region#activate()}. Different
- * releases of JBossCache may format this data differently; this property
- * identifies the format version being used by this cache instance. Setting
- * this property to a value other than the default allows a cache instance
- * from a later release to interoperate with a cache instance from an
- * earlier release.
- *
- * @param version a short identifying JBossCache release;
- * e.g. <code>124</code> for JBossCache 1.2.4
- */
- void setReplicationVersion(String version);
-
- /**
- * Default max time to wait for a lock. If the lock cannot be acquired within this time, a LockingException will be thrown.
- *
- * @return long Max number of milliseconds to wait for a lock to be acquired
- */
- long getLockAcquisitionTimeout();
-
- /**
- * Set the max time for lock acquisition. A value of 0 means to wait forever (not recomended). Note that lock acquisition timeouts may be removed in the future when we have deadlock detection.
- *
- * @param timeout
- */
- void setLockAcquisitionTimeout(long timeout);
-
- String getTransactionManagerLookupClass();
-
- /**
- * Sets the class of the TransactionManagerLookup impl. This will attempt to create an instance, and will throw an exception if this fails.
- *
- * @param cl
- * @throws Exception
- */
- void setTransactionManagerLookupClass(String cl) throws Exception;
-
- TransactionManager getTransactionManager();
-
- void setTransactionManager(TransactionManager manager);
-
- void setNodeLockingScheme(String nodeLockingScheme);
-
- String getNodeLockingScheme();
-
- /**
- * Gets whether the entire tree is inactive upon startup, only responding
- * to replication messages after activateRegion is
- * called to activate one or more parts of the tree.
- * <p/>
- * This property is only relevant if {@link org.jboss.cache.config.Configuration#isUseRegionBasedMarshalling()} is
- * <code>true</code>.
- */
- boolean isInactiveOnStartup();
-
- /**
- * Sets whether the entire tree is inactive upon startup, only responding
- * to replication messages after {@link Region#activate()} is
- * called to activate one or more parts of the tree.
- * <p/>
- * This property is only relevant if {@link org.jboss.cache.config.Configuration#isUseRegionBasedMarshalling()} is
- * <code>true</code>.
- */
- void setInactiveOnStartup(boolean inactiveOnStartup);
-
- /**
- * Sets the buddy replication configuration element
- *
- * @param config
- */
- void setBuddyReplicationConfig(Element config);
-
- /**
- * Retrieves the buddy replication cofiguration element
- *
- * @return config
- */
- Element getBuddyReplicationConfig();
-
- /**
- * Retrieves the JGroups multiplexer stack name if defined.
- *
- * @return the multiplexer stack name
- */
- String getMultiplexerStack();
-
- /**
- * Used with JGroups multiplexer, specifies stack to be used (e.g., fc-fast-minimalthreads)
- * This attribute is optional; if not provided, a default multiplexer stack will be used.
- *
- * @param stackName the name of the multiplexer stack
- */
- void setMultiplexerStack(String stackName);
-
- ChannelFactory getMuxChannelFactory();
-
- void setMuxChannelFactory(ChannelFactory factory);
}
1.7 +5 -14 JBossCache/src/org/jboss/cache/jmx/CacheLegacyJmxWrapper.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheLegacyJmxWrapper.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/jmx/CacheLegacyJmxWrapper.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- CacheLegacyJmxWrapper.java 9 May 2007 18:27:33 -0000 1.6
+++ CacheLegacyJmxWrapper.java 11 May 2007 22:40:59 -0000 1.7
@@ -30,6 +30,7 @@
import org.jboss.cache.config.BuddyReplicationConfig;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.ConfigurationException;
import org.jboss.cache.config.EvictionConfig;
import org.jboss.cache.config.RuntimeConfig;
import org.jboss.cache.factories.XmlConfigurationParser;
@@ -43,7 +44,7 @@
* configuration of the cache using the JBoss AS 4.x JMX microkernel.
*
* @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
- * @version $Revision: 1.6 $
+ * @version $Revision: 1.7 $
*/
public class CacheLegacyJmxWrapper extends CacheJmxWrapper implements CacheLegacyJmxWrapperMBean, NotificationBroadcaster
{
@@ -70,7 +71,7 @@
}
@Override
- protected void constructCache() throws Exception
+ protected void constructCache() throws ConfigurationException
{
super.constructCache();
if (multiplexerService != null)
@@ -166,11 +167,6 @@
return getConfiguration().getLockAcquisitionTimeout();
}
- /**
- *
- *
- * @deprecated directly inject the ChannelFactory via {@link #setMuxChannelFactory(ChannelFactory)}
- */
public ObjectName getMultiplexerService()
{
return multiplexerService;
@@ -331,14 +327,9 @@
getConfiguration().setLockAcquisitionTimeout(timeout);
}
- /**
- *
- *
- * @deprecated directly inject the ChannelFactory via {@link #setMuxChannelFactory(ChannelFactory)}
- */
- public ObjectName setMultiplexerService(ObjectName muxService)
+ public void setMultiplexerService(ObjectName muxService)
{
- return multiplexerService = muxService;
+ this.multiplexerService = muxService;
}
public void setMultiplexerStack(String stackName)
More information about the jboss-cvs-commits
mailing list