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(Class<T> contractOrImpl,
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(Class<T> contractOrImpl,
String name,
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(Type contractOrImpl,
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(Type contractOrImpl,
String name,
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 |
---|---|
List<ServiceHandle<?>> |
ServiceLocator.getAllServiceHandles(Annotation qualifier,
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> List<ServiceHandle<T>> |
ServiceLocator.getAllServiceHandles(Class<T> contractOrImpl,
Annotation... qualifiers)
Gets a list of
ServiceHandle that can be used to get and destroy services
associated with descriptors that match the provided criteria |
List<ServiceHandle<?>> |
ServiceLocator.getAllServiceHandles(Filter searchCriteria)
Gets a list of
ServiceHandle whose ActiveDescriptor s match
the supplied filter. |
List<ServiceHandle<?>> |
ServiceLocator.getAllServiceHandles(Type contractOrImpl,
Annotation... qualifiers)
Gets a list of
ServiceHandle that can be used to get and destroy services
associated with descriptors that match the provided criteria |
List<ServiceHandle<?>> |
ServiceHandle.getSubHandles()
Returns a list of subordinate subhandles
to this root handle
|
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 |
---|---|
Object |
ServiceLocator.assistedInject(Object injectMe,
Method method,
ServiceHandle<?> root,
MethodParameter... params)
This will invoke the given method on the given object.
|
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) . |
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 |
---|---|
ServiceHandle<?> |
HandleAndService.getHandle() |
Modifier and Type | Method and Description |
---|---|
T |
ConstantActiveDescriptor.create(ServiceHandle<?> root) |
<U> U |
InheritableThreadContext.findOrCreate(ActiveDescriptor<U> activeDescriptor,
ServiceHandle<?> root) |
<U> U |
PerThreadContext.findOrCreate(ActiveDescriptor<U> activeDescriptor,
ServiceHandle<?> root) |
Constructor and Description |
---|
HandleAndService(ServiceHandle<?> handle,
Object service) |
Modifier and Type | Method and Description |
---|---|
static <T> ServiceHandle<T> |
BuilderHelper.createConstantServiceHandle(T obj)
Creates a ServiceHandle that will always return the given object from
the
getService() method. |
ServiceHandle<?> |
ContextualInput.getRoot()
Returns the
ServiceHandle root associated with this
contextual creation |
Modifier and Type | Method and Description |
---|---|
T |
AliasDescriptor.create(ServiceHandle<?> root) |
<U> U |
ImmediateContext.findOrCreate(ActiveDescriptor<U> activeDescriptor,
ServiceHandle<?> root) |
static String |
ServiceLocatorUtilities.getOneMetadataField(ServiceHandle<?> h,
String field)
Gets one value from a metadata field from the given service handle
|
Constructor and Description |
---|
ContextualInput(ActiveDescriptor<T> descriptor,
ServiceHandle<?> root)
The inputs from the
Context.findOrCreate(ActiveDescriptor, ServiceHandle)
method |
Copyright © 2009–2019 Oracle Corporation. All rights reserved.