Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0587e24

Browse filesBrowse files
committed
ADAP-183 WIP endpointId related change.
1 parent 67c56b6 commit 0587e24
Copy full SHA for 0587e24

File tree

Expand file treeCollapse file tree

3 files changed

+32
-28
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+32
-28
lines changed
Open diff view settings
Collapse file

‎src/main/java/com/openfin/desktop/demo/FDC3Example.java‎

Copy file name to clipboardExpand all lines: src/main/java/com/openfin/desktop/demo/FDC3Example.java
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ protected JScrollPane layoutOutputPanel() {
166166

167167
void launchOpenfin() throws DesktopException, DesktopIOException, IOException, InterruptedException {
168168
RuntimeConfiguration config = new RuntimeConfiguration();
169-
// config.setRuntimeVersion("stable");
170-
config.setRuntimeVersion("10.66.41.18");
169+
config.setRuntimeVersion("alpha");
170+
// config.setRuntimeVersion("10.66.41.18");
171171
config.setAdditionalRuntimeArguments("--v=1 ");
172172
// serviceConfig = new JSONArray();
173173
// JSONObject layout = new JSONObject();
Collapse file

‎src/main/java/com/openfin/desktop/demo/LayoutServiceDemo.java‎

Copy file name to clipboardExpand all lines: src/main/java/com/openfin/desktop/demo/LayoutServiceDemo.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ void launchOpenfin() throws DesktopException, DesktopIOException, IOException, I
159159
if (rvm != null) {
160160
config.setLaunchRVMPath(rvm);
161161
}
162-
config.setRuntimeVersion("stable");
162+
config.setRuntimeVersion("alpha");
163163
config.setAdditionalRuntimeArguments("--v=1 ");
164164
serviceConfig = new JSONArray();
165165
JSONObject layout = new JSONObject();
Collapse file

‎src/test/java/com/openfin/desktop/ChannelTest.java‎

Copy file name to clipboardExpand all lines: src/test/java/com/openfin/desktop/ChannelTest.java
+29-25Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -87,28 +87,41 @@ public void onSuccess(ChannelClient result) {
8787
assertEquals(0, latch.getCount());
8888
}
8989

90+
@Ignore
9091
@Test
9192
public void multipleChannelClients() throws Exception {
9293
CountDownLatch latch1 = new CountDownLatch(1);
9394
CountDownLatch latch2 = new CountDownLatch(1);
9495
final String channelName = "createMultipleChannelClientTest";
9596
final String clientActionName = "clientAction";
97+
final String providerActionName = "providerAction";
9698
desktopConnection.getChannel(channelName).create(new AsyncCallback<ChannelProvider>() {
9799
@Override
98100
public void onSuccess(ChannelProvider provider) {
99101

102+
provider.register(providerActionName, new ChannelAction() {
103+
104+
@Override
105+
public JSONObject invoke(String action, JSONObject payload) {
106+
return null;
107+
}
108+
});
109+
100110
desktopConnection.getChannel(channelName).addChannelListener(new ChannelListener() {
101111

102112
@Override
103113
public void onChannelConnect(ConnectionEvent connectionEvent) {
104-
JSONObject identity = new JSONObject();
105-
identity.put("uuid", connectionEvent.getUuid());
106-
identity.put("channelId", connectionEvent.getChannelId());
107-
identity.put("channelName", connectionEvent.getChannelName());
108-
identity.put("name", connectionEvent.getName());
109-
identity.put("endpointId", connectionEvent.getEndpointId());
110-
111-
provider.dispatch(identity, clientActionName, null, null);
114+
if (channelName.equals(connectionEvent.getChannelName())) {
115+
JSONObject identity = new JSONObject();
116+
identity.put("uuid", connectionEvent.getUuid());
117+
identity.put("channelId", connectionEvent.getChannelId());
118+
identity.put("channelName", connectionEvent.getChannelName());
119+
identity.put("name", connectionEvent.getName());
120+
identity.put("endpointId", connectionEvent.getEndpointId());
121+
122+
logger.info("invoke client action, destIdentity={}", identity.toString());
123+
provider.dispatch(identity, clientActionName, null, null);
124+
}
112125
}
113126

114127
@Override
@@ -120,9 +133,12 @@ public void onChannelDisconnect(ConnectionEvent connectionEvent) {
120133
desktopConnection.getChannel(channelName).connect(new AsyncCallback<ChannelClient>() {
121134
@Override
122135
public void onSuccess(ChannelClient client) {
136+
client.dispatch(providerActionName, new JSONObject(), null);
137+
123138
client.register(clientActionName, new ChannelAction() {
124139
@Override
125140
public JSONObject invoke(String action, JSONObject payload) {
141+
logger.info("invoked client 1");
126142
latch1.countDown();
127143
return null;
128144
}
@@ -136,6 +152,7 @@ public void onSuccess(ChannelClient client) {
136152
client.register(clientActionName, new ChannelAction() {
137153
@Override
138154
public JSONObject invoke(String action, JSONObject payload) {
155+
logger.info("invoked client 2");
139156
latch2.countDown();
140157
return null;
141158
}
@@ -233,23 +250,7 @@ public void publishToClient() throws Exception {
233250
desktopConnection.getChannel(channelName).create(new AsyncCallback<ChannelProvider>() {
234251
@Override
235252
public void onSuccess(ChannelProvider provider) {
236-
desktopConnection.getChannel(channelName).addChannelListener(new ChannelListener() {
237-
@Override
238-
public void onChannelConnect(ConnectionEvent connectionEvent) {
239-
// once the channel is connected, invoke publish method
240-
JSONObject payload = new JSONObject();
241-
payload.put("message", actionMessage);
242-
provider.publish(actionName, payload, null);
243-
}
244-
245-
@Override
246-
public void onChannelDisconnect(ConnectionEvent connectionEvent) {
247-
248-
}
249-
});
250-
251253
desktopConnection.getChannel(channelName).connect(new AsyncCallback<ChannelClient>() {
252-
253254
@Override
254255
public void onSuccess(ChannelClient client) {
255256

@@ -262,8 +263,11 @@ public JSONObject invoke(String action, JSONObject payload) {
262263
return null;
263264
}
264265
});
266+
267+
JSONObject payload = new JSONObject();
268+
payload.put("message", actionMessage);
269+
provider.publish(actionName, payload, null);
265270
}
266-
267271
});
268272
}
269273
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.