Versions Compared

Key

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

...

The ServiceManager provides the DSpace Application with the above Spring ApplicationContext so that the developer  does not need to be responsible for its creation when developing against DSpace. Thus, to extend the pervious example, the DSpace class and its underlying Service Manager can be utilized to get at any object that has been instantiated as a service bean by core or addon application code.

Code Block
Example example = new DSpace().getSingletonService("my-example", Example.class);

...


\* Go on to do something interesting with the service */

The DSpace Service Manager implementation manages the entire lifecycle of a running DSpace application and provides access to services by Applications that may be executing external to this "kernel" of DSpace Services. Via Spring and loading of individual dspace.cfg properties the ServiceManager manages the configuration of those services, (either through providing those properties to the Spring Application Context where they can be injected in Spring definition xml files and/or "annotations" or by exposing those properties via the injection of the DSpace ConfigurationService.

...

Wiki Markup
The DSpace launcher (\[~mdiggory:dspace\]/bin/dspace) initializes a kernel before dispatching to the selected command.

...

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, DSpace Spring Services Tutorial \~mdiggory:you can see it here if you like.

...