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 the Application
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 returned ContainerBuilder
, and 3) pass the builder to the activateContainer(ContainerBuilder)
method.
Modifier and Type | Method and Description |
---|---|
DeactivatedContainer |
activateContainer(ContainerBuilder builder)
Creates and activates a
Container based on the provided ContainerBuilder . |
ContainerBuilder |
newContainerBuilder()
This method creates and returns a new
ContainerBuilder object that has the necessary references to the
application and its internal components. |
ContainerBuilder newContainerBuilder()
This method creates and returns a new ContainerBuilder
object that has the necessary references to the
application and its internal components.
DeactivatedContainer activateContainer(ContainerBuilder builder)
Creates and activates a Container
based on the provided ContainerBuilder
. 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.
builder
- The builder to activate.ApplicationNotReadyException
- If this method is called before Application.start()
or after Application.stop()
.Copyright © 2018. All rights reserved.