Package org.zeromq

Class 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 Details

  • Constructor Details

  • Method Details

    • createAgent

      private ZAgent createAgent(ZContext ctx)
    • premiere

      public 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. It return the name that will be used for the thread. If it's null, a default one will be picked by ZActor.
      Specified by:
      premiere in interface ZActor.Actor
      Overrides:
      premiere in class ZActor.SimpleActor
      Parameters:
      pipe - the backstage control pipe
      Returns:
      the name of the upcoming performance.
    • createSockets

      public List<ZMQ.Socket> createSockets(ZContext ctx, 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 interface ZActor.Actor
      Overrides:
      createSockets in class ZActor.SimpleActor
      Parameters:
      ctx - the context used to create sockets
      args - 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, 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 interface ZActor.Actor
      Overrides:
      start in class ZActor.SimpleActor
      Parameters:
      pipe - the backstage control pipe
      sockets - the managed sockets that were created in the previous step
      poller - 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 interface ZActor.Actor
      Overrides:
      backstage in class ZActor.SimpleActor
      Parameters:
      pipe - the backstage control pipe receiving the message
      poller - 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 interface ZActor.Actor
      Overrides:
      stage in class ZActor.SimpleActor
      Parameters:
      socket - the socket receiving the message
      pipe - the backstage control pipe
      poller - the poller of the double.
      events - the events source of the call
      Returns:
      true in case of success, false to stop the actor.