Class DirectorySynchroniserBarrier

java.lang.Object
com.atlassian.jira.user.util.DirectorySynchroniserBarrier

@NotThreadSafe public class DirectorySynchroniserBarrier extends Object
Class that tries to wait for any "Crowd Embedded" synchronisations to finish. This class is *not* thread safe, only one thread may await on this class.

NOTE: This is a complete hack. It does not work in all cases. It would be better if we could tell "Crowd Embedded" to shutdownAndWait be we can't currently so this is here to catch a majority of cases where this is a problem.

Since:
v5.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    DirectorySynchroniserBarrier(com.atlassian.crowd.embedded.api.ApplicationFactory applicationFactory, com.atlassian.crowd.embedded.api.CrowdDirectoryService crowdDirectoryService, com.atlassian.event.api.EventPublisher publisher)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    await(long timeout, TimeUnit unit)
     
    void
    onDirectoryFinished(com.atlassian.crowd.event.directory.RemoteDirectorySynchronisedEvent finished)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DirectorySynchroniserBarrier

      public DirectorySynchroniserBarrier(com.atlassian.crowd.embedded.api.ApplicationFactory applicationFactory, com.atlassian.crowd.embedded.api.CrowdDirectoryService crowdDirectoryService, com.atlassian.event.api.EventPublisher publisher)
  • Method Details

    • await

      public boolean await(long timeout, TimeUnit unit)
    • onDirectoryFinished

      @EventListener public void onDirectoryFinished(com.atlassian.crowd.event.directory.RemoteDirectorySynchronisedEvent finished)