| Package | Description |
|---|---|
| org.glassfish.hk2.api | |
| org.glassfish.hk2.internal | |
| org.glassfish.hk2.utilities |
| Modifier and Type | Method and Description |
|---|---|
ServiceHandle<T> |
IterableProvider.getHandle()
Rather than getting the service directly with get (in which
case the returned service cannot be disposed of) this method
will instead return a service handle for the current best service.
|
<T> ServiceHandle<T> |
ServiceLocator.getServiceHandle(ActiveDescriptor<T> activeDescriptor)
Gets a
ServiceHandle that can be used to get and destroy the service
described by the ActiveDescriptor. |
<T> ServiceHandle<T> |
ServiceLocator.getServiceHandle(ActiveDescriptor<T> activeDescriptor,
Injectee injectee)
Gets a
ServiceHandle that can be used to get and destroy the service
described by the ActiveDescriptor. |
<T> ServiceHandle<T> |
ServiceLocator.getServiceHandle(java.lang.Class<T> contractOrImpl,
java.lang.annotation.Annotation... qualifiers)
Gets a
ServiceHandle that can be used to get and destroy the
service that best matches the given criteria |
<T> ServiceHandle<T> |
ServiceLocator.getServiceHandle(java.lang.Class<T> contractOrImpl,
java.lang.String name,
java.lang.annotation.Annotation... qualifiers)
Gets a
ServiceHandle that can be used to get and destroy the
service that best matches the given criteria |
<T> ServiceHandle<T> |
ServiceLocator.getServiceHandle(java.lang.reflect.Type contractOrImpl,
java.lang.annotation.Annotation... qualifiers)
Gets a
ServiceHandle that can be used to get and destroy the
service that best matches the given criteria |
<T> ServiceHandle<T> |
ServiceLocator.getServiceHandle(java.lang.reflect.Type contractOrImpl,
java.lang.String name,
java.lang.annotation.Annotation... qualifiers)
Gets a
ServiceHandle that can be used to get and destroy the
service that best matches the given criteria |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<ServiceHandle<?>> |
ServiceLocator.getAllServiceHandles(java.lang.annotation.Annotation qualifier,
java.lang.annotation.Annotation... qualifiers)
Gets a list of
ServiceHandle that can be used to get and destroy services
associated with descriptors that match the provided criteria |
<T> java.util.List<ServiceHandle<T>> |
ServiceLocator.getAllServiceHandles(java.lang.Class<T> contractOrImpl,
java.lang.annotation.Annotation... qualifiers)
Gets a list of
ServiceHandle that can be used to get and destroy services
associated with descriptors that match the provided criteria |
java.util.List<ServiceHandle<?>> |
ServiceLocator.getAllServiceHandles(Filter searchCriteria)
Gets a list of
ServiceHandle whose ActiveDescriptors match
the supplied filter. |
java.util.List<ServiceHandle<?>> |
ServiceLocator.getAllServiceHandles(java.lang.reflect.Type contractOrImpl,
java.lang.annotation.Annotation... qualifiers)
Gets a list of
ServiceHandle that can be used to get and destroy services
associated with descriptors that match the provided criteria |
java.lang.Iterable<ServiceHandle<T>> |
IterableProvider.handleIterator()
This version of iterator returns an iterator of ServiceHandles rather
than returning the services (which then have no way to be properly
destroyed)
|
| Modifier and Type | Method and Description |
|---|---|
T |
ActiveDescriptor.create(ServiceHandle<?> root)
Creates an instance of the ActiveDescriptor.
|
<U> U |
Context.findOrCreate(ActiveDescriptor<U> activeDescriptor,
ServiceHandle<?> root)
Creates a contextual instance of this ActiveDescriptor by calling its
create method if there is no other matching contextual instance.
|
<T> T |
ServiceLocator.getService(ActiveDescriptor<T> activeDescriptor,
ServiceHandle<?> root)
|
<T> T |
ServiceLocator.getService(ActiveDescriptor<T> activeDescriptor,
ServiceHandle<?> root,
Injectee injectee)
This method should be called by code resolving injectee's on behalf of some
root service, usually by an implementation of
InjectionResolver.resolve(Injectee, ServiceHandle). |
java.lang.Object |
InjectionResolver.resolve(Injectee injectee,
ServiceHandle<?> root)
This method will return the object that should be injected into the given
injection point.
|
| Modifier and Type | Method and Description |
|---|---|
T |
ConstantActiveDescriptor.create(ServiceHandle<?> root) |
<U> U |
PerThreadContext.findOrCreate(ActiveDescriptor<U> activeDescriptor,
ServiceHandle<?> root) |
| Modifier and Type | Method and Description |
|---|---|
T |
AliasDescriptor.create(ServiceHandle<?> root) |
static java.lang.String |
ServiceLocatorUtilities.getOneMetadataField(ServiceHandle<?> h,
java.lang.String field)
Gets one value from a metadata field from the given service handle
|
Copyright © 2013 Oracle Corporation. All Rights Reserved.