| | |
| | | private DN configDn; |
| | | |
| | | /** |
| | | * A boolean indicating if the thread used to save the persistentServerState |
| | | * is terminated. |
| | | */ |
| | | private boolean done = false; |
| | | |
| | | /** |
| | | * This class contain the context related to an import or export |
| | | * launched on the domain. |
| | | */ |
| | |
| | | { } |
| | | } |
| | | state.save(); |
| | | |
| | | done = true; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | private void createListeners() |
| | | { |
| | | synchroThreads.clear(); |
| | | for (int i=0; i<listenerThreadNumber; i++) |
| | | synchronized (synchroThreads) |
| | | { |
| | | ListenerThread myThread = new ListenerThread(this); |
| | | myThread.start(); |
| | | synchroThreads.add(myThread); |
| | | if (!shutdown) |
| | | { |
| | | synchroThreads.clear(); |
| | | for (int i=0; i<listenerThreadNumber; i++) |
| | | { |
| | | ListenerThread myThread = new ListenerThread(this); |
| | | myThread.start(); |
| | | synchroThreads.add(myThread); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | public void shutdown() |
| | | { |
| | | // stop the listener threads |
| | | for (ListenerThread thread : synchroThreads) |
| | | { |
| | | thread.shutdown(); |
| | | } |
| | | |
| | | // stop the flush thread |
| | | shutdown = true; |
| | | |
| | | synchronized (synchroThreads) |
| | | { |
| | | // stop the listener threads |
| | | for (ListenerThread thread : synchroThreads) |
| | | { |
| | | thread.shutdown(); |
| | | } |
| | | } |
| | | |
| | | synchronized (this) |
| | | { |
| | | this.notify(); |
| | |
| | | // wait for the listener thread to stop |
| | | for (ListenerThread thread : synchroThreads) |
| | | { |
| | | thread.shutdown(); |
| | | thread.waitForShutdown(); |
| | | } |
| | | |
| | | // wait for completion of the persistentServerState thread. |
| | | try |
| | | { |
| | | while (!done) |
| | | { |
| | | Thread.sleep(50); |
| | | } |
| | | } catch (InterruptedException e) |
| | | { |
| | | // stop waiting when interrupted. |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | public long computeGenerationId() throws DirectoryException |
| | | { |
| | | Backend backend = this.retrievesBackend(baseDN); |
| | | Backend backend = retrievesBackend(baseDN); |
| | | long bec = backend.getEntryCount(); |
| | | this.acquireIEContext(); |
| | | ieContext.checksumOutput = true; |
| | |
| | | LDIFImportConfig importConfig = null; |
| | | DirectoryException de = null; |
| | | |
| | | Backend backend = this.retrievesBackend(baseDN); |
| | | Backend backend = retrievesBackend(baseDN); |
| | | |
| | | if (!backend.supportsLDIFImport()) |
| | | { |