Class Context


  • public final class Context
    extends java.lang.Object
    Central access hub for the OpenOSRS Interaction API. The API is intentionally DI-friendly: services are plain Guice singletons. OpenOSRS provides static convenience access for code that cannot receive constructor injection (scripts, static contexts).
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Context.Snapshot
      Immutable injector/client pair.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Context.Snapshot capture()  
      static net.runelite.api.Client client()  
      static <T> T getService​(java.lang.Class<T> type)  
      static void init​(com.google.inject.Injector runeLiteInjector)
      Resolve all required state before publishing one coherent context.
      static boolean isInitialized()  
      static void shutdown()
      Detach the static facade.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • init

        public static void init​(com.google.inject.Injector runeLiteInjector)
        Resolve all required state before publishing one coherent context.
      • shutdown

        public static void shutdown()
        Detach the static facade. Previously captured snapshots become unusable.
      • isInitialized

        public static boolean isInitialized()
      • client

        public static net.runelite.api.Client client()
      • getService

        public static <T> T getService​(java.lang.Class<T> type)