using tm instance on transportManagerFactory in order to consider that a transport should be linked to VOLATILE or PERSISTENT memory

This commit is contained in:
Roberto Cirillo 2021-06-18 12:04:41 +02:00
parent 763b30fa04
commit ee531ec7ef
1 changed files with 2 additions and 2 deletions

View File

@ -48,13 +48,13 @@ public class TransportManagerFactory {
logger.debug("transportLayer with "+transport.memoryType+" already instatiated. New memoryType request is "+memoryType);
// if we haven't any transport layer instantiated or the transport layer is istantiated on another memory type (persistent, volatile),
// then a new transport layer is needed
if(Objects.isNull(transport) || (!transport.memoryType.equals(memoryType))) {
if(Objects.isNull(tm) || Objects.isNull(tm.memoryType) || (!tm.memoryType.equals(memoryType))) {
logger.info("new transport layer instantiated for "+memoryType+" memory");
return load(backendType, memoryType, dbNames, writeConcern, readConcern);
}else {
logger.debug("new transport layer not instantiated.");
}
return transport;
return tm;
}
private TransportManager load(String backendType, MemoryType memoryType, String[] dbNames, String writeConcern, String readConcern){