Package org.apache.jackrabbit.oak.plugins.index.solr.server

Examples of org.apache.jackrabbit.oak.plugins.index.solr.server.SolrServerProvider


     * @return a {@link SolrServerProvider} adapted from the OSGi service, or a directly
     *         instantiated one or <code>null</code> if both failed
     */
    public static <T extends SolrServerProvider> SolrServerProvider adaptOsgiSolrServerProvider(
                    Class<T> providerClass) {
        SolrServerProvider solrServerProvider = null;
        try {
            BundleContext ctx = FrameworkUtil.getBundle(providerClass).getBundleContext();
            ServiceReference serviceReference = ctx.getServiceReference(SolrServerProvider.class
                            .getName());
            if (serviceReference != null) {
View Full Code Here


        return solrServerProvider;
    }

    public static <T extends SolrServerProvider> SolrServerProvider getSolrServerProvider(
                    Class<T> providerClass) {
        SolrServerProvider solrServerProvider = adaptOsgiSolrServerProvider(providerClass);
        if (solrServerProvider == null && providerClass != null) {
            try {
                solrServerProvider = providerClass.newInstance();
            } catch (InstantiationException e) {
                // do nothing
View Full Code Here

        try {
            solrServer = new EmbeddedSolrServerProvider(new EmbeddedSolrServerConfiguration(f.getPath(), "", "oak")).getSolrServer();
        } catch (Exception e) {
            throw new RuntimeException();
        }
        SolrServerProvider solrServerProvider = new SolrServerProvider() {
            @Override
            public SolrServer getSolrServer() throws Exception {
                return solrServer;
            }
        };
View Full Code Here

        try {
            solrServer = new EmbeddedSolrServerProvider(new EmbeddedSolrServerConfiguration(f.getPath(), "", "oak")).getSolrServer();
        } catch (Exception e) {
            throw new RuntimeException();
        }
        SolrServerProvider solrServerProvider = new SolrServerProvider() {
            @Override
            public SolrServer getSolrServer() throws Exception {
                return solrServer;
            }
        };
View Full Code Here

        try {
            solrServer = new EmbeddedSolrServerProvider(new EmbeddedSolrServerConfiguration(f.getPath(), "", "oak")).getSolrServer();
        } catch (Exception e) {
            throw new RuntimeException();
        }
        SolrServerProvider solrServerProvider = new SolrServerProvider() {
            @Override
            public SolrServer getSolrServer() throws Exception {
                return solrServer;
            }
        };
View Full Code Here

                if (serverType != null && !"none".equals(serverType)) {
                    SolrServerConfigurationProvider solrServerConfigurationProvider = solrServerConfigurationProviders.get(serverType);
                    if (solrServerConfigurationProvider != null) {
                        try {
                            SolrServerConfiguration solrServerConfiguration = solrServerConfigurationProvider.getSolrServerConfiguration();
                            SolrServerProvider solrServerProvider = solrServerConfiguration.getProvider();
                            cachedSolrServer = solrServerProvider.getSolrServer();
                        } catch (Exception e) {
                            log.error("could not get a SolrServerProvider of type {}", serverType, e);
                        }
                    }
                }
View Full Code Here

     * @return a {@link SolrServerProvider} adapted from the OSGi service, or a directly
     *         instantiated one or <code>null</code> if both failed
     */
    public static <T extends SolrServerProvider> SolrServerProvider adaptOsgiSolrServerProvider(
                    Class<T> providerClass) {
        SolrServerProvider solrServerProvider = null;
        try {
            BundleContext ctx = FrameworkUtil.getBundle(providerClass).getBundleContext();
            ServiceReference serviceReference = ctx.getServiceReference(SolrServerProvider.class
                            .getName());
            if (serviceReference != null) {
View Full Code Here

        return solrServerProvider;
    }

    public static <T extends SolrServerProvider> SolrServerProvider getSolrServerProvider(
                    Class<T> providerClass) {
        SolrServerProvider solrServerProvider = adaptOsgiSolrServerProvider(providerClass);
        if (solrServerProvider == null && providerClass != null) {
            try {
                solrServerProvider = providerClass.newInstance();
            } catch (InstantiationException e) {
                // do nothing
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.plugins.index.solr.server.SolrServerProvider

Copyright © 2018 www.massapicom. 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.