Class ActionEndpoint

java.lang.Object
services.moleculer.service.Endpoint
services.moleculer.service.ActionEndpoint
All Implemented Interfaces:
Action
Direct Known Subclasses:
LocalActionEndpoint, RemoteActionEndpoint

public abstract class ActionEndpoint extends Endpoint implements Action
  • Field Details

    • logger

      protected static final org.slf4j.Logger logger
    • config

      protected final io.datatree.Tree config
    • hashCode

      protected final int hashCode
    • name

      protected final String name
    • service

      protected final String service
    • localOnly

      protected final boolean localOnly
      Private Action; only the local Broker can access it and cannot be called remotely.
    • current

      protected Action current
    • checkedMiddlewares

      protected HashSet<Middleware> checkedMiddlewares
  • Constructor Details

    • ActionEndpoint

      public ActionEndpoint(String nodeID, String service, io.datatree.Tree config)
  • Method Details

    • handler

      public Object handler(Context ctx) throws Exception
      Description copied from interface: Action
      Action's main method. Allowed return types: Promise, CompletableFuture, Tree, String, int, double, byte, float, short, long, boolean, byte[], UUID, Date, InetAddress, BigInteger, BigDecimal, and Java Collections (Map, List, Set) with these types.
      Specified by:
      handler in interface Action
      Parameters:
      ctx - invocation context
      Returns:
      result of the action
      Throws:
      Exception - any exception
    • use

      public boolean use(Middleware middleware)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getConfig

      public io.datatree.Tree getConfig()
    • getAction

      public Action getAction()
    • isLocalOnly

      public boolean isLocalOnly()