Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

How the DevKit Works

The Mule DevKit uses annotations to generate Mule integration code, XML schemas, and Studio interfaces so writing Mule extensions is as simple as writing a Java class and annotating it. It will handle all the nuisances so you can focus on the core of the module itself rather than how it interacts with Mule.

Annotation Processor

When Java source code is compiled, annotations can be processed by compiler plug-ins called annotation processors. Processors can produce informational messages or create additional Java source files or resources, which in turn may be compiled and processed, and also modify the annotated code itself.

The Mule DevKit is at its heart an annotation processor that will look at how you annotate your POJO and generate code in consequence. There are several ways to execute an annotation processor, you can use the standalone tool apt, we also provide Maven plugins. Remember that most modern Java IDE have support for running annotation processors as well.

The Mule DevKit is compromised of a set of annotations specifically designed to mimic Mule vocabulary and make it easy for the unexperienced developer to grasp what the annotation might do in relation to the annotation processor.

High Level Overview

The DevKit relies on the schema-based extension mechanism from Spring framework. The DevKit’s Annotation Processing Tool generates Java code which acts as a bridge between the annotated POJOs and Mule:

CloudConnectDevKitGeneratedComponents

What type of classes get generated depends on the annotations used in the POJO:

MuleDevKitCodeGeneration+%281%29