This is the third part (part 1, part 2) of a multi-part video series where Lincoln Baxter (@lincolnthree) and I are interactively building a Forge addon to add Java EE 7 Batch functionality.
Part 1 showed how to get started with creating an addon, add relevant POM dependencies, build and install the addon using Forge shell, add a new command batch-new-jobxml
, and add --reader
, --processor
, --writer
parameters to the newly added command. Part 2 showed how to identify classes for each CLI parameter that already honor the contract required by the Batch specification. This part shows how:
- Parameters can be made required
- Add an attribute to accept jobXML name
- Check that the reader, processor, and writer are annotated with @Named
- Create templates for reader, processor, writer, and jobXML
- Use templating language to replace the name of chosen reader, processor, writer
Enjoy!
As earlier, the evolving source code is available at github.com/javaee-samples/forge-addons. The source code is compiling fine but not serving the intended purpose yet. It will be further debugged in the next episode, coming later this week.
Pingback: Adding Java EE 7 Batch Addon to JBoss Forge ? – Part 4 (Tech Tip #30) | Miles to go 2.0 …