Package com.yahoo.jdisc.core
Class ApplicationLoader
java.lang.Object
com.yahoo.jdisc.core.ApplicationLoader
- All Implemented Interfaces:
ContainerActivator
,BootstrapLoader
,CurrentContainer
public class ApplicationLoader
extends Object
implements BootstrapLoader, ContainerActivator, CurrentContainer
- Author:
- Simon Thoresen Hult, bjorncs
-
Constructor Summary
ConstructorDescriptionApplicationLoader
(OsgiFramework osgiFramework, Iterable<? extends com.google.inject.Module> guiceModules) -
Method Summary
Modifier and TypeMethodDescriptionactivateContainer
(ContainerBuilder builder) Creates and activates aContainer
based on the providedContainerBuilder
.void
destroy()
void
This method creates and returns a newContainerBuilder
object that has the necessary references to the application and its internal components.com.yahoo.jdisc.core.ContainerSnapshot
newReference
(URI uri, Object context) Returns a reference to the currently activeContainer
.void
start()
void
stop()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.yahoo.jdisc.service.CurrentContainer
newReference
-
Constructor Details
-
ApplicationLoader
public ApplicationLoader(OsgiFramework osgiFramework, Iterable<? extends com.google.inject.Module> guiceModules)
-
-
Method Details
-
newContainerBuilder
Description copied from interface:ContainerActivator
This method creates and returns a newContainerBuilder
object that has the necessary references to the application and its internal components.- Specified by:
newContainerBuilder
in interfaceContainerActivator
- Returns:
- The created builder.
-
activateContainer
Description copied from interface:ContainerActivator
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.- Specified by:
activateContainer
in interfaceContainerActivator
- Parameters:
builder
- The builder to activate.- Returns:
- The previous container, if any.
-
newReference
Description copied from interface:CurrentContainer
Returns a reference to the currently activeContainer
. UntilSharedResource.release()
has been called, the Container can not shut down.- Specified by:
newReference
in interfaceCurrentContainer
- 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.
-
init
- Specified by:
init
in interfaceBootstrapLoader
- Throws:
Exception
-
start
- Specified by:
start
in interfaceBootstrapLoader
- Throws:
Exception
-
stop
- Specified by:
stop
in interfaceBootstrapLoader
- Throws:
Exception
-
destroy
public void destroy()- Specified by:
destroy
in interfaceBootstrapLoader
-
application
-
getContainerWatchdogMetrics
-
osgiFramework
-