Package jadex.bridge.service.component
Class RequiredServicesFeatureAdapter
- java.lang.Object
- 
- jadex.bridge.service.component.RequiredServicesFeatureAdapter
 
- 
- All Implemented Interfaces:
- IExternalComponentFeature,- IExternalRequiredServicesFeature,- IRequiredServicesFeature
 
 public class RequiredServicesFeatureAdapter extends java.lang.Object implements IRequiredServicesFeature Adapter for the required services feature.
- 
- 
Field SummaryFields Modifier and Type Field Description protected IRequiredServicesFeaturedelegateThe delegate.
 - 
Constructor SummaryConstructors Constructor Description RequiredServicesFeatureAdapter(IRequiredServicesFeature delegate)Create a new adapter.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> ISubscriptionIntermediateFuture<T>addQuery(ServiceQuery<T> query)Add a service query.<T> ISubscriptionIntermediateFuture<T>addQuery(ServiceQuery<T> query, long timeout)Add a service query.<T> ISubscriptionIntermediateFuture<T>addQuery(java.lang.Class<T> type)Add a query for a declared required service.<T> ISubscriptionIntermediateFuture<T>addQuery(java.lang.String name)Add a query for a declared required service.<T> TgetLocalService(java.lang.Class<T> type)Resolve a required service of a given type.<T> TgetLocalService(java.lang.String name)Resolve a declared required service of a given name.<T> TgetLocalService0(java.lang.Class<T> type)Resolve a required service of a given type.<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> IFuture<T>getService(java.lang.Class<T> type)Resolve a required service of a given type.<T> IFuture<T>getService(java.lang.String name)Resolve a declared required service of a given name.IServicegetServiceProxy(IServiceIdentifier sid, RequiredServiceInfo info)Create the user-facing object from the received search or query result.<T> ITerminableIntermediateFuture<T>getServices(java.lang.Class<T> type)Resolve a required services of a given type.<T> ITerminableIntermediateFuture<T>getServices(java.lang.String name)Resolve a required services of a given name.java.lang.Stringrename(java.lang.String name)Rename if necessary.<T> TsearchLocalService(ServiceQuery<T> query)Search for matching services and provide first result.<T> java.util.Collection<T>searchLocalServices(ServiceQuery<T> query)Search for all matching services.<T> IFuture<T>searchService(ServiceQuery<T> query)Search for matching services and provide first result.<T> IFuture<T>searchService(ServiceQuery<T> query, long timeout)Performs a sustained search for a service.<T> ITerminableIntermediateFuture<T>searchServices(ServiceQuery<T> query)Search for all matching services.
 
- 
- 
- 
Field Detail- 
delegateprotected IRequiredServicesFeature delegate The delegate.
 
- 
 - 
Constructor Detail- 
RequiredServicesFeatureAdapterpublic RequiredServicesFeatureAdapter(IRequiredServicesFeature delegate) Create a new adapter.
 
- 
 - 
Method Detail- 
getServicepublic <T> 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:
- getServicein interface- IRequiredServicesFeature
- Parameters:
- name- The service name.
- Returns:
- The service.
 
 - 
getLocalService0public <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:
- getLocalService0in interface- IRequiredServicesFeature
- Parameters:
- type- The service type.
- Returns:
- The service.
 
 - 
getServicepublic <T> 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:
- getServicein interface- IRequiredServicesFeature
- Parameters:
- type- The service type.
- Returns:
- The service.
 
 - 
getServicespublic <T> 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:
- getServicesin interface- IRequiredServicesFeature
- Parameters:
- name- The services name.
- Returns:
- Each service as an intermediate result and a collection of services as final result.
 
 - 
getServicespublic <T> 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:
- getServicesin interface- IRequiredServicesFeature
- Parameters:
- type- The services type.
- Returns:
- Each service as an intermediate result and a collection of services as final result.
 
 - 
getLocalServicepublic <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:
- getLocalServicein interface- IRequiredServicesFeature
- Parameters:
- name- The service name.
- Returns:
- The service.
 
 - 
