Package com.yahoo.jdisc.service
Interface CurrentContainer
- All Known Implementing Classes:
ActiveContainer
,ApplicationLoader
,TestDriver
public interface CurrentContainer
This interface declares a method to retrieve a reference to the current
Container
. Note that a Container
which has not been closed
will actively keep it alive, preventing it
from shutting down when expired. Failure to call close() will eventually lead to an OutOfMemoryError
. A
ServerProvider
should have an instance of this class injected in its constructor, and simply use the appropriate Request constructor
to avoid having to worry about the keep-alive
issue.- Author:
- Simon Thoresen Hult
-
Method Summary
Modifier and TypeMethodDescriptiondefault Container
newReference
(URI uri) default Container
newReference
(URI uri, Object context) Returns a reference to the currently activeContainer
.
-
Method Details
-
newReference
Returns a reference to the currently activeContainer
. UntilSharedResource.release()
has been called, the Container can not shut down.- Parameters:
uri
- The identifier used to match this Request to an appropriateClientProvider
orRequestHandler
. The hostname must be "localhost" or a fully qualified domain name.context
- that can be attached for reference tracking- Returns:
- A reference to the current Container.
- Throws:
NoBindingSetSelectedException
- If noBindingSet
was selected by theBindingSetSelector
.BindingSetNotFoundException
- If the named BindingSet was not found.ContainerNotReadyException
- If no active Container was found, this can only happen during initial setup.
-
newReference
-