Commit bebbfb0f by Amir Aharon

allow null logger

parent 92c60bc4
...@@ -145,9 +145,12 @@ public class IRestServiceHttpImpl extends CommonServices.IRestService implements ...@@ -145,9 +145,12 @@ public class IRestServiceHttpImpl extends CommonServices.IRestService implements
@Override @Override
public boolean init() { public boolean init() {
boolean stat = true; boolean stat = true;
if (MicroserviceApp.getsInstance() != null) {
msAppInstance = MicroserviceApp.getsInstance(); msAppInstance = MicroserviceApp.getsInstance();
logger = msAppInstance.getLogger(); logger = msAppInstance.getLogger();
this.appName = msAppInstance.getAppName(); this.appName = msAppInstance.getAppName();
}
switch (getServiceMode()){ switch (getServiceMode()){
case E_CLIENT: case E_CLIENT:
break; break;
......
...@@ -826,8 +826,10 @@ public class IRestServiceZmqImpl extends CommonServices.IRestService implements ...@@ -826,8 +826,10 @@ public class IRestServiceZmqImpl extends CommonServices.IRestService implements
@Override @Override
public boolean init() { public boolean init() {
boolean retstat = true; boolean retstat = true;
if (MicroserviceApp.getsInstance() != null) {
this.appName = MicroserviceApp.getsInstance().getAppName(); this.appName = MicroserviceApp.getsInstance().getAppName();
this.logger = MicroserviceApp.getsInstance().getLogger(); this.logger = MicroserviceApp.getsInstance().getLogger();
}
switch (getServiceMode()){ switch (getServiceMode()){
case E_CLIENT: case E_CLIENT:
......
...@@ -97,13 +97,13 @@ public class IMsgQServiceZmqImpl extends CommonServices.IMsgQService { ...@@ -97,13 +97,13 @@ public class IMsgQServiceZmqImpl extends CommonServices.IMsgQService {
retstat = allocateClient(); retstat = allocateClient();
break; break;
case E_SERVER: case E_SERVER:
retstat = allocateServer(); retstat = (allocateServer() &&
!allWorkersList.isEmpty() &&
allWorkersList.stream().allMatch(CommonServices.IWorker::init));
break; break;
} }
return (retstat && return retstat;
!allWorkersList.isEmpty() &&
allWorkersList.stream().allMatch(CommonServices.IWorker::init));
} else { } else {
System.err.println(getClass().getName() + " >> unknown service mode"); System.err.println(getClass().getName() + " >> unknown service mode");
retstat = false; retstat = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment