org.jvnet.hk2.component
Interface InhabitantTracker


public interface InhabitantTracker

Tracks an inhabitant, or set of inhabitants.

Since:
3.1
Author:
Jeff Trent
See Also:
Habitat#track(InhabitantTrackerContext, Callback), Habitat#trackFuture(InhabitantTrackerContext, Boolean)

Nested Class Summary
static interface InhabitantTracker.Callback
          The callback is called when there is an event changing one of the tracked inhabitants.
 
Method Summary
<T> Inhabitant<T>
getInhabitant()
          Returns a single inhabitant.
 java.util.Collection<Inhabitant<?>> getInhabitants()
          Returns the set of inhabitants qualifying.
 void release()
          Releases / closes this tracker.
 

Method Detail

getInhabitant

<T> Inhabitant<T> getInhabitant()
                            throws ComponentException
Returns a single inhabitant. If multiple inhabitants qualify, the one selected is based upon the implementation.

Returns:
an inhabitant, or null if no inhabitants match tracker criteria
Throws:
ComponentException

getInhabitants

java.util.Collection<Inhabitant<?>> getInhabitants()
                                                   throws ComponentException
Returns the set of inhabitants qualifying.

Returns:
the collection of inhabitants matching tracker criteria
Throws:
ComponentException

release

void release()
Releases / closes this tracker. This MUST be called for performance reasons, to cleanup resources.



Copyright © 2011 Oracle Corporation. All Rights Reserved.