Package-level declarations

Types

Link copied to clipboard

Service provider interface for dependency injection and service management in the Wow framework. Provides methods to register services by type and name, and retrieve them when needed. This interface supports both type-based and name-based service resolution.

Link copied to clipboard

Simple implementation of ServiceProvider using thread-safe ConcurrentHashMap for storage. Provides basic service registration and retrieval functionality with support for both type-based and name-based lookups. Supports subtype matching for type-based lookups.

Functions

Link copied to clipboard

Retrieves a required service using reified type information, throwing an exception if not found. This is a convenience extension that automatically uses the reified type for lookup.

fun <S : Any> ServiceProvider.getRequiredService(serviceType: Class<S>): S

Retrieves a required service by Java class, throwing an exception if not found. This method guarantees that a service is returned or an exception is thrown.

Retrieves a required service by name, throwing an exception if not found. This method guarantees that a service is returned or an exception is thrown.

Retrieves a required service by Kotlin type, throwing an exception if not found. This method guarantees that a service is returned or an exception is thrown.

Link copied to clipboard
inline fun <S : Any> ServiceProvider.getService(): S?

Retrieves a service using reified type information. This is a convenience extension that automatically uses the reified type for lookup.

Link copied to clipboard
inline fun <S : Any> ServiceProvider.register(service: Any, serviceName: String = service.javaClass.toName())

Registers a service with reified type information. This is a convenience extension that automatically infers the service type using reified generics.