org.jvnet.hk2.internal
Class ServiceLocatorImpl

java.lang.Object
  extended by org.jvnet.hk2.internal.ServiceLocatorImpl
All Implemented Interfaces:
ServiceLocator

public class ServiceLocatorImpl
extends Object
implements ServiceLocator

Author:
jwells

Constructor Summary
ServiceLocatorImpl(String name, ServiceLocatorImpl parent)
          Called by the Generator, and hence must be a public method
 
Method Summary
<T> T
create(Class<T> createMe)
           
<U> U
createAndInitialize(Class<U> createMe)
          Creates, injects and postConstructs, all in one
 List<ServiceHandle<?>> getAllServiceHandles(Annotation qualifier, Annotation... qualifiers)
           
 List<ServiceHandle<?>> getAllServiceHandles(Filter searchCriteria)
           
 List<ServiceHandle<?>> getAllServiceHandles(Type contractOrImpl, Annotation... qualifiers)
           
<T> List<T>
getAllServices(Annotation qualifier, Annotation... qualifiers)
           
 List<?> getAllServices(Filter searchCriteria)
           
<T> List<T>
getAllServices(Type contractOrImpl, Annotation... qualifiers)
           
 ActiveDescriptor<?> getBestDescriptor(Filter filter)
           
 List<ActiveDescriptor<?>> getDescriptors(Filter filter)
           
 ActiveDescriptor<?> getInjecteeDescriptor(Injectee injectee)
           
 long getLocatorId()
           
 String getName()
           
<T> T
getService(ActiveDescriptor<T> activeDescriptor, ServiceHandle<?> root)
           
<T> T
getService(Type contractOrImpl, Annotation... qualifiers)
           
<T> T
getService(Type contractOrImpl, String name, Annotation... qualifiers)
           
<T> ServiceHandle<T>
getServiceHandle(ActiveDescriptor<T> activeDescriptor)
           
<T> ServiceHandle<T>
getServiceHandle(ActiveDescriptor<T> activeDescriptor, Injectee injectee)
           
<T> ServiceHandle<T>
getServiceHandle(Type contractOrImpl, Annotation... qualifiers)
           
<T> ServiceHandle<T>
getServiceHandle(Type contractOrImpl, String name, Annotation... qualifiers)
           
 void inject(Object injectMe)
           
 void postConstruct(Object postConstructMe)
           
 void preDestroy(Object preDestroyMe)
           
 ActiveDescriptor<?> reifyDescriptor(Descriptor descriptor)
           
 ActiveDescriptor<?> reifyDescriptor(Descriptor descriptor, Injectee injectee)
           
 void shutdown()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceLocatorImpl

public ServiceLocatorImpl(String name,
                          ServiceLocatorImpl parent)
Called by the Generator, and hence must be a public method

Parameters:
name - The name of this locator
parent - The parent of this locator (may be null)
Method Detail

getDescriptors

public List<ActiveDescriptor<?>> getDescriptors(Filter filter)
Specified by:
getDescriptors in interface ServiceLocator

getBestDescriptor

public ActiveDescriptor<?> getBestDescriptor(Filter filter)
Specified by:
getBestDescriptor in interface ServiceLocator

reifyDescriptor

public ActiveDescriptor<?> reifyDescriptor(Descriptor descriptor,
                                           Injectee injectee)
                                    throws MultiException
Specified by:
reifyDescriptor in interface ServiceLocator
Throws:
MultiException

reifyDescriptor

public ActiveDescriptor<?> reifyDescriptor(Descriptor descriptor)
                                    throws MultiException
Specified by:
reifyDescriptor in interface ServiceLocator
Throws:
MultiException

getInjecteeDescriptor

public ActiveDescriptor<?> getInjecteeDescriptor(Injectee injectee)
                                          throws MultiException
Specified by:
getInjecteeDescriptor in interface ServiceLocator
Throws:
MultiException

