X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=org.argeo.util%2Fsrc%2Forg%2Fargeo%2Fosgi%2Fuseradmin%2FWcXaResource.java;h=32bb401bc4695f997f021ebd190406308a538348;hb=d74f9b604d0132a6b66c7a2dc189be2c2798b7c4;hp=1630b6bd36befa841d3968b84d260750dda8e017;hpb=9f729eeb8255a9d800ad2506735dda8cc215a135;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.util/src/org/argeo/osgi/useradmin/WcXaResource.java b/org.argeo.util/src/org/argeo/osgi/useradmin/WcXaResource.java index 1630b6bd3..32bb401bc 100644 --- a/org.argeo.util/src/org/argeo/osgi/useradmin/WcXaResource.java +++ b/org.argeo.util/src/org/argeo/osgi/useradmin/WcXaResource.java @@ -11,7 +11,7 @@ import javax.transaction.xa.Xid; class WcXaResource implements XAResource { private final AbstractUserDirectory userDirectory; - private Map workingCopies = new HashMap(); + private Map workingCopies = new HashMap(); private Xid editingXid = null; private int transactionTimeout = 0; @@ -22,10 +22,10 @@ class WcXaResource implements XAResource { @Override public synchronized void start(Xid xid, int flags) throws XAException { if (editingXid != null) - throw new UserDirectoryException("Already editing " + editingXid); - UserDirectoryWorkingCopy wc = workingCopies.put(xid, new UserDirectoryWorkingCopy()); + throw new IllegalStateException("Already editing " + editingXid); + DirectoryUserWorkingCopy wc = workingCopies.put(xid, new DirectoryUserWorkingCopy()); if (wc != null) - throw new UserDirectoryException("There is already a working copy for " + xid); + throw new IllegalStateException("There is already a working copy for " + xid); this.editingXid = xid; } @@ -34,16 +34,16 @@ class WcXaResource implements XAResource { checkXid(xid); } - private UserDirectoryWorkingCopy wc(Xid xid) { + private DirectoryUserWorkingCopy wc(Xid xid) { return workingCopies.get(xid); } - synchronized UserDirectoryWorkingCopy wc() { + synchronized DirectoryUserWorkingCopy wc() { if (editingXid == null) return null; - UserDirectoryWorkingCopy wc = workingCopies.get(editingXid); + DirectoryUserWorkingCopy wc = workingCopies.get(editingXid); if (wc == null) - throw new UserDirectoryException("No working copy found for " + editingXid); + throw new IllegalStateException("No working copy found for " + editingXid); return wc; } @@ -56,7 +56,7 @@ class WcXaResource implements XAResource { @Override public int prepare(Xid xid) throws XAException { checkXid(xid); - UserDirectoryWorkingCopy wc = wc(xid); + DirectoryUserWorkingCopy wc = wc(xid); if (wc.noModifications()) return XA_RDONLY; try { @@ -72,7 +72,7 @@ class WcXaResource implements XAResource { public void commit(Xid xid, boolean onePhase) throws XAException { try { checkXid(xid); - UserDirectoryWorkingCopy wc = wc(xid); + DirectoryUserWorkingCopy wc = wc(xid); if (wc.noModifications()) return; if (onePhase)