Extensibility

This section is a work in progress. Want to help? Check out the jenkinsci/docs gitter channel. For other ways to contribute to the Jenkins project, see this page about participating and contributing.

Jenkins is designed with extensibility in mind, both internally (core) and with plugins. Extensibility in Jenkins is accomplished by combining the concepts discussed below.

Extension annotation

Extension is an annotation that allows Jenkins to discover classes, instantiate them, and register them in global lists of implementations of their supertypes and interfaces. This works for implementations both directly in core, and contributed by plugins, so that plugins can provide implementations of extension points defined in core (or other plugins). Whenever Jenkins needs to provide a list, e.g. of security realm implementations (LDAP, Jenkins user database, etc.) it can query for all subtypes of SecurityRealm that are annotated with @Extension.

Descriptors and Describables

Descriptor and Describable (or subtypes thereof) are used whenever multiple instances of a certain extension are needed, for example build steps. The Descriptor can be used to store their global configuration, and as a factory, while the Describable is the specific instance with its independent, instance-specific configuration. This is similar to class/object in object-oriented programming.

Actionable and Actions

Actionable is an abstract class allowing subtypes to be extensible using Action implementations. Action implementations can be used to store arbitrary data with a model object, or contribute additions to its presentation. The exact details vary depending on the subtype, but typically, Actionable objects will show actions in the sidepanel, and route requests to the action’s getUrlName() to the action, allowing it to contribute pages to Actionable objects.

How-To Guides

References