Examples of RegisteredSolrServerTracker


Examples of org.apache.stanbol.commons.solr.RegisteredSolrServerTracker

    }

    private SolrServer getSolrServerFromTracker(String coreName) throws StoreException {
        SolrServer solrServer = null;
        for (int i = 0; solrServer == null && i <= SECONDS_TO_WAITFOR_CORE_TO_BEREADY; i++) {
            RegisteredSolrServerTracker tracker = null;
            try {
                tracker = new RegisteredSolrServerTracker(bundleContext, new IndexReference(
                        managedSolrServer.getServerName(), coreName));
            } catch (InvalidSyntaxException e) {
                String message = e.getMessage();
                if (message == null || message.isEmpty()) {
                    message = "Failed to create a RegisteredSolrServerTracker";
                }
                throw new StoreException(message, e);
            }
            tracker.open();
            solrServer = tracker.getService();
            tracker.close();
            if (solrServer != null || i == SECONDS_TO_WAITFOR_CORE_TO_BEREADY) break;
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                // do nothing
View Full Code Here

Examples of org.apache.stanbol.commons.solr.RegisteredSolrServerTracker

            solrRankingField = value.toString().trim();
        }
       
        //(9) start tracking the SolrCore
        try {
            solrServerTracker = new RegisteredSolrServerTracker(
                bundleContext, indexReference, null){
               
                @Override
                public void removedService(ServiceReference reference, Object service) {
                    log.info(" ... SolrCore for {} was removed!", indexReference);
View Full Code Here

Examples of org.apache.stanbol.commons.solr.RegisteredSolrServerTracker

                }
            } //else already active nothing todo
            solrIndexRef = metadata.getIndexReference();
        } //else the SolrServer will be supplied (e.g. created by installing a full index)
        try {
            registeredServerTracker = new RegisteredSolrServerTracker(
                context, solrIndexRef,null){
                   
                    @Override
                    public void removedService(ServiceReference reference, Object service) {
                        updateSolrYardRegistration(registeredServerTracker.getService(),config);
View Full Code Here

Examples of org.apache.stanbol.commons.solr.RegisteredSolrServerTracker

            try {
                IndexReference indexReference = IndexReference.parse(solrCoreId);
                //String configName = getRequiredStringParam(config, SOLR_CONFIG, defaultValue)
                indexReference = checkInitSolrIndex(indexReference, solrCoreConfig);
                // track the solr core OSGi updates
                indexTracker = new RegisteredSolrServerTracker(context.getBundleContext(), indexReference);
                indexTracker.open();
            } catch (Exception e) {
                throw new ConfigurationException(solrCoreProperty, e.getMessage(), e);
            }
        }
View Full Code Here

Examples of org.apache.stanbol.commons.solr.RegisteredSolrServerTracker

                        throw new YardException("Unable to initialise configured SolrServer'"+
                            config.getSolrServerLocation() +"'!",e);
                    }
                } else { //within OSGI dynamically track the service
                    try {
                        _registeredServerTracker = new RegisteredSolrServerTracker(
                            context.getBundleContext(), indexReference, null);
                        log.info(" ... start tracking for SolrCore based on {}",indexReference);
                        _registeredServerTracker.open(); //start tracking
                    } catch (InvalidSyntaxException e) {
                        throw new YardException("Unable to track configured SolrServer'"+
View Full Code Here

Examples of org.apache.stanbol.commons.solr.RegisteredSolrServerTracker

                        throw new YardException("Unable to initialise configured SolrServer'"+
                            config.getSolrServerLocation() +"'!",e);
                    }
                } else { //within OSGI dynamically track the service
                    try {
                        _registeredServerTracker = new RegisteredSolrServerTracker(
                            context.getBundleContext(), indexReference, null);
                        _registeredServerTracker.open(); //start tracking
                    } catch (InvalidSyntaxException e) {
                        throw new YardException("Unable to track configured SolrServer'"+
                            config.getSolrServerLocation() +"'!",e);
View Full Code Here

Examples of org.apache.stanbol.commons.solr.RegisteredSolrServerTracker

            }
            try {
                IndexReference indexReference = IndexReference.parse(solrCoreId);
                indexReference = checkInitSolrIndex(indexReference);
                // track the solr core OSGi updates
                indexTracker = new RegisteredSolrServerTracker(context.getBundleContext(), indexReference);
                indexTracker.open();
            } catch (Exception e) {
                throw new ConfigurationException(solrCoreProperty, e.getMessage(), e);
            }
        }
View Full Code Here

Examples of org.apache.stanbol.commons.solr.RegisteredSolrServerTracker

                throw new ConfigurationException(solrCoreProperty,
                        solrCoreProperty + " should be a SolrServer instance for using"
                                + " the engine without any OSGi context. Got: " + solrCoreId);
            }
            try {
                indexTracker = new RegisteredSolrServerTracker(context.getBundleContext(),
                        IndexReference.parse(solrCoreId));
                indexTracker.open();
            } catch (InvalidSyntaxException e) {
                throw new ConfigurationException(solrCoreProperty, e.getMessage(), e);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.