com.sun.hk2.component
Class FactoryCreator<T>

java.lang.Object
  extended by com.sun.hk2.component.AbstractInhabitantImpl<T>
      extended by com.sun.hk2.component.AbstractCreatorImpl<T>
          extended by com.sun.hk2.component.FactoryCreator<T>
All Implemented Interfaces:
Holder<T>, Binding<T>, Factory<T>, ManagedComponentProvider<T>, Provider<T>, Creator<T>, Inhabitant<T>

public class FactoryCreator<T>
extends AbstractCreatorImpl<T>

Creates an object from Factory.

Author:
Kohsuke Kawaguchi

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.sun.hk2.component.Holder
Holder.Impl<T>
 
Field Summary
 
Fields inherited from class com.sun.hk2.component.AbstractCreatorImpl
habitat, type
 
Fields inherited from class com.sun.hk2.component.AbstractInhabitantImpl
descriptor
 
Constructor Summary
FactoryCreator(Class<T> type, Class<? extends Factory> factory, Habitat habitat, MultiMap<String,String> metadata)
           
FactoryCreator(Class<T> type, Inhabitant<? extends Factory> factory, Habitat habitat, MultiMap<String,String> metadata)
           
 
Method Summary
 T create(Inhabitant onBehalfOf)
          Creates a new instance.
 
Methods inherited from class com.sun.hk2.component.AbstractCreatorImpl
createInjectionManager, get, getExecutorService, getInjectionResolvers, initialize, inject, isActive, metadata, release, type, typeName
 
Methods inherited from class com.sun.hk2.component.AbstractInhabitantImpl
companions, dispose, get, getAnnotation, getAnnotation, getAnnotations, getDescriptor, getDescriptorFor, getProvider, getProvider, getSerializedMetadata, getSerializedMetadata, lead, matches, setCompanions, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jvnet.hk2.component.Creator
get
 
Methods inherited from interface org.jvnet.hk2.component.Inhabitant
companions, getSerializedMetadata, getSerializedMetadata, lead, setCompanions
 
Methods inherited from interface org.glassfish.hk2.Binding
getDescriptor, getProvider, getProvider
 
Methods inherited from interface org.glassfish.hk2.Provider
getAnnotations
 

Constructor Detail

FactoryCreator

public FactoryCreator(Class<T> type,
                      Class<? extends Factory> factory,
                      Habitat habitat,
                      MultiMap<String,String> metadata)

FactoryCreator

public FactoryCreator(Class<T> type,
                      Inhabitant<? extends Factory> factory,
                      Habitat habitat,
                      MultiMap<String,String> metadata)
Method Detail

create

public T create(Inhabitant onBehalfOf)
         throws ComponentException
Description copied from interface: Creator
Creates a new instance. The caller is supposed to call the Creator.initialize(Object, Inhabitant) right away. This 2-phase initialization allows us to handle cycle references correctly.

Throws:
ComponentException


Copyright © 2011 Oracle Corporation. All Rights Reserved.