Class KosCore

java.lang.Object
com.tccc.kos.core.app.KosCore

public final class KosCore extends Object
Static accessor for a number of core kOS components that are so common it's inefficient to inject them everywhere they're needed.

Usage Example

  
      Mode mode = KosCore.getMode();
      BeanContext ctx = KosCore.getCtx();
  
 
Version:
2022-08-31
  • Method Details

    • hasProfile

      public static boolean hasProfile(String profile)
      Returns true if the specified profile is active.
      Parameters:
      profile - the profile to check
    • getMode

      public static Mode getMode()
      Returns the current operational mode.
    • isTest

      public static boolean isTest()
      Returns true if the current operational mode is TEST.
    • isProd

      public static boolean isProd()
      Returns true if the current operational mode is PROD (production).
    • isSimulator

      public static boolean isSimulator()
      Returns true if we're running inside the Studio simulator.
    • isPrimary

      public static boolean isPrimary()
      Returns true if we're running on the system's primary node.
    • getPrimaryNodeId

      public static NodeId getPrimaryNodeId()
      Returns the nodeId of the primary node.
    • getAuthority

      public static String getAuthority()
      Returns the authority value of this node.
    • getBoardType

      public static String getBoardType()
      Returns the board type of this node.
    • getArch

      public static String getArch()
      Returns the arch of this node.
    • getPathMgr

      public static PathMgr getPathMgr()
      Returns the object that gives us access to named paths.
    • getCtx

      public static BeanContext getCtx()
      Returns the context for kOS.
    • getSystemCtx

      public static BeanContext getSystemCtx()
      Returns the context for the system app.
    • getSystemApp

      public static SystemApplication getSystemApp()
      Return the system application.
    • getPort

      public static int getPort()
      Returns the port number that kOS is running on. It defaults to 8081.
    • getNodeId

      public static NodeId getNodeId()
      Returns the ID of the node we're running on.