getLocalServicepublic <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:
- getLocalServicein interface- IRequiredServicesFeature
- Parameters:
- type- The service type.
- Returns:
- The service.
 
 - 
getLocalServicespublic <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:
- getLocalServicesin interface- IRequiredServicesFeature
- Parameters:
- name- The services name.
- Returns:
- Each service as an intermediate result and a collection of services as final result.
 
 - 
getLocalServicespublic <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:
- getLocalServicesin interface- IRequiredServicesFeature
- Parameters:
- type- The services type.
- Returns:
- Each service as an intermediate result and a collection of services as final result.
 
 - 
searchServicepublic <T> IFuture<T> searchService(ServiceQuery<T> query) Search for matching services and provide first result.- Specified by:
- searchServicein interface- IExternalRequiredServicesFeature
- Parameters:
- query- The search query.
- Returns:
- Future providing the corresponding service or ServiceNotFoundException when not found.
 
 - 
searchLocalServicepublic <T> T searchLocalService(ServiceQuery<T> query) Search for matching services and provide first result. Synchronous method only for locally available services.- Specified by:
- searchLocalServicein interface- IRequiredServicesFeature
- Parameters:
- query- The search query.
- Returns:
- Future providing the corresponding service or ServiceNotFoundException when not found.
 
 - 
searchServicespublic <T> ITerminableIntermediateFuture<T> searchServices(ServiceQuery<T> query) Search for all matching services.- Specified by:
- searchServicesin interface- IExternalRequiredServicesFeature
- Parameters:
- query- The search query.
- Returns:
- Future providing the corresponding services or ServiceNotFoundException when not found.
 
 - 
searchLocalServicespublic <T> java.util.Collection<T> searchLocalServices(ServiceQuery<T> query) Search for all matching services. Synchronous method only for locally available services.- Specified by:
- searchLocalServicesin interface- IRequiredServicesFeature
- Parameters:
- query- The search query.
- Returns:
- Future providing the corresponding services or ServiceNotFoundException when not found.
 
 - 
searchServicepublic <T> 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:
- searchServicein interface- IRequiredServicesFeature
- Parameters:
- query- The search query.
- timeout- Maximum time period to search.
- Returns:
- Service matching the query, exception if service is not found.
 
 - 
addQuerypublic <T> ISubscriptionIntermediateFuture<T> addQuery(java.lang.String name) Add a query for a declared required service. Continuously searches for matching services.- Specified by:
- addQueryin interface- IRequiredServicesFeature
- Parameters:
- name- The name of the required service declaration.
- Returns:
- Future providing the corresponding services as intermediate results.
 
 - 
addQuerypublic <T> ISubscriptionIntermediateFuture<T> addQuery(java.lang.Class<T> type) Add a query for a declared required service. Continuously searches for matching services.- Specified by:
- addQueryin interface- IRequiredServicesFeature
- Parameters:
- type- The type of the required service declaration.
- Returns:
- Future providing the corresponding services as intermediate results.
 
 - 
addQuerypublic <T> ISubscriptionIntermediateFuture<T> addQuery(ServiceQuery<T> query) Add a service query. Continuously searches for matching services.- Specified by:
- addQueryin interface- IExternalRequiredServicesFeature
- Parameters:
- query- The search query.
- Returns:
- Future providing the corresponding service or ServiceNotFoundException when not found.
 
 - 
addQuerypublic <T> ISubscriptionIntermediateFuture<T> addQuery(ServiceQuery<T> query, long timeout) Add a service query. Continuously searches for matching services.- Specified by:
- addQueryin interface- IRequiredServicesFeature
- Parameters:
- query- The search query.
- Returns:
- Future providing the corresponding service or ServiceNotFoundException when not found.
 
 - 
getServiceProxypublic IService getServiceProxy(IServiceIdentifier sid, RequiredServiceInfo info) Create the user-facing object from the received search or query result. Result may be service object, service identifier (local or remote), or event. User object is either event or service (with or without required proxy).- Specified by:
- getServiceProxyin interface- IRequiredServicesFeature
 
 - 
renamepublic java.lang.String rename(java.lang.String name) Rename if necessary.
 
- 
 
-