Package org.dspace.kernel

Examples of org.dspace.kernel.ServiceManager


        return result;
    }

    public static DiscoveryConfigurationService getConfigurationService() {
        DSpace dspace  = new DSpace();
        ServiceManager manager = dspace.getServiceManager();
        return manager.getServiceByName(DiscoveryConfigurationService.class.getName(), DiscoveryConfigurationService.class);
    }
View Full Code Here


    public static void main(String[] args) throws Exception {

        //Populate our solr
        Context context = new Context();
        ServiceManager serviceManager = getServiceManager();


        AuthorityIndexingService indexingService = serviceManager.getServiceByName(AuthorityIndexingService.class.getName(),AuthorityIndexingService.class);
        List<AuthorityIndexerInterface> indexers = serviceManager.getServicesByType(AuthorityIndexerInterface.class);

        log.info("Cleaning the old index");
        System.out.println("Cleaning the old index");
        indexingService.cleanIndex();
View Full Code Here

        context.abort();
        System.out.println("All done !");
    }

    public static void indexItem(Context context, Item item){
        ServiceManager serviceManager = getServiceManager();

        AuthorityIndexingService indexingService = serviceManager.getServiceByName(AuthorityIndexingService.class.getName(),AuthorityIndexingService.class);
        List<AuthorityIndexerInterface> indexers = serviceManager.getServicesByType(AuthorityIndexerInterface.class);


        for (AuthorityIndexerInterface indexerInterface : indexers) {

            indexerInterface.init(context , item);
View Full Code Here

     * Test method for {@link org.dspace.utils.servicemanager.ProviderStack#ProviderStack(org.dspace.kernel.ServiceManager, java.lang.Class)}.
     */
    @Test
    public void testProviderStackServiceManagerClassOfT() {
        // fake service manager for testing
        ServiceManager sm = new ServiceManager() {
            public <T> T getServiceByName(String name, Class<T> type) {
                return null;
            }
            public <T> List<T> getServicesByType(Class<T> type) {
                return new ArrayList<T>();
View Full Code Here

                throw new IllegalStateException("Could not get the DSpace Kernel");
            }
            if (! kernel.isRunning()) {
                throw new IllegalStateException("DSpace Kernel is not running, cannot startup the DirectServlet");
            }
            ServiceManager serviceManager = kernel.getServiceManager();
            sessionService = serviceManager.getServiceByName(SessionService.class.getName(), SessionService.class);
            if (sessionService == null) {
                throw new IllegalStateException("Could not get the DSpace SessionService");
            }
            requestService = serviceManager.getServiceByName(RequestService.class.getName(), RequestService.class);
            if (requestService == null) {
                throw new IllegalStateException("Could not get the DSpace RequestService");
            }
            log.info("Servlet initialized");
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.dspace.kernel.ServiceManager

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.