//
// Beanshell script to run the regular transactional tree cache demo
//
import org.jboss.cache.*;
import org.jboss.cache.aop.PojoCache;

// Tx imports
import javax.transaction.UserTransaction;
import javax.naming.*;
import org.jboss.cache.transaction.DummyTransactionManager;

show();  // verbose mode

// Set up transaction manager
//System.setProperty(Context.INITIAL_CONTEXT_FACTORY,
  //  "org.jboss.cache.transaction.DummyContextFactory");
DummyTransactionManager.getInstance();

prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,
    "org.jboss.cache.transaction.DummyContextFactory");
tx = (UserTransaction)new InitialContext(prop).lookup("UserTransaction");

tree = new TreeCache();
config = new PropertyConfigurator();
// configure tree cache. 
config.configure(tree, "META-INF/replSync-service.xml");

tree.startService();
tree.put("/a/b/c", "key1", "val1");