@Builtin @Singleton(eager=true) @Name(value="org.eiichiro.jaguar.scope.ApplicationContext") public class ApplicationContext extends SingletonContext implements WebContext<javax.servlet.ServletContext>
Context
implementation corresponding to the
Application
scope.
ApplicationContext
stores a component in servlet context. If the
application is not running in Web environment, this context becomes
equal to SingletonContext
.COMPONENTS
Constructor and Description |
---|
ApplicationContext() |
Modifier and Type | Method and Description |
---|---|
void |
associate(javax.servlet.ServletContext context)
Associates the current
ServletContext with this instance. |
void |
deassociate(javax.servlet.ServletContext context)
Deassociates the current
ServletContext from this instance. |
<T> T |
get(Descriptor<T> descriptor)
Returns the component corresponding to the specified
Descriptor
from the current ServletContext . |
<T> void |
put(Descriptor<T> descriptor,
T component)
Puts the specified component and descriptor pair into the current
ServletContext . |
Object |
store()
Returns the component store this context manages.
|
clear
public <T> T get(Descriptor<T> descriptor)
Descriptor
from the current ServletContext
.
If the application is not running in Web environment, the component is
got from SingletonContext
's component store.get
in interface Context
get
in class SingletonContext
T
- The component type.descriptor
- The descriptor corresponding to the component.Descriptor
.public <T> void put(Descriptor<T> descriptor, T component)
ServletContext
.
If the application is not running in Web environment, the component is
put into SingletonContext
's component store.put
in interface Context
put
in class SingletonContext
T
- The component type.descriptor
- The descriptor corresponding to the component.component
- The component to be put.public void associate(javax.servlet.ServletContext context)
ServletContext
with this instance.associate
in interface WebContext<javax.servlet.ServletContext>
context
- The current ServletContext
.public void deassociate(javax.servlet.ServletContext context)
ServletContext
from this instance.deassociate
in interface WebContext<javax.servlet.ServletContext>
context
- The current ServletContext
.Copyright © 2011-2014 Eiichiro Uchiumi. All Rights Reserved.