Class ServiceGetter<T>


  • public class ServiceGetter<T>
    extends java.lang.Object
    The service getter allows for getting a service
    • Field Detail

      • type

        protected java.lang.Class<T> type
        The service type.
      • service

        protected T service
        The cached service.
      • lastsearch

        protected long lastsearch
        The time of the last search.
      • delay

        protected long delay
        The delay between searches when no service was found.
      • callfut

        protected Future<T> callfut
        Ongoing call future.
    • Constructor Detail

      • ServiceGetter

        public ServiceGetter​(IInternalAccess component,
                             java.lang.Class<T> type,
                             ServiceScope scope)
        Create a new service getter.
      • ServiceGetter

        public ServiceGetter​(IInternalAccess component,
                             long delay,
                             java.lang.Class<T> type,
                             ServiceScope scope)
        Create a new service getter.
    • Method Detail

      • getService

        public IFuture<T> getService()
        Get or search the service with a delay in case not found.
      • resetService

        public void resetService()
        Set the service to null, if e.g. broken.
      • getLastService

        public T getLastService()
        Get last service.