Developing Plugins#
Getting Started#
Concourse plugins must be implemented as Java classes that extend com.cinchapi.concourse.server.plugin.Plugin
. To get started, create a Java project that depends on the concourse-plugin-core
framework.
Create a build.gradle file#
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
Download dependencies and generate IDE metadata#
1 |
|
Implement the plugin#
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
Any instance methods that are added to the plugin class will be dynamically added to the Concourse API.
Create the plugin package#
1 |
|
Check the build/distributions
directory to see the generated .zip
plugin package.
Accessing Concourse within a Plugin#
Concourse plugins have privileged access to the database using a special API. To interact with Concourse, use the runtime
method inside the plugin class.
1 2 3 4 5 6 7 |
|
If you need to access Concourse from a class that does not extend Plugin
(i.e. a utility class) you can interact with the runtime by calling PluginRuntime.getRuntime()
.
Background Requests#
Each Plugin has access to the host Concourse instance