Commit bf0d2a80 authored by legoc's avatar legoc
Browse files

Renamed ContextImpl into ContextZmq

parent 3e8d423a
......@@ -32,6 +32,7 @@ import fr.ill.ics.cameo.Zmq.Socket;
import fr.ill.ics.cameo.base.Application;
import fr.ill.ics.cameo.base.Application.State;
import fr.ill.ics.cameo.base.Application.This;
import fr.ill.ics.cameo.base.impl.zmq.ContextZmq;
import fr.ill.ics.cameo.base.ConnectionTimeout;
import fr.ill.ics.cameo.base.Context;
import fr.ill.ics.cameo.base.EventListener;
......@@ -60,7 +61,7 @@ public class ServerImpl {
private int[] serverVersion = new int[3];
private int statusPort;
private Zmq.Context context;
private ContextImpl contextImpl;
private ContextZmq contextImpl;
private int timeout = 0; // default value because of ZeroMQ design
private RequestSocket requestSocket;
private JSON.Parser parser = new JSON.Parser();
......@@ -115,7 +116,7 @@ public class ServerImpl {
*/
final private void init() {
context = new Zmq.Context();
contextImpl = new ContextImpl(context);
contextImpl = new ContextZmq(context);
requestSocket = this.createRequestSocket(serverEndpoint.toString());
}
......
package fr.ill.ics.cameo.base.impl;
package fr.ill.ics.cameo.base.impl.zmq;
import fr.ill.ics.cameo.Zmq;
import fr.ill.ics.cameo.base.Context;
public class ContextImpl implements Context {
public class ContextZmq implements Context {
private Zmq.Context context;
ContextImpl(Zmq.Context context) {
public ContextZmq(Zmq.Context context) {
this.context = context;
}
......
......@@ -4,7 +4,6 @@ import fr.ill.ics.cameo.Zmq;
import fr.ill.ics.cameo.base.ConnectionTimeout;
import fr.ill.ics.cameo.base.Context;
import fr.ill.ics.cameo.base.SocketException;
import fr.ill.ics.cameo.base.impl.ContextImpl;
import fr.ill.ics.cameo.base.impl.RequestSocketImpl;
public class RequestSocketZmq implements RequestSocketImpl {
......@@ -15,7 +14,7 @@ public class RequestSocketZmq implements RequestSocketImpl {
public RequestSocketZmq(Context context, int timeout) {
// Get the Zmq context.
this.context = ((ContextImpl)context).getContext();
this.context = ((ContextZmq)context).getContext();
this.socket = this.context.createSocket(Zmq.REQ);
this.timeout = timeout;
}
......
......@@ -20,8 +20,8 @@ import org.json.simple.JSONObject;
import fr.ill.ics.cameo.Zmq;
import fr.ill.ics.cameo.base.Application.This;
import fr.ill.ics.cameo.base.impl.zmq.ContextZmq;
import fr.ill.ics.cameo.base.RequestSocket;
import fr.ill.ics.cameo.base.impl.ContextImpl;
import fr.ill.ics.cameo.messages.JSON;
import fr.ill.ics.cameo.messages.Messages;
import fr.ill.ics.cameo.strings.Endpoint;
......@@ -40,7 +40,7 @@ public class PublisherImpl {
this.synchronizerPort = synchronizerPort;
this.name = name;
this.numberOfSubscribers = numberOfSubscribers;
this.context = ((ContextImpl)This.getCom().getContext()).getContext();
this.context = ((ContextZmq)This.getCom().getContext()).getContext();
// create a socket for publishing
publisher = context.createSocket(Zmq.PUB);
......
......@@ -22,8 +22,8 @@ import org.json.simple.JSONObject;
import fr.ill.ics.cameo.Zmq;
import fr.ill.ics.cameo.base.Application.This;
import fr.ill.ics.cameo.base.impl.zmq.ContextZmq;
import fr.ill.ics.cameo.base.RequestSocket;
import fr.ill.ics.cameo.base.impl.ContextImpl;
import fr.ill.ics.cameo.messages.JSON;
import fr.ill.ics.cameo.messages.Messages;
import fr.ill.ics.cameo.strings.Endpoint;
......@@ -52,7 +52,7 @@ public class RequesterImpl {
this.name = name;
this.responderId = responderId;
this.requesterId = requesterId;
this.context = ((ContextImpl)This.getCom().getContext()).getContext();
this.context = ((ContextZmq)This.getCom().getContext()).getContext();
// Create the REQ socket.
String responderEndpoint = endpoint.withPort(responderPort).toString();
......
......@@ -20,8 +20,8 @@ import org.json.simple.JSONObject;
import fr.ill.ics.cameo.Zmq;
import fr.ill.ics.cameo.base.Application.This;
import fr.ill.ics.cameo.base.impl.zmq.ContextZmq;
import fr.ill.ics.cameo.base.RequestSocket;
import fr.ill.ics.cameo.base.impl.ContextImpl;
import fr.ill.ics.cameo.messages.JSON;
import fr.ill.ics.cameo.messages.Messages;
import fr.ill.ics.cameo.strings.Endpoint;
......@@ -43,7 +43,7 @@ public class ResponderImpl {
public ResponderImpl(int responderPort, String name) {
this.responderPort = responderPort;
this.name = name;
this.context = ((ContextImpl)This.getCom().getContext()).getContext();
this.context = ((ContextZmq)This.getCom().getContext()).getContext();
// create a socket REP
responder = context.createSocket(Zmq.REP);
......
......@@ -25,7 +25,7 @@ import fr.ill.ics.cameo.base.Application.This;
import fr.ill.ics.cameo.base.ConnectionTimeout;
import fr.ill.ics.cameo.base.RequestSocket;
import fr.ill.ics.cameo.base.impl.CancelIdGenerator;
import fr.ill.ics.cameo.base.impl.ContextImpl;
import fr.ill.ics.cameo.base.impl.zmq.ContextZmq;
import fr.ill.ics.cameo.messages.JSON;
import fr.ill.ics.cameo.messages.Messages;
import fr.ill.ics.cameo.strings.Endpoint;
......@@ -51,7 +51,7 @@ public class SubscriberImpl {
this.publisherName = publisherName;
this.numberOfSubscribers = numberOfSubscribers;
this.instance = instance;
this.context = ((ContextImpl)This.getCom().getContext()).getContext();
this.context = ((ContextZmq)This.getCom().getContext()).getContext();
waiting.add();
}
......
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 to comment