public interface Container extends SharedResource, Timer
This is the immutable Container. An instance of this class is attached to every Request
, and as long as
the AbstractResource.release()
method has not been called, that Container instance is actively kept alive to prevent
any race conditions during reconfiguration or shutdown. At any time there is only a single active Container in the
running Application
, and the only way to retrieve a reference to that Container is by calling CurrentContainer.newReference(URI)
. Instead of holding a local Container object inside a ServerProvider
(which will eventually become stale), use the appropriate Request
constructor
instead.
The only way to create a new instance of this class is to 1) create and configure a ContainerBuilder
, and 2) pass that to the ContainerActivator.activateContainer(ContainerBuilder)
method.
DEBUG, SYSTEM_PROPERTY_NAME_DEBUG
Modifier and Type | Method and Description |
---|---|
<T> T |
getInstance(Class<T> type)
Returns the appropriate instance for the given injection type.
|
<T> T |
getInstance(com.google.inject.Key<T> key)
Returns the appropriate instance for the given injection key.
|
RequestHandler |
resolveHandler(Request request)
Attempts to find a
RequestHandler in the current server- (if Request.isServerRequest() is
true) or client- (if Request.isServerRequest() is false) BindingSet that
matches the given URI . |
refer, release
currentTime, currentTimeMillis
RequestHandler resolveHandler(Request request)
RequestHandler
in the current server- (if Request.isServerRequest()
is
true) or client- (if Request.isServerRequest()
is false) BindingSet
that
matches the given URI
. If no match can be found, this method returns null.request
- The Request to match against the bound RequestHandler
s.<T> T getInstance(com.google.inject.Key<T> key)
T
- The class of the instance to return.key
- The key of the instance to return.com.google.inject.ConfigurationException
- If this injector cannot find or create the provider.com.google.inject.ProvisionException
- If there was a runtime failure while providing an instance.<T> T getInstance(Class<T> type)
T
- The class of the instance to return.type
- The class object of the instance to return.com.google.inject.ConfigurationException
- If this injector cannot find or create the provider.com.google.inject.ProvisionException
- If there was a runtime failure while providing an instance.Copyright © 2018. All rights reserved.