Search in sources :

Example 1 with RepositoryRegistryEvent

use of org.apache.archiva.repository.event.RepositoryRegistryEvent in project archiva by apache.

the class ArchivaRepositoryRegistry method registerManagedRepositoryHandler.

public void registerManagedRepositoryHandler(RepositoryHandler<ManagedRepository, ManagedRepositoryConfiguration> managedRepositoryHandler) {
    this.managedRepositoryHandler = managedRepositoryHandler;
    doRegister(managedRepositoryHandler);
    initializeManagedRepositories();
    if (managed_initialized.get() && remote_initialized.get() && groups_initalized.get()) {
        pushEvent(new RepositoryRegistryEvent(RepositoryRegistryEvent.INITIALIZED, this));
    }
}
Also used : RepositoryRegistryEvent(org.apache.archiva.repository.event.RepositoryRegistryEvent)

Example 2 with RepositoryRegistryEvent

use of org.apache.archiva.repository.event.RepositoryRegistryEvent in project archiva by apache.

the class ArchivaRepositoryRegistry method initializeRemoteRepositories.

private void initializeRemoteRepositories() {
    if (this.remoteRepositoryHandler != null) {
        this.remoteRepositoryHandler.initializeFromConfig();
        this.remote_initialized.set(true);
        pushEvent(new RepositoryRegistryEvent(RepositoryRegistryEvent.REMOTE_REPOS_INITIALIZED, this));
    }
}
Also used : RepositoryRegistryEvent(org.apache.archiva.repository.event.RepositoryRegistryEvent)

Example 3 with RepositoryRegistryEvent

use of org.apache.archiva.repository.event.RepositoryRegistryEvent in project archiva by apache.

the class ArchivaRepositoryRegistry method initialize.

@PostConstruct
private void initialize() {
    rwLock.writeLock().lock();
    try {
        log.debug("Initializing repository registry");
        initializeManagedRepositories();
        initializeRemoteRepositories();
        initializeRepositoryGroups();
        for (RepositoryProvider provider : repositoryProviders) {
            provider.addRepositoryEventHandler(this);
        }
        this.configurationHandler.addListener(this);
        registerEventHandler(EventType.ROOT, centralEventManager);
    } finally {
        rwLock.writeLock().unlock();
    }
    pushEvent(new RepositoryRegistryEvent(RepositoryRegistryEvent.RELOADED, this));
    if (managed_initialized.get() && remote_initialized.get() && groups_initalized.get()) {
        pushEvent(new RepositoryRegistryEvent(RepositoryRegistryEvent.INITIALIZED, this));
    }
}
Also used : RepositoryRegistryEvent(org.apache.archiva.repository.event.RepositoryRegistryEvent) RepositoryProvider(org.apache.archiva.repository.RepositoryProvider) PostConstruct(javax.annotation.PostConstruct)

Example 4 with RepositoryRegistryEvent

use of org.apache.archiva.repository.event.RepositoryRegistryEvent in project archiva by apache.

the class ArchivaRepositoryRegistry method initializeManagedRepositories.

private void initializeManagedRepositories() {
    if (this.managedRepositoryHandler != null) {
        this.managedRepositoryHandler.initializeFromConfig();
        this.managed_initialized.set(true);
        pushEvent(new RepositoryRegistryEvent(RepositoryRegistryEvent.MANAGED_REPOS_INITIALIZED, this));
    }
}
Also used : RepositoryRegistryEvent(org.apache.archiva.repository.event.RepositoryRegistryEvent)

Example 5 with RepositoryRegistryEvent

use of org.apache.archiva.repository.event.RepositoryRegistryEvent in project archiva by apache.

the class ArchivaRepositoryRegistry method registerGroupHandler.

public void registerGroupHandler(RepositoryHandler<RepositoryGroup, RepositoryGroupConfiguration> groupHandler) {
    this.groupHandler = groupHandler;
    doRegister(groupHandler);
    initializeRepositoryGroups();
    if (managed_initialized.get() && remote_initialized.get() && groups_initalized.get()) {
        pushEvent(new RepositoryRegistryEvent(RepositoryRegistryEvent.INITIALIZED, this));
    }
}
Also used : RepositoryRegistryEvent(org.apache.archiva.repository.event.RepositoryRegistryEvent)

Aggregations

RepositoryRegistryEvent (org.apache.archiva.repository.event.RepositoryRegistryEvent)8 PostConstruct (javax.annotation.PostConstruct)1 PreDestroy (javax.annotation.PreDestroy)1 RepositoryProvider (org.apache.archiva.repository.RepositoryProvider)1