---
agentTools:
  projectIndex: https://jeakbot.readme.io/llms.txt
---

# Services

Communication between framework and plugins, as well as between plugins is implemented using services in the framework. The `ServiceManager` keeps track of service interfaces and their implementations.

[block:api-header]
{
  "title": "Retrieving a service"
}
[/block]

`IServiceManager#<T>provide(Class<T> interface)` returns an `Optional<T>` which contains the services instance if it has been registered.\
If the `Optional` is redundant (for example, when retrieving framework or own services), the unsafe `IServiceManager#<T>provideUnchecked(Class<T> interface)` can be used.

[block:api-header]
{
  "title": "Registering a service"
}
[/block]

To register a service, call `IServiceManager#<T>registerService(Class<T> interface, T instance)`.