| | |
| | | import java.util.zip.ZipOutputStream; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | import java.util.concurrent.CopyOnWriteArrayList; |
| | | import java.util.concurrent.locks.ReentrantLock; |
| | | import javax.crypto.Mac; |
| | | |
| | | import org.opends.messages.Message; |
| | |
| | | |
| | | // The write lock used to ensure that only one thread can apply a |
| | | // configuration update at any given time. |
| | | private ReentrantLock configLock; |
| | | private Object configLock; |
| | | |
| | | // The path to the configuration file. |
| | | private String configFile; |
| | |
| | | throws InitializationException |
| | | { |
| | | // Initialize the config lock. |
| | | configLock = new ReentrantLock(); |
| | | configLock = new Object(); |
| | | |
| | | |
| | | // Determine whether we should try to start using the last known good |
| | |
| | | |
| | | // Grab the config lock to ensure that only one config update may be in |
| | | // progress at any given time. |
| | | configLock.lock(); |
| | | |
| | | try |
| | | synchronized (configLock) |
| | | { |
| | | // Make sure that the target DN does not already exist. If it does, then |
| | | // fail. |
| | |
| | | throw new DirectoryException(resultCode, message); |
| | | } |
| | | } |
| | | finally |
| | | { |
| | | configLock.unlock(); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | // Grab the config lock to ensure that only one config update may be in |
| | | // progress at any given time. |
| | | configLock.lock(); |
| | | |
| | | try |
| | | synchronized (configLock) |
| | | { |
| | | // Get the target entry. If it does not exist, then fail. |
| | | ConfigEntry entry = configEntries.get(entryDN); |
| | |
| | | throw new DirectoryException(resultCode, message); |
| | | } |
| | | } |
| | | finally |
| | | { |
| | | configLock.unlock(); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | // Grab the config lock to ensure that only one config update may be in |
| | | // progress at any given time. |
| | | configLock.lock(); |
| | | |
| | | |
| | | try |
| | | synchronized (configLock) |
| | | { |
| | | // Get the DN of the target entry for future reference. |
| | | DN entryDN = e.getDN(); |
| | |
| | | throw new DirectoryException(resultCode, message); |
| | | } |
| | | } |
| | | finally |
| | | { |
| | | configLock.unlock(); |
| | | } |
| | | } |
| | | |
| | | |