getServiceHandle

public <T> ServiceHandle<T> getServiceHandle(ActiveDescriptor<T> activeDescriptor,
                                             Injectee injectee)
                                  throws MultiException
Specified by:
getServiceHandle in interface ServiceLocator
Throws:
MultiException

getServiceHandle

public <T> ServiceHandle<T> getServiceHandle(ActiveDescriptor<T> activeDescriptor)
                                  throws MultiException
Specified by:
getServiceHandle in interface ServiceLocator
Throws:
MultiException

getService

public <T> T getService(ActiveDescriptor<T> activeDescriptor,
                        ServiceHandle<?> root)
             throws MultiException
Specified by:
getService in interface ServiceLocator
Throws:
MultiException

getService

public <T> T getService(Type contractOrImpl,
                        Annotation... qualifiers)
             throws MultiException
Specified by:
getService in interface ServiceLocator
Throws:
MultiException

getService

public <T> T getService(Type contractOrImpl,
                        String name,
                        Annotation... qualifiers)
             throws MultiException
Specified by:
getService in interface ServiceLocator
Throws:
MultiException

getAllServices

public <T> List<T> getAllServices(Type contractOrImpl,
                                  Annotation... qualifiers)
                       throws MultiException
Specified by:
getAllServices in interface ServiceLocator
Throws:
MultiException

getAllServices

public <T> List<T> getAllServices(Annotation qualifier,
                                  Annotation... qualifiers)
                       throws MultiException
Specified by:
getAllServices in interface ServiceLocator
Throws:
MultiException

getAllServices

public List<?> getAllServices(Filter searchCriteria)
                       throws MultiException
Specified by:
getAllServices in interface ServiceLocator
Throws:
MultiException

getName

public String getName()
Specified by:
getName in interface ServiceLocator

shutdown

public void shutdown()
Specified by:
shutdown in interface ServiceLocator

create

public <T> T create(Class<T> createMe)
Specified by:
create in interface ServiceLocator

inject

public void inject(Object injectMe)
Specified by:
inject in interface ServiceLocator

postConstruct

public void postConstruct(Object postConstructMe)
Specified by:
postConstruct in interface ServiceLocator

preDestroy

public void preDestroy(Object preDestroyMe)
Specified by:
preDestroy in interface ServiceLocator

createAndInitialize

public <U> U createAndInitialize(Class<U> createMe)
Creates, injects and postConstructs, all in one

Specified by:
createAndInitialize in interface ServiceLocator

getServiceHandle

public <T> ServiceHandle<T> getServiceHandle(Type contractOrImpl,
                                             Annotation... qualifiers)
                                  throws MultiException
Specified by:
getServiceHandle in interface ServiceLocator
Throws:
MultiException

getAllServiceHandles

public List<ServiceHandle<?>> getAllServiceHandles(Type contractOrImpl,
                                                   Annotation... qualifiers)
                                            throws MultiException
Specified by:
getAllServiceHandles in interface ServiceLocator
Throws:
MultiException

getServiceHandle

public <T> ServiceHandle<T> getServiceHandle(Type contractOrImpl,
                                             String name,
                                             Annotation... qualifiers)
                                  throws MultiException
Specified by:
getServiceHandle in interface ServiceLocator
Throws:
MultiException

getAllServiceHandles

public List<ServiceHandle<?>> getAllServiceHandles(Filter searchCriteria)
                                            throws MultiException
Specified by:
getAllServiceHandles in interface ServiceLocator
Throws:
MultiException

getAllServiceHandles

public List<ServiceHandle<?>> getAllServiceHandles(Annotation qualifier,
                                                   Annotation... qualifiers)
                                            throws MultiException
Specified by:
getAllServiceHandles in interface ServiceLocator
Throws:
MultiException

getLocatorId

public long getLocatorId()
Specified by:
getLocatorId in interface ServiceLocator

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012 Oracle Corporation. All Rights Reserved.