Package org.zeromq
Class ZProxy.Proxy.SimpleProxy
java.lang.Object
org.zeromq.ZProxy.Proxy.SimpleProxy
- All Implemented Interfaces:
ZProxy.Proxy
- Enclosing interface:
ZProxy.Proxy
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.zeromq.ZProxy.Proxy
ZProxy.Proxy.SimpleProxy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
configure
(ZMQ.Socket pipe, ZMsg cfg, ZMQ.Socket frontend, ZMQ.Socket backend, ZMQ.Socket capture, Object... args) Configures the proxy with a custom message.boolean
custom
(ZMQ.Socket pipe, String cmd, ZMQ.Socket frontend, ZMQ.Socket backend, ZMQ.Socket capture, Object... args) Handles a custom command not recognized by the proxy.boolean
restart
(ZMsg cfg, ZMQ.Socket socket, ZProxy.Plug place, Object... args) Performs a hot restart of the given socket.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.zeromq.ZProxy.Proxy
configure, create
-
Constructor Details
-
SimpleProxy
public SimpleProxy()
-
-
Method Details
-
restart
public boolean restart(ZMsg cfg, ZMQ.Socket socket, ZProxy.Plug place, Object... args) throws IOException Description copied from interface:ZProxy.Proxy
Performs a hot restart of the given socket. Usually an unbind/bind but you can use whatever method you like.- Specified by:
restart
in interfaceZProxy.Proxy
- Parameters:
cfg
- the custom configuration message sent by the control.socket
- the socket to hot restartplace
- the position for the socket in the proxyargs
- the optional array of arguments that has been passed at the creation of the ZProxy.- Returns:
- true to perform a cold restart instead, false to do nothing. All the results will be collected from calls for all plugs. If any of them returns true, the cold restart is performed.
- Throws:
IOException
-
configure
public boolean configure(ZMQ.Socket pipe, ZMsg cfg, ZMQ.Socket frontend, ZMQ.Socket backend, ZMQ.Socket capture, Object... args) Description copied from interface:ZProxy.Proxy
Configures the proxy with a custom message. Note: you need to send one (1) mandatory custom response message with the pipe before the end of this call.- Specified by:
configure
in interfaceZProxy.Proxy
- Parameters:
pipe
- the control pipecfg
- the custom configuration message sent by the controlfrontend
- the frontend socketbackend
- the backend socketcapture
- the optional capture socketargs
- the optional array of arguments that has been passed at the creation of the ZProxy.- Returns:
- true to continue the proxy, false to exit
-
custom
public boolean custom(ZMQ.Socket pipe, String cmd, ZMQ.Socket frontend, ZMQ.Socket backend, ZMQ.Socket capture, Object... args) Description copied from interface:ZProxy.Proxy
Handles a custom command not recognized by the proxy. Note: you need to send the current state at the end of the call.- Specified by:
custom
in interfaceZProxy.Proxy
- Parameters:
pipe
- the control pipecmd
- the unrecognized commandfrontend
- the frontend socketbackend
- the backend socketcapture
- the optional capture socketargs
- the optional array of arguments that has been passed at the creation of the ZProxy.- Returns:
- true to continue the proxy, false to exit
-