I have a module with a ProjectListener.
on Project update I send a gateway message handled by a gateway script message handler
@Override
public void projectUpdated(String project) {
if (enabled && filterProjectUpdated) {
logger.debug("projectUpdated : {}",project);
if (passFiterProjectNames(project)){
notifyGateway(project,"projectUpdated");
}
}
}
private void notifyGateway(String project,String cause){
try {
synchronized(this) {
String resultGatewayMessageProjectName;
if (shutdownPending) {
return;
}
if (projectListenerUseGatewayScriptingProject) {
resultGatewayMessageProjectName = context.getSystemProperties().getGatewayScriptingProject();
} else {
if (gatewayMessageProjectName == null) {
gatewayMessageProjectName = "";
}
resultGatewayMessageProjectName = gatewayMessageProjectName;
}
if (gatewayMessageHandler == null) {
gatewayMessageHandler = "";
}
if (gatewayMessageHandler.isEmpty()) {
logger.warn("notifyGateway() - Gateway Notification Enabled but Gateway Message Handler is not provided !");
} else if (resultGatewayMessageProjectName.isEmpty()) {
logger.warn("notifyGateway() - Gateway Notification Enabled but Gateway Project Name is not provided !");
} else {
PyDictionary messagePayload = new PyDictionary();
messagePayload.put(new PyString("project"), project);
messagePayload.put(new PyString("cause"), cause);
Properties filterParams = new Properties();
filterParams.setProperty(MessageDispatchManager.KEY_SCOPE, MessageDispatchManager.SCOPE_GATEWAY_ONLY);
logger.debug("notifyGateway() - Gateway Notification : projectName={}, gatewayMessageHandler={}, messagePayload={}",
resultGatewayMessageProjectName, gatewayMessageHandler, messagePayload);
context.getMessageDispatchManager().dispatch(resultGatewayMessageProjectName, gatewayMessageHandler, messagePayload, filterParams);
}
}
} catch (Exception e) {
logger.error("notifyGateway() - exception : ", e);
}
}
when I import a project (containing the script executed by the gateway message handler)
I've sometimes have the following error, and as a side effect it seems that all tags expression with runscript are broken...and I need to restart the gateway