com.kuka.resource.pool
Interface ResourcePool

All Known Subinterfaces:
ResourceFacadePool

public interface ResourcePool

A resource pool is a collection of unique resource objects.


Method Summary
 void addResourceListener(ResourceListener listener)
           
 Collection<com.kuka.resource.IResource> getAll()
           
 Collection<com.kuka.resource.IResource> getAll(ResourceFilter filter)
           
 com.kuka.resource.IResource getAny(ResourceFilter filter)
           
 com.kuka.resource.IResource getAny(ResourceFilter filter, long duration, TimeUnit unit)
          Returns the first resource that matches the filter within the given time.
 boolean isEmpty()
           
 void removeResourceListener(ResourceListener listener)
           
 int size()
           
 

Method Detail

size

int size()
Returns:
the current count of resources in the pool

isEmpty

boolean isEmpty()
Returns:
true if the pool is empty.

getAll

Collection<com.kuka.resource.IResource> getAll()
Returns:
All resources currently in the pool

getAll

Collection<com.kuka.resource.IResource> getAll(ResourceFilter filter)
Parameters:
filter - A resource filter.
Returns:
All resources currently in the pool that pass the specified filter.

getAny

com.kuka.resource.IResource getAny(ResourceFilter filter)
Parameters:
filter - A resource filter.
Returns:
The first resource that passes the specified filter or null if none passes.

getAny

com.kuka.resource.IResource getAny(ResourceFilter filter,
                                   long duration,
                                   TimeUnit unit)
                                   throws InterruptedException
Returns the first resource that matches the filter within the given time. Null is returned if the timeout elapses without a match.

Parameters:
filter - a resource filter
duration - the time to wait till a match is found
unit - the time unit of the timeout
Returns:
the first resource to match the filter or null if no match is found within the timeout
Throws:
InterruptedException

addResourceListener

void addResourceListener(ResourceListener listener)
Parameters:
listener - A listener to be notified of resources going on- or offline in the pool.

removeResourceListener

void removeResourceListener(ResourceListener listener)
Parameters:
listener - the listener to stop receiving notifications.


Copyright © 2019. All rights reserved.