Top Description Methods
org.glassfish.hk2.runlevel

public Interface Sorter

Annotations
@Contract
Imports
java.util.List, org.glassfish.hk2.api.ServiceHandle, org.jvnet.hk2.annotations.Contract

Contract for sorting descriptors for run level services. It should be noted that sorting the handles in a multi-threaded environment is a heuristic in any case, as the threads are scheduled randomly. Sorting can only be guaranteed in a single threaded or no-threaded case.
Author
tbeerbower, jwells

Method Summary

Modifier and TypeMethod and Description
public List<ServiceHandle<?>>

Returns:

The list as sorted. If this returns null then the list as passed in will be used. If any of the service handles returned are not in the run-level being processed they will be ignored. This list may add or remove handles to the list
sort
(List<ServiceHandle<?>>
the list descriptors to be sorted
descriptors
)

Sort the given list of run level service handles.

Method Detail

sortback to summary
public List<ServiceHandle<?>> sort(List<ServiceHandle<?>> descriptors)

Sort the given list of run level service handles. This method will only be called when the run-level is going up in value. When going down in value services are always stopped in the reverse order from which they were started

Parameters
descriptors:List<ServiceHandle<?>>

the list descriptors to be sorted

Returns:List<ServiceHandle<?>>

The list as sorted. If this returns null then the list as passed in will be used. If any of the service handles returned are not in the run-level being processed they will be ignored. This list may add or remove handles to the list