Spring Integration
Though Obsidian works great on its own, Obsidian also supports seamless integration with Spring. This page outlines how to set up Spring integration and execute jobs which are configured as Spring components.
Dependency Injection via Spring
As of Obsidian 2.2.0, Obsidian has greatly improved the integration with your Spring dependency injection container. Obsidian does not include any Spring libraries and will defer to the version and libraries you include with your application. It supports versions of Spring from 2.5 onward.
Obsidian uses the @Component and any Spring or custom extensions of those annotations (such as @Service and @Repository) as a basis for knowing which job implementations should be retrieved from the Spring context. These job classes can be either SchedulableJob implementations or annotated jobs. Even if you are not using Spring annotations to wire your classes, you will need to add the annotation to your job classes to serve as a Marker to Obsidian.
You will also need to ensure Obsidian's ApplicationContextAware implementation is known to Spring. If you are using Spring's scanning, you can use the following approach to add an additional package to your configuration:
<context:component-scan base-package="com.my.package.scan.base, com.carfey.ops.job.di"/>
Another option is to extend our com.carfey.ops.job.di.SpringContextAware class with a do nothing extension class in one of your currently scanned packages. When this object is configured by Spring, it will automatically initialize Obsidian's Spring integration.
If you are not using scanning, simply ensure you wire in our com.carfey.ops.job.di.SpringContextAware class via XML.
If you have multiple instances of a given bean type in your Spring context, please ensure you use the value="" when you annotate your job with @Component or its specializations as this is how Obsidian will uniquely identify the job within the Spring context.