@JmxManaged(descrition="Reset the counter statistic") public void reset() { isClosed = false; cnt = 0; startTime = 0; lastTime = 0; }
@JmxManaged(descrition="Should the counter create and throw a RunntimeException() on next count") public boolean isThrowExceptionOnNextCount() { return throwExceptionOnNextCount; } @JmxManaged(descrition="Should the counter create and throw a RunntimeException() on next count")
@JmxManaged(descrition="Set the interval after it will sleeping") public void setSleepInterval(long sleepInterval) { this.sleepInterval = sleepInterval; } @JmxManaged(descrition="Get the seconds to sleep each interval")
@JmxManaged public long getValue() { return value; }
/** * Cleanup the connection pool. Unused or closed connections will be removed. * TODO new strategy to remove unused connections - not prompt, need a timeout time or minimum pool size. * @param unusedAlso */ @JmxManaged(descrition="Cleanup unused connections") public abstract void cleanup(boolean unusedAlso);
/** * Returns the persistent schema properties if supported. * @return The properties or null */ @JmxManaged(descrition="Database Properties of the Schema") public abstract DbProperties getSchemaProperties();
@JmxManaged(descrition="Unique name of the pool") public String getPoolId() { return name; }
@JmxManaged(descrition="Get the interval") public long getSleepInterval() { return sleepInterval; } @JmxManaged(descrition="Set the interval after it will sleeping")
@JmxManaged(descrition="Get the seconds to sleep each interval") public int getSleepSeconds() { return sleepSeconds; } @JmxManaged(descrition="Set the seconds to sleep each interval")
/** * {@inheritDoc} * * Current pool size. */ @Override @JmxManaged(descrition="Current size of the pool") public int getSize() { synchronized (pool) { return pool.size(); } }
@Override @JmxManaged(descrition="Name of the watch") public String getName() { return super.getName(); }
@Override @JmxManaged(descrition="Returns the table for the registry name") public Table getTable(String registryName) { reloadLock.waitWithException(MAX_LOCK); return cIndex.get(registryName); }
@JmxManaged(descrition="Resize the display, Parameters: width, height") public void resize(int width, int height) { console.resize(width, height); } }
@Override @JmxManaged(descrition="Current status of the watch") public String getStatusAsString() { return super.getStatusAsString(); }
@Override @JmxManaged(descrition="Currently elapsed time") public String getCurrentTimeAsString() { return super.getCurrentTimeAsString(); }
@JmxManaged public int getCacheSize() { return cache.size(); }
/** * Returns the persistent schema properties if supported. * @return The properties or null */ @Override @JmxManaged(descrition="Database Properties of the Schema") public DbProperties getSchemaProperties() { reloadLock.waitWithException(MAX_LOCK); return schemaPersistence; }
/** {@inheritDoc} */ @Override @JmxManaged(descrition="Current used connections in the pool") public int getUsedSize() { int cnt = 0; synchronized (pool) { for (DbConnection con : new LinkedList<DbConnection>(pool)) { if( con.isUsed()) cnt++; } } return cnt; }
@Override @JmxManaged(descrition="Current mapping of the table and column names") public Map<String,Object> getNameMapping() { reloadLock.waitWithException(MAX_LOCK); return nameMappingRO; }
/** {@inheritDoc} */ @Override @JmxManaged(descrition="Return the usage of the connections") public String dumpUsage(boolean used) { StringBuilder out = new StringBuilder(); synchronized (pool) { for (ConnectionTrace trace : getStackTraces().values()) { out.append(trace.toString()).append("\n"); } } return out.toString(); }