Package org.jboss.cache.marshall

Source Code of org.jboss.cache.marshall.AbstractVersionAwareMarshallerTest

package org.jboss.cache.marshall;

import org.jboss.cache.RegionManager;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.ComponentRegistry;

/**
* @author Manik Surtani (<a href="mailto:manik@jboss.org">manik@jboss.org</a>)
* @since 2.1.0
*/
public abstract class AbstractVersionAwareMarshallerTest
{
   protected ComponentRegistry cr;

   protected VersionAwareMarshaller createVAMandRestartCache(String replVersion)
   {
      Configuration c = cr.getComponent(Configuration.class);
      c.setReplVersionString(replVersion);
      return createVAMandRestartCache(new RegionManager());
   }

   protected VersionAwareMarshaller createVAMandRestartCache(RegionManager rm)
   {
      cr.registerComponent(rm, RegionManager.class);
      VersionAwareMarshaller vam = (VersionAwareMarshaller) cr.getComponent(Marshaller.class);
      if (cr.getOverallState() == ComponentRegistry.State.STARTED) cr.stop();
      cr.start();
      return vam;
   }
}
TOP

Related Classes of org.jboss.cache.marshall.AbstractVersionAwareMarshallerTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.