Package com.yahoo.jdisc.application
Interface ContainerActivator
-
- All Known Implementing Classes:
ApplicationLoader
,TestDriver
public interface ContainerActivator
This interface defines the API for changing the active
Container
of a jDISC application. An instance of this class is typically injected into theApplication
constructor. If injection is unavailable due to an Application design, an instance of this class is also available as an OSGi service under the full ContainerActivator class name.This interface allows one to create and active a new Container. To do so, one has to 1) call
newContainerBuilder()
, 2) configure the returnedContainerBuilder
, and 3) pass the builder to theactivateContainer(ContainerBuilder)
method.- Author:
- Simon Thoresen Hult
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DeactivatedContainer
activateContainer(ContainerBuilder builder)
Creates and activates aContainer
based on the providedContainerBuilder
.ContainerBuilder
newContainerBuilder()
This method creates and returns a newContainerBuilder
object that has the necessary references to the application and its internal components.
-
-
-
Method Detail
-
newContainerBuilder
ContainerBuilder newContainerBuilder()
This method creates and returns a newContainerBuilder
object that has the necessary references to the application and its internal components.- Returns:
- The created builder.
-
activateContainer
DeactivatedContainer activateContainer(ContainerBuilder builder)
Creates and activates aContainer
based on the providedContainerBuilder
. By providing a null argument, this method can be used to deactivate the current Container. The returned object can be used to schedule a cleanup task that is executed once the the deactivated Container has terminated.- Parameters:
builder
- The builder to activate.- Returns:
- The previous container, if any.
- Throws:
ApplicationNotReadyException
- If this method is called beforeApplication.start()
or afterApplication.stop()
.
-
-