mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 09:25:43 +01:00
create instance counter for EventBus, to improve visibility during restarts
This commit is contained in:
@@ -40,6 +40,8 @@ import com.github.legman.Subscribe;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Sebastian Sdorra
|
* @author Sebastian Sdorra
|
||||||
@@ -47,8 +49,11 @@ import org.slf4j.LoggerFactory;
|
|||||||
public class LegmanScmEventBus extends ScmEventBus
|
public class LegmanScmEventBus extends ScmEventBus
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private static final AtomicLong INSTANCE_COUNTER = new AtomicLong();
|
||||||
|
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
private static final String NAME = "ScmEventBus";
|
private static final String NAME = "ScmEventBus-%s";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the logger for LegmanScmEventBus
|
* the logger for LegmanScmEventBus
|
||||||
@@ -67,8 +72,9 @@ public class LegmanScmEventBus extends ScmEventBus
|
|||||||
}
|
}
|
||||||
|
|
||||||
private EventBus create() {
|
private EventBus create() {
|
||||||
logger.info("create new event bus {}", NAME);
|
String name = String.format(NAME, INSTANCE_COUNTER.incrementAndGet());
|
||||||
return new EventBus(NAME);
|
logger.info("create new event bus {}", name);
|
||||||
|
return new EventBus(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user