1 4 package org.objectweb.speedo.jmx.mbeans; 5 6 import org.objectweb.perseus.dependency.api.DependencyGraph; 7 import org.objectweb.speedo.api.SpeedoProperties; 8 import org.objectweb.speedo.pm.api.ProxyManagerFactory; 9 10 import java.util.ArrayList ; 11 import java.util.Collection ; 12 import java.util.HashMap ; 13 import java.util.Iterator ; 14 import java.util.Map ; 15 16 21 public class Tx implements TxMBean { 22 23 ProxyManagerFactory pmf; 24 DependencyGraph dg; 25 26 public Tx(ProxyManagerFactory pmf, DependencyGraph dg) { 27 this.pmf = pmf; 28 this.dg = dg; 29 } 30 31 public String getConcurrencyManager() { 32 return pmf.getProperties().getProperty(SpeedoProperties.TRANSACTION_LOCKING); 33 } 34 35 public String getConcurrencyPolicy() { 36 return (pmf.getOptimistic() ? "optimistic" : "pessimistic"); 37 } 38 39 public String getTransactionManagerName() { 40 return pmf.getProperties().getProperty(SpeedoProperties.TM_NAME); 41 } 42 43 public Collection getDependencies() { 44 Map vs = new HashMap (dg.getVertexes()); 45 ArrayList deps = new ArrayList (vs.size()); 46 for (Iterator it = vs.entrySet().iterator(); it.hasNext();) { 47 Map.Entry me = (Map.Entry ) it.next(); 48 deps.add(me.getKey() + " ==> " + me.getValue()); 49 } 50 return deps; 51 } 52 } 53 | Popular Tags |