Package org.zeromq
Class ZAuth.AuthActor
- java.lang.Object
-
- org.zeromq.ZActor.SimpleActor
-
- org.zeromq.ZAuth.AuthActor
-
- All Implemented Interfaces:
ZActor.Actor
- Enclosing class:
- ZAuth
private static class ZAuth.AuthActor extends ZActor.SimpleActor
AuthActor is the backend actor which we talk to over a pipe. This lets the actor do work asynchronously in the background while our application does other things. This is invisible to the caller, who sees a classic API.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
actorName
private java.util.Map<java.lang.String,ZAuth.Auth>
auths
private java.util.Properties
blacklist
private static java.lang.String
OK
private ZMQ.Socket
replies
private java.lang.String
repliesAddress
private boolean
repliesEnabled
private boolean
verbose
private java.util.Properties
whitelist
-
Constructor Summary
Constructors Modifier Constructor Description private
AuthActor(java.lang.String actorName, java.util.Map<java.lang.String,ZAuth.Auth> auths)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
backstage(ZMQ.Socket pipe, ZPoller poller, int events)
Called when the actor received a control message from its pipe during a loop.private ZAgent
createAgent(ZContext ctx)
java.util.List<ZMQ.Socket>
createSockets(ZContext ctx, java.lang.Object... args)
Creates and initializes sockets for the double.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.boolean
stage(ZMQ.Socket socket, ZMQ.Socket pipe, ZPoller poller, int events)
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.
-
-
-
Field Detail
-
OK
private static final java.lang.String OK
- See Also:
- Constant Field Values
-
actorName
private final java.lang.String actorName
-
whitelist
private final java.util.Properties whitelist
-
blacklist
private final java.util.Properties blacklist
-
auths
private final java.util.Map<java.lang.String,ZAuth.Auth> auths
-
repliesAddress
private final java.lang.String repliesAddress
-
repliesEnabled
private boolean repliesEnabled
-
replies
private ZMQ.Socket replies
-
verbose
private boolean verbose
-
-
Constructor Detail
-
AuthActor
private AuthActor(java.lang.String actorName, java.util.Map<java.lang.String,ZAuth.Auth> auths)
-
-
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
-
backstage
public boolean backstage(ZMQ.Socket pipe, ZPoller poller, int events)
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.events
- the events source of the call- Returns:
- true in case of success, false to stop the actor.
-
stage
public boolean stage(ZMQ.Socket socket, ZMQ.Socket pipe, ZPoller poller, int events)
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.events
- the events source of the call- Returns:
- true in case of success, false to stop the actor.
-
-