org.jvnet.hk2.component
Class ContractLocatorImpl<T>

java.lang.Object
  extended by org.jvnet.hk2.component.ContractLocatorImpl<T>
All Implemented Interfaces:
ContractLocator<T>, Providers<T>, ServiceLocator<T>

Deprecated.

@Deprecated
public class ContractLocatorImpl<T>
extends Object
implements ContractLocator<T>

Implementation of the ContractLocator interface.

This is used for location byType or byContract.

Author:
Jerome Dochez, Jeff Trent

Constructor Summary
ContractLocatorImpl(ServiceLocator serviceLocator, Type clazz, boolean byContract)
          Deprecated.  
 
Method Summary
 Collection<Provider<T>> all()
          Deprecated. Return all applicable Providers.
 Collection<Provider<T>> all(boolean stopAtFirstMatch)
          Deprecated.  
 ContractLocator<T> annotatedWith(Class<? extends Annotation> annotation)
          Deprecated. Qualify this ContractLocator to identify services have the given annotation.
 T get()
          Deprecated. A shortcut for
<U> U
getByType(Class<U> type)
          Deprecated. Obtain a reference to the component/service from the associated provider.
 Provider<T> getProvider()
          Deprecated. Return the "best" Provider from the collection that matches current criteria.
 String getTypeName()
          Deprecated.  
 ContractLocator<T> in(Scope scope)
          Deprecated. Qualify this ContractLocator to identify services that are scoped scope.
 ContractLocator<T> named(String name)
          Deprecated. Qualify this ContractLocator to identify services that are named name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContractLocatorImpl

public ContractLocatorImpl(ServiceLocator serviceLocator,
                           Type clazz,
                           boolean byContract)
Deprecated. 
Method Detail

getTypeName

public String getTypeName()
Deprecated. 

named

public ContractLocator<T> named(String name)
Deprecated. 
Description copied from interface: ContractLocator
Qualify this ContractLocator to identify services that are named name.

Specified by:
named in interface ContractLocator<T>
Parameters:
name - the name of the service
Returns:
the same ContractLocator instance, now additionally qualified by name

in

public ContractLocator<T> in(Scope scope)
Deprecated. 
Description copied from interface: ContractLocator
Qualify this ContractLocator to identify services that are scoped scope.

Specified by:
in in interface ContractLocator<T>
Parameters:
scope - the scope of the service
Returns:
the same ContractLocator instance, now additionally qualified by scope

annotatedWith

public ContractLocator<T> annotatedWith(Class<? extends Annotation> annotation)
Deprecated. 
Description copied from interface: ContractLocator
Qualify this ContractLocator to identify services have the given annotation. This method may be chained to specify multiple annotations.

Specified by:
annotatedWith in interface ContractLocator<T>
Parameters:
annotation - the annotation that the service must have
Returns:
the same ContractLocator instance, now additionally qualified by the newly specified annotation.

get

public T get()
Deprecated. 
Description copied from interface: Providers
A shortcut for
  if (getProvider() != null)
    return getProvider().get();
  return null;
 

Specified by:
get in interface Providers<T>

getByType

public <U> U getByType(Class<U> type)
Deprecated. 
Description copied from interface: Providers
Obtain a reference to the component/service from the associated provider. The given type may be used by the provider to obtain and return a proxy rather than the actual component.

Specified by:
getByType in interface Providers<T>
Parameters:
type - the required type of the returned object
Returns:
the component or a suitable proxy of the given type

getProvider

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

Currently "best" is reserved for future use.

Specified by:
getProvider in interface Providers<T>

all

public Collection<Provider<T>> all()
Deprecated. 
Description copied from interface: Providers
Return all applicable Providers. Will always be a non-null return value.

Specified by:
all in interface Providers<T>

all

public Collection<Provider<T>> all(boolean stopAtFirstMatch)
Deprecated. 


Copyright © 2013 Oracle Corporation. All Rights Reserved.