Interface RessorService<T>

  • All Known Implementing Classes:
    RessorServiceImpl

    public interface RessorService<T>
    • Method Detail

      • unwrap

        RessorService<T> unwrap()
        Returns the original instance, which extends RessorService subclass, since actual service proxies don't directly extend them.
      • underlyingType

        java.lang.Class<? extends T> underlyingType()
        Returns the underlying type of the user service.
      • instance

        T instance()
        Latest non-proxied instance of the user service. Throws IllegalStateException if there is no underlying instance. Important! This method is used implicitly by ServiceProxyBuilder while building service proxy instance.
      • getResourceId

        ResourceId getResourceId()
        The resource identifier which this service operate.
        Returns:
        the resource id
      • latestVersion

        SourceVersion latestVersion()
        Returns the latest resource version which this service is aware of and is switching to. It's guaranteed that instance() and latestVersion() will be *eventually in sync* with each other at some point of time.
      • errorHandler

        ErrorHandler errorHandler()
        Error handler which should be used for this service in case of exceptions
      • reload

        boolean reload​(@Nullable
                       @Nullable LoadedResource resource,
                       boolean force)
        Attempts to reload the service with the given resource. If the service is already reloading from another thread, will return false. In case of any error will throw appropriate exception.
        Parameters:
        resource - the new version of the resource
        force - whether to force the reload, blocking until concurrent reloads completed
        Returns:
        true if the resource was reloaded, unless false
      • reload

        default boolean reload​(@Nullable
                               @Nullable LoadedResource resource)
      • isReloading

        boolean isReloading()
        Is this service currently reloading.
      • safeInstance

        default T safeInstance()
        Same as instance() but returning null instead of throwing an exception.