Package org.zeromq
Interface ZProxy.Proxy
-
- All Known Implementing Classes:
ZProxy.Proxy.SimpleProxy
- Enclosing class:
- ZProxy
public static interface ZProxy.Proxy
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ZProxy.Proxy.SimpleProxy
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
configure(ZMQ.Socket pipe, ZMsg cfg, ZMQ.Socket frontend, ZMQ.Socket backend, ZMQ.Socket capture, java.lang.Object... args)
Configures the proxy with a custom message.boolean
configure(ZMQ.Socket socket, ZProxy.Plug place, java.lang.Object... args)
Configures the given socket.ZMQ.Socket
create(ZContext ctx, ZProxy.Plug place, java.lang.Object... args)
Creates and initializes (bind, options ...) the socket for the given plug in the proxy.boolean
custom(ZMQ.Socket pipe, java.lang.String cmd, ZMQ.Socket frontend, ZMQ.Socket backend, ZMQ.Socket capture, java.lang.Object... args)
Handles a custom command not recognized by the proxy.boolean
restart(ZMsg cfg, ZMQ.Socket socket, ZProxy.Plug place, java.lang.Object... args)
Performs a hot restart of the given socket.
-
-
-
Method Detail
-
create
ZMQ.Socket create(ZContext ctx, ZProxy.Plug place, java.lang.Object... args)
Creates and initializes (bind, options ...) the socket for the given plug in the proxy. The proxy will close them afterwards, and the context as well if not provided in the constructor. There is no need to keep a reference on the created socket or the context given in parameter.- Parameters:
ctx
- the context used for initialization.place
- the position for the future created socket in the proxy.args
- the optional array of arguments that has been passed at the creation of the ZProxy.- Returns:
- the created socket. Possibly null only for capture.
-
configure
boolean configure(ZMQ.Socket socket, ZProxy.Plug place, java.lang.Object... args) throws java.io.IOException
Configures the given socket.- Parameters:
socket
- the socket to configureplace
- 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 if successfully configured, otherwise false
- Throws:
java.io.IOException
-
restart
boolean restart(ZMsg cfg, ZMQ.Socket socket, ZProxy.Plug place, java.lang.Object... args) throws java.io.IOException
Performs a hot restart of the given socket. Usually an unbind/bind but you can use whatever method you like.- 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:
java.io.IOException
-
configure
boolean configure(ZMQ.Socket pipe, ZMsg cfg, ZMQ.Socket frontend, ZMQ.Socket backend, ZMQ.Socket capture, java.lang.Object... args)
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.- 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
boolean custom(ZMQ.Socket pipe, java.lang.String cmd, ZMQ.Socket frontend, ZMQ.Socket backend, ZMQ.Socket capture, java.lang.Object... args)
Handles a custom command not recognized by the proxy. Note: you need to send the current state at the end of the call.- 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
-
-