| | |
| | | * |
| | | * @param generationId The new value of generationId. |
| | | */ |
| | | synchronized public void initGenerationID(long generationId) |
| | | public void initGenerationID(long generationId) |
| | | { |
| | | synchronized (generationIDLock) |
| | | { |
| | | this.generationId = generationId; |
| | | this.generationIdSavedStatus = true; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Sets the provided value as the new in memory generationId. |
| | |
| | | * @param savedStatus The saved status of the generationId. |
| | | * @return The old generation id |
| | | */ |
| | | synchronized public long changeGenerationId(long generationId, |
| | | boolean savedStatus) |
| | | public long changeGenerationId(long generationId, boolean savedStatus) |
| | | { |
| | | synchronized (generationIDLock) |
| | | { |
| | | long oldGenerationId = this.generationId; |
| | | |
| | |
| | | this.generationId = generationId; |
| | | this.generationIdSavedStatus = savedStatus; |
| | | } |
| | | |
| | | return oldGenerationId; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Resets the generationID. |
| | |
| | | * @return The monitor data. |
| | | * @throws DirectoryException When an error occurs. |
| | | */ |
| | | synchronized protected MonitorData computeMonitorData( |
| | | boolean updateMonitorData) |
| | | protected MonitorData computeMonitorData(boolean updateMonitorData) |
| | | throws DirectoryException |
| | | { |
| | | synchronized (monitoringLock) |
| | | { |
| | | if (updateMonitorData) |
| | | { |
| | | // Update the monitorData of ALL domains if this was necessary. |
| | |
| | | // Returns the monitorData of THIS domain |
| | | return monitorData; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Start collecting global monitoring information for this |
| | |
| | | private ReentrantLock lock = new ReentrantLock(); |
| | | |
| | | /** |
| | | * This lock is used to protect the monitoring computing. |
| | | */ |
| | | private final Object monitoringLock = new Object(); |
| | | |
| | | /** |
| | | * This lock is used to protect the generationid variable. |
| | | */ |
| | | private final Object generationIDLock = new Object(); |
| | | |
| | | /** |
| | | * Tests if the current thread has the lock on this domain. |
| | | * @return True if the current thread has the lock. |
| | | */ |