Package org.micromanager.internal.zmq
Class ZMQServer
java.lang.Object
org.micromanager.internal.zmq.ZMQSocketWrapper
org.micromanager.internal.zmq.ZMQServer
public class ZMQServer extends ZMQSocketWrapper
implements request reply server (ie the reply part)
ecompasses both the master server and the
-
Field Summary
Fields inherited from class org.micromanager.internal.zmq.ZMQSocketWrapper
context_, port_, socket_, STARTING_PORT_NUMBER, type_ -
Constructor Summary
Constructors Constructor Description ZMQServer()This constructor used if making a new server on a different port and all the classloader info already parsedZMQServer(Collection<ClassLoader> cls, Function<Class,Object> classMapper, String[] excludePaths, Consumer<String> debugLogger)ZMQServer(Collection<ClassLoader> cls, Function<Class,Object> classMapper, String[] excludePaths, Consumer<String> debugLogger, int port) -
Method Summary
Modifier and Type Method Description voidclose()protected mmcorej.org.json.JSONObjectgetField(Object obj, mmcorej.org.json.JSONObject json)static ZMQServergetMasterServer()voidinitialize(int port)protected mmcorej.org.json.JSONObjectparseAndExecuteCommand(mmcorej.org.json.JSONObject request)protected voidsetField(Object obj, mmcorej.org.json.JSONObject json)Methods inherited from class org.micromanager.internal.zmq.ZMQSocketWrapper
getPort, receiveMessage, sendMessage
-
Field Details
-
VERSION
- See Also:
- Constant Field Values
-
-
Constructor Details
-
ZMQServer
public ZMQServer()This constructor used if making a new server on a different port and all the classloader info already parsed -
ZMQServer
public ZMQServer(Collection<ClassLoader> cls, Function<Class,Object> classMapper, String[] excludePaths, Consumer<String> debugLogger) throws URISyntaxException, UnsupportedEncodingException -
ZMQServer
public ZMQServer(Collection<ClassLoader> cls, Function<Class,Object> classMapper, String[] excludePaths, Consumer<String> debugLogger, int port) throws URISyntaxException, UnsupportedEncodingException
-
-
Method Details
-
getMasterServer
-
initialize
public void initialize(int port)- Specified by:
initializein classZMQSocketWrapper
-
close
public void close()- Overrides:
closein classZMQSocketWrapper
-
getField
protected mmcorej.org.json.JSONObject getField(Object obj, mmcorej.org.json.JSONObject json) throws mmcorej.org.json.JSONException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException- Throws:
mmcorej.org.json.JSONExceptionNoSuchFieldExceptionIllegalArgumentExceptionIllegalAccessException
-
setField
protected void setField(Object obj, mmcorej.org.json.JSONObject json) throws mmcorej.org.json.JSONException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException- Throws:
mmcorej.org.json.JSONExceptionNoSuchFieldExceptionIllegalArgumentExceptionIllegalAccessException
-
parseAndExecuteCommand
protected mmcorej.org.json.JSONObject parseAndExecuteCommand(mmcorej.org.json.JSONObject request) throws Exception- Throws:
Exception
-