Beispiel #1
0
 // must be called with class' lock
 private static void incorporate(IdentityTokenized idt) {
   tokensToTokenized.put(idt.getIdentityToken(), idt);
   if (idt instanceof PooledDataSource) {
     unclosedPooledDataSources.add(idt);
     mc.attemptManagePooledDataSource((PooledDataSource) idt);
   }
 }
Beispiel #2
0
  public static synchronized IdentityTokenized reregister(IdentityTokenized idt) {
    if (idt instanceof PooledDataSource) {
      banner();
      attemptRegisterRegistryMBean();
    }

    if (idt.getIdentityToken() == null)
      throw new RuntimeException(
          "[c3p0 issue] The identityToken of a registered object should be set prior to registration.");

    IdentityTokenized coalesceCheck = (IdentityTokenized) idtCoalescer.coalesce(idt);

    if (!isIncorporated(coalesceCheck)) incorporate(coalesceCheck);

    return coalesceCheck;
  }
Beispiel #3
0
 // must be called with class' lock
 private static boolean isIncorporated(IdentityTokenized idt) {
   return tokensToTokenized.keySet().contains(idt.getIdentityToken());
 }