Skip to content
Snippets Groups Projects
Commit 8207a555 authored by BIGARET Sebastien's avatar BIGARET Sebastien
Browse files

Local resources sent by server should be ignored by the bridge.

So-called local resources are declared with a provider named "local".
parent d5a0e3ef
No related branches found
No related tags found
No related merge requests found
Pipeline #82 failed
......@@ -150,8 +150,15 @@ public class PlatformToClientBridge extends AbstractPlatform implements ServerTo
RemoteComponents remoteComponents = new RemoteComponents(platform_conn[0], platform_conn[1], Integer.parseInt(platform_conn[2])); // TODO NumberFormatException
remoteComponents.init();
Element programs = conf.getRootElement().getChild("programs");
/*
* "local" resources /may/ be declared on the remote server, most of the times because they were present at
* compile-time and packed in the jar along with all the others. However, resources with provider named
* "local" are *never* shared: if they are present/declared on the remote side, we must ignore them, or they
* may shadow the one locally declared.
*/
for (String resource: remoteComponents.getResourceRepository().getResources())
programs.addContent(new Element("program").setAttribute("id", resource));
if (!resource.startsWith("local"))
programs.addContent(new Element("program").setAttribute("id", resource));
CommunicationFacade cnx = CommunicationFacade.buildConnection("Platform", platform_conn);
cnx.start();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment