org.jvnet.hk2.component
Class Inhabitants

java.lang.Object
  extended by org.jvnet.hk2.component.Inhabitants

Deprecated. Use Inhabitants instead.

@Deprecated
public class Inhabitants
extends Object

Factory for Inhabitant.

Author:
Kohsuke Kawaguchi

Constructor Summary
Inhabitants()
          Deprecated.  
 
Method Summary
static
<T> Inhabitant<T>
create(Class<T> c, Habitat habitat, Map<String,List<String>> metadata)
          Deprecated. Use Inhabitants instead.
static
<T> Inhabitant<T>
create(T instance)
          Deprecated. Use Inhabitants instead.
static
<T> Collection<String>
getNamesFor(Inhabitant<T> i, String indexName)
          Deprecated. Use Inhabitants instead.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Inhabitants

public Inhabitants()
Deprecated. 
Method Detail

create

public static <T> Inhabitant<T> create(T instance)
Deprecated. Use Inhabitants instead.

Creates a singleton wrapper around existing object.


create

public static <T> Inhabitant<T> create(Class<T> c,
                                       Habitat habitat,
                                       Map<String,List<String>> metadata)
Deprecated. Use Inhabitants instead.

Creates a Inhabitant by looking at annotations of the given type.


getNamesFor

public static <T> Collection<String> getNamesFor(Inhabitant<T> i,
                                                 String indexName)
Deprecated. Use Inhabitants instead.

Returns the list of names the service implementation in known. Services in hk2 are indexed by the contract name and an optional name. There can also be some aliasing so the same service can be known under different names.

Type Parameters:
T - contract type, optional
Parameters:
i - instance of inhabitant to obtain its registration name
indexName - the contract name this service is implementing
Returns:
a collection of names (usually there is only one) under which this service is registered for the passed contract name


Copyright © 2013 Oracle Corporation. All Rights Reserved.