Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

instance termination plugin api #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'org.zalando'
version '3.2.1'
version '3.3.0'

apply plugin: 'java'
apply plugin: 'maven'
Expand Down
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Mon Dec 23 14:08:03 CET 2019
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.zalando.nakadi.plugin.api.termination;

@FunctionalInterface
public interface TerminationListener extends Runnable {

/**
* Listener code to be executed upon arrival of termination event.
*/
void run();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.zalando.nakadi.plugin.api.termination;

import org.zalando.nakadi.plugin.api.exceptions.PluginException;

/**
* Termination service provides functionality to notify user about coming Nakadi instance termination.
*/
public interface TerminationService {

/**
* Registers lister to be executed once termination event happens.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/lister/listener/

*
* @param terminationRunnable action to execute once termination event happens
* @throws PluginException
*/
void register(final TerminationListener terminationRunnable) throws PluginException;

/**
* Current status of the termination.
*
* @throws PluginException
*/
boolean isTerminating() throws PluginException;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.zalando.nakadi.plugin.api.termination;

import org.zalando.nakadi.plugin.api.SystemProperties;
import org.zalando.nakadi.plugin.api.exceptions.PluginException;

public interface TerminationServiceFactory {

/**
* @param properties system properties to initialize plugin
* @return constructed ApplicationService instance
* @throws PluginException if an error occurred on plugin initialization
*/
TerminationService init(SystemProperties properties) throws PluginException;
}