com.kuka.resource.pool
Interface FacadePool

All Known Subinterfaces:
MobileRobotManager, ResourceFacadePool

public interface FacadePool

This extends a ResourcePool to handle facades of the resources in the pool.


Method Summary
<T> void
addFacadeListener(Class<T> facadeClass, FacadeListener<? super T> listener)
           
<T> TypedFacadePool<T>
facade(Class<T> facadeClass)
          Provides a pool interface with the same functions as this interface but that is strictly typified to the specified facade type.
<T> Collection<T>
getAll(Class<T> facadeClass)
          Returns facades for all resources that matches the specified facade class.
<T> Collection<T>
getAll(Class<T> facadeClass, FacadeFilter<? super T> filter)
          Returns facades for all resources that pass the specified filter and match the specified facade class.
<T> T
getAny(Class<T> facadeClass)
          Returns a facade for the first resource that matches the specified facade class.
<T> T
getAny(Class<T> facadeClass, FacadeFilter<? super T> filter)
          Returns a facade for the first resource that passes the specified filter and matches the specified facade class.
<T> T
getAny(Class<T> facadeClass, FacadeFilter<? super T> filter, long duration, TimeUnit unit)
          Returns the first facade that matches the filter within the given time.
<T> T
getFacade(Class<T> facadeClass, com.kuka.resource.IResource resource)
          Tries to create a facade of the specified type for the specified resource.
 void removeFacadeListener(FacadeListener<?> listener)
           
 int size()
           
 

Method Detail

size

int size()
Returns:
the current count of all resources underlying this facade pool

facade

<T> TypedFacadePool<T> facade(Class<T> facadeClass)
Provides a pool interface with the same functions as this interface but that is strictly typified to the specified facade type.

Type Parameters:
T - The facade type.
Parameters:
facadeClass - The type of facade to restrict to.
Returns:
A view on this pool that is restricted to the specified facade.

getAny

<T> T getAny(Class<T> facadeClass)
Returns a facade for the first resource that matches the specified facade class.

Type Parameters:
T - The facade type.
Parameters:
facadeClass - A facade class.
Returns:
A concrete resource facade.

getAny

<T> T getAny(Class<T> facadeClass,
             FacadeFilter<? super T> filter)
Returns a facade for the first resource that passes the specified filter and matches the specified facade class.

Type Parameters:
T - The facade type.
Parameters:
facadeClass - A facade class.
filter - A facade filter.
Returns:
A concrete resource facade.

getAny

<T> T getAny(Class<T> facadeClass,
             FacadeFilter<? super T> filter,
             long duration,
             TimeUnit unit)
         throws InterruptedException
Returns the first facade that matches the filter within the given time. Null is returned if the timeout elapses without a match.

Type Parameters:
T - The facade type.
Parameters:
facadeClass - A facade class.
filter - a facade filter
duration - the time to wait till a match is found
unit - the time unit of the timeout
Returns:
the first facade to match the filter or null if no match is found within the timeout
Throws:
InterruptedException

getAll

<T> Collection<T> getAll(Class<T> facadeClass)
Returns facades for all resources that matches the specified facade class.

Type Parameters:
T - The facade type.
Parameters:
facadeClass - A facade class.
Returns:
Concrete resource facades.

getAll

<T> Collection<T> getAll(Class<T> facadeClass,
                         FacadeFilter<? super T> filter)
Returns facades for all resources that pass the specified filter and match the specified facade class.

Type Parameters:
T - The facade type.
Parameters:
facadeClass - A facade class.
filter - A facade filter.
Returns:
Concrete resource facades.

getFacade

<T> T getFacade(Class<T> facadeClass,
                com.kuka.resource.IResource resource)
Tries to create a facade of the specified type for the specified resource.

Type Parameters:
T - The type of the facade.
Parameters:
facadeClass - A facade class.
resource - The resource to create a facade for.
Returns:
A concrete facade of the specified type for the specified resource.

addFacadeListener

<T> void addFacadeListener(Class<T> facadeClass,
                           FacadeListener<? super T> listener)
Type Parameters:
T - The type of the facade.
Parameters:
facadeClass - A facade class.
listener - A listener to be notified of resources going on- or offline in the pool.

removeFacadeListener

void removeFacadeListener(FacadeListener<?> listener)
Parameters:
listener - the listener to stop receiving notifications.


Copyright © 2019. All rights reserved.