Class RequiredServicesFeatureAdapter

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> jadex.commons.future.ISubscriptionIntermediateFuture<T> addQuery​(ServiceQuery<T> query)
      Add a service query.
      <T> jadex.commons.future.ISubscriptionIntermediateFuture<T> addQuery​(ServiceQuery<T> query, long timeout)
      Add a service query.
      <T> jadex.commons.future.ISubscriptionIntermediateFuture<T> addQuery​(java.lang.Class<T> type)
      Add a query for a declared required service.
      <T> jadex.commons.future.ISubscriptionIntermediateFuture<T> addQuery​(java.lang.String name)
      Add a query for a declared required service.
      <T> T getLocalService​(ServiceQuery<T> query)
      Search for matching services and provide first result.
      <T> T getLocalService​(java.lang.Class<T> type)
      Resolve a required service of a given type.
      <T> T getLocalService​(java.lang.String name)
      Resolve a declared required service of a given name.
      <T> T getLocalService0​(java.lang.Class<T> type)
      Resolve a required service of a given type.
      <T> java.util.Collection<T> getLocalServices​(ServiceQuery<T> query)
      Search for all matching services.
      <T> java.util.Collection<T> getLocalServices​(java.lang.Class<T> type)
      Resolve a required services of a given type.
      <T> java.util.Collection<T> getLocalServices​(java.lang.String name)
      Resolve a required services of a given name.
      <T> jadex.commons.future.IFuture<T> getService​(java.lang.Class<T> type)
      Resolve a required service of a given type.
      <T> jadex.commons.future.IFuture<T> getService​(java.lang.String name)
      Resolve a declared required service of a given name.
      IService getServiceProxy​(IServiceIdentifier sid, RequiredServiceInfo info)
      Create the user-facing object from the received search or query result.
      ServiceQuery<?> getServiceQuery​(java.lang.String name)
      Get a service query for a required service info (as defined in the agent under that name).
      <T> jadex.commons.future.ITerminableIntermediateFuture<T> getServices​(java.lang.Class<T> type)
      Resolve a required services of a given type.
      <T> jadex.commons.future.ITerminableIntermediateFuture<T> getServices​(java.lang.String name)
      Resolve a required services of a given name.
      java.lang.String rename​(java.lang.String name)
      Rename if necessary.
      <T> jadex.commons.future.IFuture<T> searchService​(ServiceQuery<T> query)
      Search for matching services and provide first result.
      <T> jadex.commons.future.IFuture<T> searchService​(ServiceQuery<T> query, long timeout)
      Performs a sustained search for a service.
      <T> jadex.commons.future.ITerminableIntermediateFuture<T> searchServices​(ServiceQuery<T> query)
      Search for all matching services.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RequiredServicesFeatureAdapter

        public RequiredServicesFeatureAdapter​(IRequiredServicesFeature delegate)
        Create a new adapter.
    • Method Detail

      • getService

        public <T> jadex.commons.future.IFuture<T> getService​(java.lang.String name)
        Resolve a declared required service of a given name. Asynchronous method for locally as well as remotely available services.
        Specified by:
        getService in interface IRequiredServicesFeature
        Parameters:
        name - The service name.
        Returns:
        The service.
      • getLocalService0

        public <T> T getLocalService0​(java.lang.Class<T> type)
        Resolve a required service of a given type. Synchronous method only for locally available services.
        Specified by:
        getLocalService0 in interface IRequiredServicesFeature
        Parameters:
        type - The service type.
        Returns:
        The service.
      • getService

        public <T> jadex.commons.future.IFuture<T> getService​(java.lang.Class<T> type)
        Resolve a required service of a given type. Asynchronous method for locally as well as remotely available services.
        Specified by:
        getService in interface IRequiredServicesFeature
        Parameters:
        type - The service type.
        Returns:
        The service.
      • getServices

        public <T> jadex.commons.future.ITerminableIntermediateFuture<T> getServices​(java.lang.String name)
        Resolve a required services of a given name. Asynchronous method for locally as well as remotely available services.
        Specified by:
        getServices in interface IRequiredServicesFeature
        Parameters:
        name - The services name.
        Returns:
        Each service as an intermediate result and a collection of services as final result.
      • getServices

        public <T> jadex.commons.future.ITerminableIntermediateFuture<T> getServices​(java.lang.Class<T> type)
        Resolve a required services of a given type. Asynchronous method for locally as well as remotely available services.
        Specified by:
        getServices in interface IRequiredServicesFeature
        Parameters:
        type - The services type.
        Returns:
        Each service as an intermediate result and a collection of services as final result.
      • getLocalService

        public <T> T getLocalService​(java.lang.String name)
        Resolve a declared required service of a given name. Synchronous method only for locally available services.
        Specified by:
        getLocalService in interface IRequiredServicesFeature
        Parameters:
        name - The service name.
        Returns:
        The service.
      • getLocalService

        public <T> T getLocalService​(java.lang.Class<T> type)
        Resolve a required service of a given type. Synchronous method only for locally available services.
        Specified by:
        getLocalService in interface IRequiredServicesFeature
        Parameters:
        type - The service type.
        Returns:
        The service.
      • getLocalServices

        public <T> java.util.Collection<T> getLocalServices​(java.lang.String name)
        Resolve a required services of a given name. Synchronous method only for locally available services.
        Specified by:
        getLocalServices in interface IRequiredServicesFeature
        Parameters:
        name - The services name.
        Returns:
        Each service as an intermediate result and a collection of services as final result.
      • getLocalServices

        public <T> java.util.Collection<T> getLocalServices​(java.lang.Class<T> type)
        Resolve a required services of a given type. Synchronous method only for locally available services.
        Specified by:
        getLocalServices in interface IRequiredServicesFeature
        Parameters:
        type - The services type.
        Returns:
        Each service as an intermediate result and a collection of services as final result.
      • searchService

        public <T> jadex.commons.future.IFuture<T> searchService​(ServiceQuery<T> query)
        Search for matching services and provide first result.
        Specified by:
        searchService in interface IExternalRequiredServicesFeature
        Parameters:
        query - The search query.
        Returns:
        Future providing the corresponding service or ServiceNotFoundException when not found.
      • getLocalService

        public <T> T getLocalService​(ServiceQuery<T> query)
        Search for matching services and provide first result. Synchronous method only for locally available services.
        Specified by:
        getLocalService in interface IRequiredServicesFeature
        Parameters:
        query - The search query.
        Returns:
        Future providing the corresponding service or ServiceNotFoundException when not found.
      • searchServices

        public <T> jadex.commons.future.ITerminableIntermediateFuture<T> searchServices​(ServiceQuery<T> query)
        Search for all matching services.
        Specified by:
        searchServices in interface IExternalRequiredServicesFeature
        Parameters:
        query - The search query.
        Returns:
        Future providing the corresponding services or ServiceNotFoundException when not found.
      • getLocalServices

        public <T> java.util.Collection<T> getLocalServices​(ServiceQuery<T> query)
        Search for all matching services. Synchronous method only for locally available services.
        Specified by:
        getLocalServices in interface IRequiredServicesFeature
        Parameters:
        query - The search query.
        Returns:
        Future providing the corresponding services or ServiceNotFoundException when not found.
      • searchService

        public <T> jadex.commons.future.IFuture<T> searchService​(ServiceQuery<T> query,
                                                                 long timeout)
        Performs a sustained search for a service. Attempts to find a service for a maximum duration until timeout occurs.
        Specified by:
        searchService in interface IRequiredServicesFeature
        Parameters:
        query - The search query.
        timeout - Maximum time period to search.
        Returns:
        Service matching the query, exception if service is not found.
      • addQuery

        public <T> jadex.commons.future.ISubscriptionIntermediateFuture<T> addQuery​(java.lang.String name)
        Add a query for a declared required service. Continuously searches for matching services.
        Specified by:
        addQuery in interface IRequiredServicesFeature
        Parameters:
        name - The name of the required service declaration.
        Returns:
        Future providing the corresponding services as intermediate results.
      • addQuery

        public <T> jadex.commons.future.ISubscriptionIntermediateFuture<T> addQuery​(java.lang.Class<T> type)
        Add a query for a declared required service. Continuously searches for matching services.
        Specified by:
        addQuery in interface IRequiredServicesFeature
        Parameters:
        type - The type of the required service declaration.
        Returns:
        Future providing the corresponding services as intermediate results.
      • addQuery

        public <T> jadex.commons.future.ISubscriptionIntermediateFuture<T> addQuery​(ServiceQuery<T> query)
        Add a service query. Continuously searches for matching services.
        Specified by:
        addQuery in interface IExternalRequiredServicesFeature
        Parameters:
        query - The search query.
        Returns:
        Future providing the corresponding service or ServiceNotFoundException when not found.
      • addQuery

        public <T> jadex.commons.future.ISubscriptionIntermediateFuture<T> addQuery​(ServiceQuery<T> query,
                                                                                    long timeout)
        Add a service query. Continuously searches for matching services.
        Specified by:
        addQuery in interface IRequiredServicesFeature
        Parameters:
        query - The search query.
        Returns:
        Future providing the corresponding service or ServiceNotFoundException when not found.
      • getServiceQuery

        public ServiceQuery<?> getServiceQuery​(java.lang.String name)
        Get a service query for a required service info (as defined in the agent under that name).
        Specified by:
        getServiceQuery in interface IRequiredServicesFeature
        Parameters:
        name - The name.
        Returns:
        The service query.
      • rename

        public java.lang.String rename​(java.lang.String name)
        Rename if necessary.