...
When a request is made by either the Webapplication or the CLI initialization, then the Request Lifecycle is engaged:
Basic Usage
To use the Framework you must begin by instantiating and starting a DSpaceKernel. The kernel will give you references to the ServiceManager and the ConfigurationService. The ServiceManager can be used to get references to other services and to register services which are not part of the core set. For standalone applications, access to the kernel is provided via the Kernel Manager and the DSpace object which will locate the kernel object and allow it to be used.
...
This location allows us to "override" the XML loading a specific service by overwriting its configuration in one of our own
Now to show you our Launcher Service. The trick here is we will use a feature in Spring called, autowire byType, it will collect all the Commands and wire them together for us, not matter the type. I'll save you having to view the whole file, you can see it here if you like|^dspace-spring-core-services.xml\ .
Code Block |
---|
<?xml version="1.0" encoding="UTF-8"?> <!-- 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/ --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"> <!-- allows us to use spring annotations in beans --> <context:annotation-config/> <!-- Instantiate the Launcher Service and Autowire its dependencies --> <bean class="org.dspace.app.launcher.ScriptLauncher" autowire="byType"/> <bean class="org.dspace.app.launcher.Command"> <property name="name" value="checker"/> <property name="description" value="Run the checksum checker"/> <property name="steps"> <list> <bean class="org.dspace.app.launcher.Step"> <property name="className" value="org.dspace.app.checker.ChecksumChecker"/> </bean> </list> </property> </bean> |
...