1 27 package org.objectweb.speedo.jmx.mbeans; 28 29 import java.util.Collection ; 30 31 import org.objectweb.perseus.cache.api.CacheAttributeController; 32 import org.objectweb.perseus.cache.api.CacheException; 33 import org.objectweb.perseus.cache.api.CacheManager; 34 import org.objectweb.perseus.cache.api.UnbindManager; 35 import org.objectweb.speedo.query.api.QueryManagerAttribute; 36 37 42 public class Query implements QueryMBean { 43 44 private QueryManagerAttribute qma; 45 private CacheAttributeController ca; 46 private UnbindManager um; 47 private CacheManager cm; 48 49 public Query(CacheAttributeController ca, 50 UnbindManager um, 51 CacheManager cm, 52 QueryManagerAttribute qma) { 53 this.ca = ca; 54 this.um = um; 55 this.cm = cm; 56 this.qma = qma; 57 } 58 59 public void evictAllCompiledQueriesFromCache() { 60 try { 61 um.unbindUnfixed(false); 62 } catch (CacheException e) { 63 } 64 } 65 66 public String getCompiledQueryCache_AutoCleanSize() { 67 return ca.getAutoCleanSize(); 68 } 69 public String getCompiledQueryCache_AutoCleanThreshold() { 70 return ca.getAutoCleanThreshold(); 71 } 72 public Collection getCompiledQueryCache_ObjectIdentifiers() { 73 return ca.getCurrentEntryIdentifiers(); 74 } 75 public int getCompiledQueryCache_CurrentSize() { 76 return ca.getCurrentSize(); 77 } 78 public int getCompiledQueryCache_MaxObjects() { 79 return ca.getMaxObjects(); 80 } 81 public void setCompiledQueryCache_AutoCleanSize(String size) { 82 ca.setAutoCleanSize(size); 83 } 84 public void setCompiledQueryCache_AutoCleanThreshold(String size) { 85 ca.setAutoCleanThreshold(size); 86 } 87 public void setCompiledQueryCache_MaxObjects(int size) throws IllegalArgumentException , 88 CacheException { 89 ca.setMaxObjects(size); 90 } 91 92 95 public boolean getPrefetchActivatedOnExtent() { 96 return qma.getPrefetchActivatedOnExtent(); 97 } 98 public boolean getPrefetchActivatedOnQuery() { 99 return qma.getPrefetchActivatedOnQuery(); 100 } 101 public void setPrefetchActivatedOnExtent(boolean prefetch) { 102 qma.setPrefetchActivatedOnExtent(prefetch); 103 } 104 public void setPrefetchActivatedOnQuery(boolean prefetch) { 105 qma.setPrefetchActivatedOnQuery(prefetch); 106 } 107 } 108 | Popular Tags |