Skip to content

Commit

Permalink
sonarlint :: do not ignore InterruptedException in DelayPlace (#775)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpdahlke authored May 16, 2024
1 parent af83fd0 commit dc6dd9f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/main/java/emissary/place/sample/DelayPlace.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package emissary.place.sample;

import emissary.core.IBaseDataObject;
import emissary.core.ResourceException;
import emissary.place.ServiceProviderPlace;

import java.io.IOException;

/**
* This place is a sink hole for everything it registers for
* This place performs no action other than holding everything it processes for a configurable amount of milliseconds
*/
public class DelayPlace extends ServiceProviderPlace {

Expand Down Expand Up @@ -37,18 +36,18 @@ protected void configurePlace() {
* Consume the data object
*/
@Override
public void process(IBaseDataObject tData) throws ResourceException {
public void process(IBaseDataObject tData) {
if (logger.isDebugEnabled()) {
logger.debug("Delay starting {}", tData.getAllCurrentForms());
}
try {
Thread.sleep(delayTimeMillis);
} catch (InterruptedException e) {
throw new ResourceException("Timed out before delay expired", e);
logger.warn("Interrupted before delay expired", e);
Thread.currentThread().interrupt();
}
if (logger.isDebugEnabled()) {
logger.debug("Delay ended {}", tData.getAllCurrentForms());
}
}

}

0 comments on commit dc6dd9f

Please sign in to comment.