All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.dspace.xoai.services.impl.DSpaceServiceResolver Maven / Gradle / Ivy

There is a newer version: 8.0
Show newest version
/**
 * The contents of this file are subject to the license and copyright
 * detailed in the LICENSE and NOTICE files at the root of the source
 * tree and available online at
 *
 * http://www.dspace.org/license/
 */
package org.dspace.xoai.services.impl;

import java.util.Map;

import com.lyncode.builder.MapBuilder;
import com.lyncode.xoai.dataprovider.services.api.ResourceResolver;
import org.dspace.xoai.services.api.ServiceResolver;
import org.dspace.xoai.services.api.config.ConfigurationService;
import org.dspace.xoai.services.impl.config.DSpaceConfigurationService;
import org.dspace.xoai.services.impl.resources.DSpaceResourceResolver;

public class DSpaceServiceResolver implements ServiceResolver {
    private Map services = new MapBuilder()
        .withPair(ConfigurationService.class.getName(), new DSpaceConfigurationService())
        .withPair(ResourceResolver.class.getName(), new DSpaceResourceResolver())
        .build();

    @Override
    public  T getService(Class type) {
        return (T) services.get(type.getName());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy