async
Interface ASyncServiceManager

All Superinterfaces:
ASyncServiceInspector
All Known Implementing Classes:
ASync

public interface ASyncServiceManager
extends ASyncServiceInspector

An interface for managing ASyncService objects with an ASync instance.

Author:
Michael Parker

Method Summary
 boolean addService(ASyncService service)
          Adds the provided service to this ASync instance.
 boolean containsService(ASyncService service)
          Returns whether the provided service is registered with this ASync instance.
 java.util.List<ASyncService> getActiveServices()
          Returns a list of all active services registered with this ASync instance.
 java.util.List<ASyncService> getInactiveServices()
          Returns a list of all inactive services registered with this ASync instance.
 boolean removeService(ASyncService service)
          Removes the provided service from this ASync instance.
 
Methods inherited from interface async.ASyncServiceInspector
containsServiceKey, getActiveServiceKeys, getInactiveServiceKeys
 

Method Detail

addService

boolean addService(ASyncService service)
Adds the provided service to this ASync instance. This method will only succeed if ASync is not running, and the service is not already registered.

Parameters:
service - the service to add
Returns:
true if ASync is not running and the service is not already added, false otherwise

removeService

boolean removeService(ASyncService service)
Removes the provided service from this ASync instance. This method will only succeed if ASync is not running, and the service is already registered.

Parameters:
service - the service to remove
Returns:
true if ASync is not running and the service is registered, false otherwise

containsService

boolean containsService(ASyncService service)
Returns whether the provided service is registered with this ASync instance. If this is true, it is either in the list returned by getActiveServices or the list returned by getInactiveServices.

Parameters:
service - the service to query as registered
Returns:
true if the service is registered, false otherwise

getActiveServices

java.util.List<ASyncService> getActiveServices()
Returns a list of all active services registered with this ASync instance. Note that the list is immutable, and so attempting to add or remove services through the list will not change the services registered with the corresponding ASync instance.

Returns:
a list of all active and registered services

getInactiveServices

java.util.List<ASyncService> getInactiveServices()
Returns a list of all inactive services registered with this ASync instance. Note that the list is immutable, and so attempting to add or remove services through the list will not change the services registered with the corresponding ASync instance.

Returns:
a list of all inactive and registered services