Exemplo n.º 1
0
 @Override
 public boolean isSameRM(XAResource xaResource) throws XAException {
   if (this == xaResource) {
     return true;
   }
   if (xaResource instanceof XAResourceImpl) {
     XAResourceImpl otherXaResource = (XAResourceImpl) xaResource;
     return groupName.equals(otherXaResource.groupName);
   }
   return xaResource.isSameRM(this);
 }
  /** identity of resources */
  public boolean isSameRM(XAResource resource) throws XAException {
    if (!(resource instanceof ManagedPoolItem)) return false;

    ManagedPoolItem poolItem = (ManagedPoolItem) resource;

    // if (_cm == poolItem._cm)
    //  return true;

    if (_xaResource == null) return false;

    boolean isSameRM = _xaResource.isSameRM(poolItem._xaResource);

    if (log.isLoggable(Level.FINER)) log.finer("isSameRM->" + isSameRM + " " + _xaResource);

    return isSameRM;
  }
Exemplo n.º 3
0
 synchronized byte[] getBranchId(XAResource xaResource) {
   if (xaResource instanceof XaResource) {
     byte branchId[] = ((XaResource) xaResource).getBranchId();
     if (branchId != null) {
       return branchId;
     }
   }
   for (Map.Entry<String, XaDataSource> entry : dataSources.entrySet()) {
     XaDataSource dataSource = entry.getValue();
     XAResource resource = dataSource.getXaConnection().getXaResource();
     try {
       if (resource.isSameRM(xaResource)) {
         String name = entry.getKey();
         return sourceIdMapping.get(name);
       }
     } catch (XAException e) {
       throw new TransactionFailureException("Unable to check is same resource", e);
     }
   }
   throw new TransactionFailureException(
       "Unable to find mapping for XAResource[" + xaResource + "]");
 }
Exemplo n.º 4
0
 @Override
 public boolean isSameRM(XAResource xaResource) throws XAException {
   return xaResource.isSameRM(xaResource);
 }