Package org.restlet.util
Class ServiceList
Modifiable list of services.
- Author:
- Jerome Louvel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInserts the specified element at the specified position in this list.booleanAdds a element at the end of the list.booleanaddAll(int index, Collection<? extends Service> services) Inserts all of the elements in the specified collection into this list at the specified position.booleanaddAll(Collection<? extends Service> services) Appends all of the elements in the specified collection to the end of this list.<T extends Service>
TReturns a service matching a given service class.Returns the context.voidSets the list of services.voidReplaces or adds a service.voidsetContext(Context context) Sets the context.voidstart()Starts each service.voidstop()Stops each service.Methods inherited from class org.restlet.util.WrapperList
clear, contains, containsAll, equals, get, getDelegate, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
replaceAll, sort, spliterator
-
Constructor Details
-
ServiceList
Constructor.- Parameters:
context- The context.
-
-
Method Details
-
add
Description copied from class:WrapperListInserts the specified element at the specified position in this list. -
add
Description copied from class:WrapperListAdds a element at the end of the list.- Specified by:
addin interfaceCollection<Service>- Specified by:
addin interfaceList<Service>- Overrides:
addin classWrapperList<Service>- Returns:
- True (as per the general contract of the Collection.add method).
-
addAll
Description copied from class:WrapperListAppends all of the elements in the specified collection to the end of this list.- Specified by:
addAllin interfaceCollection<Service>- Specified by:
addAllin interfaceList<Service>- Overrides:
addAllin classWrapperList<Service>- Parameters:
services- The collection of elements to append.
-
addAll
Description copied from class:WrapperListInserts all of the elements in the specified collection into this list at the specified position. -
get
Returns a service matching a given service class.- Type Parameters:
T- The service type.- Parameters:
clazz- The service class to match.- Returns:
- The matched service instance.
-
getContext
Returns the context.- Returns:
- The context.
-
set
Sets the list of services.- Parameters:
services- The list of services.
-
set
Replaces or adds a service. The replacement is based on the service class.- Parameters:
newService- The new service to set.
-
setContext
Sets the context. By default, it also updates the context of already registered services.- Parameters:
context- The context.
-
start
Starts each service.- Throws:
Exception
-
stop
Stops each service.- Throws:
Exception
-