This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #846 from Netflix/feature/add_workflow_completion_…
…listener-AL Feature to add workflow completion listener
- Loading branch information
Showing
10 changed files
with
158 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutorModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.netflix.conductor.core.execution; | ||
|
||
import com.google.inject.AbstractModule; | ||
|
||
/** | ||
* Default implementation for the workflow status listener | ||
* | ||
*/ | ||
public class WorkflowExecutorModule extends AbstractModule { | ||
@Override | ||
protected void configure() { | ||
bind(WorkflowStatusListener.class).to(WorkflowStatusListenerStub.class);//default implementation | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
core/src/main/java/com/netflix/conductor/core/execution/WorkflowStatusListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.netflix.conductor.core.execution; | ||
|
||
import com.netflix.conductor.common.run.Workflow; | ||
|
||
/** | ||
* Listener for the completed and terminated workflows | ||
* | ||
*/ | ||
public interface WorkflowStatusListener { | ||
void onWorkflowCompleted(Workflow workflow); | ||
void onWorkflowTerminated(Workflow workflow); | ||
} |
24 changes: 24 additions & 0 deletions
24
core/src/main/java/com/netflix/conductor/core/execution/WorkflowStatusListenerStub.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.netflix.conductor.core.execution; | ||
|
||
import com.netflix.conductor.common.run.Workflow; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* Stub listener default implementation | ||
*/ | ||
public class WorkflowStatusListenerStub implements WorkflowStatusListener { | ||
|
||
private static final Logger LOG = LoggerFactory.getLogger(WorkflowStatusListenerStub.class); | ||
|
||
@Override | ||
public void onWorkflowCompleted(Workflow workflow) { | ||
LOG.debug("Workflow {} is completed", workflow.getWorkflowId()); | ||
} | ||
|
||
@Override | ||
public void onWorkflowTerminated(Workflow workflow) { | ||
LOG.debug("Workflow {} is terminated", workflow.getWorkflowId()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters