Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

represents a "best practice" for new DSpace architecture and implementation of extensions to the DSpace application. DSpace Services are best described as a "Simple Registry" where plugins FIXME. The DS2 (DSpace 2.0) core services are the main services that make up a DS2 system. These includes services for things like user and permissions management and storage and caching. These services can be used by any developer writing DS2 plugins (e.g. statistics), providers (e.g. authentication), or user interfaces (e.g. JSPUI).

Core Services

...

The Service Manager

Code Block

package org.dspace.kernel;

import java.util.List;
import java.util.Map;

public interface ServiceManager {

    public <T> List<T> getServicesByType(Class<T> type);

    public <T> T getServiceByName(String name, Class<T> type);

    public boolean isServiceExists(String name);

    public List<String> getServicesNames();

    public void registerService(String name, Object service);

    public <T> T registerServiceClass(String name, Class<T> type);

    public void unregisterService(String name);

    public void pushConfig(Map<String, String> settings);

}

Core Services

Behind APIs

 can be reimplemented without affecting developers who are using the services. 

Most of the services have plugin/provider points so that customizations can be added into the system without touching the core services code.

Example, specialized authentication system and wants to manage the authentication calls which come into the system. The implementor can simply implement an AuthenticationProvider and then register it with the DS2 kernel's ServiceManager. This can be done at any time and does not have to be done during Kernel startup. This allows providers to be swapped out at runtime without disrupting the DS2 service if desired. It can also speed up development by allowing quick hot redeploys of code during development.

Configuration Service

Code Block
/* Instantiate the Utility Class */
DSpace dspace = new DSpace();

/* Access get the Service Manager by convenience method */
ConfigurationService service = dspace.getSingletonService(ConfigurationService.class);

Legacy Configuration

Wiki Markup
_\[dspace\]/config/dspace.cfg{_}

...