Class ServiceGetter<T>


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

      Fields 
      Modifier and Type Field Description
      protected jadex.commons.future.Future<T> callfut
      Ongoing call future.
      protected IInternalAccess component
      The internal access.
      protected long delay
      The delay between searches when no service was found.
      protected long lastsearch
      The time of the last search.
      protected ServiceScope scope
      The scope.
      protected T service
      The cached service.
      protected java.lang.Class<T> type
      The service type.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T getLastService()
      Get last service.
      jadex.commons.future.IFuture<T> getService()
      Get or search the service with a delay in case not found.
      void resetService()
      Set the service to null, if e.g.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 jadex.commons.future.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 jadex.commons.future.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.