Esempio n. 1
0
 /**
  * <b>Note:</b> If multiple PooledDataSources in your JVM share the same <tt>dataSourceName</tt>,
  * which of those multiple DataSources will be returned by this method is undefined!
  *
  * @return a PooledDataSource with the given <tt>dataSourceName</tt>, if at least one exists.
  *     <tt>null</tt> otherwise.
  */
 public static synchronized PooledDataSource pooledDataSourceByName(String dataSourceName) {
   for (Iterator ii = unclosedPooledDataSources.iterator(); ii.hasNext(); ) {
     PooledDataSource pds = (PooledDataSource) ii.next();
     if (pds.getDataSourceName().equals(dataSourceName)) return pds;
   }
   return null;
 }
Esempio n. 2
0
 private StatusReporter findStatusReporter(PooledDataSource pds, Document doc) {
   if (pds.getClass() == ComboPooledDataSource.class)
     return new CpdsStatusReporter((ComboPooledDataSource) pds, doc);
   else if (pds.getClass() == PoolBackedDataSource.class)
     return new PbdsStatusReporter((PoolBackedDataSource) pds, doc);
   else return new UnknownPdsStatusReporter(pds, doc);
 }
Esempio n. 3
0
 public synchronized int getNumThreadsAllThreadPools() throws SQLException {
   int count = 0;
   for (Iterator ii = unclosedPooledDataSources.iterator(); ii.hasNext(); ) {
     PooledDataSource pds = (PooledDataSource) ii.next();
     count += pds.getNumHelperThreads();
   }
   return count;
 }
Esempio n. 4
0
 /** @return the set of all PooledDataSources sharing the given dataSourceName */
 public static synchronized Set pooledDataSourcesByName(String dataSourceName) {
   Set out = new HashSet();
   for (Iterator ii = unclosedPooledDataSources.iterator(); ii.hasNext(); ) {
     PooledDataSource pds = (PooledDataSource) ii.next();
     if (pds.getDataSourceName().equals(dataSourceName)) out.add(pds);
   }
   return out;
 }
Esempio n. 5
0
    public Element reportDtElem() {
      StringBuffer sb = new StringBuffer(255);
      sb.append(shortTypeName);
      sb.append(" [ dataSourceName: ");
      sb.append(pds.getDataSourceName());
      sb.append("; identityToken: ");
      sb.append(pds.getIdentityToken());
      sb.append(" ]");

      Element dtElem = doc.createElement("dt");
      dtElem.appendChild(doc.createTextNode(sb.toString()));
      return dtElem;
    }
Esempio n. 6
0
 UnknownPdsStatusReporter(PooledDataSource pds, Document doc) {
   this(pds.getClass().getName(), pds, doc);
 }