public Map<String, CacheRegionInfo> call() throws Exception { Map<String, CacheRegionInfo> result = new LinkedHashMap<String, CacheRegionInfo>(); IServer activeCoord = clusterModel.getActiveCoordinator(); ObjectName tmpl = HibernateStatsUtils.getHibernateStatsBeanName(persistenceUnit + ",*"); Set<ObjectName> onSet = activeCoord.queryNames(tmpl, null); Iterator<ObjectName> onIter = onSet.iterator(); createBeanProvider(); while (onIter.hasNext()) { EhcacheHibernateMBean statsBean = activeCoord.getMBeanProxy(onIter.next(), EhcacheHibernateMBean.class); if (result.size() == 0) { Map<String, Map<String, Object>> regionAttrs = statsBean.getRegionCacheAttributes(); Iterator<String> regionNameIter = regionAttrs.keySet().iterator(); while (regionNameIter.hasNext()) { String regionName = regionNameIter.next(); if (!regionName.endsWith("org.hibernate.cache.UpdateTimestampsCache")) { CacheRegionInfo regionInfo = new CacheRegionInfo(regionName, regionAttrs.get(regionName), beanProvider); result.put(regionName, regionInfo); regionInfo.addPropertyChangeListener(CacheRegionsPanel.this); } } } } return result; } });
public Map<String, CacheRegionInfo> call() throws Exception { Map<String, CacheRegionInfo> result = new LinkedHashMap<String, CacheRegionInfo>(); IServer activeCoord = clusterModel.getActiveCoordinator(); ObjectName tmpl = HibernateStatsUtils.getHibernateStatsBeanName(persistenceUnit + ",*"); Set<ObjectName> onSet = activeCoord.queryNames(tmpl, null); Iterator<ObjectName> onIter = onSet.iterator(); createBeanProvider(); while (onIter.hasNext()) { EhcacheHibernateMBean statsBean = activeCoord.getMBeanProxy(onIter.next(), EhcacheHibernateMBean.class); if (result.size() == 0) { Map<String, Map<String, Object>> regionAttrs = statsBean.getRegionCacheAttributes(); Iterator<String> regionNameIter = regionAttrs.keySet().iterator(); while (regionNameIter.hasNext()) { String regionName = regionNameIter.next(); if (!regionName.endsWith("org.hibernate.cache.UpdateTimestampsCache")) { CacheRegionInfo regionInfo = new CacheRegionInfo(regionName, regionAttrs.get(regionName), beanProvider); result.put(regionName, regionInfo); regionInfo.addPropertyChangeListener(CacheRegionsPanel.this); } } } } return result; } });
public Map<String, CacheRegionInfo> call() throws Exception { Map<String, CacheRegionInfo> result = new LinkedHashMap<String, CacheRegionInfo>(); IServer activeCoord = clusterModel.getActiveCoordinator(); ObjectName tmpl = HibernateStatsUtils.getHibernateStatsBeanName(persistenceUnit + ",*"); Set<ObjectName> onSet = activeCoord.queryNames(tmpl, null); Iterator<ObjectName> onIter = onSet.iterator(); createBeanProvider(); while (onIter.hasNext()) { HibernateStatsMBean statsBean = activeCoord.getMBeanProxy(onIter.next(), HibernateStatsMBean.class); statsBean.setStatisticsEnabled(true); if (result.size() == 0) { Map<String, Map<String, Object>> regionAttrs = statsBean.getRegionCacheAttributes(); Iterator<String> regionNameIter = regionAttrs.keySet().iterator(); while (regionNameIter.hasNext()) { String regionName = regionNameIter.next(); CacheRegionInfo regionInfo = new CacheRegionInfo(regionName, regionAttrs.get(regionName), beanProvider); result.put(regionName, regionInfo); regionInfo.addPropertyChangeListener(CacheRegionsPanel.this); } } } return result; } });
public void setup(ApplicationContext appContext, IClusterModel clusterModel, String persistenceUnit) { this.clusterModel = clusterModel; this.persistenceUnit = persistenceUnit; try { statsBeanObjectName = HibernateStatsUtils.getHibernateStatsBeanName(persistenceUnit); } catch (Exception e) { throw new RuntimeException(e); } clusterModel.addPropertyChangeListener(clusterListener = new ClusterListener(clusterModel)); if (clusterModel.isReady()) { init(); } }
public HibernateStatsMBeanProvider(final IClusterModel clusterModel, final String persistenceUnit) { this.clusterModel = clusterModel; this.currBean = nullBean; this.unregisterNotificationListener = new UnRegistrationNotificationListener(); try { templateName = new ObjectName(HibernateStatsUtils.getHibernateStatsBeanName(persistenceUnit).getCanonicalName() + ",*"); } catch (Exception e) { throw new RuntimeException(e); } clusterModel.addPropertyChangeListener(new ClusterListener(clusterModel)); if (clusterModel.isReady()) { init(); } }
public HibernateStatsMBeanProvider(final IClusterModel clusterModel, final String persistenceUnit) { this.clusterModel = clusterModel; this.currBean = nullBean; this.unregisterNotificationListener = new UnRegistrationNotificationListener(); try { templateName = new ObjectName(HibernateStatsUtils.getHibernateStatsBeanName(persistenceUnit).getCanonicalName() + ",*"); } catch (Exception e) { throw new RuntimeException(e); } clusterModel.addPropertyChangeListener(new ClusterListener(clusterModel)); if (clusterModel.isReady()) { init(); } }
public void setup(ApplicationContext appContext, IClusterModel clusterModel, String persistenceUnit) { this.clusterModel = clusterModel; this.persistenceUnit = persistenceUnit; try { statsBeanObjectName = HibernateStatsUtils.getHibernateStatsBeanName(persistenceUnit); } catch (Exception e) { throw new RuntimeException(e); } clusterModel.addPropertyChangeListener(clusterListener = new ClusterListener(clusterModel)); if (clusterModel.isReady()) { init(); } }
public void setup(ApplicationContext appContext, IClusterModel clusterModel, String persistenceUnit) { this.clusterModel = clusterModel; this.persistenceUnit = persistenceUnit; try { statsBeanObjectName = HibernateStatsUtils.getHibernateStatsBeanName(persistenceUnit); } catch (Exception e) { throw new RuntimeException(e); } clusterModel.addPropertyChangeListener(clusterListener = new ClusterListener(clusterModel)); if (clusterModel.isReady()) { init(); } }
public void setup(ApplicationContext appContext, IClusterModel clusterModel, String persistenceUnit) { this.clusterModel = clusterModel; this.persistenceUnit = persistenceUnit; try { statsBeanObjectName = HibernateStatsUtils.getHibernateStatsBeanName(persistenceUnit); } catch (Exception e) { throw new RuntimeException(e); } clusterModel.addPropertyChangeListener(clusterListener = new ClusterListener(clusterModel)); if (clusterModel.isReady()) { init(); } }
public void setup(ApplicationContext appContext, IClusterModel clusterModel, String persistenceUnit) { this.clusterModel = clusterModel; this.persistenceUnit = persistenceUnit; try { statsBeanObjectName = HibernateStatsUtils.getHibernateStatsBeanName(persistenceUnit); } catch (Exception e) { throw new RuntimeException(e); } clusterModel.addPropertyChangeListener(clusterListener = new ClusterListener(clusterModel)); if (clusterModel.isReady()) { init(); } }
public void setup(ApplicationContext appContext, IClusterModel clusterModel, String persistenceUnit) { this.clusterModel = clusterModel; this.persistenceUnit = persistenceUnit; try { statsBeanObjectName = HibernateStatsUtils.getHibernateStatsBeanName(persistenceUnit); } catch (Exception e) { throw new RuntimeException(e); } clusterModel.addPropertyChangeListener(clusterListener = new ClusterListener(clusterModel)); if (clusterModel.isReady()) { init(); } }
private boolean testUnregisterPersistenceUnit(ObjectName on) { boolean result = false; if (!tornDown.get()) { try { if (statsBeanPattern.apply(on)) { String persistenceUnit = on.getKeyProperty("name"); if (persistenceUnit != null) { IServer activeCoord = clusterModel.getActiveCoordinator(); ObjectName tmpl = HibernateStatsUtils.getHibernateStatsBeanName(persistenceUnit); tmpl = new ObjectName(tmpl.getCanonicalName() + ",*"); Set<ObjectName> onSet = activeCoord.queryNames(tmpl, null); if (onSet.size() == 0) { DefaultComboBoxModel puModel = (DefaultComboBoxModel) puSelector.getModel(); int index = puModel.getIndexOf(persistenceUnit); if (index != -1) { pagedView.removePage(persistenceUnit); puModel.removeElementAt(index); result = true; appContext.setStatus("Removed Hibernate persistence-unit '" + persistenceUnit + "'"); } } } } } catch (Exception e) { appContext.log(e); } } return result; }
public void setup(final ApplicationContext appContext, final IClusterModel clusterModel, final String persistenceUnit) { this.appContext = appContext; this.clusterModel = clusterModel; this.persistenceUnit = persistenceUnit; this.beanProvider = new HibernateStatsMBeanProvider(clusterModel, persistenceUnit); this.beanProvider.addNotificationListener(this); try { statsBeanObjectName = HibernateStatsUtils.getHibernateStatsBeanName(persistenceUnit); statsBeanPattern = new ObjectName(statsBeanObjectName.getCanonicalName() + ",*"); } catch (Exception e) { throw new RuntimeException(e); } setLayout(new BorderLayout()); add(createRegionTablePanel()); revalidate(); repaint(); clusterModel.addPropertyChangeListener(clusterListener = new ClusterListener(clusterModel)); if (clusterModel.isReady()) { init(); } }
if (persistenceUnit != null) { IServer activeCoord = clusterModel.getActiveCoordinator(); ObjectName tmpl = HibernateStatsUtils.getHibernateStatsBeanName(persistenceUnit); tmpl = new ObjectName(tmpl.getCanonicalName() + ",*"); Set<ObjectName> onSet = activeCoord.queryNames(tmpl, null);
public void setup(final ApplicationContext appContext, final IClusterModel clusterModel, final String persistenceUnit) { this.appContext = appContext; this.clusterModel = clusterModel; this.persistenceUnit = persistenceUnit; this.beanProvider = new HibernateStatsMBeanProvider(clusterModel, persistenceUnit); this.beanProvider.addNotificationListener(this); try { statsBeanObjectName = HibernateStatsUtils.getHibernateStatsBeanName(persistenceUnit); statsBeanPattern = new ObjectName(statsBeanObjectName.getCanonicalName() + ",*"); } catch (Exception e) { throw new RuntimeException(e); } setLayout(new BorderLayout()); add(createRegionTablePanel()); revalidate(); repaint(); clusterModel.addPropertyChangeListener(clusterListener = new ClusterListener(clusterModel)); if (clusterModel.isReady()) { init(); } }
public void setup(final ApplicationContext appContext, final IClusterModel clusterModel, final String persistenceUnit) { this.appContext = appContext; this.clusterModel = clusterModel; this.persistenceUnit = persistenceUnit; this.beanProvider = new HibernateStatsMBeanProvider(clusterModel, persistenceUnit); this.beanProvider.addNotificationListener(this); try { statsBeanObjectName = HibernateStatsUtils.getHibernateStatsBeanName(persistenceUnit); } catch (Exception e) { throw new RuntimeException(e); } setLayout(new BorderLayout()); add(createRegionTablePanel()); revalidate(); repaint(); clusterModel.addPropertyChangeListener(clusterListener = new ClusterListener(clusterModel)); if (clusterModel.isReady()) { init(); } }
public void setup(final ApplicationContext appContext, final IClusterModel clusterModel, final String persistenceUnit) { this.appContext = appContext; this.clusterModel = clusterModel; this.persistenceUnit = persistenceUnit; this.beanProvider = new HibernateStatsMBeanProvider(clusterModel, persistenceUnit); this.beanProvider.addNotificationListener(this); try { statsBeanObjectName = HibernateStatsUtils.getHibernateStatsBeanName(persistenceUnit); } catch (Exception e) { throw new RuntimeException(e); } setLayout(new BorderLayout()); add(createTabbedPane()); revalidate(); repaint(); clusterModel.addPropertyChangeListener(clusterListener = new ClusterListener(clusterModel)); if (clusterModel.isReady()) { init(); } addHierarchyListener(this); }
public void setup(final ApplicationContext appContext, final IClusterModel clusterModel, final String persistenceUnit) { this.appContext = appContext; this.clusterModel = clusterModel; this.persistenceUnit = persistenceUnit; this.beanProvider = new HibernateStatsMBeanProvider(clusterModel, persistenceUnit); this.beanProvider.addNotificationListener(this); try { statsBeanObjectName = HibernateStatsUtils.getHibernateStatsBeanName(persistenceUnit); } catch (Exception e) { throw new RuntimeException(e); } setLayout(new BorderLayout()); add(createTabbedPane()); revalidate(); repaint(); clusterModel.addPropertyChangeListener(clusterListener = new ClusterListener(clusterModel)); if (clusterModel.isReady()) { init(); } addHierarchyListener(this); }
public void setup(final ApplicationContext appContext, final IClusterModel clusterModel, final String persistenceUnit) { this.appContext = appContext; this.clusterModel = clusterModel; this.persistenceUnit = persistenceUnit; this.beanProvider = new HibernateStatsMBeanProvider(clusterModel, persistenceUnit); this.beanProvider.addNotificationListener(this); try { statsBeanObjectName = HibernateStatsUtils.getHibernateStatsBeanName(persistenceUnit); } catch (Exception e) { throw new RuntimeException(e); } setLayout(new BorderLayout()); add(createTabbedPane()); revalidate(); repaint(); clusterModel.addPropertyChangeListener(clusterListener = new ClusterListener(clusterModel)); if (clusterModel.isReady()) { init(); } addHierarchyListener(this); }