org.glassfish.hk2
Interface Providers<T>

All Known Subinterfaces:
ContractLocator<T>, ServiceLocator<T>

public interface Providers<T>

This contract provides a means to access runtime component providers.

This is often times produced by ContractLocator and ServiceLocator.

Author:
Jerome Dochez, Jeff Trent, Mason Taube

Method Summary
 java.util.Collection<Provider<T>> all()
          Return all applicable Providers.
 T get()
          A shortcut for
 Provider<T> getProvider()
          Return the "best" Provider from the collection that matches current criteria.
 

Method Detail

all

java.util.Collection<Provider<T>> all()
Return all applicable Providers. Will always be a non-null return value.


getProvider

Provider<T> getProvider()
Return the "best" Provider from the collection that matches current criteria. If the collection all() is not empty, this will return a non null value. Otherwise the return value is null.


get

T get()
A shortcut for
  if (getProvider() != null)
    return getProvider().get();
  return null;
 



Copyright © 2011 Oracle Corporation. All Rights Reserved.