Package org.zeromq
Class ZMonitor.MonitorActor
- java.lang.Object
-
- org.zeromq.ZActor.SimpleActor
-
- org.zeromq.ZMonitor.MonitorActor
-
- All Implemented Interfaces:
ZActor.Actor
- Enclosing class:
- ZMonitor
private static class ZMonitor.MonitorActor extends ZActor.SimpleActor
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
address
private static java.lang.String
ERROR
private int
events
private ZMQ.Socket
monitor
private ZMQ.Socket
monitored
private static java.lang.String
OK
private boolean
verbose
-
Constructor Summary
Constructors Constructor Description MonitorActor(ZMQ.Socket socket)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
addEvents(ZMQ.Socket pipe)
boolean
backstage(ZMQ.Socket pipe, ZPoller poller, int evts)
Called when the actor received a control message from its pipe during a loop.private boolean
close(ZPoller poller, ZMQ.Socket pipe)
java.util.List<ZMQ.Socket>
createSockets(ZContext ctx, java.lang.Object... args)
Creates and initializes sockets for the double.private void
log(java.lang.String action, boolean rc, java.lang.String err)
java.lang.String
premiere(ZMQ.Socket pipe)
This is the grand premiere! Called before the creation of the first double and the sockets 2nd in the order call of the global acting.private boolean
removeEvents(ZMQ.Socket pipe)
boolean
stage(ZMQ.Socket socket, ZMQ.Socket pipe, ZPoller poller, int evts)
The actor received a message from the created sockets during a loop.void
start(ZMQ.Socket pipe, java.util.List<ZMQ.Socket> sockets, ZPoller poller)
Called when the double is started, before the first loop.private boolean
start(ZPoller poller, ZMQ.Socket pipe)
-
-
-
Field Detail
-
ERROR
private static final java.lang.String ERROR
- See Also:
- Constant Field Values
-
OK
private static final java.lang.String OK
- See Also:
- Constant Field Values
-
monitored
private final ZMQ.Socket monitored
-
address
private final java.lang.String address
-
monitor
private ZMQ.Socket monitor
-
events
private int events
-
verbose
private boolean verbose
-
-
Constructor Detail
-
MonitorActor
public MonitorActor(ZMQ.Socket socket)
-
-
Method Detail
-
premiere
public java.lang.String premiere(ZMQ.Socket pipe)
Description copied from interface:ZActor.Actor
This is the grand premiere! Called before the creation of the first double and the sockets 2nd in the order call of the global acting.- Specified by:
premiere
in interfaceZActor.Actor
- Overrides:
premiere
in classZActor.SimpleActor
- Parameters:
pipe
- the backstage control pipe- Returns:
- the name of the upcoming performance
-
createSockets
public java.util.List<ZMQ.Socket> createSockets(ZContext ctx, java.lang.Object... args)
Description copied from interface:ZActor.Actor
Creates and initializes sockets for the double. This is done at each creation of a new double. 3rd in the order call of the global acting. 1st in the order call of the new double.- Specified by:
createSockets
in interfaceZActor.Actor
- Overrides:
createSockets
in classZActor.SimpleActor
- Parameters:
ctx
- the context used to create socketsargs
- the arguments passed as parameters of the ZActor- Returns:
- a list of created sockets that will be managed by the double. Not null.
-
start
public void start(ZMQ.Socket pipe, java.util.List<ZMQ.Socket> sockets, ZPoller poller)
Description copied from interface:ZActor.Actor
Called when the double is started, before the first loop. 4th in the order call of the global acting. 2nd in the order call of the new double.- Specified by:
start
in interfaceZActor.Actor
- Overrides:
start
in classZActor.SimpleActor
- Parameters:
pipe
- the backstage control pipesockets
- the managed sockets that were created in the previous steppoller
- the poller where to eventually register the sockets for events
-
stage
public boolean stage(ZMQ.Socket socket, ZMQ.Socket pipe, ZPoller poller, int evts)
Description copied from interface:ZActor.Actor
The actor received a message from the created sockets during a loop. 2nd ex-aequo in the order call of the new loop.- Specified by:
stage
in interfaceZActor.Actor
- Overrides:
stage
in classZActor.SimpleActor
- Parameters:
socket
- the socket receiving the messagepipe
- the backstage control pipepoller
- the poller of the double.evts
- the events source of the call- Returns:
- true in case of success, false to stop the actor.
-
backstage
public boolean backstage(ZMQ.Socket pipe, ZPoller poller, int evts)
Description copied from interface:ZActor.Actor
Called when the actor received a control message from its pipe during a loop. 2nd in the order call of the new loop.- Specified by:
backstage
in interfaceZActor.Actor
- Overrides:
backstage
in classZActor.SimpleActor
- Parameters:
pipe
- the backstage control pipe receiving the messagepoller
- the poller of the double.evts
- the events source of the call- Returns:
- true in case of success, false to stop the actor.
-
addEvents
private boolean addEvents(ZMQ.Socket pipe)
-
removeEvents
private boolean removeEvents(ZMQ.Socket pipe)
-
start
private boolean start(ZPoller poller, ZMQ.Socket pipe)
-
close
private boolean close(ZPoller poller, ZMQ.Socket pipe)
-
log
private void log(java.lang.String action, boolean rc, java.lang.String err)
-
-