Package net.openosrs.api
Class Context
- java.lang.Object
-
- net.openosrs.api.Context
-
public final class Context extends java.lang.ObjectCentral access hub for the OpenOSRS Interaction API. The API is intentionally DI-friendly: services are plain Guice singletons.OpenOSRSprovides static convenience access for code that cannot receive constructor injection (scripts, static contexts).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classContext.SnapshotImmutable injector/client pair.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Context.Snapshotcapture()static net.runelite.api.Clientclient()static <T> TgetService(java.lang.Class<T> type)static voidinit(com.google.inject.Injector runeLiteInjector)Resolve all required state before publishing one coherent context.static booleanisInitialized()static voidshutdown()Detach the static facade.
-
-
-
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()
-
capture
public static Context.Snapshot capture()
-
client
public static net.runelite.api.Client client()
-
getService
public static <T> T getService(java.lang.Class<T> type)
-
-