@Beta public interface ResourceService extends ResourceQueryService, ListenerService<ResourceEvent,ResourceListener>
Modifier and Type | Method and Description |
---|---|
java.util.List<ResourceAllocation> |
allocate(ResourceConsumer consumer,
java.util.List<? extends Resource> resources)
Transactionally allocates the specified resources to the specified user.
|
default java.util.List<ResourceAllocation> |
allocate(ResourceConsumer consumer,
Resource... resources)
Transactionally allocates the specified resources to the specified user.
|
default java.util.Optional<ResourceAllocation> |
allocate(ResourceConsumer consumer,
Resource resource)
Allocates the specified resource to the specified user.
|
boolean |
release(java.util.List<ResourceAllocation> allocations)
Transactionally releases the specified resource allocations.
|
default boolean |
release(ResourceAllocation... allocations)
Transactionally releases the specified resource allocations.
|
default boolean |
release(ResourceAllocation allocation)
Releases the specified resource allocation.
|
boolean |
release(ResourceConsumer consumer)
Transactionally releases the resources allocated to the specified consumer.
|
getAvailableResources, getAvailableResources, getAvailableResourceValues, getRegisteredResources, getResourceAllocations, getResourceAllocations, getResourceAllocations, isAvailable
addListener, removeListener
default java.util.Optional<ResourceAllocation> allocate(ResourceConsumer consumer, Resource resource)
consumer
- resource user which the resource is allocated toresource
- resource to be allocatedjava.util.List<ResourceAllocation> allocate(ResourceConsumer consumer, java.util.List<? extends Resource> resources)
consumer
- resource user which the resources are allocated toresources
- resources to be allocateddefault java.util.List<ResourceAllocation> allocate(ResourceConsumer consumer, Resource... resources)
consumer
- resource user which the resources are allocated toresources
- resources to be allocateddefault boolean release(ResourceAllocation allocation)
allocation
- resource allocation to be releasedboolean release(java.util.List<ResourceAllocation> allocations)
allocations
- resource allocations to be releaseddefault boolean release(ResourceAllocation... allocations)
allocations
- resource allocations to be releasedboolean release(ResourceConsumer consumer)
consumer
- consumer whose allocated resources are to be released