Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Rotten markup doesn't recognize {{thing}}s as plural of something in code font

...

Command holds the details about the command we will call. Notice it doesn't parse any XML and most importantly it does not instantiate any Step directly; that is decoupled from the Command and we will show you later how it is assembled. All {{Command}}s do a Command does when getting created is sit there like a good old Java Bean should. It just "IS".

...

Ok, at this point you're saying, "but, wait a second, how did you configure the CommandService, {{Command}}s and {{Step}}s Commands and Steps so they could be available?"  That's the majic of Spring, and there's a couple ways we do this, but I will take the most explicit approach that still will allow you to wire in your own {{Command}}s Commands later.

Step 4: The Spring Configuration

...

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 {{Command}}s Commands and wire them together for us, no matter the type. I'll save you having to view the whole file — you can see it here if you like .

...

One of the luxuries we get from using the autowire byType in our spring configuration within the ServiceManager, is that now we can allow others to toss in their commands regardless of what they are named — we just need to know that they implement our Command interface and provide {{Step}}s Steps we can execute.  For instance, to introduce a command that will allow us to index discovery or operate on the statistics indexes, we can, in our Discovery and Statistics Addons _  add additional src/main/resources/spring/spring-dspace-addon-discovery-services.xml_. Do the following:

Discovery (dspace/trunk/dspace-discovery/dspace-discovery-provider/src/main/resources/spring)

...