Allow DMF to be disabled

Signed-off-by: Kai Zimmermann <kai.zimmermann@bosch-si.com>
This commit is contained in:
Kai Zimmermann
2016-09-07 09:30:48 +02:00
parent 2f415c4839
commit e03bca45d5
13 changed files with 94 additions and 116 deletions

View File

@@ -10,6 +10,7 @@ package org.eclipse.hawkbit.eventbus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import com.google.common.eventbus.DeadEvent;
import com.google.common.eventbus.Subscribe;
@@ -22,6 +23,7 @@ import com.google.common.eventbus.Subscribe;
*
*/
@EventSubscriber
@Service
public class DeadEventListener {
private static final Logger LOG = LoggerFactory.getLogger(DeadEventListener.class);

View File

@@ -14,8 +14,6 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import org.springframework.stereotype.Service;
/**
* Marks an class as an event subscriber to listen on event on the event bus
* without explicit register this class to the event bus.
@@ -36,7 +34,6 @@ import org.springframework.stereotype.Service;
*/
@Target({ TYPE })
@Retention(RUNTIME)
@Service
public @interface EventSubscriber {
}

View File

@@ -17,6 +17,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.springframework.stereotype.Service;
import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;
@@ -56,6 +57,7 @@ public class EventBusSubscriberProcessorTest {
}
@EventSubscriber
@Service
private class TestEventSubscriberClass {
@Subscribe
public void subscribe(final String s) {
@@ -64,6 +66,7 @@ public class EventBusSubscriberProcessorTest {
}
@EventSubscriber
@Service
private class TestWrongEventSubscriberClass {
public void methodWithoutAnnotation(final String s) {