sessions continue phase
This commit is contained in:
parent
8d21e5a23e
commit
786e4af3eb
4 changed files with 16 additions and 1 deletions
|
|
@ -77,7 +77,10 @@ public class EventsReceiver extends QueueConsumer implements InitializingBean {
|
||||||
.forDestination(Task.startOfT0.topic(), callbacks::put);
|
.forDestination(Task.startOfT0.topic(), callbacks::put);
|
||||||
|
|
||||||
callback(Object.class)
|
callback(Object.class)
|
||||||
.setConsumer(primaryAuctionBnSession::continueSession)
|
.setConsumer(req -> {
|
||||||
|
primaryAuctionBnSession.continueSession(req);
|
||||||
|
secondaryAuctionT0Session.continueSession(req);
|
||||||
|
})
|
||||||
.forDestination(Consts.CONTINUE_SESSION_BN_FIRST_PART, callbacks::put);
|
.forDestination(Consts.CONTINUE_SESSION_BN_FIRST_PART, callbacks::put);
|
||||||
|
|
||||||
callback(STradesImportedRequest.class)
|
callback(STradesImportedRequest.class)
|
||||||
|
|
|
||||||
|
|
@ -65,4 +65,10 @@ public class AbstractSession {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean isRunning() {
|
||||||
|
synchronized (this.currStage) {
|
||||||
|
return this.currStage.get() != null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,9 @@ public class PrimaryAuctionBnSession extends AbstractSession implements Initiali
|
||||||
|
|
||||||
public void continueSession(BaseRequest<?> req) {
|
public void continueSession(BaseRequest<?> req) {
|
||||||
try {
|
try {
|
||||||
|
if (!isRunning()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!checkStage(TaskType.StartRevise)) {
|
if (!checkStage(TaskType.StartRevise)) {
|
||||||
log.error("cannot continue session, current stage is {}", currStage.get());
|
log.error("cannot continue session, current stage is {}", currStage.get());
|
||||||
throw new StageException();
|
throw new StageException();
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,9 @@ public class SecondaryAuctionT0Session extends AbstractSession implements Initia
|
||||||
|
|
||||||
public void continueSession(BaseRequest<?> req) {
|
public void continueSession(BaseRequest<?> req) {
|
||||||
try {
|
try {
|
||||||
|
if (!isRunning()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!checkStage(TaskType.StartRevise)) {
|
if (!checkStage(TaskType.StartRevise)) {
|
||||||
log.error("cannot continue session, current stage is {}", currStage.get());
|
log.error("cannot continue session, current stage is {}", currStage.get());
|
||||||
throw new StageException();
|
throw new StageException();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue