Skip to content

Commit

Permalink
1.1.0 Beta 4
Browse files Browse the repository at this point in the history
  • Loading branch information
gsteinacker committed Jun 20, 2017
1 parent 748638d commit febfc21
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ subprojects {
// DO NOT FORGET TO DOCUMENT CHANGES IN CHANGELOG.md
//
// Add a GitHub release for every new release: https://github.com/otto-de/edison-microservice/releases
version = '1.1.0-beta.4-SNAPSHOT'
version = '1.1.0-beta.4'
group = 'de.otto.edison'

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public class LdapConfiguration {
* All routes starting with the value of the {@code edison.ldap.prefix} property will be secured by LDAP. If no
* property is set this will default to all routes starting with '/internal'.
*
* @param prefix the prefix of routes authenticated by the ldap filter. Default is /internal
* @param ldapProperties the properties used to configure LDAP
* @return FilterRegistrationBean
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

import de.otto.edison.jobs.domain.Level;

import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.concurrent.ConcurrentSkipListSet;

import static java.util.Collections.synchronizedSet;

/**
* Delegates the calls of {@link JobEventPublisher#info(String)},
Expand All @@ -16,7 +20,7 @@
public final class JobEvents {

private static final ThreadLocal<JobEventPublisher> jobEventPublisherThreadLocal = new InheritableThreadLocal<>();
private static final Set<JobEventPublisher> jobEventPublishers = new LinkedHashSet<>();
private static final Set<JobEventPublisher> broadcastEventPublishers = synchronizedSet(new LinkedHashSet<>());

/**
* Internal method. Should only be called inside edison-jobs.
Expand All @@ -31,7 +35,7 @@ public static void register(final JobEventPublisher jobEventPublisher) {
);
}
jobEventPublisherThreadLocal.set(jobEventPublisher);
jobEventPublishers.add(jobEventPublisher);
broadcastEventPublishers.add(jobEventPublisher);
}

/**
Expand All @@ -40,7 +44,7 @@ public static void register(final JobEventPublisher jobEventPublisher) {
public static void deregister() {
JobEventPublisher jobEventPublisher = jobEventPublisherThreadLocal.get();
if (jobEventPublisher != null) {
jobEventPublishers.remove(jobEventPublisher);
broadcastEventPublishers.remove(jobEventPublisher);
}
jobEventPublisherThreadLocal.remove();
}
Expand Down Expand Up @@ -80,9 +84,10 @@ public static void info(final String message) {
*
* @param level
* @param message
* @since 1.1.0
*/
public static void broadcast(final Level level, final String message) {
for (JobEventPublisher jobEventPublisher : jobEventPublishers) {
for (JobEventPublisher jobEventPublisher : broadcastEventPublishers) {
jobEventPublisher.message(level, message);
}
}
Expand Down

0 comments on commit febfc21

Please sign in to comment.