org.apache.maven.index.updater.IndexUpdater Java Examples

The following examples show how to use org.apache.maven.index.updater.IndexUpdater. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NexusRepositoryIndexerImpl.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private void initIndexer () {
    if (!inited) {
        try {
            ContainerConfiguration config = new DefaultContainerConfiguration();
            //#154755 - start
            ClassLoader indexerLoader = NexusRepositoryIndexerImpl.class.getClassLoader();
            ClassWorld classWorld = new ClassWorld();
            ClassRealm plexusRealm = classWorld.newRealm("plexus.core", EmbedderFactory.class.getClassLoader()); //NOI18N
            plexusRealm.importFrom(indexerLoader, "META-INF/sisu"); //NOI18N
            plexusRealm.importFrom(indexerLoader, "org.apache.maven.index"); //NOI18N
            plexusRealm.importFrom(indexerLoader, "org.netbeans.modules.maven.indexer"); //NOI18N
            config.setClassWorld(classWorld);
            config.setClassPathScanning( PlexusConstants.SCANNING_INDEX );
            //#154755 - end
            embedder = new DefaultPlexusContainer(config);

            ComponentDescriptor<ArtifactContextProducer> desc = new ComponentDescriptor<ArtifactContextProducer>();
            desc.setRoleClass(ArtifactContextProducer.class);
            desc.setImplementationClass(CustomArtifactContextProducer.class);
            ComponentRequirement req = new ComponentRequirement(); // XXX why is this not automatic?
            req.setFieldName("mapper");
            req.setRole(ArtifactPackagingMapper.class.getName());
            desc.addRequirement(req);
            embedder.addComponentDescriptor(desc);
            indexer = embedder.lookup(Indexer.class);
            searcher = embedder.lookup(SearchEngine.class);
            remoteIndexUpdater = embedder.lookup(IndexUpdater.class);
            contextProducer = embedder.lookup(ArtifactContextProducer.class);
            scanner = new FastScanner(contextProducer);
            inited = true;
        } catch (Exception x) {
            Exceptions.printStackTrace(x);
        }
    }
}
 
Example #2
Source File: IndexQuerier.java    From sling-whiteboard with Apache License 2.0 5 votes vote down vote up
public IndexQuerier() throws PlexusContainerException, ComponentLookupException {

        DefaultContainerConfiguration config = new DefaultContainerConfiguration();
        config.setClassPathScanning(PlexusConstants.SCANNING_INDEX);

        this.plexusContainer = new DefaultPlexusContainer(config);

        // lookup the indexer components from plexus
        this.indexer = plexusContainer.lookup(Indexer.class);
        this.indexUpdater = plexusContainer.lookup(IndexUpdater.class);
        // lookup wagon used to remotely fetch index
        this.httpWagon = plexusContainer.lookup(Wagon.class, "https");
    }
 
Example #3
Source File: DownloadRemoteIndexTaskRequest.java    From archiva with Apache License 2.0 4 votes vote down vote up
public IndexUpdater getIndexUpdater()
{
    return indexUpdater;
}
 
Example #4
Source File: DownloadRemoteIndexTaskRequest.java    From archiva with Apache License 2.0 4 votes vote down vote up
public DownloadRemoteIndexTaskRequest setIndexUpdater( IndexUpdater indexUpdater )
{
    this.indexUpdater = indexUpdater;
    return this;
}