Spring Framework

Microbule is designed to be automatically loaded into your Spring ApplicationContext. All of Microbule’s components are assigned JSR-330 (javax.inject) annotations. First, you’ll need to add Microbule to the classpath.

Dependencies

If you are using Maven, simply add the following dependencies to your pom.xml file:

<dependency>
  <groupId>org.microbule</groupId>
  <artifactId>microbule-all</artifactId>
  <version>${microbule.version}</version>
<dependency>

<dependency>
  <groupId>org.microbule</groupId>
  <artifactId>microbule-spring-container</artifactId>
  <version>${microbule.version}</version>
<dependency>

<dependency>
  <groupId>org.microbule</groupId>
  <artifactId>microbule-spring-config</artifactId>
  <version>${microbule.version}</version>
<dependency>

Let’s examine these dependencies:

Once you have these dependencies defined, you can easily load Microbule into your ApplicationContext.

Loading Microbule

Since Microbule uses JSR-330, it can be automatically detected using Spring’s component scan feature. For example, if you are using Spring’s Java-based configuration:

@Configuration
@ComponentScan(basePackages = {"org.microbule","com.myco.myproj"})
@PropertySource("classpath:application.properties")
public class MyApplicationConfiguration {

}

JAX-RS Service Discovery

Once Microbule starts, it will automatically create a CXF server for any @Path-annotated bean in the current ApplicationContext.