Building an Extension

Extensions: Getting Started


  • Language: Java 8Β 
  • Packaging: Java .jar
  • Build Maven; this guide assumes the usage of Maven; you can use Gradle or others

Build the Project

To get started:

  • Get the HYPR CC extension API, published as a standalone .jar
  • Get the source for one of the published extensions; it's recommended to use this as a starting point
  • Import the existing source into the IDE of your choice
  • Change directory to the and run mvn clean package

Add Logic

Customize the extension code to add your custom logic.

An extension is an implementation of the CC plugin API. You must extend the HyprExtension class.

Here is the outline of a typical extension:

public class MyExtension extends HyprExtension {

    public MyPlugin(PluginWrapper wrapper) {

    @Extension(ordinal = 1)
    public static class MyRegExtPoint extends AbstractRegistrationExtensionPoint {
        // Implement custom lifecycyle logic here

    @Extension(ordinal = 2)
    public static class MyAuthExtPoint extends AbstractAuthenticationExtensionPoint {
        // Implement custom lifecycyle logic here

Replace the existing ExtensionPoint code with your custom logic.

Customizing Library Dependencies

Dependencies are managed via the standard Maven/Gradle approach.

HYPR recommends minimizing the use of external libraries to keep the plugin package small and reduce the likelihood of dependency conflicts.

If you use external libraries, they must be packaged with the plugin .jar file.

The following dependencies are provided by the CC, so you do not need to package them.Β Β 

pf4jCC plugins are based on this library.
HYPR cc-extension-apiArtifact containing CC ext. API3.6.0
Apache httpclient
Useful for making external REST calls over HTTP


CC extensions use the Java .jar file to provide metadata to CC.

When the extension .jar is uploaded, CC will inspect the manifest and extract the relevant information.

The manifest is automatically created by the Maven build file, using the maven-compiler-plugin.

Similar results can be achieved with Gradle.

The following is a sample


Modify the following attributes in the pom.xml to match your needs. These will feed into the generated manifest file.


        <!-- Plugin metadata, used to uniquely identify the extension -->
        <!-- The assembly plugin (below) is going to put this in the Jar -->
        <extension.provider>HYPR Corp</extension.provider>


It is recommended to unit/component test your plugin code. There are no complicated dependencies, so it is easy to add tests. Simulate the plugin configuration manually, like this:

public class MyExtensionTest {
  private MyPlugin.MyRegistrationExtension setupTestExtension() {
    MyPlugin.MyRegistrationExtension ext = new MyPlugin.MyRegistrationExtension();

    // Setup test configuration 
    PluginConfigAttribute config = new PluginConfigAttribute();
    config.setName("Attribute A");

    List<PluginConfigAttribute> config = new ArrayList<>();

    // Invoke the callback to set configuration on the ext 
    // Once ext is deployed, the server does this step
    return ext;
  public void testReg() {
    MyPlugin.MyRegistrationExtension ext = setupTestExtension();
    // Invoke the callbacks on the ext and assert outcome

Now that we have a plugin instance (above), you can invoke the callbacks to test relevant code.