Skip to content

Commit

Permalink
Fix signature of onReady callback
Browse files Browse the repository at this point in the history
  • Loading branch information
rudi committed Oct 25, 2024
1 parent 14793d3 commit 1de513e
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ public class ExnConnector {
*/
public Context getContext() {
if (context_ == null) {
// synchronized(this) {
// while (context_ == null) {
// try {
// wait();
// } catch (InterruptedException e) {
// log.error("Caught InterruptException while waiting for ActiveMQ connection Context; looping", e);
// }
// }
// }
synchronized(this) {
while (context_ == null) {
try {
wait();
} catch (InterruptedException e) {
log.error("Caught InterruptException while waiting for ActiveMQ connection Context; looping", e);
}
}
}
}
return context_;
}
Expand Down Expand Up @@ -146,11 +146,11 @@ public ExnConnector(String host, int port, String name, String password) {
conn = new Connector(
"optimiser_controller",
new ConnectorHandler() {
public void onReady(AtomicReference<Context> context) {
ExnConnector.this.context_ = context.get();
// synchronized(ExnConnector.this) {
// ExnConnector.this.notifyAll();
// }
public void onReady(Context context) {
ExnConnector.this.context_ = context;
synchronized(ExnConnector.this) {
ExnConnector.this.notifyAll();
}
log.info("Optimiser-controller connected to ActiveMQ, got connection context {}", context);
}
},
Expand Down

0 comments on commit 1de513e

Please sign in to comment.